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
int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1;
-
+
drop.Dock().Bottom().
Layer(new_layer).
Row(0).
{
if (!part || !part->dock)
return false;
-
+
// calculate the offset from where the dock begins
// to the point where the user dropped the pane
int dock_drop_offset = 0;
{
drop.Float();
}
-
+
m_skipping = false;
-
+
return ProcessDockResult(target, drop);
}
-
+
drop.Position(pt.x - GetDockPixelOffset(drop) - offset.x);
return ProcessDockResult(target, drop);
{
m_skipping = false;
}
-
+
if (!m_skipping)
{
m_last_rect = part->dock->rect;
pos = wnd->ClientToScreen( pos );
pt.y = pos.y;
}
+#else
+ wxUnusedVar(dir);
#endif
wxPoint client_pt = m_frame->ScreenToClient(pt);
pos = wnd->ClientToScreen( pos );
pt.y = pos.y;
}
+#else
+ wxUnusedVar(dir);
#endif
wxPoint client_pt = m_frame->ScreenToClient(pt);
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();
}
}