]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/winuniv.cpp
warning fix
[wxWidgets.git] / src / univ / winuniv.cpp
index 4ce63facfe380c72be8b4ba6a0058b2ad75168ef..56bf92060d7e57522df49d46e48d6cc451b29a0c 100644 (file)
@@ -73,6 +73,8 @@
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK)
 #elif defined(__WXMGL__)
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL)
+#elif defined(__WXX11__)
+    IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowX11)
 #elif defined(__WXPM__)
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowOS2)
 #endif
@@ -135,11 +137,6 @@ bool wxWindow::Create(wxWindow *parent,
         PositionScrollbars();
     }
 
-    // the colours/fonts are default
-    m_hasBgCol =
-    m_hasFgCol =
-    m_hasFont = FALSE;
-
     return TRUE;
 }
 
@@ -371,7 +368,7 @@ bool wxWindow::Enable(bool enable)
         return FALSE;
 
     // disabled window can't keep focus
-    if ( FindFocus() == this )
+    if ( FindFocus() == this && GetParent() != NULL )
     {
         GetParent()->SetFocus();
     }
@@ -659,9 +656,12 @@ void wxWindow::SetScrollbar(int orient,
                             int range,
                             bool refresh)
 {
+    wxASSERT_MSG( pageSize <= range,
+                    _T("page size can't be greater than range") );
+
     bool hasClientSizeChanged = FALSE;
     wxScrollBar *scrollbar = GetScrollbar(orient);
-    if ( range )
+    if ( range && (pageSize < range) )
     {
         if ( !scrollbar )
         {
@@ -935,87 +935,6 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
     return rect;
 }
 
-// ----------------------------------------------------------------------------
-// colours/fonts
-// ----------------------------------------------------------------------------
-
-bool wxWindow::SetBackgroundColour(const wxColour& colour)
-{
-    if ( !wxWindowNative::SetBackgroundColour(colour) )
-        return FALSE;
-
-    m_hasBgCol = TRUE;
-
-    return TRUE;
-}
-
-bool wxWindow::SetForegroundColour(const wxColour& colour)
-{
-    if ( !wxWindowNative::SetForegroundColour(colour) )
-        return FALSE;
-
-    m_hasFgCol = TRUE;
-
-    return TRUE;
-}
-
-bool wxWindow::SetFont(const wxFont& font)
-{
-    if ( !wxWindowNative::SetFont(font) )
-        return FALSE;
-
-    m_hasFont = TRUE;
-
-    return TRUE;
-}
-
-// ----------------------------------------------------------------------------
-// mouse capture
-// ----------------------------------------------------------------------------
-
-struct WXDLLEXPORT wxWindowNext
-{
-    wxWindow *win;
-    wxWindowNext *next;
-} *wxWindow::ms_winCaptureNext = NULL;
-
-void wxWindow::CaptureMouse()
-{
-    wxLogTrace(_T("mousecapture"), _T("CaptureMouse(0x%08x)"), this);
-
-    wxWindow *winOld = GetCapture();
-    if ( winOld )
-    {
-        // save it on stack
-        wxWindowNext *item = new wxWindowNext;
-        item->win = winOld;
-        item->next = ms_winCaptureNext;
-        ms_winCaptureNext = item;
-    }
-    //else: no mouse capture to save
-
-    wxWindowNative::CaptureMouse();
-}
-
-void wxWindow::ReleaseMouse()
-{
-    wxWindowNative::ReleaseMouse();
-
-    if ( ms_winCaptureNext )
-    {
-        ms_winCaptureNext->win->CaptureMouse();
-
-        wxWindowNext *item = ms_winCaptureNext;
-        ms_winCaptureNext = item->next;
-        delete item;
-    }
-    //else: stack is empty, no previous capture
-
-    wxLogTrace(_T("mousecapture"),
-               _T("After ReleaseMouse() mouse is captured by 0x%08x"),
-               GetCapture());
-}
-
 // ----------------------------------------------------------------------------
 // accelerators and menu hot keys
 // ----------------------------------------------------------------------------