]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/nativdlg.cpp
wxNavigationKeyEvent doesn't derive from wxCommandEvent (but from wxEvent)
[wxWidgets.git] / src / msw / nativdlg.cpp
index 1a6ee40629faa09629078070b0dc2f86ffa6f6a9..9c8c53505cb4a62ab78781064cac64ba4fceade6 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation
 #endif
 
@@ -34,7 +34,7 @@
     #include "wx/wx.h"
 #endif
 
-#if defined(__WIN95__) && !defined(__TWIN32__)
+#if defined(__WIN95__)
 #include "wx/spinbutt.h"
 #endif
 #include "wx/msw/private.h"
@@ -74,15 +74,14 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
     HWND hWndNext;
     hWndNext = ::GetWindow((HWND) m_hWnd, GW_CHILD);
 
-    wxWindow* child = NULL;
     if (hWndNext)
-        child = CreateWindowFromHWND(this, (WXHWND) hWndNext);
+        CreateWindowFromHWND(this, (WXHWND) hWndNext);
 
     while (hWndNext != (HWND) NULL)
     {
         hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT);
         if (hWndNext)
-            child = CreateWindowFromHWND(this, (WXHWND) hWndNext);
+            CreateWindowFromHWND(this, (WXHWND) hWndNext);
     }
 
     return TRUE;
@@ -108,7 +107,19 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
     else
         wxTopLevelWindows.Append(this);
 
-    // FIXME why don't we enum all children here?
+    // Enumerate all children
+    HWND hWndNext;
+    hWndNext = ::GetWindow((HWND) m_hWnd, GW_CHILD);
+
+    if (hWndNext)
+        CreateWindowFromHWND(this, (WXHWND) hWndNext);
+
+    while (hWndNext != (HWND) NULL)
+    {
+        hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT);
+        if (hWndNext)
+            CreateWindowFromHWND(this, (WXHWND) hWndNext);
+    }
 
     return TRUE;
 }
@@ -122,7 +133,7 @@ wxWindow* wxWindow::GetWindowChild1(wxWindowID id)
     if ( m_windowId == id )
         return this;
 
-    wxWindowList::Node *node = GetChildren().GetFirst();
+    wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
     while ( node )
     {
         wxWindow* child = node->GetData();
@@ -183,6 +194,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
         {
             win = new wxRadioButton;
         }
+#if wxUSE_BMPBUTTON
 #if defined(__WIN32__) && defined(BS_BITMAP)
         else if (style & BS_BITMAP)
         {
@@ -201,6 +213,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
             // with a switch in the drawing code. Call default proc if BS_BITMAP.
             win = new wxBitmapButton;
         }
+#endif
         else if ((style1 == BS_PUSHBUTTON) || (style1 == BS_DEFPUSHBUTTON))
         {
             win = new wxButton;
@@ -237,7 +250,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
     {
         win = new wxScrollBar;
     }
-#if defined(__WIN95__) && !defined(__TWIN32__) && wxUSE_SPINBTN
+#if defined(__WIN95__) && wxUSE_SPINBTN
     else if (str == wxT("MSCTLS_UPDOWN32"))
     {
         win = new wxSpinButton;
@@ -254,8 +267,13 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
     {
         int style1 = (style & 0xFF);
 
-        if ((style1 == SS_LEFT) || (style1 == SS_RIGHT) || (style1 == SS_SIMPLE))
+        if ((style1 == SS_LEFT) || (style1 == SS_RIGHT)
+#ifndef __WXWINCE__
+            || (style1 == SS_SIMPLE)
+#endif
+            )
             win = new wxStaticText;
+#if wxUSE_STATBMP
 #if defined(__WIN32__) && defined(BS_BITMAP)
         else if (style1 == SS_BITMAP)
         {
@@ -265,6 +283,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
             wxLogError(wxT("Please make SS_BITMAP statics into owner-draw buttons."));
         }
 #endif
+#endif /* wxUSE_STATBMP */
     }
     else
     {