Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPMenuBar in non-client-area ???
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPMenuBar in non-client-area ???

 Post Reply Post Reply
Author
Message
hpesata View Drop Down
Groupie
Groupie


Joined: 16 July 2004
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote hpesata Quote  Post ReplyReply Direct Link To This Post Topic: CXTPMenuBar in non-client-area ???
    Posted: 27 December 2004 at 8:21am
Hi!

I am currently trying to use Xtreme Toolkit Pro with an existing VC++.NET/MFC app.
our app hast just a single CFrameWnd based window with no document/view stuff.

I managed to convert our existing dynamic CMenu-structure (read from a XML-file) into the XTP-stuff. altough I still couldnt figure out how to create everything from scratch and convert it.
I am still using a dummy-resource-menu with GetCommandBars()->SetMenu(_T("Menu Bar"), IDR_MENU1) to create the CXTPCommandBar object and use GetControls()->RemoveAll()
afterwards. I would prefer to create all objects from scratch without the dummy-resource-menu.

I realized, that the office-2003 style menu is displayed within the client-area of
my window and I would like to have it dispalyed within the non-client-area as it is with
the MFC-menu.

how can I do that ?

my app-window doesnt need a client-area, it just displays the menu and probably a toolbar.

any help with this woudl be greatly appreciated,
thanx in advance!

best regards,
Hans

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: 27 December 2004 at 11:51pm

You can use 0 as parameter instead dummy resource:

GetCommandBars()->SetMenu(_T("Menu Bar"), 0)

to Add controls:

pMenuBar->GetControls()->Add(xtpControlButton, nID1);

pMenuBar->GetControls()->Add(xtpControlButton, nID2);

....

 

You can't make it nonclient.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
hpesata View Drop Down
Groupie
Groupie


Joined: 16 July 2004
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote hpesata Quote  Post ReplyReply Direct Link To This Post Posted: 28 December 2004 at 4:21am
Hi Oleg!

Thanx for your reply!

I am now using GetCommandBars()->SetMenu("Menu", 0) and
GetComamndBars()->GetMenuBar()->LoadMenu(&mymenu , TRUE); and this works.

but how can I make the menubar non-dockable and being displayed right under
the caption of my frame-window like in the DialogSample or other samples ?

in my case the menubar is displayed WITHIN the frame of the client-area.
maybe I have to use different window-styles for my frame-window ?

thanx in advance!

best regards,
Hans

Back to Top
hpesata View Drop Down
Groupie
Groupie


Joined: 16 July 2004
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote hpesata Quote  Post ReplyReply Direct Link To This Post Posted: 28 December 2004 at 6:11am
Hi Oleg!

I found out about the  WS_EX_CLIENTEDGE flag which has to be cleared
within PreCreateWindow() of my frame-window and the menu ins now displayed
right below the caption.

I also found out about the xtpFlagStretched for my menubar and it is now fixed.

in my app I managed to write code, so that the size of my frame-window always
is limited to the size of the caption+borders+menu by overriding WM_GETMINMAXINFO
and calculating the appropriate size.

thsi worked well for the MFC-menu, but how can I do this wit Xtreme Toolkit Pro ?
how can I get the size of the menubar ?

this size can change if the user reduces the cx-size of my frame-window and the
menu afterwards contains multiple lines and therefore has an effect on the cy-size.

WIN32 offers GetMenuItemRect() to get the position/size of an menu-entry which helped
me to determien the number of lines of my menu.

how can I use this approch with Xtreme Toolkit Pro ?

thanx in advance!

best regards,
Hans

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.047 seconds.