Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » custom menubar Collapse All
Subject Author Date
Eric guez Apr 7, 2010 - 12:20 PM

Hi !

I want to make a custom menubar with these components :

_____________________________________________________________________
|MENU|___________ WINDOW DRAG HANDLE _________ |TOOLBAR | SYSTEM MENU|

As you can see, there are 4 parts
- App menu (left aligned)
- Resizable Drag Handle to move the window
- app toolbar (right aligned)
- system buttons ( minimize, maximize, close) (top, right aligned as usual)

(in my app I removed the titlebar)

What is the best way to achieve this with profuis ?
I know thats a very open question, but any help should be good :)

Thanks

Eric guez Apr 14, 2010 - 10:40 AM

Thanks,

The layout looks ok now !

I still have a problem with my buttons.
I insered buttons in the menubar (the system buttons maximize, close ..). But I dont know how to catch click events on them.


Seriously I spend my day on it. Please Help !

Technical Support Apr 8, 2010 - 10:00 AM

This layout can be implemented by overriding the CExtToolControlBar::_RecalcPositionsImpl() virtual method in your CExtMenuControlBar-derived class. The CExtMenuControlBar class implements the menu bar and it’s the extended version of the CExtToolControlBar class that implements toolbar. Your overridden version of the CExtToolControlBar::_RecalcPositionsImpl() virtual method should invoke the parent class method to let it to reposition its CExtBarButton toolbar buttons by default. The default layout will place the TOOLBAR part near the MENU part. Then your method should offset the buttons of the TOOLBAR part closer to the SYSTEM MENU part. To enable the window dragging via clicking on the WINDOW DRAG HANDLE part you should handle the WM_NCHITTEST message in your menu bar class and return the HTCAPTION code.

Eric guez Apr 14, 2010 - 10:40 AM

Thanks,

The layout looks ok now !

I still have a problem with my buttons.
I insered buttons in the menubar (the system buttons maximize, close ..). But I dont know how to catch click events on them.


Seriously I spend my day on it. Please Help !

Technical Support Apr 15, 2010 - 5:33 AM

The [_][o][x] buttons are actually represented by one CExtBarMdiRightButton toolbar button, which sends WM_SYSCOMMAND to the MDI client area window with the SC_MINIMIZE, SC_RESTORE or SC_MAXIMIZE values in the WPARAM parameter. The [?] button and the SC_CONTEXTHELP command are also supported. You can intercept these messages in the MDI client area window. You can also handle the WM_WINDOWPOSCHANGED message in your MDI child frame windows and detect the current active/inactive/minimized/maximized/restored state of each MDI child frame window. Of course, you can also implement the CExtBarMdiRightButton-derived class and override the CExtBarMdiRightButton::OnClick() virtual method to intercept the button click event before the state of the active MDI child frame window is changed. To make the menu bar using your button object you should override the CExtMenuControlBar::_InstallMdiDocButtons() internal virtual method, copy source code from the original method and make it instantiating your button type.