]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/nativdlg.cpp
If zero time is specified, don't try to sleep when using a timer.
[wxWidgets.git] / src / msw / nativdlg.cpp
index 5eef575db79bb69f9dfe3905f09d47235f6f5109..eac7d80f514ce421225f186d3672189cc973f430 100644 (file)
@@ -43,7 +43,6 @@
 // global functions
 // ---------------------------------------------------------------------------
 
 // global functions
 // ---------------------------------------------------------------------------
 
-extern wxWindow *wxWndHook;
 extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
                                        WPARAM wParam, LPARAM lParam);
 
 extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
                                        WPARAM wParam, LPARAM lParam);
 
@@ -54,12 +53,12 @@ extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
 bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
 {
     m_windowId = id;
 bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
 {
     m_windowId = id;
-    wxWndHook = this;
+
+    wxWindowCreationHook hook(this);
     m_hWnd = (WXHWND)::CreateDialog((HINSTANCE)wxGetInstance(),
                                     MAKEINTRESOURCE(id),
                                     parent ? (HWND)parent->GetHWND() : 0,
                                     (DLGPROC) wxDlgProc);
     m_hWnd = (WXHWND)::CreateDialog((HINSTANCE)wxGetInstance(),
                                     MAKEINTRESOURCE(id),
                                     parent ? (HWND)parent->GetHWND() : 0,
                                     (DLGPROC) wxDlgProc);
-    wxWndHook = NULL;
 
     if ( !m_hWnd )
         return FALSE;
 
     if ( !m_hWnd )
         return FALSE;
@@ -93,12 +92,11 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
 {
     SetName(name);
 
 {
     SetName(name);
 
-    wxWndHook = this;
+    wxWindowCreationHook hook(this);
     m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
                                     name.c_str(),
                                     parent ? (HWND)parent->GetHWND() : 0,
                                     (DLGPROC)wxDlgProc);
     m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
                                     name.c_str(),
                                     parent ? (HWND)parent->GetHWND() : 0,
                                     (DLGPROC)wxDlgProc);
-    wxWndHook = NULL;
 
     if ( !m_hWnd )
         return FALSE;
 
     if ( !m_hWnd )
         return FALSE;
@@ -213,7 +211,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
         }
         else
         {
         }
         else
         {
-            wxLogError(wxT("Don't know what kind of button this is: id = %d"),
+            wxLogError(wxT("Don't know what kind of button this is: id = %ld"),
                        id);
         }
     }
                        id);
         }
     }
@@ -245,11 +243,13 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
         win = new wxSpinButton;
     }
 #endif
         win = new wxSpinButton;
     }
 #endif
+#if wxUSE_SLIDER
     else if (str == wxT("MSCTLS_TRACKBAR32"))
     {
         // Need to ascertain if it's horiz or vert
         win = new wxSlider;
     }
     else if (str == wxT("MSCTLS_TRACKBAR32"))
     {
         // Need to ascertain if it's horiz or vert
         win = new wxSlider;
     }
+#endif // wxUSE_SLIDER
     else if (str == wxT("STATIC"))
     {
         int style1 = (style & 0xFF);
     else if (str == wxT("STATIC"))
     {
         int style1 = (style & 0xFF);