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

C++ wxContextMenuEvent类代码示例

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

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



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

示例1: ScreenToClient

void wxWebView::OnContextMenuEvents(wxContextMenuEvent& event)
{
    m_impl->page->contextMenuController()->clearContextMenu();
    wxPoint localEventPoint = ScreenToClient(event.GetPosition());

    if (!m_mainFrame)
        return;
        
    WebCore::Frame* focusedFrame = m_mainFrame->GetFrame();
    if (!focusedFrame->view())
        return;

    //Create WebCore mouse event from the wxContextMenuEvent
    wxMouseEvent mouseEvent(wxEVT_RIGHT_DOWN);
    mouseEvent.m_x = localEventPoint.x;
    mouseEvent.m_y = localEventPoint.y;
    WebCore::PlatformMouseEvent wkEvent(mouseEvent, event.GetPosition());

    bool handledEvent = focusedFrame->eventHandler()->sendContextMenuEvent(wkEvent);
    if (!handledEvent)
        return;

    WebCore::ContextMenu* coreMenu = m_impl->page->contextMenuController()->contextMenu();
    if (!coreMenu)
        return;

    WebCore::PlatformMenuDescription menuWx = coreMenu->platformDescription();
    if (!menuWx)
        return;

    PopupMenu(menuWx, localEventPoint);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:32,代码来源:WebView.cpp


示例2: OnContextMenu

void MyListCtrl::OnContextMenu(wxContextMenuEvent& event)
{
    if (GetEditControl() == NULL)
    {
        wxPoint point = event.GetPosition();
        // If from keyboard
        if ( (point.x == -1) && (point.y == -1) )
        {
            wxSize size = GetSize();
            point.x = size.x / 2;
            point.y = size.y / 2;
        }
        else
        {
            point = ScreenToClient(point);
        }
        ShowContextMenu(point);
    }
    else
    {
        // the user is editing:
        // allow the text control to display its context menu
        // if it has one (it has on Windows) rather than display our one
        event.Skip();
    }
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:26,代码来源:listtest.cpp


示例3: OnContextMenu

void unFilterListCtrl::OnContextMenu( wxContextMenuEvent& event )
{
	wxPoint pt = event.GetPosition();
	//wxLogMessage(wxT("OnContextMenu at screen coords (%i, %i)"), pt.x, pt.y);

	if( pt.x == -1 && pt.y == -1 ) 
	{
		pt = wxWindow::FindFocus()->GetPosition();
	}
	else 
	{
        pt = ScreenToClient(pt);
        if( pt.y > List->GetPosition().y )
        {
            event.Skip();
            return;
        }
	}


	wxMenu menu(wxT("RegExp Options"));
	menu.AppendRadioItem(Menu_SyntaxExtended, wxT("&Extended Syntax"));
	menu.AppendRadioItem(Menu_SyntaxAdvanced, wxT("&Advanced Syntax"));
	menu.AppendRadioItem(Menu_SyntaxBasic, wxT("&Basic Syntax"));
	menu.AppendSeparator();
	menu.AppendCheckItem(Menu_CaseSensitive, wxT("Ignore &Case"));
	menu.AppendCheckItem(Menu_BackReferences, wxT("Don't set Back &References"));

	menu.Check( Menu_SyntaxExtended + unFilterListCtrl::reSyntax, true );
	menu.Check( Menu_CaseSensitive, !unFilterListCtrl::reCaseSensitive );
	menu.Check( Menu_BackReferences, !unFilterListCtrl::reBackReferences );

	PopupMenu(&menu, pt);

}
开发者ID:roman-dzieciol,项目名称:unrilities-v02,代码行数:35,代码来源:unFilterList.cpp


示例4: OnContextMenu

void cbStyledTextCtrl::OnContextMenu(wxContextMenuEvent& event)
{
    if (m_pParent)
    {
        if ( EditorBase* pParent = dynamic_cast<EditorBase*>(m_pParent) )
        {
            const bool is_right_click = event.GetPosition() != wxDefaultPosition;
            const wxPoint mp(is_right_click ? event.GetPosition() : wxDefaultPosition);
            pParent->DisplayContextMenu(mp, mtEditorManager);
        }
        else
            event.Skip();
    }
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:14,代码来源:cbstyledtextctrl.cpp


示例5: OnContextMenu

void pvExports::OnContextMenu( wxContextMenuEvent& event )
{
    wxPoint pt = event.GetPosition();
    if( pt.x == -1 && pt.y == -1 ) 
    {
        pt = wxWindow::FindFocus()->GetPosition();
    }
    else 
    {
        pt = ScreenToClient(pt);
    }

    long item = GetList()->GetFocusedItem();
    if( item != -1 )
    {
        wxString caption;
        caption = Serializer->GetObjectName( GetTable()->GetSerialIdx(item)+1 );

        wxMenu menu(caption);
        menu.Append(Menu_InspectObject, wxT("&Inspect Object"));
        menu.Append(Menu_InspectAll, wxT("Inspect &All (Debug)"));
        //menu.AppendSeparator();

        PopupMenu(&menu, pt);
    }
         


}
开发者ID:roman-dzieciol,项目名称:unrilities-v02,代码行数:29,代码来源:pvExports.cpp


示例6: OnContextMenu

void LitesqlView::OnContextMenu(wxContextMenuEvent& event)
{
  if (frame)
  {
    frame->PopupMenu(GetContextMenu(),frame->ScreenToClient(event.GetPosition()));
  }
}
开发者ID:aclysma,项目名称:Helium,代码行数:7,代码来源:LitesqlView.cpp


示例7: OnContextMenu

void MyTreeCtrl::OnContextMenu(wxContextMenuEvent& event)
{
    wxPoint pt = event.GetPosition();
    wxTreeItemId item;
    if ( !HasFlag(wxTR_MULTIPLE) )
        item = GetSelection();
    wxLogMessage(wxT("OnContextMenu at screen coords (%i, %i)"), pt.x, pt.y);

    // check if event was generated by keyboard (MSW-specific?)
    if ( pt.x == -1 && pt.y == -1 ) //(this is how MSW indicates it)
    {
        // attempt to guess where to show the menu
        if ( item.IsOk() )
        {
            // if an item was clicked, show menu to the right of it
            wxRect rect;
            GetBoundingRect(item, rect, true /* only the label */);
            pt = wxPoint(rect.GetRight(), rect.GetTop());
        }
        else
        {
            pt = wxPoint(0, 0);
        }
    }
    else // event was generated by mouse, use supplied coords
    {
        pt = ScreenToClient(pt);
    }

    ShowMenu(item, pt);
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:31,代码来源:treetest.cpp


示例8: OnContextMenu

/**< context menu */
void ImagePanel::OnContextMenu(wxContextMenuEvent& event)
{
	if (m_stMP.iState != 0)
		return;

	wxMenu* pMenu = new wxMenu();
	wxASSERT_MSG(pMenu != nullptr, _T("Create Popup Menu failed."));
	wxMenuItem* pMenuItem = nullptr;
	// group 1
	if (m_img.IsOk())
	{
		pMenuItem = new wxMenuItem(pMenu, ID_CMENU_SAVE, _("&Save Image"), _("Save the Image"));
		pMenu->Append(pMenuItem);
	}
	// popup
	if (pMenuItem != nullptr)
	{
		wxPoint pt = event.GetPosition();
		if (pt == wxDefaultPosition)
		{
			// position invalide, get the mouse position
			pt = wxGetMousePosition();
			wxRect rc = GetScreenRect();
			if (!rc.Contains(pt))
			{
				// mouse is't in the panel, get the panel center
				pt.x = rc.x + rc.width/2;
				pt.y = rc.y + rc.height/2;
			}
		}
		pt = ScreenToClient(pt);
		PopupMenu(pMenu, pt);
	}
	delete pMenu;
}
开发者ID:gxcast,项目名称:GEIM,代码行数:36,代码来源:ImagePanel.cpp


示例9: OnContextMenu

void pvExports::OnContextMenu( wxContextMenuEvent& event )
{
    guard;
    wxPoint pt = event.GetPosition();
    if( pt.x == -1 && pt.y == -1 ) 
    {
        pt = wxWindow::FindFocus()->GetPosition();
    }
    else 
    {
        pt = ScreenToClient(pt);
    }

    long item = GetList()->GetFocusedItem();
    if( item != -1 )
    {
        wxString caption;
        caption = Serializer->GetObjectName( GetTable()->GetSerialIdx(item)+1 );

        wxMenu* menu = unMenuExports::Create();
        menu->SetTitle(caption);
        PopupMenu(menu, pt);
    }
         


    unguard;
}
开发者ID:roman-dzieciol,项目名称:wxUnrilities_XML,代码行数:28,代码来源:pvExports.cpp


示例10: OnUserContext

void Frame::OnUserContext(wxContextMenuEvent& event)
{
	wxMenu* menu = new wxMenu;
	menu->Append(ID_DROP_USER, wxT("Drop User"));
	userListCtrl->PopupMenu(menu, userListCtrl->ScreenToClient(
		event.GetPosition()));
}
开发者ID:jkuziel,项目名称:SmokeSignal,代码行数:7,代码来源:Frame.cpp


示例11: OnContextMenu

void wxTextCtrl::OnContextMenu(wxContextMenuEvent& event)
{
    if ( GetTextPeer()->HasOwnContextMenu() )
    {
        event.Skip() ;
        return ;
    }

#if wxUSE_MENUS
    if (m_privateContextMenu == NULL)
    {
        m_privateContextMenu = new wxMenu;
        m_privateContextMenu->Append(wxID_UNDO, _("&Undo"));
        m_privateContextMenu->Append(wxID_REDO, _("&Redo"));
        m_privateContextMenu->AppendSeparator();
        m_privateContextMenu->Append(wxID_CUT, _("Cu&t"));
        m_privateContextMenu->Append(wxID_COPY, _("&Copy"));
        m_privateContextMenu->Append(wxID_PASTE, _("&Paste"));
        m_privateContextMenu->Append(wxID_CLEAR, _("&Delete"));
        m_privateContextMenu->AppendSeparator();
        m_privateContextMenu->Append(wxID_SELECTALL, _("Select &All"));
    }

    PopupMenu(m_privateContextMenu);
#endif
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:26,代码来源:textctrl_osx.cpp


示例12: onContextMenu

void MerryMainPanel::onContextMenu(wxContextMenuEvent& e)
{
	e.StopPropagation();

	PopupMenu(menu);
    return;
}
开发者ID:EnumaxElish,项目名称:ALMRun,代码行数:7,代码来源:MerryMainPanel.cpp


示例13: file_ctrlOnContextMenu

void MainWindow::file_ctrlOnContextMenu( wxContextMenuEvent& event )
{
	wxPoint point = event.GetPosition();

	if ( (point.x == -1) && (point.y == -1) )
    {
        wxSize size = GetSize();
        point.x = size.x / 2;
        point.y = size.y / 2;
    }
    else
    {
        point = ScreenToClient(point);
    }

	wxMenu menu(wxEmptyString);

	long item = file_ctrl->GetNextItem(-1,wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED);
	if (item!=-1) menu.Append(FDBex_ExtractFocusFile, wxString::Format(_("Extract '%s' to..."), file_ctrl->GetItemText(item)));
	if (file_ctrl->GetSelectedItemCount()>1)  menu.Append(FDBex_ExtractFiles, _("Extract files to..."));
    menu.Append(FDBex_ExtractFolder, _("Extract folder to..."));

	menu.AppendSeparator();
	menu.Append(FDBex_CopyPath, _("Copy pathname"));

    PopupMenu(&menu, point);
}
开发者ID:nybegblya,项目名称:FDB_Extractor2,代码行数:27,代码来源:MainWindow.cpp


示例14: OnContextMenu

void BaseGrid::OnContextMenu(wxContextMenuEvent &evt) {
	wxPoint pos = evt.GetPosition();
	if (pos == wxDefaultPosition || ScreenToClient(pos).y > lineHeight) {
		if (!context_menu) context_menu = menu::GetMenu("grid_context", context);
		menu::OpenPopupMenu(context_menu, this);
	}
	else {
		const wxString strings[] = {
			_("Line Number"),
			_("Layer"),
			_("Start"),
			_("End"),
			_("Style"),
			_("Actor"),
			_("Effect"),
			_("Left"),
			_("Right"),
			_("Vert"),
		};

		wxMenu menu;
		for (int i = 0; i < columns; ++i)
			menu.Append(MENU_SHOW_COL + i, strings[i], "", wxITEM_CHECK)->Check(showCol[i]);
		PopupMenu(&menu);
	}
}
开发者ID:sthenc,项目名称:Aegisub,代码行数:26,代码来源:base_grid.cpp


示例15: OnRightClick

void MusikFXDialog::OnRightClick( wxContextMenuEvent& event )
{
	if ( event.GetId() == SLD_PITCH )
	{
		slPitch->SetValue( 50 );
		g_FX.SetFrequency( 44100 );
	}
}
开发者ID:BackupTheBerlios,项目名称:musik-svn,代码行数:8,代码来源:MusikFXFrame.cpp


示例16: EventHandleContextMenu

void MainWindow::EventHandleContextMenu(wxContextMenuEvent &event)
{
	wxMenu menu(wxT(""));
	
	menu.Append(ID_CONTEXTSETTINGS, wxT("Einstellungen"));
	menu.Append(ID_CONTEXTCLOSE, wxT("Beenden"));
	
	PopupMenu(&menu, ScreenToClient(event.GetPosition()));
}
开发者ID:jmenzel,项目名称:artikelverwaltung,代码行数:9,代码来源:mainwindow.cpp


示例17: OnContextMenu

//------------------------------------------------------------------------
// 
//------------------------------------------------------------------------
void CPropertyWindow::OnContextMenu(wxContextMenuEvent& event)
{
	wxPoint point = event.GetPosition();
	point = ScreenToClient(point);
	wxMenu menu;
	menu.Append(MENU_OPEN_PROPERTY, wxT("&Open Property"));
	menu.Append(MENU_OPEN_GRAPH, wxT("&Open Graph"));
	PopupMenu(&menu, point);
}
开发者ID:butilities,项目名称:3D-Lecture-2,代码行数:12,代码来源:PropertyWindow.cpp


示例18: OnOpenContextMenu

void LstOdaServerList::OnOpenContextMenu(wxContextMenuEvent& event)
{
    wxPoint MousePosition = event.GetPosition();

    if (MousePosition == wxDefaultPosition)
        MousePosition = wxGetMousePosition();

    PopupMenu(m_mnuPopup, ScreenToClient(MousePosition));
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:9,代码来源:lst_servers.cpp


示例19: OnContextMenu

void ModelListTree::OnContextMenu(wxContextMenuEvent& event)
{
	wxPoint pt = event.GetPosition();
	wxPoint clientPt = ScreenToClient(pt);

	wxMenu menu;  
	menu.Append(ID_MODEL_PANEL_CONTEXT_MENU_IMPORT, wxT("&import"));

	PopupMenu(&menu, clientPt);
}
开发者ID:SinYocto,项目名称:Zee,代码行数:10,代码来源:ModelPanel.cpp


示例20: OnMenu

void Notebook::OnMenu(wxContextMenuEvent& e)
{
    int where = HitTest( ScreenToClient(::wxGetMousePosition()) );
    if(where != wxNOT_FOUND && m_contextMenu) {
        SetSelection(where, false);
        // dont notify the user about changes
        PopupMenu(m_contextMenu);
    }
    e.Skip();
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:10,代码来源:gtk_notebook_ex.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ wxCursor类代码示例发布时间:2022-05-31
下一篇:
C++ wxConfigBase类代码示例发布时间: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