Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Problem loading Menu's with Ribbon bar.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem loading Menu's with Ribbon bar.

 Post Reply Post Reply
Author
Message
sankulp80 View Drop Down
Newbie
Newbie


Joined: 13 October 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote sankulp80 Quote  Post ReplyReply Direct Link To This Post Topic: Problem loading Menu's with Ribbon bar.
    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
 
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post 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)?
Back to Top
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
sankulp80 View Drop Down
Newbie
Newbie


Joined: 13 October 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote sankulp80 Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
sankulp80 View Drop Down
Newbie
Newbie


Joined: 13 October 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote sankulp80 Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post 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).
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.066 seconds.