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 » Using CExtToolControlBar::SetButtonCtrl; how do I let user customize? Collapse All
Subject Author Date
Daisy Peterson Mar 20, 2008 - 4:53 PM

I am using SetButtonCtrl to put a combo box onto a toolbar.  This is fine, it works.  However, when the user brings up the customize dialog a placeholder icon is used (just a square), and if the user drags that to a toolbar, that’s all that appears in the toolbar as well.


1) How do I make the new user button into a combo box?  (Is there a message telling me the user has dragged a button to a toolbar, is a callback utilized in this case, etc.?)


2) Can the customize dialog show the combo box instead of the icon?


 


Thanks,


Kevin Murray


AGI

Technical Support Mar 26, 2008 - 9:55 AM

The CExtToolControlBar::SetButtonCtrl() method attaches a window handle to a toolbar button. This method relates mostly to non-customizable toolbars. Although customizable toolbars can have windows attached to their buttons, it’s not recommended because a similar feature is not supported by menus and customization subsystem does not know how to clone and synchronize several copies of such buttons. So please use built-in text/combo fields instead of combo box common controls attached to toolbar buttons. The combo boxes in the StyleEditor sample are not combo box windows but rather built-in combo field buttons for toolbars and menus. You can note you can create several copies of a combo box in toolbars and menus and they will be automatically synchronized plus you will see combo box line items in the Customize dialog. The CMainFrame::OnCreate() method in the StyleEditor sample demonstrates how to initialize combo fields. The combo fields do not contain any data, neither text field’s string nor collection of strings for the popup list box. These data is provided to combo fields through overridden CExtCustomizeSite::OnPopupListBox***() and CExtCustomizeSite::OnTextField***() virtual methods in the CMainFrame class. This design allows you to provide all the copies of each text/combo field with the same data and, as result, the text/combo fields become always synchronized.