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 » OnRibbonGalleryInitContent Collapse All
Subject Author Date
himanshu joshi Jan 18, 2007 - 3:42 AM

Hi

In the ribbon bar example when we run the application OnRibbonGalleryInitContent is called internally.

Is there any way to call the function explicitly whenever we need that.

In my application it is getting called whenever i click on the ribbon tab inside which gallery is placed

Thanks in Advance

Technical Support Jan 19, 2007 - 3:22 AM

The OnRibbonGalleryInitContent() is called when the ribbon gallery control is created. If you need to access the in-place ribbon gallery control:

UINT nRibbonGalleryButtonID = . . .
CExtRibbonBar * pRibbonBar = . . .
INT nIndex = pRibbonBar->CommandToIndex( nRibbonGalleryButtonID );
    if( nIndex < 0 )
        return . . . // gallery is not visible
CExtBarButton * pTBB = pRibbonBar->GetButton( nIndex );
    ASSERT_VALID( pTBB );
CExtRibbonGalleryWnd * pWndRibbonGallery =
        STATIC_DOWNCAST(
            CExtRibbonGalleryWnd,
            pTBB->CtrlGet()
            );
    ASSERT_VALID( pWndRibbonGallery );

himanshu joshi Jan 22, 2007 - 1:37 AM

Hi

Thanks a lot.

A little question about the UINT nRibbonGalleryButtonID declared above.
What should this ID be declared or is this the same ID when we create the gallery e.g
CExtRibbonNodeGallery * pNodeQuickStyles =new CExtRibbonNodeGallery(nRibbonGalleryButtonID, NULL, 0, GroupName );
because when i am taking this ID to get nIndex

INT nIndex = pRibbonBar->CommandToIndex( nRibbonGalleryButtonID ); if( nIndex < 0 ) return ;
it is returning -1.

Thanks

Technical Support Jan 22, 2007 - 12:18 PM

Yes, you should use the identifier of the ribbon gallery node.

himanshu joshi Jan 22, 2007 - 2:39 AM

Another thing is when i create the CExtRibbonNodeGallery using new statement like above it is not calling OnRibbonGalleryInitContent
however when i clikc on the tab which contains the gallery init function is called.

In the ribbon bar example also it is not called on tab click of ribbon bar
What could be reason

thanks

Technical Support Jan 22, 2007 - 12:04 PM

The ribbon gallery controls exist only as part of ribbon gallery buttons. The ribbon bar keeps buttons for the selected ribbon tab page only.

himanshu joshi Jan 18, 2007 - 5:26 AM

Hi

Another question in context of above OnRibbonGalleryInitContent is first parameter of this function is "CExtRibbonGalleryWnd & wndRG"
If i want to make use of this in some different function how i can define the same and make use of that for e.g
wndRG.ModifyToolBoxWndStyle( __TBWS_ZERO_HEIGHT_CAPTIONS );

Thanks

Technical Support Jan 19, 2007 - 3:23 AM

The answer to your previous message in this thread explains how to access the ribbon gallery control. So you can change it from everywhere and anytime.