]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
1. wxLoad/SaveFileSelector return "wxString" instead of "char *"
[wxWidgets.git] / src / msw / window.cpp
index 9d1f5e24e160169d258ddad4031c8ae1de06c343..7df198653369da2cfd03f4c0b7089ac8da0c1503 100644 (file)
 #include <windowsx.h>
 #endif
 
+#ifndef __TWIN32__
 #ifdef __GNUWIN32__
 #include <wx/msw/gnuwin32/extra.h>
 #endif
+#endif
 
 #ifdef GetCharWidth
 #undef GetCharWidth
@@ -125,7 +127,7 @@ wxWindow *wxWindow::FindItem(int id) const
         if (childWin->IsKindOf(CLASSINFO(wxControl)))
         {
             wxControl *item = (wxControl *)childWin;
-            if (item->m_windowId == id)
+            if (item->GetId() == id)
                 return item;
             else
             {
@@ -1420,7 +1422,7 @@ void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win)
 {
     // adding NULL hWnd is (first) surely a result of an error and
     // (secondly) breaks menu command processing
-    wxCHECK_RET( hWnd != NULL, "attempt to add a NULL hWnd to window list" );
+    wxCHECK_RET( hWnd != (HWND) NULL, "attempt to add a NULL hWnd to window list" );
 
     if ( !wxWinHandleList->Find((long)hWnd) )
         wxWinHandleList->Append((long)hWnd, win);
@@ -2963,7 +2965,7 @@ void wxSetKeyboardHook(bool doIt)
     {
         wxTheKeyboardHookProc = MakeProcInstance((FARPROC) wxKeyboardHook, wxGetInstance());
         wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
             GetCurrentThreadId());
         //      (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
 #else
@@ -3102,10 +3104,14 @@ bool wxWindow::MSWOnEraseBkgnd (WXHDC pDC)
 
 void wxWindow::OnEraseBackground(wxEraseEvent& event)
 {
+    if (!GetHWND())
+        return;
+
     RECT rect;
     ::GetClientRect((HWND) GetHWND(), &rect);
 
-    HBRUSH hBrush = ::CreateSolidBrush(PALETTERGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
+    COLORREF ref = PALETTERGB(m_backgroundColour.Red(), m_backgroundColour.Green(), m_backgroundColour.Blue()) ;
+    HBRUSH hBrush = ::CreateSolidBrush(ref);
     int mode = ::SetMapMode((HDC) event.GetDC()->GetHDC(), MM_TEXT);
 
     //  ::GetClipBox((HDC) event.GetDC()->GetHDC(), &rect);