Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtControlBar and GetClientRect Collapse All
Subject Author Date
Ionut Ceausu Jul 26, 2005 - 8:09 AM

 Hello,

 I have an CExtControlBar and inside it I want to put other control (let’s say a list). When the control bar it’s chage his size, I change the size of the control inside it also. If the control bar is docked there is no problems. When it is floating, my control has right edge over painted. How do I find the real dimension of the client rect? (Note: I don’t want to use anchors.)

Technical Support Jul 26, 2005 - 10:44 AM

It seems the anchoring feature of the resizable dialog suits best what you described, so we we wonder why you don’t want to use it? Unfortunately we have not encountered the problem described in your message. In any case we would appreciate if you would send us a screenshot demonstrating the problem or your test project.

Ionut Ceausu Jul 26, 2005 - 10:56 AM

Where can I send you the capture?

Technical Support Jul 26, 2005 - 11:44 AM

Please send it to support@prof-uis.com.

Ionut Ceausu Jul 27, 2005 - 9:18 AM

May be will help somebody, someday


To avoid this problem, you need  to use a different approach for the custom sized control bar’s child window. Create a CExtControlBar-derived class and override the CExtControlBar::OnRepositionSingleChild() method which is called not only when the control bar receives the WM_SIZE standard windows message. We confirm that the size of control bar’s child window in the floating mode is a bit smaller than the control bar’s client area. This is done for the UI theme compatibility. Here it is a rule for calculating the control bar’s child window location:
 
CRect rcChild;
    pControlBar->GetClientRect( &rcChild );
    if( pControlBar->IsFloating() )
    {
        CSize sizeFrame(
            ::GetSystemMetrics(SM_CXSIZEFRAME),
            ::GetSystemMetrics(SM_CYSIZEFRAME)
        );
        rcChild.DeflateRect( sizeFrame );
    }
    pChildWnd->MoveWindow( &rcChild );
 
 
Please do not hesitate to contact us if you have any questions.

 

Best regards,
Technical Support Team

 

FOSS Software, Inc.
Phones:  (603) 894 6425
(603) 894 6427

 


 

From:
Sent:
To:
Subject: Re:Re:CExtControlBar and GetClientRect

 

Hello,
 I atach the picture where you can see that the area is miss calculated when is floating. When is dockig..all is ok. How is made: on the control bar is placed a dialog. When the control bar is resized I receive OnSize notification on dialog and resize the dialog also using a code like this
 
 WINDOWPLACEMENT windowPlacementParent;
 CWnd *pParentWindow;
 pParentWindow = GetParent();
 if (pParentWindow)
 {
  ::GetWindowPlacement(pParentWindow->m_hWnd, &windowPlacementParent);
 
  cx = windowPlacementParent.rcNormalPosition.right -
      windowPlacementParent.rcNormalPosition.left;
 
  cy = windowPlacementParent.rcNormalPosition.bottom -
      windowPlacementParent.rcNormalPosition.top;
 }
 
 CDialog::OnSize(nType, cx, cy);