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 » CExtToolControlBar in a CExtResizableDialog Collapse All
Subject Author Date
Roberto MAnes Feb 8, 2005 - 4:22 AM

I have a CExtResizableDialog and I need to put on it a CExtMenuBar together a CExtToolControlBar. I followed all the instructions as described in the online documentation, in the dialog I put two custom controls of type class ProfUIS-ControlBar respectively for the menubar and the toolbar. Both controls style value is set to 0x56402034. I used the DDX_Control method for both controls and the following is the source code I wrote in the OnInitDialog() function <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>


<o:p> </o:p>


      CExtResizableDialog::OnInitDialog();<o:p></o:p>


 <o:p></o:p>


      CWinApp *pApp = AfxGetApp();<o:p></o:p>


      VERIFY(<o:p></o:p>


            g_CmdManager->UpdateFromMenu(<o:p></o:p>


                  pApp->m_pszProfileName,<o:p></o:p>


                  IDR_MENU_CWAYS<o:p></o:p>


                  )<o:p></o:p>


            );<o:p></o:p>


      VERIFY(<o:p></o:p>


            g_CmdManager->UpdateFromToolBar(<o:p></o:p>


                  pApp->m_pszProfileName,<o:p></o:p>


                  IDR_TOOLBAR_CWAYS<o:p></o:p>


                  )<o:p></o:p>


            );<o:p></o:p>


<o:p> </o:p>


      CString szTitle, szMessage;<o:p></o:p>


<o:p> </o:p>


      ASSERT( m_wndMenuBar.GetSafeHwnd() != NULL );<o:p></o:p>


      if( !m_wndMenuBar.LoadMenuBar(IDR_MENU_CWAYS) ) {<o:p></o:p>


            ASSERT(FALSE);<o:p></o:p>


            return FALSE;<o:p></o:p>


      }<o:p></o:p>


<o:p> </o:p>


      ASSERT( m_wndToolBar.GetSafeHwnd() != NULL );<o:p></o:p>


      if( !m_wndToolBar.LoadToolBar(IDR_TOOLBAR_CWAYS) )<o:p></o:p>


      {<o:p></o:p>


            TRACE0("Failed to create colorways toolbar\n");<o:p></o:p>


            return -1;      // fail to create<o:p></o:p>


      }<o:p></o:p>


      m_wndToolBar.SetWindowText(_T("Colorways toolbar") );<o:p></o:p>


<o:p> </o:p>


      // show gripper<o:p></o:p>


      ShowSizeGrip();<o:p></o:p>


<o:p> </o:p>


      . . .<o:p></o:p>


      . . .<o:p></o:p>


<o:p> </o:p>


      CWnd::RepositionBars(0, 0xffff, 0);<o:p></o:p>


      return FALSE;<o:p></o:p>


<o:p> </o:p>


 <o:p></o:p>


The problem is that I just can see the menu bar and the room space left for the tool bar. I also can see the toolbar’s buttons highlighted when I move the cursor onto those ones which have been checked directly from the toolbar or from the menu bar.<o:p></o:p>

Technical Support Feb 9, 2005 - 4:35 AM

Dear Roberto,

It seems you need to find the first occurence of

g_CmdManager->UpdateFromMenu( ... );
and, just before it, insert the following code
g_CmdManager->ProfileSetup( pApp->m_pszProfileName, m_hWnd );

After that, you should not encounter this problem anymore. If it’s not the case, just send us your (test) project.