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 » RibbonGallery Control Collapse All
Subject Author Date
himanshu joshi Jan 29, 2007 - 11:04 PM

Hi
I have implemented two ribbon gallery controls same as in ribbonbar example Home->Style Tab with 10 styles within them each.

When i click on first gallery control Style1 it is highlighted however when i click on second gallery control Style1 this is highlighted as well.
It doesn’t remove the highlight or selection from first gallery control Style1 when i click on second gallery control Style 1.

What could be the solution for this.

Thanks

Technical Support Jan 30, 2007 - 12:25 PM

Please check if you did not forget to invoke the parent class’s methods from all the overridden methods in your CExtRibbonBar-derived class.

himanshu joshi Jan 30, 2007 - 10:09 PM

Hi

I had invoked parent class’s methods from overridden methods still the same thing is happening.

any solution for this

Technical Support Feb 1, 2007 - 4:59 AM

We modified the RibbonBar sample in order to reproduce what you are talking about:

1) CMainFrame::_InitRibbonNode_Home_Style() in the CMainFrame::_InitRibbonPage_Home() method is invoked twice:

pRibbonNodeTabPage->InsertNode( NULL, _InitRibbonNode_Home_Style() );
pRibbonNodeTabPage->InsertNode( NULL, _InitRibbonNode_Home_Style() );


2) The following code near the end of the CMainFrame::_InitRibbonNode_Home_Style() method is commented out:
/*
    CExtRibbonNode * pNodeChangeStyles =
        new CExtRibbonNode( ID_CHANGE_STYLES_BIG, 0, NULL, 0, _T("Change\nStyles") );
    pNodeChangeStyles->RibbonILE_RuleArrayGet().RemoveAll();
    VERIFY( pNodeChangeStyles->m_iconBig.m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE(ID_CHANGE_STYLES_BIG) ) );
    pNodeChangeStyles->m_iconBig.m_bmpNormal.Make32();
    pNodeChangeStyles->m_iconBig.m_bmpNormal.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
    pRibbonGroup->InsertNode(
        NULL,
        pNodeChangeStyles
        );
*/
After that, we can see two ribbon gallery controls next to each other in the ribbon bar’s Home page. There are no any hover/pressed state processing bugs with gallery item. The only thing is that both galleries are not synchronized. But they should not be synchronized because there is no point to insert two same two galleries next to each other in your real project.

himanshu joshi Feb 1, 2007 - 10:17 PM

Hi

In the above example
Initially we can see Style1 in both ribbon gallery looks selected .
If you comment the line "if( nItemIndex == 0 )pTBCI_GalleryItem->ModifyItemStyle( __TBWI_SELECTED );" in ID_QUICK_STYLES_BIG in CMyRibbonBar::OnRibbonGalleryInitContent both are unselected.
Now when i press on Style1 of first gallery content it looks selected however after that when i press on Style1 of second gallery control both looks selected.

In my project i want the first selection to be not shown when i click on second gallery item because both galleries contain different items.

Thanks

Technical Support Feb 2, 2007 - 4:59 AM

Both galleries are independent from each other. If you are handling some event of one gallery, then your code is responsible to modify the item states in other gallery like you expect to see. You should try to get the gallery button from the ribbon bar, access its gallery control and change item states in it.

himanshu joshi Feb 4, 2007 - 10:13 PM

Hi

Could you suggest if any item style which will remove the selection of the selected item .
e.g pTBCI_GalleryItem->ModifyItemStyle( __TBWI_SELECTED ); __TBWI_SELECTED selects the item .Any such style which will do the work opposite to __TBWI_SELECTED.(for non selection )

Thanks

Technical Support Feb 6, 2007 - 7:18 AM


The pTBCI_GalleryItem->ModifyItemStyle( __TBWI_SELECTED ); code in your message invokes a CExtToolBoxWnd::TOOLBOX_ITEM_DATA::ModifyItemStyle() method which is declared as follows:

virtual DWORD ModifyItemStyle(
      DWORD dwStylesAdd,
      DWORD dwStylesRemove = 0L
      );
As you can see, this method allows both to add and remove the __TBWI_*** toolbox/gallery item styles.

The pTBCI_GalleryItem->ModifyItemStyle( __TBWI_SELECTED ); code adds the __TBWI_SELECTED style to the pTBCI_GalleryItem toolbox/gallery item.

The pTBCI_GalleryItem->ModifyItemStyle( 0, __TBWI_SELECTED ); code removes the __TBWI_SELECTED<code> style from the <code>pTBCI_GalleryItem toolbox/gallery item.

himanshu joshi Feb 1, 2007 - 10:19 PM

Please tell how to write tooltip that come when i move mouse over styles on status bar.
I have overirded OnRibbonGalleryItemHoverChange function in my project what method should i use to write tooltip on status bar

Technical Support Feb 2, 2007 - 5:03 AM

The CExtStatusControlBar::SetTipText() and CExtStatusControlBar::GetTipText() methods allow you to manage tooltips for panes in the status bars. If you are using a toolbar window as status bars’ child attached to some pane, then you should initialize tooltips for its status buttons using exactly the same way as for the toolbar in the main frame or a dialog window.

himanshu joshi Feb 5, 2007 - 9:47 PM

Hi

Is there any alternative for the function OnRibbonGalleryItemHoverChange as it works whenever i hover is changed
I want something similar to that but it should work whenever i bring the mouse on any item and no on changing item hover

Thanks

Technical Support Feb 8, 2007 - 3:29 AM

The meant in your message virtual function can be used independently from whether ribbon gallery items are selected or not. If you are using the gallery control as a container for non-selected items, then the method will always handle hovering of unselected items. Please provide us with more details or a test application showing the hover processing problems.