1. wxProgressDialog uses wxWindowDisabler, not (dumb) wxEnableTopLevelWindows
2. some more wxWindowDisabler bugs fixed (updated dialogs sample to test them) 3. Esc won't close the dialogs without cancel button under MSW 4. status bar can be child of windows of clases other than wxFrame (updated statbar sample to show it) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -235,24 +235,26 @@ wxDialog::~wxDialog()
|
||||
// By default, pressing escape cancels the dialog
|
||||
void wxDialog::OnCharHook(wxKeyEvent& event)
|
||||
{
|
||||
if (GetHWND())
|
||||
{
|
||||
if (event.m_keyCode == WXK_ESCAPE)
|
||||
if (GetHWND())
|
||||
{
|
||||
// Behaviour changed in 2.0: we'll send a Cancel message
|
||||
// to the dialog instead of Close.
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||
// "Esc" works as an accelerator for the "Cancel" button, but it
|
||||
// shouldn't close the dialog which doesn't have any cancel button
|
||||
if ( (event.m_keyCode == WXK_ESCAPE) && FindWindow(wxID_CANCEL) )
|
||||
{
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||
|
||||
// ensure that there is another message for this window so the
|
||||
// ShowModal loop will exit and won't get stuck in GetMessage().
|
||||
::PostMessage(GetHwnd(), WM_NULL, 0, 0);
|
||||
return;
|
||||
// ensure that there is another message for this window so the
|
||||
// ShowModal loop will exit and won't get stuck in GetMessage().
|
||||
::PostMessage(GetHwnd(), WM_NULL, 0, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// We didn't process this event.
|
||||
event.Skip();
|
||||
|
||||
// We didn't process this event.
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user