From 0fc58b86fbbcaf7b26a43398272a50ea09b72cae Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 17 Apr 2004 14:30:19 +0000 Subject: [PATCH] Show the OK button in the title bar under PocketPC and react to pressing it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dialog.cpp | 16 ++++++++++++++++ src/msw/toplevel.cpp | 12 +++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index fdc4bf3a2e..2b891ad626 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -440,6 +440,22 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar switch ( message ) { +#ifdef __WXWINCE__ + // react to pressing the OK button in the title + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + wxButton *btn = wxDynamicCast(FindWindow(wxID_CANCEL), wxButton); + if ( btn && btn->IsEnabled() ) + { + // if we do have a cancel button, do press it + btn->MSWCommand(BN_CLICKED, 0 /* unused */); + processed = TRUE; + break; + } + } + break; +#endif case WM_CLOSE: // if we can't close, tell the system that we processed the // message - otherwise it would close us diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index ee7bed0b1f..b7f00bb6c7 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -915,7 +915,7 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) // the DialogProc for all wxWindows dialogs LONG APIENTRY _EXPORT -wxDlgProc(HWND WXUNUSED(hDlg), +wxDlgProc(HWND hDlg, UINT message, WPARAM WXUNUSED(wParam), LPARAM WXUNUSED(lParam)) @@ -926,6 +926,16 @@ wxDlgProc(HWND WXUNUSED(hDlg), // for this message, returning TRUE tells system to set focus to // the first control in the dialog box, but as we set the focus // ourselves, we return FALSE from here as well, so fall through +#ifdef __WXWINCE__ + { + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | + SHIDIF_SIZEDLGFULLSCREEN; + shidi.hDlg = hDlg; + SHInitDialog( &shidi ); + } +#endif default: // for all the other ones, FALSE means that we didn't process the -- 2.45.2