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


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

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


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

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

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

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

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

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

示例7: OnAuiRightDown

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


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