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 General Discussion » Color button in RibbonBar Collapse All
Subject Author Date
chen xinyu Oct 30, 2009 - 8:17 PM

Hello:


    I have create a color button in RibbonBar. I want that the color can change automatically when the cursor move above the color, but if I do not


 

Technical Support Nov 2, 2009 - 7:17 AM

Please run the FormulaGrid sample application and select some range of grid cells in it. Now you can move the mouse pointer over the ribbon gallery items or over the color palette menus. As a result, the style of the selected grid cells will be changed. But style is restored if you didn’t pick any color or any style preset. Is that what you need?

Technical Support Oct 31, 2009 - 1:44 PM

You should override the CExtCustomizeSite::OnColorItemValueGet() virtual method in your CExtRibbonBar-derived class for providing any color buttons with any dynamically changed color values. The CExtCustomizeSite::RedrawCommandItems() method allows you to repaint the color buttons when you changed its color value. You can override the CExtCustomizeSite::OnColorItemValueSet() virtual method to catch the color value selection event.


chen xinyu Oct 31, 2009 - 7:45 PM

But I want the color icon on the button can be changed automatically just when the cursor move above the according color beside I select the color. Moreover if I do not select the color finally, the color icon on the button will restore.

Thank you!

chen xinyu Oct 30, 2009 - 8:21 PM

Hello:


 


    I have create a color button in RibbonBar. I want that the color can change automatically when the cursor move above the color, but if I do not select the color the color in the color button can change back to the color before. Is it clear?


    I create it as follows.


 CExtRibbonNode * pNodeBackgroundColor =  new CExtRibbonNodeToolButton( ID_VIEW_BACKGROUND_COLOR );


 pNodeBackgroundColor->SetLParam( ID_VIEW_BACKGROUND_COLOR );


 pNodeBackgroundColor->CmdKeyTipSet( new CExtCustomizeCmdKeyTip( __EXT_MFC_SAFE_TCHAR( _T(’BC’) ) ), false );

 pNodeBackgroundColor->ModifyFlags( __ECTN_TBB_COLOR|__ECTN_TBB_MCB_CUSTOM|__ECTN_TBB_MCB_DEFAULT );