Professional UI Solutions
Site Map   /  Register


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 » Show/hide a RibbonNodeTabPage ? Collapse All
Subject Author Date
Mr Tran Aug 8, 2008 - 2:05 AM

Dear Prof-UI team !
I’m using Prof-Ui v 2.82 for MFC and created a application contains 3 ribbonpage: Home, Edit, View and default tab Edit is invisible ( it’s visible when i click a certain button) by the following block code:

        CExtRibbonNodeTabPage * pRibbonNodeTabPage =
            STATIC_DOWNCAST(CExtRibbonNodeTabPage,    pRibbonNodeTabPageCollection->ElementAt( 1)); // 1 = tab Edit
        ASSERT_VALID( pRibbonNodeTabPage );
        pRibbonNodeTabPage->ModifyFlags( __ECTN_TBB_HIDDEN );

I built successfully this application and when runs application, tab Edit is invisible but if switchs to tab View I receive a error message

Unhandled exception at 0x00c2d9ca in Example Application.exe: 0xC0000005: Access violation reading location 0x00000000.

I don’t know what i’ve mistaked. How to show/hide a RibbonNodeTabPage? For example: I’ ve 3 ribbon tab: Home, Edit, View. I want to click a button then tab Edit is invisible, click again tab Edit is visible. Plz help me !
Thanks !

Mr Tran Aug 12, 2008 - 10:33 PM

:( I don’t want to re-construct because it’s take a long time to load. Isn’t there a another way ?
In addition i have a question about CExtRibbonNodeRightButtonsCollection.I create a pRibbonNodeRightButtonsCollection consist of "Help" button and "Close" button and at the certain time when i click a button in ribbonbar, i want to hide "Close" button in pRibbonNodeRightButtonsCollection. How Can i do it ? Thanks !

Technical Support Aug 13, 2008 - 12:48 PM

The entire ribbon bar structure is described by ribbon nodes, which are non-visual elements. The ribbon bar is a very extended version of the Prof-UIS toolbar so ribbon buttons are simply toolbar buttons. The ribbon nodes are used for constructing visible ribbon buttons only. When a new ribbon tab page is selected, a set of buttons become destroyed and a set of new buttons are created. So, re-constructing ribbon nodes is not slow operation. It’s 100% correct and acceptable way for changing the ribbon structure. You should simply add parameters to your ribbon tree initialization methods to allow them construct ribbon trees of all possible configurations you need.

Technical Support Aug 8, 2008 - 1:35 PM

Unfortunately hidden pages are not currently supported by ribbon controls. Please re-construct the command tree and re-assign it to the ribbon bar.