• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxAuiToolBarEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中wxAuiToolBarEvent的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiToolBarEvent类的具体用法?C++ wxAuiToolBarEvent怎么用?C++ wxAuiToolBarEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wxAuiToolBarEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OnFileOpenDropDown

void HtMainFrame::OnFileOpenDropDown (wxAuiToolBarEvent &event)
{
   if (event.IsDropDownClicked())
   {
      wxAuiToolBar *tb = static_cast<wxAuiToolBar *>(event.GetEventObject());
      tb->SetToolSticky(event.GetId(), true);

      wxMenu menuPopup;
      history.AddFilesToMenu(&menuPopup);

      // event handler to deal with the menu items
      const int start = history.GetBaseId();
      const int end = history.GetBaseId() + history.GetMaxFiles();

      Connect(start, end, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(HtMainFrame::OnRecentFilesSelected));

      // line up our menu with the button
      wxRect rect = tb->GetToolRect(event.GetId());
      wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
      pt = ScreenToClient(pt);

      PopupMenu(&menuPopup, pt);

      // make sure the button is "un-stuck"
      tb->SetToolSticky(event.GetId(), false);
   }
   else
   {
      wxCommandEvent dummy;
      OnFileOpen(dummy);
   }
}
开发者ID:rjricken,项目名称:hexterminator,代码行数:32,代码来源:ht_mainframe.cpp


示例2: OnSetupRemoteUpload

void PHPWorkspaceView::OnSetupRemoteUpload(wxAuiToolBarEvent& event)
{

    if ( !event.IsDropDownClicked() ) {
        CallAfter( &PHPWorkspaceView::DoOpenSSHAccountManager );


    } else {
        SSHWorkspaceSettings settings;
        settings.Load();

        wxMenu menu;
        if ( !settings.IsRemoteUploadSet() ) {
            // We never setup remote upload for this workspace
            menu.AppendCheckItem(ID_TOGGLE_AUTOMATIC_UPLOAD, _("Enable automatic upload"));
            menu.Enable(ID_TOGGLE_AUTOMATIC_UPLOAD, false);
            menu.Check(ID_TOGGLE_AUTOMATIC_UPLOAD, false);

        } else {
            menu.AppendCheckItem(ID_TOGGLE_AUTOMATIC_UPLOAD, _("Enable automatic upload"));
            menu.Check(ID_TOGGLE_AUTOMATIC_UPLOAD, settings.IsRemoteUploadEnabled());
            menu.Connect(ID_TOGGLE_AUTOMATIC_UPLOAD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PHPWorkspaceView::OnToggleAutoUpload), NULL, this);
        }

        wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(event.GetEventObject());
        if ( auibar ) {
            clAuiToolStickness ts(auibar, event.GetToolId());
            wxRect rect = auibar->GetToolRect(event.GetId());
            wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
            pt = ScreenToClient(pt);
            PopupMenu(&menu, pt);
        }
    }
}
开发者ID:gahr,项目名称:codelite,代码行数:34,代码来源:php_workspace_view.cpp


示例3: OnHistoryToolClicked

void SQLCommandPanel::OnHistoryToolClicked(wxAuiToolBarEvent& event)
{
    wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(event.GetEventObject());
    if ( auibar ) {
        clAuiToolStickness ts(auibar, event.GetToolId());
        wxRect rect = auibar->GetToolRect(event.GetId());
        wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
        pt = ScreenToClient(pt);
        
        DbExplorerSettings settings;
        clConfig conf(DBE_CONFIG_FILE);
        conf.ReadItem(&settings);
        settings.GetRecentFiles();
        
        wxArrayString sqls = settings.GetSqlHistory();
        wxMenu menu;
        for(size_t i=0; i<sqls.GetCount(); ++i) {
            menu.Append(wxID_HIGHEST+i, sqls.Item(i));
        }
        
        int pos = GetPopupMenuSelectionFromUser(menu, pt);
        if ( pos == wxID_NONE )
            return;
        
        size_t index = pos - wxID_HIGHEST;
        if ( index > sqls.GetCount() )
            return;
        
        m_scintillaSQL->SetText( sqls.Item(index) );
        CallAfter( &SQLCommandPanel::ExecuteSql );
    }
}
开发者ID:HTshandou,项目名称:codelite,代码行数:32,代码来源:SqlCommandPanel.cpp


示例4: 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


示例5: 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


示例6: OnGizmosAUI

void WizardsPlugin::OnGizmosAUI(wxAuiToolBarEvent& e)
{
    if (e.IsDropDownClicked()) {
        wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(e.GetEventObject());
        tb->SetToolSticky(e.GetId(), true);

        // line up our menu with the button
        wxRect rect = tb->GetToolRect(e.GetId());
        wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
        pt = m_mgr->GetTheApp()->GetTopWindow()->ScreenToClient(pt);

        DoPopupButtonMenu(pt);
        tb->SetToolSticky(e.GetId(), false);
    }
}
开发者ID:HTshandou,项目名称:codelite,代码行数:15,代码来源:gizmos.cpp


示例7: OnDropDownToolbarYUV

void MainFrame::OnDropDownToolbarYUV(wxAuiToolBarEvent& event)
{
    wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(event.GetEventObject());
    tb->SetToolSticky(event.GetId(), true);
    wxMenu menuPopup;
    menuPopup.AppendRadioItem(ID_Switch_YUV, _T("YUV"), _T("Show YUV"));
    menuPopup.AppendRadioItem(ID_Switch_Y, _T("Y"), _T("Show Y component"));
    menuPopup.AppendRadioItem(ID_Switch_U, _T("U"), _T("Show U component"));
    menuPopup.AppendRadioItem(ID_Switch_V, _T("V"), _T("Show V component"));
    menuPopup.Check(ID_Switch_YUV + (int)m_eYUVComponentChoose, true);
    wxRect rect = tb->GetToolRect(event.GetId());
    wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
    pt = ScreenToClient(pt);
    PopupMenu(&menuPopup, pt);
    tb->SetToolSticky(event.GetId(), false);
}
开发者ID:AaronLiChen,项目名称:HEVCAnalyzer,代码行数:16,代码来源:MainFrame.cpp


示例8: OnOpenTerminal

void SFTPTreeView::OnOpenTerminal(wxAuiToolBarEvent& event)
{
    // Open terminal to the selected account
    if(event.IsDropDownClicked()) {
        SFTPTreeViewBase::ShowAuiToolMenu(event);

    } else {
        SFTPSettings settings;
        settings.Load();

        wxString accountName = m_choiceAccount->GetStringSelection();
        if(accountName.IsEmpty()) {
            ::wxMessageBox(_("Please select an account to connect to"), "CodeLite", wxICON_ERROR | wxOK);
            return;
        }

        SSHAccountInfo account;
        if(!settings.GetAccount(accountName, account)) {
            ::wxMessageBox(wxString() << _("Could not find account: ") << accountName, "CodeLite", wxICON_ERROR | wxOK);
            return;
        }

        wxString connectString;
        connectString << account.GetUsername() << "@" << account.GetHost();

        const wxString& sshClient = settings.GetSshClient();
        FileUtils::OpenSSHTerminal(sshClient, connectString, account.GetPassword(), account.GetPort());
    }
}
开发者ID:Jactry,项目名称:codelite,代码行数:29,代码来源:SFTPTreeView.cpp


示例9: DoOnDropdown

void GitConsole::DoOnDropdown(wxAuiToolBarEvent& e, const wxString& commandName, int id)
{

    if(!e.IsDropDownClicked()) {
        e.Skip();
        return;
    }

    GitEntry data;
    {
        clConfig conf("git.conf");
        conf.ReadItem(&data);
    } // Force conf out of scope, else its dtor clobbers the GitConsole::OnDropDownMenuEvent Save()
    GitCommandsEntries& ce = data.GetGitCommandsEntries(commandName);
    vGitLabelCommands_t entries = ce.GetCommands();
    int lastUsed = ce.GetLastUsedCommandIndex();

    wxArrayString arr;
    wxMenu menu;
    for(size_t n = 0; n < entries.size(); ++n) {
        wxMenuItem* item = menu.AppendRadioItem(n, entries.at(n).label);
        item->Check(n == (size_t)lastUsed);
        arr.Add(entries.at(n).command);
    }
    menu.Bind(wxEVT_COMMAND_MENU_SELECTED,
              wxCommandEventHandler(GitConsole::OnDropDownMenuEvent),
              this,
              0,
              arr.GetCount(),
              new GitCommandData(arr, commandName, id));

    wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(e.GetEventObject());
    if(auibar) {
        clAuiToolStickness ts(auibar, e.GetToolId());
        wxRect rect = auibar->GetToolRect(e.GetId());
        wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
        pt = ScreenToClient(pt);
        PopupMenu(&menu, pt);
    }
    menu.Unbind(wxEVT_COMMAND_MENU_SELECTED,
                wxCommandEventHandler(GitConsole::OnDropDownMenuEvent),
                this,
                0,
                arr.GetCount(),
                new GitCommandData(arr, commandName, id));
}
开发者ID:massimiliano76,项目名称:codelite,代码行数:46,代码来源:GitConsole.cpp


示例10: OnTemplatesBtnClick

void SQLCommandPanel::OnTemplatesBtnClick(wxAuiToolBarEvent& event)
{
    wxMenu menu;
    menu.Append(XRCID("IDR_SQLCOMMAND_SELECT"),_("Insert SELECT SQL template"),_("Insert SELECT SQL statement template into editor."));
    menu.Append(XRCID("IDR_SQLCOMMAND_INSERT"),_("Insert INSERT SQL template"),_("Insert INSERT SQL statement template into editor."));
    menu.Append(XRCID("IDR_SQLCOMMAND_UPDATE"),_("Insert UPDATE SQL template"),_("Insert UPDATE SQL statement template into editor."));
    menu.Append(XRCID("IDR_SQLCOMMAND_DELETE"),_("Insert DELETE SQL template"),_("Insert DELETE SQL statement template into editor."));
    menu.Connect(wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&SQLCommandPanel::OnPopupClick, NULL, this);

    wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(event.GetEventObject());
    if ( auibar ) {
        clAuiToolStickness ts(auibar, event.GetToolId());
        wxRect rect = auibar->GetToolRect(event.GetId());
        wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
        pt = ScreenToClient(pt);
        PopupMenu(&menu, pt);
    }
}
开发者ID:HTshandou,项目名称:codelite,代码行数:18,代码来源:SqlCommandPanel.cpp


示例11: 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


示例12: OnEditUndoDropDown

void HtMainFrame::OnEditUndoDropDown (wxAuiToolBarEvent &event)
{
   if (event.IsDropDownClicked())
   {
      wxAuiToolBar *tb = static_cast<wxAuiToolBar *>(event.GetEventObject());
      tb->SetToolSticky(event.GetId(), true);

      wxMenu menuPopup;
      menuPopup.Append(wxID_ANY, wxT("Not implemented"));

      // line up our menu with the button
      wxRect rect = tb->GetToolRect(event.GetId());
      wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
      pt = ScreenToClient(pt);

      PopupMenu(&menuPopup, pt);

      // make sure the button is "un-stuck"
      tb->SetToolSticky(event.GetId(), false);
   }
}
开发者ID:rjricken,项目名称:hexterminator,代码行数:21,代码来源:ht_mainframe.cpp


示例13: wxDynamicCast

void wxAuiToolBarXmlHandler::MenuHandler::OnDropDown(wxAuiToolBarEvent& event)
{
    if (event.IsDropDownClicked())
    {
        wxAuiToolBar *toobar = wxDynamicCast(event.GetEventObject(), wxAuiToolBar);
        if (toobar != NULL)
        {
            wxAuiToolBarItem *item = toobar->FindTool(event.GetId());
            if (item != NULL)
            {
                wxMenu * const menu = m_menus[item->GetUserData()];
                if (menu != NULL)
                {
                    wxRect rect = item->GetSizerItem()->GetRect();
                    toobar->PopupMenu(menu, rect.GetRight() - toobar->FromDIP(10), rect.GetBottom());
                }
            }
        }
    }
    else
    {
        event.Skip();
    }
}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:24,代码来源:xh_auitoolb.cpp


示例14: 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


示例15: OnOpenTerminal

void SFTPTreeView::OnOpenTerminal(wxAuiToolBarEvent& event)
{
    // Open terminal to the selected account
    if(event.IsDropDownClicked()) {
        SFTPTreeViewBase::ShowAuiToolMenu(event);

    } else {
        SSHAccountInfo account;
        if(!GetAccountFromUser(account)) { return; }

        wxString connectString;
        connectString << account.GetUsername() << "@" << account.GetHost();

        SFTPSettings settings;
        settings.Load();

        const wxString& sshClient = settings.GetSshClient();
        FileUtils::OpenSSHTerminal(sshClient, connectString, account.GetPassword(), account.GetPort());
    }
}
开发者ID:lpc1996,项目名称:codelite,代码行数:20,代码来源:SFTPTreeView.cpp


示例16: OnDropDownToolbarItem

void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
{
	event.Skip();
	ClearStatusBar();

	if (event.IsDropDownClicked())
	{
		wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(event.GetEventObject());
		tb->SetToolSticky(event.GetId(), true);

		// create the popup menu
		wxMenu* menuPopup = new wxMenu;
		wxMenuItem* Item = new wxMenuItem(menuPopup, IDM_ADD_PERSPECTIVE,
				_("Create new perspective"));
		menuPopup->Append(Item);

		if (Perspectives.size() > 0)
		{
			menuPopup->Append(new wxMenuItem(menuPopup));
			for (u32 i = 0; i < Perspectives.size(); i++)
			{
				wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i,
						StrToWxStr(Perspectives[i].Name),
						wxT(""), wxITEM_CHECK);

				menuPopup->Append(mItem);

				if (i == ActivePerspective)
				{
					mItem->Check(true);
				}
			}
		}

		// line up our menu with the button
		wxRect rect = tb->GetToolRect(event.GetId());
		wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
		pt = ScreenToClient(pt);

		// show
		PopupMenu(menuPopup, pt);

		// make sure the button is "un-stuck"
		tb->SetToolSticky(event.GetId(), false);
	}
}
开发者ID:hjarmstrong,项目名称:dolphin,代码行数:46,代码来源:FrameAui.cpp


示例17: 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


示例18: OnDropDownSettingsToolbar

// Toolbar
void CFrame::OnDropDownSettingsToolbar(wxAuiToolBarEvent& event)
{
	event.Skip();
	ClearStatusBar();

	if (event.IsDropDownClicked())
	{
		wxAuiToolBar* Tb = static_cast<wxAuiToolBar*>(event.GetEventObject());
		Tb->SetToolSticky(event.GetId(), true);

		// Create the popup menu
		wxMenu* menuPopup = new wxMenu;

		wxMenuItem* Item =  new wxMenuItem(menuPopup, IDM_PERSPECTIVES_ADD_PANE,
				_("Add new pane"));
		menuPopup->Append(Item);
		menuPopup->Append(new wxMenuItem(menuPopup));
		Item = new wxMenuItem(menuPopup, IDM_TAB_SPLIT, _("Tab split"),
				wxT(""), wxITEM_CHECK);
		menuPopup->Append(Item);
		Item->Check(m_bTabSplit);
		Item = new wxMenuItem(menuPopup, IDM_NO_DOCKING, _("No docking"),
				wxT(""), wxITEM_CHECK);
		menuPopup->Append(Item);
		Item->Check(m_bNoDocking);

		// Line up our menu with the button
		wxRect rect = Tb->GetToolRect(event.GetId());
		wxPoint Pt = Tb->ClientToScreen(rect.GetBottomLeft());
		Pt = ScreenToClient(Pt);

		// Show
		PopupMenu(menuPopup, Pt);

		// Make the button un-stuck again
		if (!m_bEdit)
		{
			Tb->SetToolSticky(event.GetId(), false);
		}
	}
}
开发者ID:hjarmstrong,项目名称:dolphin,代码行数:42,代码来源:FrameAui.cpp


示例19: OnAuiRightDown

void wxGISApplication::OnAuiRightDown(wxAuiToolBarEvent& event)
{
	event.Skip();
	ShowToolBarMenu();
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:5,代码来源:application.cpp


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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxBitmap类代码示例发布时间:2022-05-31
下一篇:
C++ wxAuiPaneInfo类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap