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 » StateSetTextField Collapse All
Subject Author Date
Daniel Tiedy Nov 25, 2003 - 4:34 PM

How would I approach adding my own derived CEdit class and CScrollBar controls to a toolbar. I see that there is a way with the CommandManager to use StateSetTextField, but can I have custom controls?

Technical Support Nov 26, 2003 - 6:56 AM

Dear Daniel,

Thank you for a good question. The instance of the CExtCustomizeSite class is responsible for creating buttons in toolbars. You can override its OnCreateToolbarButton() method to create your own CExtBarButton-based objects (i.e. toolbar buttons) for any particular command in any toolbar. You may see how CMainFrame::OnCreateToolbarButton() is implemented in the DRAWCLI sample. You need this method to initialize custom text-field buttons or any other buttons in toolbars. Text-field buttons and combo-field buttons are instances of the CExtBarTextFieldButton class. You may code your own class derived from CExtBarTextFieldButton and override OnInplaceControlCreate() to create your specific CEdit inside a toolbar button.

Your task is not typical, but it can be solved with Prof-UIS. If you just need to verify text input in the toolbar’s edit or combo-edit button, you need to override CExtCustomizeSite::OnTextFieldVerify().