delete m_art;
}
+// Creates a floating frame for the windows
+wxFloatingPane * wxFrameManager::CreateFloatingFrame(wxWindow* parent, const wxPaneInfo& p)
+{
+ return new wxFloatingPane(parent, this, p);
+}
+
// GetPane() looks up a wxPaneInfo structure based
// on the supplied window pointer. Upon failure, GetPane()
// returns an empty wxPaneInfo, a condition which can be checked
return false;
}
+// ClosePane() destroys or hides the pane depending on its
+// flags
+void wxFrameManager::ClosePane(wxPaneInfo& pane_info)
+{
+ // first, hide the window
+ if (pane_info.window && pane_info.window->IsShown()) {
+ pane_info.window->Show(false);
+ }
+
+ // make sure that we are the parent of this window
+ if(pane_info.window && pane_info.window->GetParent() != m_frame) {
+ pane_info.window->Reparent(m_frame);
+ }
+
+ // if we have a frame, destroy it
+ if(pane_info.frame) {
+ pane_info.frame->Destroy();
+ pane_info.frame = NULL;
+ }
+
+ // now we need to either destroy or hide the pane
+ if(pane_info.IsDestroyOnClose())
+ {
+ wxWindow * window = pane_info.window;
+ DetachPane(window);
+ if(window) {
+ window->Destroy();
+ }
+ }
+ else
+ {
+ pane_info.Hide();
+ }
+}
// EscapeDelimiters() changes ";" into "\;" and "|" into "\|"
// in the input string. This is an internal functions which is
{
// we need to create a frame for this
// pane, which has recently been floated
- wxFloatingPane* frame = new wxFloatingPane(m_frame,
- this,
- p);
+ wxFloatingPane* frame = CreateFloatingFrame(m_frame, p);
#if wxCHECK_VERSION(2,7,0)
// on MSW and Mac, if the owner desires transparent dragging, and
evt.Veto();
return;
}
- else
+ else
{
- // reparent the pane window back to us and
- // prepare the frame window for destruction
- if (pane.window->IsShown())
- pane.window->Show(false);
- pane.window->Reparent(m_frame);
- pane.frame = NULL;
- pane.Hide();
+ ClosePane(pane);
}
}
if (!e.GetVeto())
{
- pane.Hide();
+ ClosePane(pane);
Update();
}
}