当前位置: 首页>>代码示例>>C++>>正文


C++ wxAuiToolBarEvent::GetItemRect方法代码示例

本文整理汇总了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);
    }
}
开发者ID:kluete,项目名称:codelite,代码行数:27,代码来源:findresultstab.cpp

示例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);
}
开发者ID:292388900,项目名称:codelite,代码行数:8,代码来源:unredobase.cpp

示例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"));
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:16,代码来源:DbViewerPanel.cpp

示例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);
                }
            }
        }
    }
}
开发者ID:292388900,项目名称:codelite,代码行数:19,代码来源:wxcrafter_plugin.cpp

示例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();
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:21,代码来源:application.cpp

示例6: OnTBUnRedo

void CommandProcessorBase::OnTBUnRedo(wxAuiToolBarEvent& event)
{
    wxPoint pt = event.GetItemRect().GetBottomLeft();
    pt.y++;
    PopulateUnRedoMenu(wxTheApp->GetTopWindow(), pt, event.GetId() == wxID_UNDO);
}
开发者ID:blitz-research,项目名称:codelite,代码行数:6,代码来源:unredobase.cpp


注:本文中的wxAuiToolBarEvent::GetItemRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。