X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..9a48c2ba3dc319c2cea520ca9ac54d2081362a39:/src/msw/nativdlg.cpp?ds=inline diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index 886418996f..a99be6dbf8 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -31,7 +31,7 @@ extern wxWindow *wxWndHook; extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxWindowID& id) +bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id) { m_windowId = id; wxWndHook = this; @@ -58,7 +58,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxWindowID& id) if (hWndNext) child = CreateWindowFromHWND(this, (WXHWND) hWndNext); - while (hWndNext != NULL) + while (hWndNext != (HWND) NULL) { hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT); if (hWndNext) @@ -91,12 +91,12 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name) return TRUE; } -wxWindow* wxWindow::GetWindowChild1(const wxWindowID& id) +wxWindow* wxWindow::GetWindowChild1(wxWindowID& id) { if ( m_windowId == id ) return this; - wxNode *node = GetChildren()->First(); + wxNode *node = GetChildren().First(); while ( node ) { wxWindow* child = (wxWindow*) node->Data(); @@ -109,7 +109,7 @@ wxWindow* wxWindow::GetWindowChild1(const wxWindowID& id) return NULL; } -wxWindow* wxWindow::GetWindowChild(const wxWindowID& id) +wxWindow* wxWindow::GetWindowChild(wxWindowID& id) { wxWindow* win = GetWindowChild1(id); if ( !win ) @@ -139,9 +139,13 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) #else #ifdef UNICODE GetClassNameW((HWND) hWnd, buf, 256); +#else +#ifdef __TWIN32__ + GetClassName((HWND) hWnd, buf, 256); #else GetClassNameA((HWND) hWnd, buf, 256); #endif +#endif #endif wxString str(buf); @@ -169,12 +173,12 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { win = new wxRadioButton; } -#ifdef __WIN32__ +#if defined(__WIN32__) && defined(BS_BITMAP) else if (style & BS_BITMAP) { // TODO: how to find the bitmap? win = new wxBitmapButton; - wxMessageBox("Have not yet implemented bitmap button as BS_BITMAP button."); + wxLogError("Have not yet implemented bitmap button as BS_BITMAP button."); } #endif else if (style1 == BS_OWNERDRAW) @@ -199,7 +203,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { char buf[256]; sprintf(buf, "Don't know what kind of button this is: id = %d", (int) id); - wxMessageBox(buf); + wxLogError(buf); } } else if (str == "COMBOBOX") @@ -224,10 +228,10 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { win = new wxScrollBar; } -#if defined(__WIN95__) +#if defined(__WIN95__) && !defined(__TWIN32__) else if (str == "MSCTLS_UPDOWN32") { - win == new wxSpinButton; + win = new wxSpinButton; } #endif else if (str == "MSCTLS_TRACKBAR32") @@ -241,13 +245,13 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) if ((style1 == SS_LEFT) || (style1 == SS_RIGHT) || (style1 == SS_SIMPLE)) win = new wxStaticText; -#ifdef __WIN32__ +#if defined(__WIN32__) && defined(BS_BITMAP) else if (style1 == SS_BITMAP) { win = new wxStaticBitmap; // Help! this doesn't correspond with the wxWin implementation. - wxMessageBox("Please make SS_BITMAP statics into owner-draw buttons."); + wxLogError("Please make SS_BITMAP statics into owner-draw buttons."); } #endif } @@ -255,7 +259,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { wxString msg("Don't know how to convert from Windows class "); msg += str; - wxMessageBox(msg); + wxLogError(msg); } if (win)