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 General Discussion » Menu as in MFC. Collapse All
Subject Author Date
ahmad hassan Mar 23, 2004 - 3:09 AM

Hello,


I don’t use the CExtMenuControlBar class but i use CExtToolControlBar for toolbars. The problem i face is that the menu seems in the background i mean its really flat and toolbar look like 3d. I want to have the same behaviour as any hello world mfc application. I think we call it flat toolbars when you get the hover for button you draw the rect.


 


Hope you solve my problem.


Thanking in advance.


 


 

Technical Support Mar 24, 2004 - 8:11 AM

Dear Ahmad,

We are sorry, but we seem not to know exactly what feature you mean. Could you provide us with more detailed description of what you need. Or just send us some screenshot of what you want so that we can help you.

ahmad hassan Mar 24, 2004 - 10:17 PM

Hello,


All i want to say is that if you comment out the


//CExtMenuControlBar    m_wndMenuBar;


from any sample in my case SDIDOCVIEW  and i added another toolbar to see the behaviour.


Now what happens is that the menu bar looks like in background (flat) and the toolbars looks ike a bit 3d.


All i want is the toolbar and menubar to be at same depth.  The behaviour can be seen by making a wizard generated mfc exe with docking toolbar support and it would be clear.


MFC has it really flat.


Also the border for menubar is drawn in white. This can all be seen in any sample by disabling CExtMenuControlBar.


Looking forward to your as always immediate support response.


Thank You.

Technical Support Mar 25, 2004 - 9:46 AM

Dear Ahmad,

First please take a look at the GLViews sample. It uses a non-dockable CExtMenuControlBar menu bar which is statically positioned at the top of the main frame window and looks absolutely like CExtToolControlBar. Is it what you need? If yes, then you won’t have to remove the menu bar from the SDIDOCVIEW sample. To make the menu bar look like the standard Window’s menu line, what you only need to do is to comment or remove these two lines in the CMainFrame::OnCreate() method:

m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
and
DockControlBar(&m_wndMenuBar);


ahmad hassan Mar 25, 2004 - 10:14 PM

Hello,


I am sorry to be extending this thread once again but the thing is when you add new toolbar to glviews and enable docking on it. The behaviour which i have said again and again is back with menu bar looking in background due to the drawing of dockable toolbar.


All i want is mfc menu bar and two or three dockable CExttoolcontrolbars.


Would it be possible for you to tell me what drawing method to override so that toolbars are drawn flat as menu is and the menu line also appears as in any mfc application.


Waiting for your reply.

Technical Support Mar 29, 2004 - 2:21 AM

Dear Ahmad,

Please add the class below to your project:

 
class CMyPM : public CExtPaintManager
{
public:
 virtual void PaintDockingFrame(
  CDC & dc,
  CExtPaintManager::PAINTDOCKINGFRAMEDATA & _pdfd
  )
 {
  if( ! (_pdfd.m_bFloating || _pdfd.m_bExtBar) )
  {
   CRect rcWnd( _pdfd.m_rcWindow );
   COLORREF clr3dFace = GetColor(CLR_3DFACE_OUT);
   dc.FillSolidRect(
    &rcWnd,
    clr3dFace
    );
   return;
  }
  CExtPaintManager::PaintDockingFrame(
   dc,
   _pdfd
   );
 }
};

and put this line to the CMainFrame’s constructor:


g_PaintManager.InstallPaintManager( new CMyPM );

Now you should have absolutely flat toolbars.