]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed native dialog bug
authorJulian Smart <julian@anthemion.co.uk>
Thu, 5 Jun 2003 10:57:59 +0000 (10:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 5 Jun 2003 10:57:59 +0000 (10:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/nativdlg/nativdlg.cpp
src/msw/nativdlg.cpp

index 69a9c42b66309d547ba2619e443633914145a463..6ff49b5b0fca651b018d426626d3f3a604d66acf 100644 (file)
@@ -95,11 +95,6 @@ void MyFrame::OnTest1(wxCommandEvent& event)
       MyDialog *dialog = new MyDialog;
       if (dialog->LoadNativeDialog(this, _T("dialog1")))
       {
-/*
-        wxTextCtrl *text = (wxTextCtrl *)wxFindWindowByName("multitext3", dialog);
-        if (text)
-          text->SetValue("wxWindows resource demo");
-*/
         dialog->SetModal(TRUE);
         dialog->ShowModal();
       }
index 2abb33debe06262ae4369b59f825a41a5d66e5f3..0b2b1ee94e81df75d52c86999484903654ca3120 100644 (file)
@@ -108,7 +108,20 @@ 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);
+
+    wxWindow* child = NULL;
+    if (hWndNext)
+        child = CreateWindowFromHWND(this, (WXHWND) hWndNext);
+
+    while (hWndNext != (HWND) NULL)
+    {
+        hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT);
+        if (hWndNext)
+            child = CreateWindowFromHWND(this, (WXHWND) hWndNext);
+    }
 
     return TRUE;
 }