Fix extra wxEVT_COLLAPSIBLEPANE_CHANGED with wxCP_NO_TLW_RESIZE
A pane using wxCP_NO_TLW_RESIZE would generate wxCollapsiblePaneEvent even when toggled from a program because the GTK+ callback didn't take m_bIgnoreNextChange flag into account in this case. Fix this and also avoid duplicating the code for sending the event.
This commit is contained in:
@@ -99,16 +99,8 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object),
|
||||
// (redraw/relayout/resize) so that it's flicker-free
|
||||
p->SetMinSize(sz);
|
||||
|
||||
if (p->HasFlag(wxCP_NO_TLW_RESIZE))
|
||||
if (!p->HasFlag(wxCP_NO_TLW_RESIZE))
|
||||
{
|
||||
// fire an event
|
||||
wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed());
|
||||
p->HandleWindowEvent(ev);
|
||||
|
||||
// the user asked to explicitly handle the resizing itself...
|
||||
return;
|
||||
}
|
||||
|
||||
wxTopLevelWindow *
|
||||
top = wxDynamicCast(wxGetTopLevelParent(p), wxTopLevelWindow);
|
||||
if ( top && top->GetSizer() )
|
||||
@@ -135,6 +127,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object),
|
||||
top->SetClientSize(sz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( p->m_bIgnoreNextChange )
|
||||
{
|
||||
|
Reference in New Issue
Block a user