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 » Toolbar in CExtResizeableDialog with desktop window parent Collapse All
Subject Author Date
John Ritzenthaler Mar 4, 2009 - 9:57 AM

I have a modeless CExtResizableDialog with a CExtToolControlBar.  It works fine when the dialog’s parent is AfxGetMainWnd() but I want the dialog to be behind the main window when the main window has focus.  To do this I changed the parent to CWnd::GetDesktopWindow().  But then the buttons are blank.  (They work but the images aren’t there.)


Here’s what I do in OnInitDialog()


 m_wndToolBar.LoadToolBar(IDR_DOXLST_BAR);
 RDrwDpiGet(&nDpiX, &nDpiY);
 ::SetRect(&rectWork, 0, 0, (int)(2.25*nDpiX), nDpiY);
 VERIFY(m_cmbBarDrag.Create(
   WS_CHILD|WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWNLIST|CBS_HASSTRINGS,
   rectWork, &m_wndToolBar, ID_DOXLST_CMB_DRAG));
 VERIFY(m_wndToolBar.SetButtonCtrl( 
   m_wndToolBar.CommandToIndex(ID_DOXLST_CMB_DRAG), &m_cmbBarDrag));
  m_wndToolBar.m_bForceBalloonGradientInDialogs = true;

And then this in DoDataExchange()


 DDX_Control(pDX, IDR_DOXLST_BAR, m_wndToolBar);


Those are the only refernces to the toolbar

Technical Support Mar 4, 2009 - 1:05 PM

You should invoke the g_CmdManager->ProfileWndAdd( pszProfile, pDialog->m_hWnd ); code in the beginning of the dialog’s OnInitDialog() virtual method. You should invoke the g_CmdManager->ProfileWndRemove( pDialog->m_hWnd ); code in the beginning of the dialog’s OnOK() and OnCancel() virtual methods.

John Ritzenthaler Mar 4, 2009 - 3:09 PM

Thanks.


Actually I overrode DestroyWindow() and called ProfileWndRemove() there so it’s called when the window is closed.

John Ritzenthaler Mar 4, 2009 - 10:08 AM

I tried adding this to the main window creation:


 g_CmdManager->ProfileWndAdd(pszProfile, ::GetDesktopWindow());


But still no luck.