X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dbda9e86f0e5ec1184bc16d135bb7205bc99236e..1d3dbc7b63b3a5bcceafd513c165f719b864e3c2:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index d5f4085fa6..d2f6a22272 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -58,11 +58,6 @@ extern wxList WXDLLEXPORT wxPendingDelete; END_EVENT_TABLE() #endif -bool wxDialog::MSWProcessMessage(WXMSG* pMsg) -{ - return (::IsDialogMessage((HWND) GetHWND(), (MSG*)pMsg) != 0); -} - bool wxDialog::MSWOnClose(void) { return Close(); @@ -116,6 +111,9 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, if (height < 0) height = 500; + // All dialogs should really have this style + m_windowStyle |= wxTAB_TRAVERSAL; + WXDWORD extendedStyle = MakeExtendedStyle(m_windowStyle); if (m_windowStyle & wxSTAY_ON_TOP) extendedStyle |= WS_EX_TOPMOST; @@ -140,7 +138,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, if ( !hwnd ) { - wxLogError(_("Failed to created dialog.")); + wxLogError(_("Failed to create dialog.")); return FALSE; } @@ -213,13 +211,13 @@ void wxDialog::OnCharHook(wxKeyEvent& event) { if (event.m_keyCode == WXK_ESCAPE) { - // 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); + // 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); - return; + return; } } // We didn't process this event. @@ -248,11 +246,11 @@ bool wxDialog::IsIconized(void) const return FALSE; } -void wxDialog::SetClientSize(int width, int height) +void wxDialog::DoSetClientSize(int width, int height) { HWND hWnd = (HWND) GetHWND(); RECT rect; - GetClientRect(hWnd, &rect); + ::GetClientRect(hWnd, &rect); RECT rect2; GetWindowRect(hWnd, &rect2); @@ -361,12 +359,14 @@ bool wxDialog::Show(bool show) // a message before the deletion. while (wxModalDialogs.Member(this) && m_modalShowing && GetMessage(&msg, NULL, 0, 0)) { - if (m_acceleratorTable.Ok() && - ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable.GetHACCEL(), &msg)) + if ( m_acceleratorTable.Ok() && + ::TranslateAccelerator((HWND)GetHWND(), + (HACCEL)m_acceleratorTable.GetHACCEL(), + &msg) ) { // Have processed the message } - else if (!IsDialogMessage((HWND) GetHWND(), &msg)) + else if ( !wxTheApp->ProcessMessage((WXMSG *)&msg) ) { TranslateMessage(&msg); DispatchMessage(&msg); @@ -560,7 +560,7 @@ void wxDialog::OnCancel(wxCommandEvent& event) else { SetReturnCode(wxID_CANCEL); - this->Show(FALSE); + this->Show(FALSE); } } @@ -620,4 +620,4 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event) SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); Refresh(); #endif -} \ No newline at end of file +}