m_title = title;
m_widget = gtk_window_new( GTK_WINDOW_POPUP );
+ g_object_ref(m_widget);
+
+ if (parent) parent->AddChild(this);
g_signal_connect( m_widget, "realize",
G_CALLBACK (gtk_pseudo_window_realized_callback), this );
EVT_LEFT_UP(wxAuiManager::OnLeftUp)
EVT_MOTION(wxAuiManager::OnMotion)
EVT_LEAVE_WINDOW(wxAuiManager::OnLeaveWindow)
+ EVT_MOUSE_CAPTURE_LOST(wxAuiManager::OnCaptureLost)
EVT_CHILD_FOCUS(wxAuiManager::OnChildFocus)
EVT_AUI_FIND_MANAGER(wxAuiManager::OnFindManager)
EVT_TIMER(101, wxAuiManager::OnHintFadeTimer)
wxDefaultPosition, wxSize(1,1),
wxFRAME_FLOAT_ON_PARENT
| wxFRAME_TOOL_WINDOW );
+ m_hint_wnd->Connect(wxEVT_ACTIVATE,
+ wxActivateEventHandler(wxAuiManager::OnHintActivate), NULL, this);
// Can't set the bg colour of a Frame in wxMac
wxPanel* p = new wxPanel(m_hint_wnd);
{
wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i));
- if (pane.state & wxAuiPaneInfo::actionPane)
+ if (pane.HasFlag(wxAuiPaneInfo::actionPane))
{
wxASSERT_MSG(action_pane==-1, wxT("Too many fixed action panes"));
action_pane = pane_i;
dock.toolbar = false;
if (pane.HasFlag(wxAuiPaneInfo::optionDockFixed))
dock.fixed = true;
- if (pane.state & wxAuiPaneInfo::actionPane)
+ if (pane.HasFlag(wxAuiPaneInfo::actionPane))
action_pane_marked = true;
}
}
}
+void wxAuiManager::OnHintActivate(wxActivateEvent& WXUNUSED(event))
+{
+ // Do nothing so this event isn't handled in the base handlers.
+
+ // Letting the hint window activate without this handler can lead to
+ // weird behavior on Mac where the menu is switched out to the top
+ // window's menu in MDI applications when it shouldn't be. So since
+ // we don't want user interaction with the hint window anyway, we just
+ // prevent it from activating here.
+}
+
void wxAuiManager::StartPaneDrag(wxWindow* pane_window,
wxAuiPaneInfo& pane = GetPane(m_action_window);
wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));
- pane.state |= wxAuiPaneInfo::actionPane;
+ pane.SetFlag(wxAuiPaneInfo::actionPane, true);
wxPoint pt = event.GetPosition();
DoDrop(m_docks, m_panes, pane, pt, m_action_offset);
}
}
+void wxAuiManager::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
+{
+ // cancel the operation in progress, if any
+ if ( m_action != actionNone )
+ {
+ m_action = actionNone;
+ HideHint();
+ }
+}
+
void wxAuiManager::OnChildFocus(wxChildFocusEvent& event)
{
// when a child pane has it's focus set, we should change the