]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
Missing define.
[wxWidgets.git] / src / msw / dialog.cpp
index 67f6fec03654f3dcfa533668a17d0af83f2321ac..8ecdaa9680ac37f2d08c2ed41b2e4ef1b70acba2 100644 (file)
     #include <commdlg.h>
 #endif
 
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
+    #include "wx/msw/wince/resources.h"
+#endif // __SMARTPHONE__ && __WXWINCE__
+
 // ----------------------------------------------------------------------------
 // wxWin macros
 // ----------------------------------------------------------------------------
@@ -180,7 +184,9 @@ bool wxDialog::Create(wxWindow *parent,
     if ( !m_hasFont )
         SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
 
-    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
+    SetLeftMenu(wxID_OK, _("OK"));
+#endif
 
     return true;
 }
@@ -198,7 +204,7 @@ wxDialog::wxDialog(wxWindow *parent,
 {
     Init();
 
-    Create(parent, -1, title, wxPoint(x, y), wxSize(w, h), style, name);
+    Create(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h), style, name);
 }
 
 void wxDialog::SetModal(bool WXUNUSED(flag))
@@ -354,7 +360,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 +380,7 @@ void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
   if ( Validate() && TransferDataFromWindow() )
   {
-      EndModal(wxID_OK);
+      EndDialog(wxID_OK);
   }
 }
 
@@ -380,7 +394,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))
@@ -415,12 +429,8 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 
 void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
 {
-#if wxUSE_CTL3D
-    Ctl3dColorChange();
-#else
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
     Refresh();
-#endif
 }
 
 // ---------------------------------------------------------------------------
@@ -437,18 +447,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
@@ -506,18 +526,3 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
     return rc;
 }
 
-#if wxUSE_CTL3D
-
-// Define for each class of dialog and control
-WXHBRUSH wxDialog::OnCtlColor(WXHDC WXUNUSED(pDC),
-                              WXHWND WXUNUSED(pWnd),
-                              WXUINT WXUNUSED(nCtlColor),
-                              WXUINT message,
-                              WXWPARAM wParam,
-                              WXLPARAM lParam)
-{
-    return (WXHBRUSH)Ctl3dCtlColorEx(message, wParam, lParam);
-}
-
-#endif // wxUSE_CTL3D
-