]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
wxBase compilation fixes
[wxWidgets.git] / src / common / wincmn.cpp
index 0b883ad1069c014bd2167016beb68a3039526c42..9a1a983162f8922f7580fe9508b4ddd674c3aa88 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "windowbase.h"
 #endif
 
@@ -977,6 +977,17 @@ bool wxWindowBase::IsExposed(int x, int y, int w, int h) const
     return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
 }
 
+void wxWindowBase::ClearBackground()
+{
+    // wxGTK uses its own version, no need to add never used code
+#ifndef __WXGTK__
+    wxClientDC dc((wxWindow *)this);
+    wxBrush brush(GetBackgroundColour(), wxSOLID);
+    dc.SetBackground(brush);
+    dc.Clear();
+#endif // __WXGTK__
+}
+
 // ----------------------------------------------------------------------------
 // find child window by id or name
 // ----------------------------------------------------------------------------
@@ -2230,7 +2241,7 @@ wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId)
     {
         if (elementId <= (int) GetWindow()->GetChildren().GetCount())
         {
-            win = (wxWindow*) GetWindow()->GetChildren().Nth(elementId-1)->GetData();
+            win = GetWindow()->GetChildren().Item(elementId-1)->GetData();
         }
         else
             return wxACC_FAIL;
@@ -2278,7 +2289,8 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
     case wxNAVDIR_DOWN:
     case wxNAVDIR_NEXT:
         {
-            wxWindowList::compatibility_iterator node = NULL;
+            wxWindowList::compatibility_iterator node =
+                wxWindowList::compatibility_iterator();
             if (fromId == 0)
             {
                 // Can't navigate to sibling of this window
@@ -2296,7 +2308,7 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
 
             if (node && node->GetNext())
             {
-                wxWindow* nextWindow = (wxWindow*) node->GetNext()->Data();
+                wxWindow* nextWindow = node->GetNext()->GetData();
                 *toObject = nextWindow->GetOrCreateAccessible();
                 return wxACC_OK;
             }
@@ -2307,7 +2319,8 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
     case wxNAVDIR_UP:
     case wxNAVDIR_PREVIOUS:
         {
-            wxWindowList::compatibility_iterator node = NULL;
+            wxWindowList::compatibility_iterator node =
+                wxWindowList::compatibility_iterator();
             if (fromId == 0)
             {
                 // Can't navigate to sibling of this window
@@ -2325,7 +2338,7 @@ wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
 
             if (node && node->GetPrevious())
             {
-                wxWindow* previousWindow = (wxWindow*) node->GetPrevious()->Data();
+                wxWindow* previousWindow = node->GetPrevious()->GetData();
                 *toObject = previousWindow->GetOrCreateAccessible();
                 return wxACC_OK;
             }
@@ -2398,7 +2411,7 @@ wxAccStatus wxWindowAccessible::GetChild(int childId, wxAccessible** child)
     if (childId > (int) GetWindow()->GetChildren().GetCount())
         return wxACC_FAIL;
 
-    wxWindow* childWindow = (wxWindow*) GetWindow()->GetChildren().Nth(childId-1)->GetData();
+    wxWindow* childWindow = GetWindow()->GetChildren().Item(childId-1)->GetData();
     *child = childWindow->GetOrCreateAccessible();
     if (*child)
         return wxACC_OK;