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 » Ribbon Bar Home->Style Tab Collapse All
Subject Author Date
himanshu joshi Jan 18, 2007 - 5:51 AM

Hi

In the ribbon bar example under Home->Style there are 1 to 16 different styles are present.
Is it posiible to do some processing on clicking any of the styles means can i handle the click event of each style and do some coding on that click event


Thanks

Technical Support Jan 19, 2007 - 3:23 AM

You should override the CExtRibbonPage::OnRibbonGalleryItemSelChange() virtual method to handle clicks on gallery items.

himanshu joshi Jan 21, 2007 - 10:43 PM

Hi

Thanks a lot .
In the ribbonbar example this method is not implemented could you suggest the code for the same

Thanks

Technical Support Jan 22, 2007 - 12:13 PM

You should simply override the virtual method in your class, invoke the parent class method and finally invoke your code which handles the event.

himanshu joshi Jan 23, 2007 - 12:45 AM

Hi

I have 10 styles and on clicking any of the style it first comes to OnRibbonGalleryItemSelChange() function.
Now how could i get the ID of each style so that i can invoke 10 different codes(implementations for styles) on 10 different clicks .

Thanks

Technical Support Jan 23, 2007 - 3:45 AM

As we mentioned before, the ribbon gallery control is a kind of toolbox control. Each toolbox item can have LPARAM user defined value which is accessible with CExtToolBoxWnd::TOOLBOX_ITEM_DATA::LPARAM_Get() and CExtToolBoxWnd::TOOLBOX_ITEM_DATA::LPARAM_Set() methods. So you can assign your identifier values while initializing toolbox and you can use your identifiers while handling item clicks.

himanshu joshi Jan 24, 2007 - 2:58 AM

Hi,

I have implemented the above thing CExtToolBoxWnd::TOOLBOX_ITEM_DATA::LPARAM_Set() in the ribbonbar example for Style tab and and on clicking of each style it is coming to OnRibbonGalleryItemSelChange function where i am getting the LPARAM.

However one thing that is happening is, if i am clicking on style1 first time it is coming to OnRibbonGalleryItemSelChange but if i am clicking immediately on the same style1 again it is not coming to OnRibbonGalleryItemSelChange function as if that style is disabled .

Now when i click on style2 and returns to click on style1 it is again enabled.

What is the solution for that

Your help is appreciated.
Thanks

Technical Support Jan 24, 2007 - 12:31 PM

The toolbox window/ribbon gallery control is invoking an item selection notification both for category items and leaf items (children of category items). If you assigned unique LPARAM values to all items, then you should have no problems with detecting which item is selected.

himanshu joshi Jan 25, 2007 - 2:15 AM

Hi

i am assigning unique LPARAM values to all items and able to detect which item is selected
however when i clicking on a particular item first time it is invoking my code but if i click on the same item immediately after first click it is not invoking the my code .(In fact it is not coming to function OnRibbonGalleryItemSelChange )in ribbonbar example.
What could be the reson and solution for the same.



Thanks

Technical Support Jan 29, 2007 - 12:56 PM

Please use the OnRibbonGalleryItemSelEndOK() virtual method instead.

himanshu joshi Jan 24, 2007 - 5:17 AM

In context with above if i load a small size bmp e.g 32*32 and divide it in two icons of 16*16 i could see two icons in style tab in ribbon example but i could not expand it and see another 3 buttons in that group viz 1)Save Selection as a New &Quick Style2)Clear Formatting and 3)Apply Styles

What could be the solution for this

Thanks

Technical Support Jan 24, 2007 - 12:34 PM

Could you send us (at support) a screenshot demonstrating the problem? You can create a bitmap with icons for several commands. The CExtBitmap::FromBitmap() method allows you to assign one CExtBitmap object from part of another one. So you can use this method for assigning the CExtCmdIcon::m_bmpNormal property from part of the CExtBitmap object.

himanshu joshi Jan 25, 2007 - 2:24 AM

In ribbonbar example if you replace the existing bitmap(ID_RIBBON_GALLERY_STYLES.bmp) with some small size bitmap like ID_QUICK_STYLES_BIG.bmp(32*32) and just divide it in 2 icons of 16*16 by making nItemCount=2 then i was unable to expand the galley and see last three nodes in ribbon gallery viz
1)Save Selection as a New &Quick Style
2)Clear Formatting
3)Apply Styles
What could be the reson and solution.

Thanks

Technical Support Jan 29, 2007 - 12:58 PM

Could you modify the RibbonBar sample in order to demonstrate the problem and send it to us?