fixed bug 424212 (unworking close button in the progress dialog)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -192,6 +192,36 @@ bool wxDialog::Create(wxWindow *parent,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxDialog::EnableCloseButton(bool enable)
|
||||
{
|
||||
// get system (a.k.a. window) menu
|
||||
HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
|
||||
if ( !hmenu )
|
||||
{
|
||||
wxLogLastError(_T("GetSystemMenu"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// enabling/disabling the close item from it also automatically
|
||||
// disables/enabling the close title bar button
|
||||
if ( !::EnableMenuItem(hmenu, SC_CLOSE,
|
||||
MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED)) )
|
||||
{
|
||||
wxLogLastError(_T("DeleteMenu(SC_CLOSE)"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// update appearance immediately
|
||||
if ( !::DrawMenuBar(GetHwnd()) )
|
||||
{
|
||||
wxLogLastError(_T("DrawMenuBar"));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxDialog::SetModal(bool flag)
|
||||
{
|
||||
if ( flag )
|
||||
|
Reference in New Issue
Block a user