]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxRegion::Offset(x,y)
authorRobert Roebling <robert@roebling.de>
Wed, 30 Jan 2002 17:25:18 +0000 (17:25 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 30 Jan 2002 17:25:18 +0000 (17:25 +0000)
  Go to plan B: wxWindow::Scroll() now moved the
    m_updateRegion for later processing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/gtk/changes.txt
include/wx/gtk/region.h
include/wx/gtk1/region.h
src/gtk/region.cpp
src/gtk/scrolwin.cpp
src/gtk/window.cpp
src/gtk1/region.cpp
src/gtk1/scrolwin.cpp
src/gtk1/window.cpp

index 3f03645d68bf873af8b9144c89cb7ccf734708dd..2b5a91ff5b988ee46bf5c643a2125854e19e19db 100644 (file)
@@ -1,6 +1,19 @@
 
 *** wxWindows 2.3.3 ***
 
+New behaviour for wxWindow::Refresh() as it now produces a 
+delayed refresh. Call the new wxWindow::Update() to force
+an immediate update.
+
+Support for more SGI hardware (12-bit mode among others).
+
+Changed wxDC::Blit() to honour source DC's logical coordinates.
+
+Implemented wxIdleEvent::RequestMore() for simple background
+tasks (unlike thread work).
+
+Various updates to wxHTML.
+
 Some wxFont changes for better mixing of native fonts
 and wxFont's accessors.
 
index 3409ce33391d8878a734c01210f989b0e7ce4c72..89541c1d1587ee5accd7917e27faa11cf8c3b53a 100644 (file)
@@ -66,6 +66,8 @@ public:
     bool operator != ( const wxRegion& region );
 
     void Clear();
+    
+    bool Offset( wxCoord x, wxCoord y );
 
     bool Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
     bool Union( const wxRect& rect );
index 3409ce33391d8878a734c01210f989b0e7ce4c72..89541c1d1587ee5accd7917e27faa11cf8c3b53a 100644 (file)
@@ -66,6 +66,8 @@ public:
     bool operator != ( const wxRegion& region );
 
     void Clear();
+    
+    bool Offset( wxCoord x, wxCoord y );
 
     bool Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
     bool Union( const wxRect& rect );
index b89afd3b4ce9e686fecf7c75de49c929a9ed82e6..e71f072e8c70ccc21a0f3edc53daa34dc9f730ae 100644 (file)
@@ -516,6 +516,16 @@ wxRect wxRegion::GetBox() const
     return wxRect( x, y, w, h );
 }
 
+bool wxRegion::Offset( wxCoord x, wxCoord y )
+{
+    if (!m_refData)
+        return FALSE;
+
+    gdk_region_offset( M_REGIONDATA->m_region, x, y );
+    
+    return TRUE;
+}
+
 bool wxRegion::Empty() const
 {
     if (!m_refData)
index d16768c30c67b33b789c10deb91c68b570ed8fad..143c07f78d7e7393280315af6f9f5aad72ff3fe6 100644 (file)
@@ -320,9 +320,6 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
                int noUnitsX, int noUnitsY,
                int xPos, int yPos, bool noRefresh )
 {
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-
     int old_x = m_xScrollPixelsPerLine * m_xScrollPosition;
     int old_y = m_yScrollPixelsPerLine * m_yScrollPosition;
     
@@ -358,9 +355,6 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
 
 void wxScrolledWindow::AdjustScrollbars()
 {
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-
     int w, h;
     m_targetWindow->GetClientSize( &w, &h );
 
@@ -435,9 +429,6 @@ void wxScrolledWindow::OnScroll(wxScrollWinEvent& event)
     int nScrollInc = CalcScrollInc(event);
     if (nScrollInc == 0) return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     if (orient == wxHORIZONTAL)
     {
         int newPos = m_xScrollPosition + nScrollInc;
@@ -482,9 +473,6 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
     if (((x_pos == -1) || (x_pos == m_xScrollPosition)) &&
         ((y_pos == -1) || (y_pos == m_yScrollPosition))) return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     if ((x_pos != -1) && (m_xScrollPixelsPerLine))
     {
         int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
@@ -537,9 +525,6 @@ void wxScrolledWindow::GtkVScroll( float value )
     if (y_pos == m_yScrollPosition)
         return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
     GtkRange *range = GTK_RANGE(scrolledWindow->vscrollbar);
 
@@ -567,9 +552,6 @@ void wxScrolledWindow::GtkHScroll( float value )
     if (x_pos == m_xScrollPosition)
         return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
     GtkRange *range = GTK_RANGE(scrolledWindow->hscrollbar);
 
@@ -714,11 +696,6 @@ void wxScrolledWindow::SetScrollPos( int orient, int pos, bool refresh )
 
     wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
 
-    // Update any invalidates areas before the get moved/scrolled.
-    // We ignore the refresh parameter here because it is meant
-    // to control the behaviour AFTER scrolling happens.
-    Update();
-    
     if (orient == wxHORIZONTAL)
     {
         int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
index a1df18708a7b10a094a2fd94887da2f382cf2db8..e4ef75a2921d842bc39228b07ab0eaae8409e907 100644 (file)
@@ -4091,6 +4091,16 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     // No scrolling requested.
     if ((dx == 0) && (dy == 0)) return;
     
+    if (!m_updateRegion.IsEmpty())
+    {
+        m_updateRegion.Offset( dx, dy );
+        
+        int cw = 0;
+        int ch = 0;
+        GetClientSize( &cw, &ch );
+        m_updateRegion.Intersect( 0, 0, cw, ch );
+    }
+    
 #if 1
 
     m_clipPaintRegion = TRUE;
index b89afd3b4ce9e686fecf7c75de49c929a9ed82e6..e71f072e8c70ccc21a0f3edc53daa34dc9f730ae 100644 (file)
@@ -516,6 +516,16 @@ wxRect wxRegion::GetBox() const
     return wxRect( x, y, w, h );
 }
 
+bool wxRegion::Offset( wxCoord x, wxCoord y )
+{
+    if (!m_refData)
+        return FALSE;
+
+    gdk_region_offset( M_REGIONDATA->m_region, x, y );
+    
+    return TRUE;
+}
+
 bool wxRegion::Empty() const
 {
     if (!m_refData)
index d16768c30c67b33b789c10deb91c68b570ed8fad..143c07f78d7e7393280315af6f9f5aad72ff3fe6 100644 (file)
@@ -320,9 +320,6 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
                int noUnitsX, int noUnitsY,
                int xPos, int yPos, bool noRefresh )
 {
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-
     int old_x = m_xScrollPixelsPerLine * m_xScrollPosition;
     int old_y = m_yScrollPixelsPerLine * m_yScrollPosition;
     
@@ -358,9 +355,6 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
 
 void wxScrolledWindow::AdjustScrollbars()
 {
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-
     int w, h;
     m_targetWindow->GetClientSize( &w, &h );
 
@@ -435,9 +429,6 @@ void wxScrolledWindow::OnScroll(wxScrollWinEvent& event)
     int nScrollInc = CalcScrollInc(event);
     if (nScrollInc == 0) return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     if (orient == wxHORIZONTAL)
     {
         int newPos = m_xScrollPosition + nScrollInc;
@@ -482,9 +473,6 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
     if (((x_pos == -1) || (x_pos == m_xScrollPosition)) &&
         ((y_pos == -1) || (y_pos == m_yScrollPosition))) return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     if ((x_pos != -1) && (m_xScrollPixelsPerLine))
     {
         int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
@@ -537,9 +525,6 @@ void wxScrolledWindow::GtkVScroll( float value )
     if (y_pos == m_yScrollPosition)
         return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
     GtkRange *range = GTK_RANGE(scrolledWindow->vscrollbar);
 
@@ -567,9 +552,6 @@ void wxScrolledWindow::GtkHScroll( float value )
     if (x_pos == m_xScrollPosition)
         return;
 
-    // Update any invalidates areas before the get moved/scrolled.
-    Update();
-    
     GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
     GtkRange *range = GTK_RANGE(scrolledWindow->hscrollbar);
 
@@ -714,11 +696,6 @@ void wxScrolledWindow::SetScrollPos( int orient, int pos, bool refresh )
 
     wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
 
-    // Update any invalidates areas before the get moved/scrolled.
-    // We ignore the refresh parameter here because it is meant
-    // to control the behaviour AFTER scrolling happens.
-    Update();
-    
     if (orient == wxHORIZONTAL)
     {
         int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
index a1df18708a7b10a094a2fd94887da2f382cf2db8..e4ef75a2921d842bc39228b07ab0eaae8409e907 100644 (file)
@@ -4091,6 +4091,16 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     // No scrolling requested.
     if ((dx == 0) && (dy == 0)) return;
     
+    if (!m_updateRegion.IsEmpty())
+    {
+        m_updateRegion.Offset( dx, dy );
+        
+        int cw = 0;
+        int ch = 0;
+        GetClientSize( &cw, &ch );
+        m_updateRegion.Intersect( 0, 0, cw, ch );
+    }
+    
 #if 1
 
     m_clipPaintRegion = TRUE;