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


C++ wxListEvent::GetPoint方法代码示例

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


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

示例1: OnRClick

void CUnitPane::OnRClick(wxListEvent& event)
{
    wxMenu       menu;
    long         idx   = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
    CUnit      * pUnit = GetUnit(idx);
    int          x=0,y;

    int          width, height;

    int nItems = GetSelectedItemCount();


    wxDisplaySize(&width, &height);
    y = event.GetPoint().y;
    ClientToScreen(&x, &y);
    if (height-y < 150)
        y = height-150;
    ScreenToClient(&x, &y);

    if (nItems>1)
    {
        // multiple units
        menu.Append(menu_Popup_IssueOrders     , wxT("Issue orders"));
        menu.Append(menu_Popup_UnitFlags       , wxT("Set custom flags")    );
        menu.Append(menu_Popup_AddToTracking   , wxT("Add to a tracking group"));

        PopupMenu( &menu, event.GetPoint().x, y);
    }
    else
        if (pUnit)
        {
            // single unit
            if (pUnit->IsOurs)
            {
                menu.Append(menu_Popup_ShareSilv     , wxT("Share SILV")        );
                menu.Append(menu_Popup_Teach         , wxT("Teach")             );
                menu.Append(menu_Popup_Split         , wxT("Split")             );
                menu.Append(menu_Popup_DiscardJunk   , wxT("Discard junk items"));
                menu.Append(menu_Popup_GiveEverything, wxT("Give everything")   );
                menu.Append(menu_Popup_DetectSpies   , wxT("Detect spies")      );
            }

            menu.Append(menu_Popup_UnitFlags       , wxT("Set custom flags")    );
            menu.Append(menu_Popup_AddToTracking   , wxT("Add to a tracking group"));


            PopupMenu( &menu, event.GetPoint().x, y);
        }
}
开发者ID:ennorehling,项目名称:alh,代码行数:49,代码来源:unitpane.cpp

示例2: parameter

/* FIXME I'm confused here with the wx event system
   The example is the context menu below. It has to invoke several functions
   and esspecially tui::TopedFrame::OnDefineLayer(). This function needs a
   parameter (currently selected layer) and I'm trying to send it via
   wxCommandEvent. Unfortunately it doesn't work with the event definitions
   I've tried. In the same time the function can be invoked via the menu, but
   then the parameter can't be passed. Another possibility is to put the
   contents of the tui::TopedFrame::OnDefineLayer() in a function here, in
   this class. The problem with this is that it invokes a dialog box
   tui::defineLayer, which needs a parent frame as a parameter. The parent
   frame must be the TopedFrame - as a top frame in the hierarchy. It's not
   easy to get that pointer from here. The only solution at the moment is a
   bit convoluted and I'm not quite happy with it. The context menu invokes
   tui::TopedFrame::OnDefineLayer() - without a parameter, which in turn calls
   (indirectly) browsers::layerbrowser::getFirstSelected() to get that parameter
   and finaly ivokes tui::defineLayer.
   Quite similar is the situation with tui::TopedFrame::OnCellRef_B and
   tui::TopedFrame::OnCellARef_B (could be others) which are invoked via the
   context menu in browsers::CellBrowser::ShowMenu() above
*/
void browsers::layerbrowser::OnItemRightClick(wxListEvent& event)
{
   wxMenu menu;
   bool multi_selection = _layerlist->GetSelectedItemCount() > 1;
   wxString plural = (multi_selection) ? wxT("s") : wxT("");
   wxString mline1;
   mline1 << wxT("Hide Layer") << plural;
   menu.Append( LAYERHIDESELECTED, mline1);

   wxString mline2;
   mline2 << wxT("Show Layer") << plural;
   menu.Append(LAYERSHOWSELECTED, mline2);
   
   wxString mline3;
   mline3 << wxT("Lock Layer") << plural;
   menu.Append( LAYERLOCKSELECTED, mline3);
   
   wxString mline4;
   mline4 << wxT("Unlock Layer") << plural;
   menu.Append( LAYERUNLOCKSELECTED, mline4);
   if (!multi_selection)
   {
      menu.AppendSeparator();
      menu.Append(tui::TMSET_DEFLAY, wxT("Edit layer"));
      menu.Append(LAYERCURRENTSELECTED ,wxT("Make Current"));
   }
   PopupMenu(&menu, event.GetPoint());
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:48,代码来源:browsers.cpp

示例3: OnPropRightClick

void frmMain::OnPropRightClick(wxListEvent &event)
{
	OnPropSelChanged(event);

	if (currentObject)
		doPopup(properties, event.GetPoint(), currentObject);
}
开发者ID:search5,项目名称:pgadmin3,代码行数:7,代码来源:events.cpp

示例4: OnFileRightClick

void UpdateDlg::OnFileRightClick(wxListEvent& event)
{
//    LOGSTREAM << "pt.x=" << event.GetPoint().x << ", pt.y=" << event.GetPoint().y << '\n';
    UpdateRec* rec = GetRecFromListView();
    if (!rec)
        return;

    wxMenu popup;
    popup.Append(idPopupDownloadAndInstall, _("Download && install"));
    popup.AppendSeparator();
    popup.Append(idPopupDownload, _("Download"));
    popup.Append(idPopupInstall, _("Install"));
    popup.AppendSeparator();
    popup.Append(idPopupUninstall, _("Uninstall"));

    bool canDl = !rec->downloaded || rec->version != rec->installed_version;
    bool canInst = rec->downloaded && (!rec->installed || rec->version != rec->installed_version);

    popup.Enable(idPopupDownload, canDl);
    popup.Enable(idPopupInstall, canInst);
    popup.Enable(idPopupDownloadAndInstall, canInst || canDl);
    popup.Enable(idPopupUninstall, rec->installed);

    wxListCtrl* lst = XRCCTRL(*this, "lvFiles", wxListCtrl);
    lst->PopupMenu(&popup, event.GetPoint());
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:26,代码来源:updatedlg.cpp

示例5: OnRightClick

void wxPlaylist::OnRightClick(wxListEvent & event)
{
	if (!m_FileList->GetItemCount()) return;

	wxMenu *popup = new wxMenu();

	if (m_FileList->GetSelectedItemCount()==1) {
		popup->Append(ID_PL_PLAY, wxT("Play"));
		popup->AppendSeparator();
	}
	popup->Append(ID_PL_SEL_REV, wxT("Inverse Selection"));
	if (m_FileList->GetSelectedItemCount()) popup->Append(ID_PL_REM_FILE, wxT("Remove File(s)"));
	if (m_FileList->GetItemCount()>1) {
		popup->AppendSeparator();
		popup->Append(ID_PL_SORT_TITLE, wxT("Sort By Title"));
		popup->Append(ID_PL_SORT_FILE, wxT("Sort By File Name"));
		popup->Append(ID_PL_SORT_DUR, wxT("Sort By Duration"));
		popup->AppendSeparator();
		popup->Append(ID_PL_REVERSE, wxT("Reverse List"));
		popup->Append(ID_PL_RANDOMIZE, wxT("Randomize"));
	}

	PopupMenu(popup, event.GetPoint());
	delete popup;
}
开发者ID:ARSekkat,项目名称:gpac,代码行数:25,代码来源:Playlist.cpp

示例6: OnItemRightClick

//-----------------------------------------------------------------------------
void DeviceListCtrl::OnItemRightClick( wxListEvent& e )
//-----------------------------------------------------------------------------
{
    wxMenu menu( wxT( "" ) );
    menu.Append( LIST_ASSIGN_TEMPORARY_IP, wxT( "&Assign Temporary IPv4 Address" ), wxEmptyString );
    menu.Append( LIST_VIEW_POTENTIAL_PERFORMANCE_ISSUES, wxT( "&View Potential Performance Issues" ), wxEmptyString );
    PopupMenu( &menu, e.GetPoint() );
}
开发者ID:jmaye,项目名称:libmv,代码行数:9,代码来源:DeviceListCtrl.cpp

示例7: OnItemListRightClick

void ItemEditorFrame::OnItemListRightClick( wxListEvent& event )
{
	if ( selectItemIndex < 0 )
		return;

	wxMenu* menu = new wxMenu;
	menu->Append( COM_CHANGE_ITEM_ID , wxT("Change ID") );
	menu->Append( COM_DELETE_ITEM    , wxT("Delete Item") );
	m_ItemListCtrl->PopupMenu( menu , event.GetPoint() );
	event.Skip();
}
开发者ID:uvbs,项目名称:GameProject,代码行数:11,代码来源:ItemEditorFrame.cpp

示例8: OnColumnRClick

void CMuleListCtrl::OnColumnRClick(wxListEvent& evt)
{
	wxMenu menu;
	wxListItem item;
	
	for ( int i = 0; i < GetColumnCount() && i < 15; ++i) {
		GetColumn(i, item);

		menu.AppendCheckItem(i + MP_LISTCOL_1, item.GetText() );
		menu.Check( i + MP_LISTCOL_1, GetColumnWidth(i) > COL_SIZE_MIN );
	}

	PopupMenu(&menu, evt.GetPoint());
}
开发者ID:windreamer,项目名称:amule-dlp,代码行数:14,代码来源:MuleListCtrl.cpp

示例9: OnColRightClick

void MyListCtrl::OnColRightClick(wxListEvent& event)
{
    int col = event.GetColumn();
    if ( col != -1 )
    {
        SetColumnImage(col, -1);
    }

    // Show popupmenu at position
    wxMenu menu(wxT("Test"));
    menu.Append(LIST_ABOUT, _T("&About"));
    PopupMenu(&menu, event.GetPoint());

    wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() );
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:15,代码来源:listtest.cpp

示例10: PopupMenu

void 
PlayerPanel::onRightClicked(wxListEvent& ev)
{
    if (!mOperateMenu)
    {
        return;
    }

    if (!mListResultSet)
    {
        return;
    }

    if ((mListResultSet->GetWindowStyle() & wxLC_REPORT) && mListResultSet->GetSelectedItemCount() == 1)
    {
        wxPoint pt = ev.GetPoint();
        pt.y += mListResultSet->GetPosition().y;
        PopupMenu(mOperateMenu, pt);
    }
}
开发者ID:secondtonone1,项目名称:fingerserver,代码行数:20,代码来源:PlayerPanel.cpp

示例11: RightClick

void GameViewer::RightClick(wxListEvent& event)
{
	for (wxMenuItem *item : m_popup->GetMenuItems()) {
		m_popup->Destroy(item);
	}
	
	wxMenuItem* boot_item = new wxMenuItem(m_popup, 0, _T("Boot"));
#if defined (_WIN32)
	// wxMenuItem::Set(Get)Font only available for the wxMSW port
	wxFont font = GetFont();
	font.SetWeight(wxFONTWEIGHT_BOLD);
	boot_item->SetFont(font);
#endif
	m_popup->Append(boot_item);
	m_popup->Append(1, _T("Configure"));
	m_popup->Append(2, _T("Remove Game"));

	Bind(wxEVT_MENU, &GameViewer::BootGame, this, 0);
	Bind(wxEVT_MENU, &GameViewer::ConfigureGame, this, 1);
	Bind(wxEVT_MENU, &GameViewer::RemoveGame, this, 2);

	PopupMenu(m_popup, event.GetPoint());
}
开发者ID:Aaahh,项目名称:rpcs3,代码行数:23,代码来源:GameViewer.cpp

示例12: ShowPopupMenu

void MainFrame::ShowPopupMenu( wxListEvent& event )
{
    PopupMenu(GetPopupMenu(), event.GetPoint());
}
开发者ID:murusu,项目名称:wxAutoBot,代码行数:4,代码来源:wxAutoBot.cpp

示例13: OnRightClick

void CSharedFilesCtrl::OnRightClick(wxListEvent& event)
{
	long item_hit = CheckSelection(event);

	if ( (m_menu == NULL) && (item_hit != -1)) {
		m_menu = new wxMenu(_("Shared Files"));
		wxMenu* prioMenu = new wxMenu();
		prioMenu->AppendCheckItem(MP_PRIOVERYLOW, _("Very low"));
		prioMenu->AppendCheckItem(MP_PRIOLOW, _("Low"));
		prioMenu->AppendCheckItem(MP_PRIONORMAL, _("Normal"));
		prioMenu->AppendCheckItem(MP_PRIOHIGH, _("High"));
		prioMenu->AppendCheckItem(MP_PRIOVERYHIGH, _("Very High"));
		prioMenu->AppendCheckItem(MP_POWERSHARE, _("Release"));
		prioMenu->AppendCheckItem(MP_PRIOAUTO, _("Auto"));

		m_menu->Append(0,_("Priority"),prioMenu);
		m_menu->AppendSeparator();

		CKnownFile* file = (CKnownFile*)GetItemData(item_hit);
		if (file->GetFileComment().IsEmpty() && !file->GetFileRating()) {
			m_menu->Append(MP_CMT, _("Add Comment/Rating"));
		} else {
			m_menu->Append(MP_CMT, _("Edit Comment/Rating"));
		}
		
		m_menu->AppendSeparator();
		m_menu->Append(MP_RENAME, _("Rename"));
		m_menu->AppendSeparator();

		if (file->GetFileName().GetExt() == wxT("emulecollection")) {
			m_menu->Append( MP_ADDCOLLECTION, _("Add files in collection to transfer list"));
			m_menu->AppendSeparator();
		}
		m_menu->Append(MP_GETMAGNETLINK,_("Copy magnet &URI to clipboard"));
		m_menu->Append(MP_GETED2KLINK,_("Copy eD2k &link to clipboard"));
		m_menu->Append(MP_GETSOURCEED2KLINK,_("Copy eD2k link to clipboard (&Source)"));
		m_menu->Append(MP_GETCRYPTSOURCEDED2KLINK,_("Copy eD2k link to clipboard (Source) (&With Crypt options)"));
		m_menu->Append(MP_GETHOSTNAMESOURCEED2KLINK,_("Copy eD2k link to clipboard (&Hostname)"));
		m_menu->Append(MP_GETHOSTNAMECRYPTSOURCEED2KLINK,_("Copy eD2k link to clipboard (Hostname) (With &Crypt options)"));		
		m_menu->Append(MP_GETAICHED2KLINK,_("Copy eD2k link to clipboard (&AICH info)"));
		m_menu->Append(MP_WS,_("Copy feedback to clipboard"));
		
		m_menu->Enable(MP_GETAICHED2KLINK, file->HasProperAICHHashSet());
		m_menu->Enable(MP_GETHOSTNAMESOURCEED2KLINK, !thePrefs::GetYourHostname().IsEmpty());
		m_menu->Enable(MP_GETHOSTNAMECRYPTSOURCEED2KLINK, !thePrefs::GetYourHostname().IsEmpty());

		int priority = file->IsAutoUpPriority() ? PR_AUTO : file->GetUpPriority();

		prioMenu->Check(MP_PRIOVERYLOW,	priority == PR_VERYLOW);
		prioMenu->Check(MP_PRIOLOW,	priority == PR_LOW);
		prioMenu->Check(MP_PRIONORMAL,	priority == PR_NORMAL);
		prioMenu->Check(MP_PRIOHIGH,	priority == PR_HIGH);
		prioMenu->Check(MP_PRIOVERYHIGH,priority == PR_VERYHIGH);
		prioMenu->Check(MP_POWERSHARE,	priority == PR_POWERSHARE);
		prioMenu->Check(MP_PRIOAUTO,	priority == PR_AUTO);

		PopupMenu( m_menu, event.GetPoint() );

		delete m_menu;

		m_menu = NULL;
	}
}
开发者ID:donkey4u,项目名称:donkeyseed,代码行数:63,代码来源:SharedFilesCtrl.cpp

示例14: bmx_wxlistevent_getpoint

void bmx_wxlistevent_getpoint(wxListEvent & event, int * x, int * y) {
	wxPoint p = event.GetPoint();
	*x = p.x;
	*y = p.y;
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:5,代码来源:glue.cpp

示例15: OnMaterialRightClicked

void MaterialSelector::OnMaterialRightClicked(wxListEvent& event)
{
	long item = mMaterialList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
	if(item >= 0)
	{
		wxString name = mMaterialList->GetItemText(item);
		Ogre::MaterialPtr pMaterial = Ogre::MaterialManager::getSingleton().getByName(name.c_str());
		if (!pMaterial.isNull())
		{
			
			int iSelectedPage = m_Frame->GetEditorNotebook()->GetSelection();

			if(iSelectedPage == 0)
			{
				Fairy::EffectElement* pEffectElement = dynamic_cast<Fairy::EffectElement*>(m_Frame->GetEffectObjectEditor()->GetSelectedObject());
				if(pEffectElement)
				{
					Ogre::String elementType = pEffectElement->getType();
					if(elementType == "Mesh" || elementType == "BillboardSet" || 
						elementType == "Projector" || elementType == "Beam")
					{
						wxPoint pt = event.GetPoint();
						wxMenu menu;
						wxString menuText = wxT("效果:");
						menuText.Append(elementType.c_str());
						menu.Append(feID_SET_EFFECT_MATERIAL,menuText);
						wxPoint clientpt = event.GetPoint();
						PopupMenu(&menu, pt);

					}
					
				}
				Ogre::ParticleSystem* pParticleSystem = dynamic_cast<Ogre::ParticleSystem*>(m_Frame->GetEffectObjectEditor()->GetSelectedObject());
				if(pParticleSystem)
				{
					wxPoint pt = event.GetPoint();
					wxMenu menu;
					wxString menuText = wxT("粒子:");
					menuText.Append(pParticleSystem->getName().c_str());
					menu.Append(feID_SET_EFFECT_MATERIAL,menuText);
					wxPoint clientpt = event.GetPoint();
					PopupMenu(&menu, pt);

				}
			}
			else if(iSelectedPage == 1)
			{
				Ogre::StringInterface* pElement = m_Frame->GetSkillObjectEidtor()->GetSelectedSkllElement();
				if(!pElement)
					return;
				Fairy::AnimationRibbon* pRibbon = dynamic_cast<Fairy::AnimationRibbon*>(pElement);
				if(pRibbon)
				{
					wxPoint pt = event.GetPoint();
					wxMenu menu;
					wxString menuText = wxT("技能:Ribbon ");
					menu.Append(feID_SET_SKILL_MATERIAL,menuText);
					wxPoint clientpt = event.GetPoint();
					PopupMenu(&menu, pt);
				}
			}

			//#if wxUSE_MENUS
			//	wxMenu menu(title);
			//	menu.Append(TreeTest_About, wxT("&About..."));
			//	menu.AppendSeparator();
			//	menu.Append(TreeTest_Highlight, wxT("&Highlight item"));
			//	menu.Append(TreeTest_Dump, wxT("&Dump"));
			//
			//	PopupMenu(&menu, pt);
			//#endif // wxUSE_MENUS
		}
	}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:74,代码来源:MaterialSelector.cpp


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