Commited Bryan Petty's blind fix patch.
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
This commit is contained in:
@@ -51,7 +51,7 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent,
|
|||||||
m_moving = false;
|
m_moving = false;
|
||||||
m_last_rect = wxRect();
|
m_last_rect = wxRect();
|
||||||
m_mgr.SetManagedWindow(this);
|
m_mgr.SetManagedWindow(this);
|
||||||
SetExtraStyle(wxWS_EX_PROCESS_IDLE);
|
// SetExtraStyle(wxWS_EX_PROCESS_IDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFloatingPane::~wxFloatingPane()
|
wxFloatingPane::~wxFloatingPane()
|
||||||
@@ -125,16 +125,6 @@ void wxFloatingPane::OnClose(wxCloseEvent& evt)
|
|||||||
|
|
||||||
void wxFloatingPane::OnMoveEvent(wxMoveEvent& event)
|
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();
|
wxRect win_rect = GetRect();
|
||||||
|
|
||||||
// skip the first move event
|
// skip the first move event
|
||||||
|
@@ -85,6 +85,7 @@ public:
|
|||||||
#else
|
#else
|
||||||
m_CanSetShape = true;
|
m_CanSetShape = true;
|
||||||
#endif
|
#endif
|
||||||
|
m_Region = wxRegion(0, 0, 0, 0);
|
||||||
SetTransparent(0);
|
SetTransparent(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,28 +96,24 @@ public:
|
|||||||
int w=100; // some defaults
|
int w=100; // some defaults
|
||||||
int h=100;
|
int h=100;
|
||||||
GetClientSize(&w, &h);
|
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
|
for (int y=0; y<m_MaxHeight; y++)
|
||||||
// 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++)
|
// 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);
|
||||||
// Reverse the order of the bottom 4 bits
|
if ((j*16+8)<m_Amount)
|
||||||
int j=((y&8)?1:0)|((y&4)?2:0)|((y&2)?4:0)|((y&1)?8:0);
|
m_Region.Union(0, y, m_MaxWidth, 1);
|
||||||
if ((j*16+8)<m_Amount)
|
|
||||||
m_Region.Union(0, y, m_MaxWidth, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SetShape(m_Region);
|
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
SetShape(m_Region);
|
||||||
|
Refresh();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -125,7 +122,14 @@ public:
|
|||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
|
if (m_Region.IsEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
dc.SetBrush(wxColour(128, 192, 255));
|
||||||
|
#else
|
||||||
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
|
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
|
||||||
|
#endif
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
|
|
||||||
wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
|
wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
|
||||||
@@ -143,6 +147,16 @@ public:
|
|||||||
void OnWindowCreate(wxWindowCreateEvent& WXUNUSED(event)) {m_CanSetShape=true; SetTransparent(0);}
|
void OnWindowCreate(wxWindowCreateEvent& WXUNUSED(event)) {m_CanSetShape=true; SetTransparent(0);}
|
||||||
#endif
|
#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:
|
private:
|
||||||
int m_Amount;
|
int m_Amount;
|
||||||
int m_MaxWidth;
|
int m_MaxWidth;
|
||||||
@@ -160,6 +174,7 @@ IMPLEMENT_DYNAMIC_CLASS( wxPseudoTransparentFrame, wxFrame )
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPseudoTransparentFrame, wxFrame)
|
BEGIN_EVENT_TABLE(wxPseudoTransparentFrame, wxFrame)
|
||||||
EVT_PAINT(wxPseudoTransparentFrame::OnPaint)
|
EVT_PAINT(wxPseudoTransparentFrame::OnPaint)
|
||||||
|
EVT_SIZE(wxPseudoTransparentFrame::OnSize)
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
EVT_WINDOW_CREATE(wxPseudoTransparentFrame::OnWindowCreate)
|
EVT_WINDOW_CREATE(wxPseudoTransparentFrame::OnWindowCreate)
|
||||||
#endif
|
#endif
|
||||||
@@ -3118,13 +3133,14 @@ void wxFrameManager::OnEraseBackground(wxEraseEvent& event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrameManager::OnSize(wxSizeEvent& WXUNUSED(event))
|
void wxFrameManager::OnSize(wxSizeEvent& event)
|
||||||
{
|
{
|
||||||
if (m_frame)
|
if (m_frame)
|
||||||
{
|
{
|
||||||
DoFrameLayout();
|
DoFrameLayout();
|
||||||
Repaint();
|
Repaint();
|
||||||
}
|
}
|
||||||
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user