- Code: Select all
// First check it in over window ...
if ( pt.x > layer_insert_offset-auiLayerInsertPixels &&
pt.y > layer_insert_offset-auiLayerInsertPixels &&
pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels &&
pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels )
{
if (pt.x < layer_insert_offset )
{
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).
Position(pt.y - GetDockPixelOffset(drop) - offset.y);
return ProcessDockResult(target, drop);
}
else if (pt.y < layer_insert_offset )
{
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).
Position(pt.x - GetDockPixelOffset(drop) - offset.x);
return ProcessDockResult(target, drop);
}
else if (pt.x >= cli_size.x - layer_insert_offset )
{
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT),
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).
Position(pt.y - GetDockPixelOffset(drop) - offset.y);
return ProcessDockResult(target, drop);
}
else if (pt.y >= cli_size.y - layer_insert_offset )
{
int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
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).
Position(pt.x - GetDockPixelOffset(drop) - offset.x);
return ProcessDockResult(target, drop);
}
}
Huge