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 » Labels and check boxes on toolbars? Collapse All
Subject Author Date
Robert Webb Dec 4, 2008 - 12:36 AM

I’m having lots of problems putting controls on toolbars successfully.  Sorry if I’ve missed something obvious.



(1) None of CExtBarLabelButton, CExtBarCheckBoxButton or CExtBarRadioBoxButton appear in any of the sample code.  A label is put on a toolbar in the ProfUIS_Controls sample, but it is done differently, by creating a CExtLabel and adding it with SetButtonCtrl().  One problem with this approach seems to be that it disappears when the toolbar is resized (to split over multiple lines).  Why is that?  Can it be avoided?  Should the CExtBar*Button classes avoid that problem?



(2) When attempting to use CExtBarLabelButton, how do I set the text for the label?  Nothing I’ve tried has worked.  Same question for CExtBarCheckBoxButton.



(3) Is the only way to set the width of a label or check-box in a toolbar to derive new classes and override CalculateLayout()?



(4) Some reason when I create a CExtBarCheckBoxButton in your ProfUIS_Controls sample code and add it with InsertSpecButton() to a toolbar, it works (but without showing any text).  However when I do the same thing in my own code, it fails, just leaving the original icon button there.  One thing that’s slightly different is that in my code I am replacing existing buttons, first with InsertSpecButton() to add the new one, then with RemoveButton() to remove the original one.  They have the same ID though, so is it possible the customization module is changing my check box back to whatever it thinks the button should be?  Any other suggestions?



(5) I understand what you mean about making the label part of the combo box, and see that it would be a better option, but haven’t tried that yet.  That may circumvent my problems with CExtBarLabelButton, but I still have all the same problems with CExtBarCheckBoxButton.



(6) I tried using SetButtonCtrlVisibleVertically() for various controls, but they just appear as wide blank areas when docked vertically.  Eg edit and combo boxes behave that way.  Am I doing something wrong or is this just a known limitation?



Maybe you could add some sample code to demonstrate creation of labels and check boxes on toolbars, via the CExtBar*Button and InsertSpecButton() method, which seems preferable?  Showing how to control the width and text on such controls.



Thanks,

Rob.

Technical Support Dec 4, 2008 - 12:52 PM

The CExtToolControlBar window does not contain icons nor text strings for its toolbar buttons. Both icons and text strings are stored in the command manager. You should get the command description object using the CExtCmdManager::CmdGetPtr() method and set its CExtCmdItem::m_sToolbarText () property. This approach should be used for both check box and label buttons.

The CExtToolControlBar::SetButtonCtrlVisibleVertically() and CExtBarButton::SetCtrlVisibleVertically() methods are typically used with the CExtBarButton::SetNoRotateVerticalLayout() method. All the most often used common controls have horizontal layout. So, if you want to see them in vertical toolbar, then you should make button using horizontal layout in vertically docked toolbar.

We think, we can add the new two features for all the toolbar buttons: text to display before toolbar button and text to display after it. This is easier to code in Prof-UIS than to code in standalone test project created for you as ready-to-use sample application.