]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
removed gtk.h include
[wxWidgets.git] / src / msw / dialog.cpp
index 67f6fec03654f3dcfa533668a17d0af83f2321ac..5d86517ffd0a59e4d33637f7d7794d5ea53291f7 100644 (file)
     #include <commdlg.h>
 #endif
 
+#ifdef __SMARTPHONE__
+    #include "wx/msw/wince/resources.h"
+#endif // __SMARTPHONE__
+
 // ----------------------------------------------------------------------------
 // wxWin macros
 // ----------------------------------------------------------------------------
@@ -182,6 +186,10 @@ bool wxDialog::Create(wxWindow *parent,
 
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
 
+#ifdef __SMARTPHONE__
+    SetLeftMenu(wxID_OK, _("OK"));
+#endif
+
     return true;
 }
 
@@ -354,7 +362,15 @@ void wxDialog::EndModal(int retCode)
     m_endModalCalled = true;
     SetReturnCode(retCode);
 
-    Show(false);
+    Hide();
+}
+
+void wxDialog::EndDialog(int rc)
+{
+    if ( IsModal() )
+        EndModal(rc);
+    else
+        Hide();
 }
 
 // ----------------------------------------------------------------------------
@@ -366,7 +382,7 @@ void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
   if ( Validate() && TransferDataFromWindow() )
   {
-      EndModal(wxID_OK);
+      EndDialog(wxID_OK);
   }
 }
 
@@ -380,7 +396,7 @@ void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
 
 void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
 {
-    EndModal(wxID_CANCEL);
+    EndDialog(wxID_CANCEL);
 }
 
 void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
@@ -437,18 +453,28 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
 #ifdef __WXWINCE__
         // react to pressing the OK button in the title
         case WM_COMMAND:
-            if (LOWORD(wParam) == IDOK)
+        {
+            switch ( LOWORD(wParam) )
             {
-                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;
+#ifndef __SMARTPHONE__
+                case 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;
+                    }
+#else // ifdef __SMARTPHONE__
+                case IDM_LEFT:
+                case IDM_RIGHT:
+                    processed = HandleCommand( LOWORD(wParam) , 0 , NULL );
                     break;
-                }
+#endif // __SMARTPHONE__
             }
             break;
+        }
 #endif
         case WM_CLOSE:
             // if we can't close, tell the system that we processed the