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 » CExtToolControlBar and Gripper in CWnd Collapse All
Subject Author Date
Dmitry Kostromin Nov 9, 2005 - 8:18 AM

Hi. I can’t display Gripper if CExtToolControlBar is inserted in CWnd.


I call method Create:


m_wndToolBar.Create(NULL,this,AFX_IDW_DIALOGBAR, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_HIDE_INPLACE);


 


What I do wrong.

Technical Support Nov 9, 2005 - 9:56 AM

It seems you forgot to make the toolbar dockable:

m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
...
DockControlBar(&m_wndToolBar);



Dmitry Kostromin Nov 10, 2005 - 2:18 AM

No, you have not understood. I mean CExtToolControlBar in CWnd, not in CFrameWnd. Problem in this exactly.

Technical Support Nov 10, 2005 - 6:01 AM

To provide the toolbar with a gripper, specify the CBRS_GRIPPER style when invoking toolbar’s Create() method or when invoking MFC’s CControlBar::SetBarStyle() method. This should work when the toolbar is created inside any window, not only in CFrameWnd. For instance, grippers in toolbars and the menu bar on the Menubar & Toolbars page of the ProfUIS_Controls sample application are turned on and off with the Show Gripper check box. We guess the problem with displaying a toolbar gripper in your application hides somewhere else. So, if the problem persists, just send us your project or only the source code of the window that owns toolbars so we can help you resolve the problem.

Dmitry Kostromin Nov 18, 2005 - 3:09 AM


Please test this code, because any ways to show gripper no effect. I saw your sample ProfUIS_Controls but your sample code not workin in this situation


BOOL CtestDlg::OnInitDialog()


{


.....


//I create any CWnd object


m_cwnd.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,


CRect(0, 50, 300, 200), this, -1, NULL);


//then create toolbar in it



m_wndToolBar.Create(NULL,m_cwnd->GetSafeHwnd(),AFX_IDW_DIALOGBAR,


WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER |


CBRS_TOOLTIPS | CBRS_HIDE_INPLACE);


//add button for example


INT nCmdID = ID_TEST;


CString sToolBarBtnText("");


sToolBarBtnText.LoadString(nCmdID);


CExtCmdItem * p_cmd = g_CmdManager->CmdAllocPtr


(


g_CmdManager->ProfileNameFromWnd(GetSafeHwnd()),


nCmdID


);


ASSERT( p_cmd != NULL );


p_cmd->m_sToolbarText = sToolBarBtnText;


m_wndToolBar.InsertButton( -1, nCmdID, FALSE );


.....


}


Of course i call RepositionBars in Class of m_cwnd and there is no Gripper in this m_toolbar


 

Dmitry Kostromin Nov 18, 2005 - 3:14 AM

Sorry in line


m_wndToolBar.Create(NULL,m_cwnd->GetSafeHwnd(),AFX_IDW_DIALOGBAR,


i mean


m_wndToolBar.Create(NULL,&m_cwnd,AFX_IDW_DIALOGBAR,


 


 

Technical Support Nov 18, 2005 - 12:25 PM

If the suggested way of setting the bar style does not work in your application, then you can set the bar styles using the code like this:

bar.Create( . . . );
bar.SetBarStyle( bar.GetBarStyle() | CBRS_GRIPPER );