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 » Question about CExtControBar Collapse All
Subject Author Date
mai mike Aug 25, 2008 - 7:59 AM

Dear Technical team,


I have a problem about CExtControlBar want to ask for your help.


The situation is:


I created 3 bars(bar1, bar2 and bar3) which is derived from CExtControlBar.


There are two bars(bar1 and bar2) which overlap dock at the left side of the main frame.


And the other bar(bar3) docks at the right side of the main frame.


I created two buttons on the bar3, one button(button1) use to close bar1 and bar2 if they are visible, the other one(button2)


use to show bar1 bar1 and bar2 if they are invisible.


Now, bar1 is topper than bar2, means that, we can see bar1 totally, but just can see tab of bar2.


As you know, we can change the position of both bars. we can see bar2 totally, and just can see tab of bar1.


Now , the step is:


1. I click button1 to close bar1 and bar2.


2. I click button2 to display bar1 and bar2


Except result:


If bar1 is topper than bar2 before I click button1, I want that bar1 still topper than bar2,


and if bar2 is topper than bar1 before I click button1, I want that bar2 still topper than bar1,


How can I implement this situation?


Does any existing method I can use?


Thank you in advance.


Best regards,


Mike Mai

mai mike Sep 2, 2008 - 7:23 AM

Dear Technical Team,


As you know, if there are more than one bar which overlap dock at the main frame, a tab group will be yield.


I found that this tab group is an object of class CExtTabWnd.


How can I get the object of class CExtTabWnd?


As you know, we can use method named


LONG SelectionGet() const;

 


 to return the index of the selected tab item or which bar is selected right now.


And we can use method named


 



LONG SelectionSet(LONG nSelIndex,   bool bEnsureVisible = false,   bool bUpdateTabWnd = false);


to set the selection of the tab item programmatically.


So if I can get the object of class CExtTabWnd, I think I can solve my problem which has been metioned above.


Thank you in advance.


Best regards,


Mike Mai

Technical Support Sep 3, 2008 - 3:59 AM

You should use the following code:

CExtControlBar * pBar = . . .
CExtDynTabControlBar * pTabBar = pBar->_GetNearestTabbedContainer();
      if( pTabBar == NULL )
            return . . .
CExtTabWnd * pWndTabControl = NULL;
CWnd * pWnd = pTabBar->GetNextWindow( GW_CHILD );
      for( ; pWnd != NULL; pWnd = pWnd->GetNextWindow( GW_HWNDNEXT ) )
      {
            pWndTabControl = DYNAMIC_DOWNCAST( CExtTabWnd, pWnd );
            if( pWndTabControl != NULL )
                  break;
      }


mai mike Aug 26, 2008 - 7:55 AM

Dear Technical Team,


How can I show you the screenshot? How to add image?


Best regards,


Mike Mai

Technical Support Aug 26, 2008 - 12:37 PM

You can either send it to support@prof-uis.com or just upload to your webserver and put a link to it in this forum.

Technical Support Aug 26, 2008 - 3:55 AM

We definitively need a screenshot demonstrating where the buttons are and where the bars should appear relative to each other?

mai mike Aug 26, 2008 - 8:42 AM

Dear Technical Team,


About this problem, maybe I use another description.


There are there bars(bar1, bar2, bar3) which is derive from CExtControlBar in the main frame.


As you know, there is a context menu can be pop-up when I user click Right button of the mouse on the main frame, on the toolbar or on the  capture of each control. Use the contex menu, the user can display or hide the controlbar or toolbar or menu bar. use such as code:


BOOL CMainFrame::OnBarCheck( UINT nID )

{

      return CExtControlBar::DoFrameBarCheckCmd( this, nID, false );

}


or use CFrameWnd::ShowControlBar() method to show or hide controlbar


Now bar2 and bar3 are in tab group, you can see bar2 totally, but just can see the tab window of bar3.


when the user click the context menu to show bar1, bar2 and bar3 will hide together.


and when the user click the context menu to hide bar1, bar2 and bar3 will show together, at this time,


I want bar2 and bar3 are still in tab group, you can see bar2 totally, but just can see the tab window of bar3.


Do you know what I means?


How to implement?


Thank you in advance!


Best regards,


Mike Mai

Technical Support Aug 26, 2008 - 12:40 PM

We have compiled and run the SDI sample application. This sample application uses a toolbar-like command style for control bars and auto-hiding is disabled. We tried to show/hide any bars in the tabbed group and didn’t find any bugs. Then we have repeated the same tests the ProfStudio sample where control bars are enabled for auto-hiding and commands can only show and activate bars. We also didn’t found any bugs. May be you can provide us with detailed step by step instructions related to any of our application? Which application should we run? Where should we click? What should we move?