toolbar docking bug fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams
2006-11-20 15:35:17 +00:00
parent 21fae46d76
commit 32e4b03c49

View File

@@ -76,6 +76,7 @@ enum wxAuiPrivateManagerOption
};
const int auiToolBarLayer = 10;
class wxPseudoTransparentFrame : public wxFrame
@@ -259,7 +260,8 @@ static void CopyDocksAndPanes(wxAuiDockInfoArray& dest_docks,
// GetMaxLayer() is an internal function which returns
// the highest layer inside the specified dock
static int GetMaxLayer(const wxAuiDockInfoArray& docks, int dock_direction)
static int GetMaxLayer(const wxAuiDockInfoArray& docks,
int dock_direction)
{
int i, dock_count, max_layer = 0;
for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i)
@@ -2577,15 +2579,20 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
int layer_insert_offset = auiLayerInsertOffset;
if (target.IsToolbar())
if (drop.IsToolbar())
layer_insert_offset = 0;
if (pt.x < layer_insert_offset &&
pt.x > layer_insert_offset-auiLayerInsertPixels)
{
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_LEFT),
GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)),
GetMaxLayer(docks, wxAUI_DOCK_TOP)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Left().
Layer(new_layer).
Row(0).
@@ -2598,6 +2605,10 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP),
GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Top().
Layer(new_layer).
Row(0).
@@ -2611,6 +2622,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
GetMaxLayer(docks, wxAUI_DOCK_TOP)),
GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Right().
Layer(new_layer).
Row(0).
@@ -2624,6 +2638,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Bottom().
Layer(new_layer).
Row(0).
@@ -2631,6 +2648,7 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
return ProcessDockResult(target, drop);
}
wxAuiDockUIPart* part = HitTest(pt.x, pt.y);
@@ -4093,7 +4111,8 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
}
else if (m_action == actionDragFloatingPane)
{
if(m_action_window) {
if (m_action_window)
{
wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
m_action_window->Move(pt.x - m_action_offset.x,
pt.y - m_action_offset.y);