]> git.saurik.com Git - wxWidgets.git/commitdiff
Some more fiddling with two-window approach and
authorRobert Roebling <robert@roebling.de>
Mon, 25 Mar 2002 22:05:53 +0000 (22:05 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 25 Mar 2002 22:05:53 +0000 (22:05 +0000)
    the wxNO_FULL_REPAINT_ON_RESIZE flag.

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

src/univ/listbox.cpp
src/x11/app.cpp
src/x11/toplevel.cpp
src/x11/window.cpp

index 025f2b5a00bf1df5e88abbf200a72647523d7f56..65c41bc9dfad0b3eec2e8d964b0b964efee5a13e 100644 (file)
@@ -101,7 +101,7 @@ bool wxListBox::Create(wxWindow *parent,
     if ( !(style & (wxLB_MULTIPLE | wxLB_EXTENDED)) )
         style |= wxLB_SINGLE;
 
-    if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
+    if ( !wxControl::Create(parent, id, pos, size, style | wxVSCROLL , wxDefaultValidator, name) )
         return FALSE;
 
     SetWindow(this);
index e1a0d8027ecc0eb7dabd579b59e1b6a4267ebc6b..431e76420fc34103304aec93ac10d69e396350cc 100644 (file)
@@ -530,7 +530,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
 
                 // Only erase background, paint in idle time.
                 win->SendEraseEvents();
-                //win->Update();
+                // win->Update();
             }
 
             return TRUE;
index 56ffc9d7d40062cde0f86ad1fb71a9e8b8b3c86d..7cc9463a814c0f8ba3ffc27fd2474516db922e79 100644 (file)
@@ -132,7 +132,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
     {
         xattributes_mask |= CWBitGravity;
-        xattributes.bit_gravity = StaticGravity;
+        xattributes.bit_gravity = NorthWestGravity;
     }
     
     xattributes_mask |= CWEventMask;
@@ -199,11 +199,12 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
         }
     }
 
-    size_hints.flags = PSize | PPosition;
+    size_hints.flags = PSize | PPosition | PWinGravity;
     size_hints.x = pos2.x;
     size_hints.y = pos2.y;
     size_hints.width = size2.x;
     size_hints.height = size2.y;
+    size_hints.win_gravity = NorthWestGravity;
     XSetWMNormalHints( xdisplay, xwindow, &size_hints);
     
     XWMHints wm_hints;
index 3f186d493769f5e5d53e5a4f2ba2cbbf9c31415a..2c1888c795970a912454486af60cb7c329f40b82 100644 (file)
@@ -102,6 +102,7 @@ void wxWindowX11::Init()
     m_mainWindow = (WXWindow) 0;
     m_clientWindow = (WXWindow) 0;
     m_insertIntoMain = FALSE;
+    m_updateNcArea = FALSE;
     
     m_winCaptured = FALSE;
     m_needsInputFocus = FALSE;
@@ -212,7 +213,26 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
             xattributes.bit_gravity = StaticGravity;
         }
 
-        xwindow = XCreateWindow( xdisplay, xwindow, 0, 0, size2.x, size2.y, 
+        if (HasFlag( wxSUNKEN_BORDER) || HasFlag( wxRAISED_BORDER))
+        {
+            pos2.x = 2;
+            pos2.y = 2;
+            size2.x -= 4;
+            size2.y -= 4;
+        } else
+        if (HasFlag( wxSIMPLE_BORDER ))
+        {
+            pos2.x = 1;
+            pos2.y = 1;
+            size2.x -= 2;
+            size2.y -= 2;
+        } else
+        {
+            pos2.x = 0;
+            pos2.y = 0;
+        }
+        
+        xwindow = XCreateWindow( xdisplay, xwindow, pos2.x, pos2.y, size2.x, size2.y, 
             0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes );
     
         XSetWindowBackgroundPixmap( xdisplay, xwindow, None );
@@ -235,7 +255,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
         if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
         {
             xattributes_mask |= CWBitGravity;
-            xattributes.bit_gravity = StaticGravity;
+            xattributes.bit_gravity = NorthWestGravity;
         }
 
         Window xwindow = XCreateWindow( xdisplay, xparent, pos2.x, pos2.y, size2.x, size2.y, 
@@ -1051,6 +1071,7 @@ void wxWindowX11::Update()
 {
     if (m_updateNcArea)
     {
+        // wxLogDebug("wxWindowX11::UpdateNC: %s", GetClassInfo()->GetClassName());
         // Send nc paint events.
         SendNcPaintEvents();
     }
@@ -1124,6 +1145,8 @@ void wxWindowX11::SendNcPaintEvents()
     wxNcPaintEvent nc_paint_event( GetId() );
     nc_paint_event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( nc_paint_event );
+    
+    m_updateNcArea = FALSE;
 }
 
 // ----------------------------------------------------------------------------