Print Page | Close Window

Problem loading Menu's with Ribbon bar.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=15351
Printed Date: 27 February 2025 at 12:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem loading Menu's with Ribbon bar.
Posted By: sankulp80
Subject: Problem loading Menu's with Ribbon bar.
Date Posted: 13 October 2009 at 5:44am
Hi,

I am loading menus with the Ribbon bars in the CommandBars. Menus are not showing up properly, they are apperaing below the ribbon bar.

I need Menu to be shown above RibbonBar

Please help me what wrong I am doing.

Below is the code snippet:


    CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar));
    if (!pRibbonBar)
    {
        return FALSE;
    }
    pRibbonBar->EnableDocking(TRUE);
    //pRibbonBar->GetTabPaintManager()->m_bSelectOnButtonDown = FALSE;

    CXTPMenuBar* pMenu = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
    pMenu->SetPosition(xtpBarNone);

    CXTPControlPopup* pControlFile = (CXTPControlPopup*)pRibbonBar->AddSystemButton(ID_MENU_FILE);
    //pControlFile->SetCommandBar(menu.GetSubMenu(0));
    pControlFile->GetCommandBar()->SetIconSize(CSize(32, 32));

   
    //pControlFile->SetIconId(IDB_GEAR);
    UINT uCommand = {IDB_GEAR};
    pCommandBars->GetImageManager()->SetIcons(IDB_GEAR, &uCommand, 1, CSize(0, 0), xtpImageNormal);
   
    CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(ID_TAB_HOME);

I am attching Image also...please look at the image

Thanks in advance,
Yogi
 



Replies:
Posted By: rdhd
Date Posted: 15 October 2009 at 12:27pm
Can you manually move the menu above the ribbon bar (I see the gripper)? If not, that might imply it is not possible to do.
 
Have you tried creating the menu first (I assume SetPosition(xtpBarTop) is an option when doing so)?


Posted By: zaksoft
Date Posted: 15 October 2009 at 1:18pm
I think this is not allowed by Microsoft licence, read it carefully, you cannot mix ribbon with old items, in the same way you cannot modify icons dimension and so on.
 
Interface is copyrighted and you have to agree in full to their requirements-


-------------
VS2022 - MFC MBCS Statically linked

XTP 23.1 Static Link

---------------------------------------------------------

Davide Zaccanti - ZakSoft - www.zaksoft.com



Posted By: Oleg
Date Posted: 16 October 2009 at 5:33am
Hi,
 
yes its Ribbon thing to show always above all menus/toolbars.
Why do you need Ribbon if you whant standard MenuBar too.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: sankulp80
Date Posted: 16 October 2009 at 5:53am
Can you manually move the menu above the ribbon bar (I see the gripper)? If not, that might imply it is not possible to do.
 
Have you tried creating the menu first (I assume SetPosition(xtpBarTop) is an option when doing so)?

Hi

I cannot move the menu above the ribbon bar.

I also tried creating menus before creating RibbonBar. In this case I faced following issues:

- In an MDI application multiple Min,Max and Close button show up
- No Titlebar in the application
- Cannot Maximize and Change Window Size by double clicking on the Title of the window.
- Icon of the Windows appears below the MenuBar. should be in parllel to Menus as no Title Bar

Please check the Attached Image.




Posted By: sankulp80
Date Posted: 16 October 2009 at 5:58am
It's my client's requirements that both RibbonBar and MenuBar should show up. They should be toglled OFF/ON based using some keys.

I saw both Ribbon and Standard menu's in some applications.



Posted By: rdhd
Date Posted: 16 October 2009 at 10:10am

I don't know if you can call ShowWindow(SW_HIDE) on the ribbon. You might be able to delete the ribbon and create the menu and vica versa on the fly. Do any of the samples do such a thing?

 
We had a standard MFC menu at the top of our frame when we first moved to CJ (didn't bother to remove it). The ribbon did not always hide it properly so we removed the menu (we were not using it).



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net