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 » Ribbon Bar Combo Font name selection Collapse All
Subject Author Date
Abdul Rahim Feb 12, 2007 - 6:57 AM

Hi
My application is based on the RibbonBarMDI sample.
When the combo boxes font name or size (embedded in the home ribbon page ) is changed I need to be able to detect the selection change event in the MainFrm or ChilldFrm class. I have tried the conventional method like ON_CBN_SELCHANGE in the MainFrm but to no avail. Can you please show how i can do this. Also What is the best way to update these combo boxes from the Mainfrm or ChildFrm.
Thank You

Technical Support Feb 13, 2007 - 3:27 AM

The combo boxes in question are not based on the combo box common control . Such a combo box is a kind of combo field and you can work with it by overriding virtual methods of the CExtCustomizeSite class. Tha latter is the base class of CExtRibbonBar. There are the following methods you can override:

OnPopupListBoxGetStyles() allows you to add the LBS_SORT style to the popup list box in order to make the font names sorted.
OnPopupListBoxInitContent() allows you to initialize the list box with font names.
OnPopupListBoxItemDraw(), CExtCustomizeSite::OnPopupListBoxItemMeasure() allows you to draw font names and measure list box items.
OnPopupListBoxMeasureTrackSize() can be helpful if you need to measure the size of the entire list box before it appears on the screen.
OnTextFieldVerify() allows you to verify the edited text on-the-fly.
OnTextFieldInplaceTextGet() returns the text displayed in the combo box.
OnTextFieldInplaceTextSet() allows you to catch the following events: the user selected an item in the list and the user finished editing.

The built-in combo boxes are assumed as edit controls with the combo box like dropdown button displaying popup list box. The above methods are designed to provide content synchronization between multiple copies of the same combo box in customizable toolbars, menus and ribbon bar. The Font combo box in the ribbon bar can be both under the Home tab and in the Quick Access Toolbar. When in a toolbar , the font combo box can be copied by the user into several copies in different toolbars and menus using the combo box drag-n-drop with the ALT key hold pressed. In both cases, the built-in combo boxes are fully controlled by the CExtCustomizeSite class. The described above methods are implemented in the CMyRibbonBar class of the RibbonBar and RibbonBarMDI sample applications and in the CMainFrame class of the StyleEditor sample.