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 ( Point out a dock function ) Collapse All
Subject Author Date
tarou iiyama Feb 27, 2005 - 10:38 PM

Hello.


I cannot write English well.
Thank you.


I want to let CExtControlBar(B) dock with specific CExtControlBar(A).


CExtControlBar(A)  -------------->  CExtControlBar(B)
                             I can dock !


I do not want to let CExtControlBar(D) dock with specific CExtControlBar(C).


CExtControlBar(C)  --------------->  CExtControlBar(D)
                             I cannot dock !


Will it be possible?


Thank you.


 

Technical Support Feb 28, 2005 - 1:42 PM

We may guess that you want to restrict the ability of some resizable control bars to be docked into the same tabbed containers with some other resizable bars. Yes, it’s completely possible. Please use your own CExtControlBar-derived class and override the following internal virtual method:

protected:
    virtual bool _CanDockToTabbedContainers(
        CExtControlBar * pDestBar
        ) const;

This method should return true if the this bar can be docked into the same tabbed group with pDestBar bar. You may use the dialog control identifier values returned by the CWnd::GetDlgCtrlID() method to compare or identify any control bar because each control bar has its own unique dialog control identifier. Please note that the pDestBar may be an instance of the CExtDynTabControlBar class which implements a tabbed container with several CExtControlBar instances inside. So, you also need to code your own CExtDynTabControlBar-derived class and override the _CanDockToTabbedContainers() internal virtual method in it. To make Prof-UIS frame work using your tabbed container type, you should handle the CExtControlBar::g_nMsgCreateTabbedBar registered windows message in your main frame window:
ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgCreateTabbedBar, OnMsgCreateTabbedBar )

LRESULT CMainFrame::OnMsgCreateTabbedBar( WPARAM wParam, LPARAM lParam )
{
    lParam; // unused
CExtDynTabControlBar ** ppBar = (CExtDynTabControlBar **)wParam;
    ASSERT( ppBar != NULL );
    (*ppBar) = new CMyCustomDynTabControlBar;
    return  0;
}

Now your application is able to control any event relating to creation and modification of the tabbed bar container. The pDestBar parameter in the CMyCustomDynTabControlBar::_CanDockToTabbedContainers() might also be a pointer to the CMyCustomDynTabControlBar instance when one tabbed group is docked into other. The following code will walk through all the control bars in the tabbed container
    INT nItemCount = CExtDynTabControlBar::GetSwitcherItemCount()
    for( INT nBar = 0; nBar < nItemCount; nBar ++ )
    {
        CExtControlBar * pExtBar =
            CExtDynTabControlBar::GetBarAt( nBar, true );
        ASSERT_VALID( pExtBar );
        . . .
    }
Finally, you will need to include the following header file to have access to the CExtDynTabControlBar class type:
#incude <../Src/ExtControlBarTabbedFeatures.h>

tarou iiyama Mar 1, 2005 - 12:17 AM

  Thank you for an answer.  



*************************************************
Question1:
*************************************************


>The pDestBar parameter in the CMyCustomDynTabControlBar::_CanDockToTabbedContainers()
>might also be a pointer to the CMyCustomDynTabControlBar instance when one tabbed group
>is docked into other. The following code will walk through all the control bars in the
>tabbed container


  I tried to make it according to the instructions.  
However, I do not work.


bool CExtDynTabControlBarCust::_CanDockToTabbedContainers( CExtDynTabControlBar * pDestBar )
{
    INT nItemCount = CExtDynTabControlBar::GetSwitcherItemCount();
    for( INT nBar = 0; nBar < nItemCount; nBar ++ )    {
        CExtControlBar * pExtBar = GetBarAt( nBar, true );       
        ASSERT_VALID( pExtBar );
    }
    return true;
}


  I become an error to build when I add const to a function.



*************************************************
Question2:
*************************************************


  I did not do the docking of a tab.
However, I dock besides it.


   Bar(A)         Bar(B)  
   _____       _______
  |_____|       |_______|
  |      |   +   |         |         __________________________
  |      |        |         |  ==   |   Bar(A)     |     Bar(B)     |
  |_____|       |_______|        |____________|_____________|
                                   |                |                 |
                                   |                |                 |
                                   |                |                 |
                                   |____________|_____________|


 


  It does not want to be possible by union.
Please teach a way.


*************************************************
Question3:
*************************************************


bool  CExtControlBar::_CanDockToInnerCircles() const


What is this?


Thank you.


 

Technical Support Mar 1, 2005 - 8:11 AM

The custom tab container solution we suggested you in our previous message should be compiled without any errors and warnings. We may guess you simply made some typo. You can send us your project and we will check it.

The resizable control bar is designed as a re-dockable container window without any restrictions imposed on docking positions and its size. Its idea similar to dockable panes in Visual Studio .NET or Visual Studio 2005. It is not possible and there is no reason to disable docking two resizable control bars with each other or inside a tab group.

The CExtControlBar::_CanDockToInnerCircles() method is an internal API of the control bar and it returns true if the instance of CExtControlBar works like a resizable control bar. It returns false if the control bar is a toolbar or it can be docked in the same outer frame areas with toolbars.

tarou iiyama Mar 1, 2005 - 9:16 PM

Thank you for an answer. 


>The custom tab container solution we suggested you in our previous message
>should be compiled without any errors and warnings.
> We may guess you simply made some typo. You can send us your project and we
>will check it.


Are you all right if you send a program to support@prof-uis.com ?


Thank you.

Technical Support Mar 2, 2005 - 4:14 AM

Yes, you can send us your project to support@prof-uis.com so that we can help you.