+void MyFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& evt)
+{
+ if (evt.IsDropDownClicked())
+ {
+ wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(evt.GetEventObject());
+
+ tb->SetToolSticky(evt.GetId(), true);
+
+ // create the popup menu
+ wxMenu menuPopup;
+
+ wxBitmap bmp = wxArtProvider::GetBitmap(wxART_QUESTION, wxART_OTHER, wxSize(16,16));
+
+ wxMenuItem* m1 = new wxMenuItem(&menuPopup, 10001, _("Drop Down Item 1"));
+ m1->SetBitmap(bmp);
+ menuPopup.Append(m1);
+
+ wxMenuItem* m2 = new wxMenuItem(&menuPopup, 10002, _("Drop Down Item 2"));
+ m2->SetBitmap(bmp);
+ menuPopup.Append(m2);
+
+ wxMenuItem* m3 = new wxMenuItem(&menuPopup, 10003, _("Drop Down Item 3"));
+ m3->SetBitmap(bmp);
+ menuPopup.Append(m3);
+
+ wxMenuItem* m4 = new wxMenuItem(&menuPopup, 10004, _("Drop Down Item 4"));
+ m4->SetBitmap(bmp);
+ menuPopup.Append(m4);
+
+ // line up our menu with the button
+ wxRect rect = tb->GetToolRect(evt.GetId());
+ wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
+ pt = ScreenToClient(pt);
+
+
+ PopupMenu(&menuPopup, pt);
+
+
+ // make sure the button is "un-stuck"
+ tb->SetToolSticky(evt.GetId(), false);
+ }
+}
+
+
+void MyFrame::OnTabAlignment(wxCommandEvent &evt)
+{
+ size_t i, count;
+ wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
+ for (i = 0, count = all_panes.GetCount(); i < count; ++i)
+ {
+ wxAuiPaneInfo& pane = all_panes.Item(i);
+ if (pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
+ {
+ wxAuiNotebook* nb = (wxAuiNotebook*)pane.window;
+
+ long style = nb->GetWindowStyleFlag();
+ style &= ~(wxAUI_NB_TOP | wxAUI_NB_BOTTOM);
+ if (evt.GetId() == ID_NotebookAlignTop)
+ style |= wxAUI_NB_TOP;
+ else if (evt.GetId() == ID_NotebookAlignBottom)
+ style |= wxAUI_NB_BOTTOM;
+ nb->SetWindowStyleFlag(style);
+
+ nb->Refresh();
+ }
+ }
+}
+