Print Page | Close Window

CXTPMenuBar in non-client-area ???

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=1591
Printed Date: 05 March 2025 at 10:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPMenuBar in non-client-area ???
Posted By: hpesata
Subject: CXTPMenuBar in non-client-area ???
Date 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




Replies:
Posted By: Oleg
Date 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


Posted By: hpesata
Date 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



Posted By: hpesata
Date 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




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