Solved

Get CTabCtrl client size within a splitter window

Posted on 2003-11-24
3
676 Views
Last Modified: 2013-11-20
I derive a subclass A from CTabCtrl and put A into a CView-derived class B. B is used as a view in the splitter window. The splitter window has one row and two columns. I want to put a CWnd-derived class into pane (0, 0).

The code is like this:

class A : public CTabCtrl { ... };

class B : public CView
{
public:
    A m_a;
...
};

class D : public CWnd
{
    CTreeCtrl m_treeCtrl;
};

BOOL B::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
      // TODO: Add your specialized code here and/or call the base class
      if(!CView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
            return false;
                /* here the rect has much smaller size than pane (0, 0) */

      CRect rectTmp;
      GetParent()->GetClientRect(&rectTmp);
      m_a.Create(WS_CHILD | WS_VISIBLE | TCS_OWNERDRAWFIXED, rectTmp,
                         this, IDC_TABA);
                /* Here rectTmp is just 0 for top, bottom, left, right */
      D *pD = new D;
      pD->Create(NULL, "MyContainer", WS_CHILD | WS_VISIBLE, rectTmp,
            &m_a, IDC_DDD);
      pD->GetClientRect(&rectTmp);
      m_treeCtrl.Create(WS_CHILD | WS_VISIBLE |
                                 TVS_HASLINES | TVS_LINESATROOT |
                                 TVS_HASBUTTONS | TVS_SHOWSELALWAYS,
                                 rectTmp,
                                 pD,
                                 IDC_LEFTTABTREECTRL);

                TC_ITEM tcItem;
                tcItem.mask = TCIF_TEXT | TCIF_PARAM;
                tcItem.pszText = "Browser";
                tcItem.param = (LPARAM) pD;
      m_a.InsertItem(pD, "Browser");
                return true;
}

So how can I get the correct size for child window D so that D will occupies all the empty area in the TabCtrl?

Thanks for your help
0
Comment
Question by:htang_us
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Author Comment

by:htang_us
ID: 9818404
I have solved this question.

In class B, WM_SIZE is processed and pass the coordinates to Tab Ctrl and TreeCtrl, so that they can correctly resize themselves.

0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9838336
PAQed, with points refunded (50)

Computer101
E-E Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 114
WinWaitActive parameters 12 31
sumDigits challenge 9 178
Thin secure Windows 10 5 116
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question