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

C++ GetSelectedItem函数代码示例

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

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



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

示例1: GetCursorPos

void CSiteGroupsTree::OnRightClick(NMHDR *, LRESULT *result)
{
    CPoint pt;
    GetCursorPos(&pt);
    CPoint ptClient = pt;
    ScreenToClient(&ptClient);
    
    HTREEITEM item = HitTest(ptClient);
    if (item == 0)
        item = GetSelectedItem();

    UpdateMenu(m_menu, item);
    m_menu.TrackPopupMenu(TPM_LEFTALIGN, pt.x, pt.y, this);

    *result = 1;
}
开发者ID:death,项目名称:webwatch,代码行数:16,代码来源:SiteGroupsTree.cpp


示例2: Dlg

void ValueListCtrl::OnDelete(wxCommandEvent& event)
{
  wxMessageDialog Dlg(this, "Are you sure you want to delete this value?", "Confirm Value Delete", wxYES_NO | wxICON_EXCLAMATION );
  if(Dlg.ShowModal() != wxID_YES)
  {
    return;
  }
  long Item = GetSelectedItem();
  if(Item == -1)
  {
    return ;
  }
  wxString Text = GetItemText(Item);
  m_pConfig->remove_value(m_Key, Text);
  DeleteItem(Item);
}
开发者ID:asdlei00,项目名称:ACE,代码行数:16,代码来源:ValueListCtrl.cpp


示例3: GetSelectedItem

void MenuEditor::AddItem(const wxString& label, const wxString& shortcut,
  const wxString& id, const wxString& name, const wxString &help, const wxString &kind)
{
    int sel = GetSelectedItem();
    int identation = 0;
    if (sel >= 0) identation = GetItemIdentation(sel);
    wxString labelAux = label;
    labelAux.Trim(true);
    labelAux.Trim(false);
    if (sel < 0) sel = m_menuList->GetItemCount() - 1;

    labelAux = wxString(wxChar(' '), identation * IDENTATION) + labelAux;

    long index = InsertItem(sel + 1, labelAux, shortcut, id, name, help, kind);
    m_menuList->SetItemState(index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
开发者ID:Three-DS,项目名称:wxformbuilder-3.5.0,代码行数:16,代码来源:menueditor.cpp


示例4: GetSelectedItem

void CPageSound::OnSelectButton() 
{
	int iSel = GetSelectedItem();
	
	if(iSel!=-1)
	{
		CString strFileName = m_SoundPathList.GetItemText(iSel,1);
		CFileDialog OpenDlg(TRUE,NULL,strFileName,OFN_CREATEPROMPT|OFN_EXPLORER,GetString(IDS_SOUND_FORMAT),this);
		if(OpenDlg.DoModal()==IDOK)
		{
			m_SoundPathList.SetItemText(iSel,1,OpenDlg.GetPathName());
			SetModified();
		}
	}
	BlockOrUnBlock();
}
开发者ID:0anion0,项目名称:IBN,代码行数:16,代码来源:PageSound.cpp


示例5: GetSelectedItem

void CMyTreeListControl::OnContextMenu(CWnd* /*pWnd*/, CPoint pt)
{
	int i= GetSelectedItem();
	if (i == -1)
		return;

	CTreeListItem *item= GetItem(i);

	CRect rc= GetWholeSubitemRect(i, 0);
	CRect rcTitle= item->GetTitleRect() + rc.TopLeft();

	CMenu menu;
	menu.LoadMenu(IDR_POPUPLIST);
	CMenu *sub= menu.GetSubMenu(0);

	PrepareDefaultMenu(sub, (CItem *)item);
	GetMainFrame()->AppendUserDefinedCleanups(sub);

	// Show popup menu and act accordingly.
	//
	// The menu shall not overlap the label but appear
	// horizontally at the cursor position,
	// vertically under (or above) the label.
	// TrackPopupMenuEx() behaves in the desired way, if
	// we exclude the label rectangle extended to full screen width.
	// 
	// Thanks to Sven for this compromise between the old Windirstat
	// behavior (show the menu to the right of the label) and the
	// Explorer behavior (show the menu at the cursor position).

	TPMPARAMS tp;
	tp.cbSize = sizeof(tp);
	tp.rcExclude = rcTitle;
	ClientToScreen(&tp.rcExclude);

	CRect desktop;
	GetDesktopWindow()->GetWindowRect(desktop);

	tp.rcExclude.left = desktop.left;
	tp.rcExclude.right = desktop.right;

	const int overlap = 2;	// a little vertical overlapping
	tp.rcExclude.top += overlap;
	tp.rcExclude.bottom -= overlap;

	sub->TrackPopupMenuEx(TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, AfxGetMainWnd(), &tp);
}
开发者ID:Meitinger,项目名称:windirstat,代码行数:47,代码来源:dirstatview.cpp


示例6: GetSelectedItem

void CTreeFileCtrl::OnRclick(NMHDR* /*pNMHDR*/, LRESULT* pResult) 
{
  //Remember the old selected item
  HTREEITEM hOldSelItem = GetSelectedItem();

  //Work out the position of where the context menu should be
  CPoint p(GetCurrentMessage()->pt);
  CPoint pt(p);
  ScreenToClient(&pt);
  Select(HitTest(pt), TVGN_CARET);
	OnContextMenu(NULL, p);

  //Reselect the old selected item
  Select(hOldSelItem, TVGN_CARET);
	
	*pResult = 0;
}
开发者ID:5432935,项目名称:genesis3d,代码行数:17,代码来源:FileTreeCtrl.cpp


示例7: notify

void CFileListManager::OnUnloadFiles( KeyValues *pParams )
{
	CNotifyScopeGuard notify( "CFileListManager::OnUnloadFiles", NOTIFY_SOURCE_FILE_LIST_MANAGER, NOTIFY_SETDIRTYFLAG );

	int nSelected = GetSelectedItemsCount();
	for ( int i = 0; i < nSelected; ++i )
	{
		int itemId = GetSelectedItem( i );
		DmFileId_t fileid = ( DmFileId_t )GetItemUserData( itemId );
		if ( g_pDataModel->IsFileLoaded( fileid ) )
		{
			SetLoaded( fileid, false );
		}
	}

	Refresh();
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:17,代码来源:FileListManager.cpp


示例8: GetSelectedItem

//---------------------------- PRIVATE          -----------------------------//
void wxContextListCtrl::LeftDown(wxMouseEvent &)
{
	wxInt32 index = GetSelectedItem();

	if(-1 != index)
	{
		wxInt32 id = GetItemData(index);

		// Since we're a menu, we just want clicks, not selections.
		SetSelectedItem(-1);

		Controller::get().Transmit(shEventContextMenuClick, id);
		
		wxCommandEvent command(wxEVT_COMMAND_BUTTON_CLICKED, id);
		ProcessEvent(command);
	}
}
开发者ID:Dangr8,项目名称:Cities3D,代码行数:18,代码来源:ContextListCtrl.cpp


示例9: GetSelectedItem

void CTabMemSpellsDlg::OnMaxdec() 
{
	int nIndex = GetSelectedItem();
	if (nIndex == -1)
		return;

	CString strNum;
	int nNum;
	
	strNum = m_lcList.GetItemText(nIndex,2);
	nNum = atoi(strNum);
	if (nNum > 0)
	{
		strNum.Format("%d",nNum-1);
		m_lcList.SetItemText(nIndex,2,strNum);
	}
}
开发者ID:devurandom,项目名称:shadowkeeper,代码行数:17,代码来源:TabMemSpellsDlg.cpp


示例10: GetSelectedItem

void CDirectoryTreeCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	if (nChar == VK_SPACE)
	{
		HTREEITEM hItem = GetSelectedItem();
		if (hItem)
		{
			ShareSubDirTree(hItem, GetKeyState(VK_CONTROL) & 0x8000);

			// if Ctrl+Space is passed to the tree control, it just beeps and does not check/uncheck the item!
			SetCheck(hItem, !GetCheck(hItem));
			return;
		}
	}

	CTreeCtrl::OnKeyDown(nChar, nRepCnt, nFlags);
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:17,代码来源:DirectoryTreeCtrl.cpp


示例11: SendMessage

/**
 * Call when adapter selection changed. This will reset device
 * combobox, list devices for new adapter, and call ChangedDevice().
 */
void ZFXD3DEnum::ChangedAdapter(void) {
   ZFXADAPTERINFO *pA=NULL;

   // delete content of device combobox
   SendMessage(m_hDEVICE, CB_RESETCONTENT, 0, 0);

   pA = (ZFXADAPTERINFO *)GetSelectedItem(m_hADAPTER);

   for (UINT d=0; d<pA->nNumDevs; d++) {
      AddItem(m_hDEVICE, D3DDevTypeToString(pA->d3dDevs[d].
              d3dDevType), &pA->d3dDevs[d]);
     }
   SendMessage(m_hDEVICE, CB_SETCURSEL, (WPARAM)0, 0);
   
   // treat as if device slectio changed
   ChangedDevice();
   } // ChangedAdapter
开发者ID:slipslob,项目名称:3d-zfxengine,代码行数:21,代码来源:ZFXD3D_enum.cpp


示例12: KillTimer

void CTreeCtrlEx::OnTimer(UINT nIDEvent)
{
	if (nIDEvent == TCEX_EDITLABEL)
	{
		// Stop the timer.
		KillTimer(m_idTimer);

		// Invoke label editing.
		if (m_bEditLabelPending)
			EditLabel(GetSelectedItem());

		m_bEditLabelPending = FALSE;
		return;
	}

	CTreeCtrl::OnTimer(nIDEvent);
}
开发者ID:mikemakuch,项目名称:muzikbrowzer,代码行数:17,代码来源:TreeCtrlEx.cpp


示例13: switch

void CDirectoryTreeCtrl::OnTvnKeydown(NMHDR *pNMHDR, LRESULT *pResult)
{ 
	LPNMTVKEYDOWN pTVKeyDown = reinterpret_cast<LPNMTVKEYDOWN>(pNMHDR);

	switch(pTVKeyDown->wVKey)
	{
		case VK_SPACE:
		case VK_RETURN:
		{
			HTREEITEM hItem = GetSelectedItem();

			if(hItem)
			{		
				HTREEITEM tItem = GetFirstVisibleItem();

				CheckChanged(hItem, !GetCheck(hItem));
								
				if(m_bCtrlPressed)
				{
					Expand(hItem, TVE_TOGGLE);
					HTREEITEM hChild;
					hChild = GetChildItem(hItem);

					while(hChild != NULL)
					{ 
						MarkChilds(hChild,!GetCheck(hItem));
						hChild = GetNextSiblingItem( hChild );
					}

					SetCheck(hItem, !GetCheck(hItem));
					Expand(hItem, TVE_TOGGLE);
				}
		 
				SelectSetFirstVisible(tItem);
			}

			break;
		}

		default:
			break;
	}

	*pResult = 0;
}
开发者ID:rusingineer,项目名称:EmulePlus,代码行数:45,代码来源:DirectoryTreeCtrl.cpp


示例14: GetSelectedItem

/**
 *\fn           HRESULT GetCurProject(Project **ppProject)
 *\brief        得到当前项目
 *\param[in]    Project * * ppProject 项目指针
 *\return       HRESULT 0成功,其它失败
 */
HRESULT CAddinProcess::GetCurProject(Project **ppProject)
{
    CComPtr<SelectedItem> selectItem;
    HRESULT hr = GetSelectedItem(1, &selectItem);

    if (SUCCEEDED(hr) && selectItem != NULL)
    {
        CComPtr<ProjectItem> item;
        hr = selectItem->get_ProjectItem(&item);

        if (SUCCEEDED(hr) && item != NULL)
        {
            hr = item->get_ContainingProject(ppProject);
        }
    }

    return hr;
}
开发者ID:tempbottle,项目名称:TestSet,代码行数:24,代码来源:AddinProcess.cpp


示例15: GetSelectedItem

BOOL CShellTreeCtrl::GetCurFilePath(CString & str)
{
	LPTVITEMDATA	lptvid;
	char		szBuff[MAX_PATH];
	HTREEITEM		hItem=NULL;

	hItem = GetSelectedItem();

	lptvid=(LPTVITEMDATA)GetItemData(hItem);

	if(SHGetPathFromIDList(lptvid->lpifq,szBuff))
	{
		str = szBuff;
		return TRUE;
	}
	else
		return FALSE;
}
开发者ID:vicentdsmin,项目名称:myie,代码行数:18,代码来源:ShellTreeCtrl.cpp


示例16: GetSelectedItem

//�������������������������������������������������������������������������Ŀ
// ToolTree - GetSelected                                                   �
//���������������������������������������������������������������������������
dword ToolTree::GetSelected(void)
{
    HTREEITEM       h;
    TV_ITEM         i;

    h = GetSelectedItem();

    if (!h)
        return 0;

    i.mask = TVIF_HANDLE;
    i.hItem = h;

    if (!GetItem(&i))
        return 0;

    return (dword)i.lParam;
}
开发者ID:OhGameKillers,项目名称:mythosengine,代码行数:21,代码来源:eshttree.cpp


示例17: handle

int objectList::handle(LPARAM lParam)
{
  NMHDR* nmhdr = (NMHDR*)lParam;
  if (nmhdr->idFrom == ID)
  {
    if (nmhdr->code == TVN_SELCHANGED)
    {
      NMTREEVIEW* tree =    (NMTREEVIEW*)lParam;
      selectedObject   = (object*)GetSelectedItem(tree);
      
      return OBJECTLIST_SELCHANGED;
    }
    else if (nmhdr->code == NM_RCLICK)
    {
      return OBJECTLIST_RCLICK;
    }
  }
}
开发者ID:wurlyfox,项目名称:crashutils,代码行数:18,代码来源:objectlist.cpp


示例18: ShowPopupBar

void CXTPRibbonControlTab::ShowPopupBar(BOOL bKeyboard)
{
	if (!GetSelectedItem())
		return;

	CXTPRibbonBar* pRibbonBar = GetRibbonBar();
	if (!pRibbonBar->IsRibbonMinimized())
		return;

	if (pRibbonBar->m_nPopuped == m_nIndex)
	{
		pRibbonBar->m_nPopuped = -1;
		if (m_pCommandBar) m_pCommandBar->SetTrackingMode(FALSE);
	}

	pRibbonBar->SetTrackingMode(TRUE, FALSE);
	pRibbonBar->SetPopuped(m_nIndex, bKeyboard);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:18,代码来源:XTPRibbonControlTab.cpp


示例19: GetDropHilightItem

LRESULT MFTreeView::OnKeydown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) {
	int x = 9;
	TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*)pnmh;

	if (pTVKeyDown->wVKey == VK_F2) {

		WTL::CTreeItem item = GetDropHilightItem();
		if (item.IsNull()) {
			item = GetSelectedItem();
		}
		MFTreeViewItem* pItem = (MFTreeViewItem*)item.GetData();
		if (pItem == NULL) 
			return 0;

		pItem->HandleMenuCmd(4 /*CMD_RENAME*/, item);		
	}
	return 0;
}
开发者ID:MisatoTremor,项目名称:aoia,代码行数:18,代码来源:MFTreeView.cpp


示例20: GetSelectedItem

fsDldFilter* CDownloads_Groups::GetCurrentFilter()
{
	HTREEITEM hItem = GetSelectedItem ();

	if (hItem == m_hTasks)
		return &m_filterTasks;

	if (hItem == m_hAllGroups || hItem == m_hFilters)
		return &m_filterAll;

	if (hItem == m_hHistory || hItem == m_hDeleted)
		return NULL;

	if (GetParentItem (hItem) == m_hFilters || IsGroupItem (hItem))
		return (fsDldFilter*) GetItemData (hItem);

	return NULL;
}
开发者ID:DragonZX,项目名称:fdm2,代码行数:18,代码来源:Downloads_Groups.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetSelectedItemCount函数代码示例发布时间:2022-05-30
下一篇:
C++ GetSelectedCount函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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