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 Tech Support » DynamicControlBar started as tabbed document Collapse All
Subject Author Date
Suhai Gyorgy Dec 7, 2005 - 1:53 PM

Hi! I was trying to find out the right way to initially start a dynamic control bar as tabbed document. I took the SDI_DynamicBars sample as sarting point, but the initialization part (the "for(i=0,j=0;i<...;j++)" block) was too difficult for me to understand completely.
I start my code with initializing another, docked control bar:
m_pMyBar1->DockControlBar(...);
m_pMyBar1->BarStateSet(...DOCKED, true);
after that I tab in the other bar:
ShowControlBar(m_pBar2, true, true);
m_pBar2->BarStateSet(...DOCUMENT, true);

My problem is: when I start the app, in the Menu it seems like m_pMyBar2 isn’t visible (the menuline is not checked), although I can see it tabbed. And when I click on that menuline, another instance of Bar2 appears docked outside the View (CExtTabPageContainerWhidbey). What am I doing wrong? Could you please send me a small sample with only two control bars in it and without using the array m_arrAllDynamicBars of CTypedPtrArray? Thank you very much: Chris.

Technical Support Dec 8, 2005 - 9:04 AM

We have a sample application that seems to be what you are searching for. The "strange" part of code from our standard set of samples is required to make a funny docked bar layout with multiple nested bar levels at the top/bottom/left/right frame window sides. The sample application mentioned above does not have this code. It creates two bars and makes one of them switched into the document tab mode in the tab page container window initially.

Suhai Gyorgy Dec 9, 2005 - 3:25 AM

I guess I figured out what caused the problem mentioned in the first post of this thread: Since I don’t want AutoHide feature in my app I made some steps eliminating it and probably that’s where I made the mistake. So what I would like to reach is this: in the menu I don’t want icons next to the DynamincBars’ names, rather I want them checked showing whether they are visible or not. If the user clicks the menuline, I want to hide the bar if it was visible, or show it if it was hidden. I made the following steps in the CMainFrame class of the sample code you’ve sent me:

a) commented out the declaration and definition of OnCmdMsg, OnBarCheck and OnUpdateControlBarMenu methods.

b) from OnCreate I commented out the calls of FrameInjectAutoHideAreas, LoadImage, AssignFromHICON methods, in BarAlloc I wrote NULL as second parameter instead of iconA and iconB.

c) in the MessageMap I inserted the following:
ON_COMMAND_EX( 5000, OnBarCheck )
ON_UPDATE_COMMAND_UI( 5000, OnUpdateControlBarMenu )
for both DynamicBars (I don’t want the user to be able to hide the menu, so I removed the two lines refering to the menu from the MessageMap)

Compile and run. You should see what I wrote earlier: in the menu BarB is not checked, although it’s visible and when I click on the menuline, another BarB appears.

I know I will have to override OnInitDbsMenu to remove AutoHide entry from the context menu. But could you tell me what should I do to reach my goal (remove AutoHide feature)?

P.S.: Why don’t you call m_pDynamicBarA->EnableDocking( CBRS_ALIGN_ANY ); and m_pDynamicBarB->EnableDocking( CBRS_ALIGN_ANY ); nowhere in your sample? Isn’t it neccessary?
Thank you for your help: Chris

Technical Support Dec 10, 2005 - 11:35 AM

We improved the sample we’d sent you the previous time. Please download it and let us know whether it is what you need.

Suhai Gyorgy Dec 12, 2005 - 2:09 AM

Hi! There’s an error in this code you’ve sent me the last time: in the messagemap of CMainFrame, the line
ON_COMMAND_EX( ID_VIEW_MENUBAR, OnBarCheck )
is there twice, but there’s no
ON_COMMAND_EX( 5001, OnBarCheck )
line in it. Could you check that? Thanks.

Suhai Gyorgy Dec 12, 2005 - 1:53 AM

Hi!
Unfortunately this is not exactly what I need. The context menu is fine, also removing the autohide feature is fine, but in the main menu I don’t want icons next to the menuline "Bar A" and "Bar B". Instead I want a checkmark indicating whether that ControlBar is visible or not, and clicking the menuline should hide/unhide the ControlBar. To reach that, I removed the declaration and definition for both OnUpdateControlBarMenu and OnBarCheck methods from CMainFrame class, and also I invoked BarAlloc like:

"CExtDynamicBarSite::BarAlloc( _T("Bar A"), NULL, 5000, RUNTIME_CLASS( CMyControlBar ), true );"
instead of
"CExtDynamicBarSite::BarAlloc( _T("Bar A"), iconA, 5000, RUNTIME_CLASS( CMyControlBar ), true );" to remove the icons.

If you could do these same steps, you would see that BarB is not visible (its menuline is not checked). Everything works fine with BarA, but not with BarB. Could you check that issue as well, please?

Thank you: Chris