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 » Can I hide a circular button on ribbon bar? Collapse All
Subject Author Date
daeyeon joo Feb 25, 2008 - 6:12 PM

Hello,
Can I hide a circular button on ribbon bar?
Or change the figure to another somthing..

Please answer it :)

Technical Support Feb 27, 2008 - 6:46 AM

There is a CMainFrame::_InitRibbon_FileMenu() method in the RibbonBar sample that initializes the File button. But the icon displayed on this button is initialized by the following code in the CMainFrame::_InitRibbonBar() method:

      VERIFY(
            m_wndRibbonBar.Ribbon_FileButtonGet() ->
                  m_iconForLargeMode.m_bmpNormal.
                        LoadBMP_Resource( MAKEINTRESOURCE( IDB_BITMAP_SMALL_ICON ) )
            );
You can load any other bitmap instead of IDB_BITMAP_SMALL_ICON.

The last part of the CMainFrame::_InitRibbonBar() method performs complete initialization of the ribbon file button.
CExtRibbonNodeFile * pRibbonNodeFile = _InitRibbon_FileMenu();
      m_pRibbonNode->InsertNode( NULL, pRibbonNodeFile );

      m_wndRibbonBar.SetButtons( m_pRibbonNode );
      VERIFY(
            m_wndRibbonBar.
                  MenuInfoGetDefault()->
                        AccelTableLoad( IDR_MAINFRAME )
            );
      VERIFY(
            m_wndRibbonBar.Ribbon_FileButtonGet() ->
                  m_iconForLargeMode.m_bmpNormal.
                        LoadBMP_Resource( MAKEINTRESOURCE( IDB_BITMAP_SMALL_ICON ) )
            );
You can comment out this code to hide the File button at all. But the CExtRibbonBar ribbon bar control looks bad without it. Please also take a look at the CExtRibbonPage simplified ribbon control demonstrated in the RibbonPage sample application. Most of applications are simple and containing commands which can be placed in one page of the ribbon bar. Such application can use the CExtRibbonPage simplified ribbon control instead of the CExtRibbonBar ribbon bar control.