wxRect rect(upd.GetRect());
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
- upd++;
+ ++upd;
}
}
return new wxAuiFloatingFrame(parent, this, pane_info);
}
+bool wxAuiManager::CanDockPanel(const wxAuiPaneInfo & WXUNUSED(p))
+{
+ // if a key modifier is pressed while dragging the frame,
+ // don't dock the window
+ return !(wxGetKeyState(WXK_CONTROL) || wxGetKeyState(WXK_ALT));
+}
+
// GetPane() looks up a wxAuiPaneInfo structure based
// on the supplied window pointer. Upon failure, GetPane()
// returns an empty wxAuiPaneInfo, a condition which can be checked
wxAuiPaneInfo().Name(wxT("mdiclient")).
CenterPane().PaneBorder(false));
}
- else if (m_frame->IsKindOf(CLASSINFO(wxAuiMDIParentFrame)))
+ else if (m_frame->IsKindOf(CLASSINFO(wxAuiMDIParentFrame)))
{
wxAuiMDIParentFrame* mdi_frame = (wxAuiMDIParentFrame*)m_frame;
wxAuiMDIClientWindow* client_window = mdi_frame->GetClientWindow();
// I believe this to be the correct action, until
// wxToolBar::GetBestSize() is fixed. Is this assumption
// correct?
- pinfo.best_size.y++;
+ // commented out by JACS 2007-9-08 after having added a pixel in wxMSW's wxToolBar::DoGetBestSize()
+ // pinfo.best_size.y++;
}
if (pinfo.min_size != wxDefaultSize)
p.window->SetSize(1,1);
- // the following block is a workaround for bug #1531361
- // (see wxWidgets sourceforge page). On wxGTK (only), when
- // a frame is shown/hidden, a move event unfortunately
- // also gets fired. Because we may be dragging around
- // a pane, we need to cancel that action here to prevent
- // a spurious crash.
- if (m_action_window == p.frame)
- {
- if (wxWindow::GetCapture() == m_frame)
+ // the following block is a workaround for bug #1531361
+ // (see wxWidgets sourceforge page). On wxGTK (only), when
+ // a frame is shown/hidden, a move event unfortunately
+ // also gets fired. Because we may be dragging around
+ // a pane, we need to cancel that action here to prevent
+ // a spurious crash.
+ if (m_action_window == p.frame)
+ {
+ if (wxWindow::GetCapture() == m_frame)
m_frame->ReleaseMouse();
m_action = actionNone;
- m_action_window = NULL;
- }
+ m_action_window = NULL;
+ }
- // hide the frame
+ // hide the frame
if (p.frame->IsShown())
p.frame->Show(false);
{
// frame already exists, make sure it's position
// and size reflect the information in wxAuiPaneInfo
- if (p.frame->GetPosition() != p.floating_pos)
+ if ((p.frame->GetPosition() != p.floating_pos) || (p.frame->GetSize() != p.floating_size))
{
p.frame->SetSize(p.floating_pos.x, p.floating_pos.y,
p.floating_size.x, p.floating_size.y,
return ProcessDockResult(target, drop);
}
- else
- {
- m_skipping = false;
- }
- if (!m_skipping)
- {
- m_last_rect = part->dock->rect;
- m_last_rect.Inflate( 15, 15 );
- }
+ m_skipping = false;
+
+ m_last_rect = part->dock->rect;
+ m_last_rect.Inflate( 15, 15 );
drop.Dock().
Direction(part->dock->dock_direction).
wxAuiDockUIPartArray uiparts;
wxAuiPaneInfo hint = GetPane(pane_window);
hint.name = wxT("__HINT__");
+ hint.PaneBorder(true);
hint.Show();
if (!hint.IsOk())
// no hint for toolbar floating windows
if (pane.IsToolbar() && m_action == actionDragFloatingPane)
{
- if (m_action == actionDragFloatingPane)
- {
- wxAuiDockInfoArray docks;
- wxAuiPaneInfoArray panes;
- wxAuiDockUIPartArray uiparts;
- wxAuiPaneInfo hint = pane;
+ wxAuiDockInfoArray docks;
+ wxAuiPaneInfoArray panes;
+ wxAuiDockUIPartArray uiparts;
+ wxAuiPaneInfo hint = pane;
- CopyDocksAndPanes(docks, panes, m_docks, m_panes);
+ CopyDocksAndPanes(docks, panes, m_docks, m_panes);
- // find out where the new pane would be
- if (!DoDrop(docks, panes, hint, client_pt))
- return;
- if (hint.IsFloating())
- return;
+ // find out where the new pane would be
+ if (!DoDrop(docks, panes, hint, client_pt))
+ return;
+ if (hint.IsFloating())
+ return;
- pane = hint;
- m_action = actionDragToolbarPane;
- m_action_window = pane.window;
+ pane = hint;
+ m_action = actionDragToolbarPane;
+ m_action_window = pane.window;
- Update();
- }
+ Update();
return;
}
// if a key modifier is pressed while dragging the frame,
// don't dock the window
- if (wxGetKeyState(WXK_CONTROL) || wxGetKeyState(WXK_ALT))
+ if (!CanDockPanel(pane))
{
HideHint();
return;
// if a key modifier is pressed while dragging the frame,
// don't dock the window
- if (!wxGetKeyState(WXK_CONTROL) && !wxGetKeyState(WXK_ALT))
+ if (CanDockPanel(pane))
{
// do the drop calculation
DoDrop(m_docks, m_panes, pane, client_pt, action_offset);
void wxAuiManager::OnFloatingPaneActivated(wxWindow* wnd)
{
- if (GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE)
+ if ((GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE) && GetPane(wnd).IsOk())
{
- // try to find the pane
- wxASSERT_MSG(GetPane(wnd).IsOk(), wxT("Pane window not found"));
-
SetActivePane(m_panes, wnd);
Repaint();
}
{
// if the frame is about to be deleted, don't bother
if (!m_frame || wxPendingDelete.Member(m_frame))
- return;
-
+ return;
+
wxDC* dc = evt.GetDC();
#ifdef __WXMAC__
{
wxAuiDockUIPart& part = m_uiparts.Item(i);
- // don't draw hidden pane items
- if (part.sizer_item && !part.sizer_item->IsShown())
+ // don't draw hidden pane items or items that aren't windows
+ if (part.sizer_item && ((!part.sizer_item->IsWindow() && !part.sizer_item->IsSpacer() && !part.sizer_item->IsSizer()) || !part.sizer_item->IsShown()))
continue;
switch (part.type)
- if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
- return;
-
if (GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE)
{
// set the caption as active
Repaint();
}
+ if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
+ return;
+
m_action = actionClickCaption;
m_action_part = part;
m_action_start = wxPoint(event.m_x, event.m_y);