]> git.saurik.com Git - wxWidgets.git/commitdiff
Commited Bryan Petty's blind fix patch.
authorRobert Roebling <robert@roebling.de>
Tue, 22 Aug 2006 12:30:07 +0000 (12:30 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 22 Aug 2006 12:30:07 +0000 (12:30 +0000)
  Added event.Skip() to size event handler
    in frame manager and removed the wrong
    work around for this.

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

src/aui/floatpane.cpp
src/aui/framemanager.cpp

index 82bd93fb7d05807c45587bf57f44196e88683662..22940e6a80b3d7d8f8700d3f53af59ae2eb56b9e 100644 (file)
@@ -51,7 +51,7 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent,
     m_moving = false;
     m_last_rect = wxRect();
     m_mgr.SetManagedWindow(this);
-    SetExtraStyle(wxWS_EX_PROCESS_IDLE);
+    // SetExtraStyle(wxWS_EX_PROCESS_IDLE);
 }
 
 wxFloatingPane::~wxFloatingPane()
@@ -125,16 +125,6 @@ void wxFloatingPane::OnClose(wxCloseEvent& evt)
 
 void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)
 {
-#ifdef __WXGTK__
-    // On wxGTK 2.6 and 2.7 for some unknown reason, wxSizeEvents are not
-    // emitted for wxFloatingPanes when they are manually resized.
-    // See Bug #1528554.
-    // However, it does (fortunately) wrongly emit wxMoveEvent in this scenario.
-    // So we having on that to update the floating pane size - let's hope noone
-    // fixes this useful bug, without fixing the above.
-    m_owner_mgr->OnFloatingPaneResized(m_pane_window, GetSize());
-#endif
-
     wxRect win_rect = GetRect();
 
     // skip the first move event
index 3aec290a2a484455bfdd713621942c01b5b7738b..0018ab37b0e24636a9ecd6606d535f62eb2d3312 100644 (file)
@@ -85,6 +85,7 @@ public:
 #else
         m_CanSetShape = true;
 #endif
+        m_Region = wxRegion(0, 0, 0, 0);
         SetTransparent(0);
     }
 
@@ -95,28 +96,24 @@ public:
             int w=100; // some defaults
             int h=100;
             GetClientSize(&w, &h);
-            if ((alpha != m_Amount) || (m_MaxWidth<w) | (m_MaxHeight<h))
+
+                       m_MaxWidth = w;
+            m_MaxHeight = h;
+            m_Amount = alpha;
+            m_Region.Clear();
+//            m_Region.Union(0, 0, 1, m_MaxWidth);
+            if (m_Amount)
             {
-                // Make the region at least double the height and width so we don't have
-                // to rebuild if the size changes.
-                m_MaxWidth=w*2;
-                m_MaxHeight=h*2;
-                m_Amount = alpha;
-                m_Region.Clear();
-//                m_Region.Union(0, 0, 1, m_MaxWidth);
-                if (m_Amount)
+                for (int y=0; y<m_MaxHeight; y++)
                 {
-                    for (int y=0; y<m_MaxHeight; y++)
-                    {
-                        // Reverse the order of the bottom 4 bits
-                        int j=((y&8)?1:0)|((y&4)?2:0)|((y&2)?4:0)|((y&1)?8:0);
-                        if ((j*16+8)<m_Amount)
-                            m_Region.Union(0, y, m_MaxWidth, 1);
-                    }
+                    // Reverse the order of the bottom 4 bits
+                    int j=((y&8)?1:0)|((y&4)?2:0)|((y&2)?4:0)|((y&1)?8:0);
+                    if ((j*16+8)<m_Amount)
+                        m_Region.Union(0, y, m_MaxWidth, 1);
                 }
-                SetShape(m_Region);
-                Refresh();
             }
+            SetShape(m_Region);
+            Refresh();
         }
         return true;
     }
@@ -125,7 +122,14 @@ public:
     {
         wxPaintDC dc(this);
 
+        if (m_Region.IsEmpty())
+            return;
+
+#ifdef __WXMAC__
+        dc.SetBrush(wxColour(128, 192, 255));
+#else
         dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
+#endif
         dc.SetPen(*wxTRANSPARENT_PEN);
 
         wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
@@ -143,6 +147,16 @@ public:
     void OnWindowCreate(wxWindowCreateEvent& WXUNUSED(event)) {m_CanSetShape=true; SetTransparent(0);}
 #endif
 
+    void OnSize(wxSizeEvent& event)
+    {
+        SetTransparent(m_Amount);
+        m_Region.Intersect(0, 0, event.GetSize().GetWidth(),
+                           event.GetSize().GetHeight());
+        SetShape(m_Region);
+        Refresh();
+        event.Skip();
+    }
+
 private:
     int m_Amount;
     int m_MaxWidth;
@@ -160,6 +174,7 @@ IMPLEMENT_DYNAMIC_CLASS( wxPseudoTransparentFrame, wxFrame )
 
 BEGIN_EVENT_TABLE(wxPseudoTransparentFrame, wxFrame)
     EVT_PAINT(wxPseudoTransparentFrame::OnPaint)
+    EVT_SIZE(wxPseudoTransparentFrame::OnSize)
 #ifdef __WXGTK__
     EVT_WINDOW_CREATE(wxPseudoTransparentFrame::OnWindowCreate)
 #endif
@@ -3118,13 +3133,14 @@ void wxFrameManager::OnEraseBackground(wxEraseEvent& event)
 #endif
 }
 
-void wxFrameManager::OnSize(wxSizeEvent& WXUNUSED(event))
+void wxFrameManager::OnSize(wxSizeEvent& event)
 {
     if (m_frame)
     {
         DoFrameLayout();
         Repaint();
     }
+    event.Skip();
 }