]> git.saurik.com Git - wxWidgets.git/commitdiff
Show the OK button in the title bar under PocketPC
authorRobert Roebling <robert@roebling.de>
Sat, 17 Apr 2004 14:30:19 +0000 (14:30 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 17 Apr 2004 14:30:19 +0000 (14:30 +0000)
    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
src/msw/toplevel.cpp

index fdc4bf3a2e3a0e257bdb26ade35cc975d5c71b3c..2b891ad6266df4657bedf3dd2d6d78063692b9d5 100644 (file)
@@ -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
index ee7bed0b1feffe533b2af7b33a3ac26a40459c36..b7f00bb6c7a7046cca813cc1eb513a9a18fed218 100644 (file)
@@ -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