CExtMdiWindowsListDlg::OnUpdateButtons

Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

Called to enable/disable button controls for the dialog depending on the selection.

virtualvoid OnUpdateButtons();

Example

The method allows you to manage the state of the dialog buttons. For example, if you want to hide the Cascade, Tilevert, Tilehorz and Minimize buttons when the MDI document buttons are hidden, use the class below:

class CMyMdiWindowsListDlg : public CExtMdiWindowsListDlg
{
public:
CMyMdiWindowsListDlg::CMyMdiWindowsListDlg(CMDIFrameWnd* pMDIFrameWnd, CWnd* pParent=NULL)
: CExtMdiWindowsListDlg(pMDIFrameWnd, pParent)
{
}
protected:
virtual void OnUpdateButtons()
{
CExtMdiWindowsListDlg::OnUpdateButtons();

CMainFrame *pFrame = static_cast<CMainFrame *>(m_pMDIFrameWnd);
if ( !pFrame->m_wndMenuBar.IsDisplayMdiDocumentButtons() )
{
m_btnCascade.ShowWindow(SW_HIDE);
m_btnTileVert.ShowWindow(SW_HIDE);
m_btnTileHorz.ShowWindow(SW_HIDE);
m_btnMinimize.ShowWindow(SW_HIDE);
}
else
{
m_btnCascade.ShowWindow(SW_SHOW);
m_btnTileVert.ShowWindow(SW_SHOW);
m_btnTileHorz.ShowWindow(SW_SHOW);
m_btnMinimize.ShowWindow(SW_SHOW);
}
}
}; // class CMyMdiWindowsListDlg : public CExtMdiWindowsListDlg ... // Show the "Windows..." dialog
CMyMdiWindowsListDlg dlg( this );
dlg.DoModal();

See Also

CExtMdiWindowsListDlg Overview | Class Members | Hierarchy Chart