本文整理汇总了C++中wxAuiToolBarEvent::GetItemRect方法的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiToolBarEvent::GetItemRect方法的具体用法?C++ wxAuiToolBarEvent::GetItemRect怎么用?C++ wxAuiToolBarEvent::GetItemRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxAuiToolBarEvent
的用法示例。
在下文中一共展示了wxAuiToolBarEvent::GetItemRect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRecentSearches
void FindResultsTab::OnRecentSearches(wxAuiToolBarEvent& e)
{
// Show the menu
wxMenu menu;
clAuiToolStickness s(m_tb, e.GetId());
const int firstID = 8000;
int counter = 0;
std::map<int, History> entries;
std::for_each(m_history.Begin(), m_history.End(), [&](const std::pair<wxString, History>& p) {
menu.Prepend(firstID + counter, p.first, "", wxITEM_CHECK)->Check(m_searchTitle == p.first);
entries.insert(std::make_pair(firstID + counter, p.second));
++counter;
});
menu.AppendSeparator();
int clearHistory = ::wxNewId();
menu.Append(clearHistory, _("Clear History"));
int sel = GetPopupMenuSelectionFromUser(menu, e.GetItemRect().GetBottomLeft());
if(sel == wxID_NONE) return;
if(sel == clearHistory) {
m_history.Clear();
} else if(entries.count(sel)) {
const History& h = entries.find(sel)->second;
LoadSearch(h);
}
}
示例2: OnTBUnRedo
void CommandProcessorBase::OnTBUnRedo(wxAuiToolBarEvent& event)
{
wxPoint pt = event.GetItemRect().GetBottomLeft();
pt.y++;
wxWindow* win = wxDynamicCast(event.GetEventObject(), wxWindow); // We must use the toolbar as 'win', in case it's not in its default location
wxCHECK_RET(win, "No toolbar?");
PopulateUnRedoMenu(win, pt, event.GetId() == wxID_UNDO);
}
示例3: OnERDSelected
void DbViewerPanel::OnERDSelected(wxAuiToolBarEvent& event)
{
wxMenu menu;
menu.Append(XRCID("IDM_DBE_ERD_SQLITE"), _("SQLite"));
menu.Append(XRCID("IDM_DBE_ERD_MYSQL"), _("MySQL"));
menu.Append(XRCID("IDM_DBE_ERD_POSTGRESQL"), _("PostgreSQL"));
int selection = GetPopupMenuSelectionFromUser(menu, event.GetItemRect().GetBottomLeft());
if(selection == XRCID("IDM_DBE_ERD_SQLITE")) {
m_mgr->AddEditorPage(new ErdPanel(m_pNotebook, new SQLiteDbAdapter(), m_pConnections), _("SQLite ERD"));
} else if(selection == XRCID("IDM_DBE_ERD_MYSQL")) {
m_mgr->AddEditorPage(new ErdPanel(m_pNotebook, new MySqlDbAdapter(), m_pConnections), _("MySQL ERD"));
} else if(selection == XRCID("IDM_DBE_ERD_POSTGRESQL")) {
m_mgr->AddEditorPage(new ErdPanel(m_pNotebook, new PostgreSqlDbAdapter(), m_pConnections), _("PostgreSQL ERD"));
}
}
示例4: ShowAuiToolMenu
void DiffSideBySidePanelBase::ShowAuiToolMenu(wxAuiToolBarEvent& event)
{
event.Skip();
if (event.IsDropDownClicked()) {
wxAuiToolBar* toolbar = wxDynamicCast(event.GetEventObject(), wxAuiToolBar);
if (toolbar) {
wxAuiToolBarItem* item = toolbar->FindTool(event.GetId());
if (item) {
std::map<int, wxMenu*>::iterator iter = m_dropdownMenus.find(item->GetId());
if (iter != m_dropdownMenus.end()) {
event.Skip(false);
wxPoint pt = event.GetItemRect().GetBottomLeft();
pt.y++;
toolbar->PopupMenu(iter->second, pt);
}
}
}
}
}
示例5: OnToolDropDown
void wxGISApplication::OnToolDropDown(wxAuiToolBarEvent& event)
{
if(event.IsDropDownClicked())
{
wxGISCommand* pCmd = GetCommand(event.GetToolId());
m_pDropDownCommand = dynamic_cast<IDropDownCommand*>(pCmd);
if(m_pDropDownCommand)
{
wxMenu* pMenu = m_pDropDownCommand->GetDropDownMenu();
if(pMenu)
{
PushEventHandler(pMenu);
PopupMenu(pMenu, event.GetItemRect().GetBottomLeft());
PopEventHandler();
delete pMenu;
return;
}
}
}
event.Skip();
}
示例6: OnTBUnRedo
void CommandProcessorBase::OnTBUnRedo(wxAuiToolBarEvent& event)
{
wxPoint pt = event.GetItemRect().GetBottomLeft();
pt.y++;
PopulateUnRedoMenu(wxTheApp->GetTopWindow(), pt, event.GetId() == wxID_UNDO);
}