+ if (pane.IsMaximized())
+ {
+ // If the pane is maximized, the original state must be restored
+ // before trying to float the pane, otherwise the other panels
+ // wouldn't appear correctly when it becomes floating.
+ wxAuiManagerEvent e(wxEVT_AUI_PANE_RESTORE);
+ e.SetManager(this);
+ e.SetPane(evt.pane);
+ ProcessMgrEvent(e);
+
+ if (e.GetVeto())
+ {
+ // If it can't be restored, it can't be floated neither.
+ return;
+ }
+
+ RestorePane(pane);
+ }
+
+ pane.Float();