]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
use Ellipsize() in wxStatusBarGeneric so that the text is correctly ellipsized when...
[wxWidgets.git] / src / gtk / window.cpp
index 6f2da8ab52bfe45e198d0946e20f3c597a552be4..1f64d565bdce31a914b48610bbaf3b27cbf3567f 100644 (file)
@@ -3545,6 +3545,9 @@ void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground),
     else
         return;
 
+    if (!widget->window)
+        return;
+
     if (rect == NULL)
         gtk_widget_queue_draw(widget);
     else
@@ -3553,7 +3556,16 @@ void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground),
         if (GetLayoutDirection() == wxLayout_RightToLeft)
             x = GetClientSize().x - x - rect->width;
 
+#if 0
         gtk_widget_queue_draw_area(widget, x, rect->y, rect->width, rect->height);
+#else
+        GdkRectangle r;
+        r.x = rect->x;
+        r.y = rect->y;
+        r.width = rect->width;
+        r.height = rect->height;
+        gdk_window_invalidate_rect( m_wxwindow->window, &r, TRUE );
+#endif
     }
 }
 
@@ -4183,7 +4195,7 @@ int wxWindowGTK::GetScrollThumb(int orient) const
     GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)];
     wxCHECK_MSG( sb, 0, _T("this window is not scrollable") );
 
-    return int(sb->adjustment->page_size);
+    return wxRound(sb->adjustment->page_size);
 }
 
 int wxWindowGTK::GetScrollPos( int orient ) const
@@ -4191,7 +4203,7 @@ int wxWindowGTK::GetScrollPos( int orient ) const
     GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)];
     wxCHECK_MSG( sb, 0, _T("this window is not scrollable") );
 
-    return int(sb->adjustment->value + 0.5);
+    return wxRound(sb->adjustment->value);
 }
 
 int wxWindowGTK::GetScrollRange( int orient ) const
@@ -4199,7 +4211,7 @@ int wxWindowGTK::GetScrollRange( int orient ) const
     GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)];
     wxCHECK_MSG( sb, 0, _T("this window is not scrollable") );
 
-    return int(sb->adjustment->upper);
+    return wxRound(sb->adjustment->upper);
 }
 
 // Determine if increment is the same as +/-x, allowing for some small
@@ -4218,14 +4230,14 @@ wxEventType wxWindowGTK::GetScrollEventType(GtkRange* range)
     const int barIndex = range == m_scrollBar[1];
     GtkAdjustment* adj = range->adjustment;
 
-    const int value = int(adj->value + 0.5);
+    const int value = wxRound(adj->value);
 
     // save previous position
     const double oldPos = m_scrollPos[barIndex];
     // update current position
     m_scrollPos[barIndex] = adj->value;
     // If event should be ignored, or integral position has not changed
-    if (!m_hasVMT || g_blockEventsOnDrag || value == int(oldPos + 0.5))
+    if (!m_hasVMT || g_blockEventsOnDrag || value == wxRound(oldPos))
     {
         return wxEVT_NULL;
     }