![]() |
CXTPMenuBar in non-client-area ??? |
Post Reply ![]() |
Author | |
hpesata ![]() Groupie ![]() Joined: 16 July 2004 Status: Offline Points: 60 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
hpesata ![]() Groupie ![]() Joined: 16 July 2004 Status: Offline Points: 60 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
hpesata ![]() Groupie ![]() Joined: 16 July 2004 Status: Offline Points: 60 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |