當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetItemText函數代碼示例

本文整理匯總了C++中GetItemText函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetItemText函數的具體用法?C++ GetItemText怎麽用?C++ GetItemText使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetItemText函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GetItemText

wxTreeItemId
SamplesTreeCtrl::changeSpeaker( const wxTreeItemId &speech,
                                const wxTreeItemId &currentSpeaker,
                                const wxTreeItemId &newSpeaker )
{
	// Do be sure that these aren't made invalid when the item is deleted.
	std::string name     = GetItemText( speech );
	wxTreeItemData *data = GetItemData( speech );

	SetItemData( speech, NULL ); // replace the data with NULL; speech will not delete it now!
	Delete( speech );

	// Delete the speaker, if this was the only speech in it.
	if ( GetChildrenCount( currentSpeaker ) == 0 )
		Delete( currentSpeaker );

	return AppendItem( newSpeaker, name.c_str(), -1, -1, data );
}
開發者ID:rainChu,項目名稱:ytp-king,代碼行數:18,代碼來源:SamplesTreeCtrl.cpp

示例2: Get_Server_Item

//---------------------------------------------------------
wxTreeItemId CData_Source_PgSQL::Find_Source(const wxString &Server)
{
	wxTreeItemId	Item	= Get_Server_Item(Server, false);

	if( Item.IsOk() )
	{
		wxTreeItemIdValue Cookie; Item = GetFirstChild(Item, Cookie);

		wxString	Name	= Server.BeforeLast('['); Name.Trim(true);

		while( Item.IsOk() && Name.Cmp(GetItemText(Item)) )
		{
			Item	= GetNextChild(Item, Cookie);
		}
	}

	return( Item );
}
開發者ID:sinozope,項目名稱:SAGA-GIS-git-mirror,代碼行數:19,代碼來源:data_source_pgsql.cpp

示例3: while

CString CDirTreeCtrl::GetFullPath(HTREEITEM hItem)
{
	CString strReturn;
	CString strTemp;
	HTREEITEM hParent = hItem;
	strReturn = "";
	while ( hParent )
	{ 
		strTemp  = GetItemText( hParent );
		if(strTemp != _T("project"))   {
			if ( strTemp.Right(1) !=  _T("\\"))
				strTemp += _T("\\");
			strReturn = strTemp + strReturn;
		} 
		hParent = GetParentItem( hParent );
	}
	return strReturn;
}
開發者ID:neil-yi,項目名稱:ffsource,代碼行數:18,代碼來源:DirTreeCtrl.cpp

示例4: GetItemText

void CLightTree::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
	
	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	// TODO:  在此添加控件通知處理程序代碼
	CString obj_name = GetItemText(pNMTreeView->itemNew.hItem);
	CMainFrame *pFrame = (CMainFrame*)(AfxGetApp()->m_pMainWnd);
	pFrame->draw_property(obj_name, DRAW_LIGHT);
	pFrame->m_obj_or_light_name = obj_name;
	pFrame->m_draw_type = DRAW_LIGHT;
	CSceneEditorView* pView = (CSceneEditorView*)pFrame->GetActiveView();
	/*取消另外的選中
	HTREEITEM hItem = pFrame->m_wndFileView.m_wndFileView.GetSelectedItem();
	pFrame->m_wndFileView.m_wndFileView.SetItemState(hItem, 0, TVIS_SELECTED);
	*/
	pView->Invalidate(FALSE);
	*pResult = 0;
}
開發者ID:XiangTianxiao,項目名稱:SceneEditor,代碼行數:18,代碼來源:LightTree.cpp

示例5: GetParentItem

CString CDirTreeCtrl::GetFullPath1(HTREEITEM hItem)
{
	CString path, temp;

	HTREEITEM hParent = GetParentItem(hItem);
	while ( hParent )
	{ 
		temp  = GetItemText( hParent );
		if(temp != m_RootName){
			temp =  temp + _T("\\");
			path = temp + path;
		}
		hParent = GetParentItem(hParent);
	}
	path = _T("\\") + path;
	path = m_RootPath + path;
	return path;
}
開發者ID:neil-yi,項目名稱:ffsource,代碼行數:18,代碼來源:DirTreeCtrl.cpp

示例6: JXKeyModifiers

void
JXStringCompletionMenu::HandleSelection
	(
	const JIndex index
	)
{
	if (itsAllowTabChar && index == kInsertTabCmd)
		{
		// tab may insert spaces
		itsTE->JXTEBase::HandleKeyPress('\t', JXKeyModifiers(GetDisplay()));
		}
	else if (index - (itsAllowTabChar ? kSpecialCmdCount : 0) <= kMaxItemCount)
		{
		JString s = GetItemText(index);
		s.RemoveSubstring(1, kItemPrefixLength + itsPrefixLength);
		itsTE->Paste(s);
		}
}
開發者ID:raorn,項目名稱:jx_application_framework,代碼行數:18,代碼來源:JXStringCompletionMenu.cpp

示例7: _T

void CLocalTreeView::RemoveDrive(wxChar drive)
{
	wxString driveName = drive;
	driveName += _T(":");
	wxTreeItemIdValue value;
	wxTreeItemId driveItem = GetFirstChild(m_drives, value);
	while (driveItem)
	{
		if (!GetItemText(driveItem).Left(2).CmpNoCase(driveName))
			break;

		driveItem = GetNextSibling(driveItem);
	}
	if (!driveItem)
		return;

	Delete(driveItem);
}
開發者ID:idgaf,項目名稱:FileZilla3,代碼行數:18,代碼來源:LocalTreeView.cpp

示例8: SuppressListItemStateEventsWrapper

void CSourcesListBox::DelSel()
{
	//-----------------------------------------------------//
	//--- the EVT_LIST_ITEM_SELECTED will check this	---//
	//--- as there is no need to update the sel until	---//
	//--- we're done									---//
	//-----------------------------------------------------//
    SuppressListItemStateEventsWrapper(*this);
    m_Deleting = true;

	//--- where are we selected? ---//
	int nIndex = - 1;
	nIndex = GetNextItem( nIndex, wxLIST_NEXT_ALL , wxLIST_STATE_SELECTED );

	int nType = GetType( nIndex );

	//--- no item selected? bail ---//
	if ( nIndex == - 1 || nType == MUSIK_SOURCES_LIBRARY || nType == MUSIK_SOURCES_NOW_PLAYING )
		return;

	//--- if we have a standard or dynamic playlist, delete the file ---//
	if ( nType == MUSIK_SOURCES_PLAYLIST_STANDARD || nType == MUSIK_SOURCES_PLAYLIST_DYNAMIC || MUSIK_SOURCES_NETSTREAM)
	{
		wxString sFilename = GetItemText( nIndex );
		SourcesToFilename( &sFilename, nType );

		if ( wxFileExists( sFilename ) )
			wxRemoveFile( sFilename );
	}
	
	//--- remove item from list ---//
	m_SourcesList.RemoveAt( nIndex );
	Update();


	int nNextSel = nIndex;
	if ( nNextSel != 0 )
		nNextSel -= 1;

	SetItemState( nNextSel, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
	UpdateSel( nNextSel );

	m_Deleting = false;
}
開發者ID:BackupTheBerlios,項目名稱:musik-svn,代碼行數:44,代碼來源:SourcesBox.cpp

示例9: _QuickSortRecursive

BOOL CReportCtrl::_PartialSort(int nStart, int nEnd)
{
	if (nStart >= nEnd || !_IsValidIndex(nStart) || !_IsValidIndex(nEnd))
		return FALSE;

	const int COUNT = nEnd - nStart + 1;
	int i = 0;
	int* aIndices = new int[COUNT];
	for (i = 0; i < COUNT; i++)
		aIndices[i] = nStart + i;
	
	_QuickSortRecursive(aIndices, 0, COUNT - 1); 

	// rearrange items
	const int COLS = GetColumnCount();
	ROWINFO* aRows = new ROWINFO[COUNT];
	for (i = 0; i < COUNT; i++)
	{
		int n = aIndices[i];
		aRows[i].dwStates = GetItemStates(aIndices[i]);
		aRows[i].dwData = CListCtrl::GetItemData(aIndices[i]);
		aRows[i].aImages.SetSize(COLS);
		aRows[i].aTexts.SetSize(COLS);
		for (int j = 0; j < COLS; j++)
		{
			aRows[i].aImages[j] = GetItemImage(aIndices[i], j);
			aRows[i].aTexts[j] = GetItemText(aIndices[i], j);
		}
	}

	for (i = 0; i < COUNT; i++)
	{
		SetItemStates(nStart + i, aRows[i].dwStates);
		CListCtrl::SetItemData(nStart + i, aRows[i].dwData);
		for (int j = 0; j < COLS; j++)
		{
			SetItemImage(nStart + i, j, aRows[i].aImages[j]);			
			CListCtrl::SetItemText(nStart + i, j, aRows[i].aTexts[j]);
		}
	}
	delete [] aRows;
	delete [] aIndices;
	return TRUE;
}
開發者ID:KnowNo,項目名稱:test-code-backup,代碼行數:44,代碼來源:ReportCtrl.cpp

示例10: GetRootItem

CString CStatisticsTree::GetText(bool onlyVisible, HTREEITEM theItem, int theItemLevel, bool firstItem)
{
	bool bPrintHeader = firstItem;
	HTREEITEM hCurrent;
	if (theItem == NULL)
	{
		hCurrent = GetRootItem(); // Copy All Vis or Copy All
	}
	else
	{
		if (bPrintHeader && (!ItemHasChildren(theItem) || !IsExpanded(theItem)))
			bPrintHeader = false;
		hCurrent = theItem;
	}

	CString	strBuffer;
	if (bPrintHeader)
		//Xman // Maella -Support for tag ET_MOD_VERSION 0x55
		/*
		strBuffer.Format(_T("eMule v%s %s [%s]\r\n\r\n"), theApp.m_strCurVersionLong, GetResString(IDS_SF_STATISTICS) ,thePrefs.GetUserNick());
		*/
		// ==> ModID [itsonlyme/SiRoB] - Stulle
		/*
		strBuffer.Format(_T("eMule v%s %s [%s]\r\n\r\n"), theApp.m_strCurVersionLong + _T(" ") + MOD_VERSION, GetResString(IDS_SF_STATISTICS) ,thePrefs.GetUserNick()); //Xman // Maella -Support for tag ET_MOD_VERSION 0x55
		*/
		strBuffer.Format(_T("eMule v%s [%s] %s [%s]\r\n\r\n"), theApp.m_strCurVersionLong,theApp.m_strModLongVersion, GetResString(IDS_SF_STATISTICS) ,thePrefs.GetUserNick());
		// <== ModID [itsonlyme/SiRoB] - Stulle
		//Xman end

	while (hCurrent != NULL)
	{
		for (int i = 0; i < theItemLevel; i++)
			strBuffer += _T("   ");
		strBuffer += GetItemText(hCurrent);
		if (bPrintHeader || !firstItem)
			strBuffer += _T("\r\n");
		if (ItemHasChildren(hCurrent) && (!onlyVisible || IsExpanded(hCurrent)))
			strBuffer += GetText(onlyVisible, GetChildItem(hCurrent), theItemLevel+1, false);
		hCurrent = GetNextItem(hCurrent, TVGN_NEXT);
		if (firstItem && theItem != NULL)
			break; // Copy Selected Branch was used, so we don't want to copy all branches at this level.  Only the one that was selected.
	}
	return strBuffer;
}
開發者ID:brolee,項目名稱:EMule-GIFC,代碼行數:44,代碼來源:StatisticsTree.cpp

示例11: GetItemText

//繪畫數據
VOID CEasySkinListCtrl::DrawReportItem(CDC * pDC, INT nItem, CRect & rcSubItem, INT nColumnIndex)
{
	//獲取文字
	TCHAR szString[256]=TEXT("");
	GetItemText(nItem,nColumnIndex,szString,CountArray(szString));

	//繪畫文字
	rcSubItem.left+=5;

	//繪製CheckButton
	if( nColumnIndex == 0 )
	{
		if ((m_pCheckImg != NULL && !m_pCheckImg->IsNull()) && (m_pUnCheckImg != NULL && !m_pUnCheckImg->IsNull()))
		{
			if( GetCheck(nItem) )
				m_pCheckImg->DrawImage(pDC,rcSubItem.left+2,rcSubItem.top+(rcSubItem.Height()-m_pCheckImg->GetHeight())/2);
			else
				m_pUnCheckImg->DrawImage(pDC,rcSubItem.left+2,rcSubItem.top+(rcSubItem.Height()-m_pUnCheckImg->GetHeight())/2);

			rcSubItem.left+=(8+m_pCheckImg->GetWidth());
		}

		CItemImgArray::iterator iter = m_ItemImgArray.begin();

		for (;iter != m_ItemImgArray.end(); ++iter )
		{
			if ( iter->nItem == nItem )
			{
				CImageEx *pImage = iter->pImage;

				if (pImage != NULL && !pImage->IsNull())
				{
					pImage->DrawImage(pDC,rcSubItem.left+2,rcSubItem.top+(rcSubItem.Height()-pImage->GetHeight())/2);
					rcSubItem.left+=(8+pImage->GetWidth());
				}
				break;
			}
		}
	}

	pDC->DrawText(szString,lstrlen(szString),&rcSubItem,DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);

	return;
}
開發者ID:alon-zhong,項目名稱:EasyClient,代碼行數:45,代碼來源:EasySkinListCtrl.cpp

示例12: GetDataView

void WIDGET_HOTKEY_LIST::OnSize( wxSizeEvent& aEvent )
{
    // Handle this manually - wxTreeListCtrl screws up the width of the first column
    wxDataViewCtrl* view = GetDataView();

    if( !view )
        return;

    wxRect rect = GetClientRect();
    view->SetSize( rect );

#ifdef wxHAS_GENERIC_DATAVIEWCTRL
    {
        wxWindow* view = GetView();
        view->Refresh();
        view->Update();
    }
#endif

    // Find the maximum width of the hotkey column
    int hk_column_width = 0;

    for( wxTreeListItem item = GetFirstItem(); item.IsOk(); item = GetNextItem( item ) )
    {
        const wxString& text = GetItemText( item, 1 );
        int width = WidthFor( text );

        if( width > hk_column_width )
            hk_column_width = width;
    }

    if( hk_column_width < HOTKEY_MIN_WIDTH )
        hk_column_width = HOTKEY_MIN_WIDTH;
    else if( hk_column_width <= 0 )
        hk_column_width = 1;

    int name_column_width = rect.width - hk_column_width - HORIZ_MARGIN;

    if( name_column_width <= 0 )
        name_column_width = 1;

    SetColumnWidth( 1, hk_column_width );
    SetColumnWidth( 0, name_column_width );
}
開發者ID:bpkempke,項目名稱:kicad-source-mirror,代碼行數:44,代碼來源:widget_hotkey_list.cpp

示例13: GetItem

void CListControlEx::DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct )
{
	// TODO:  添加您的代碼以繪製指定項
	CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);

	LVITEM lvi = {0};
	lvi.mask = LVIF_STATE;
	lvi.stateMask = LVIS_FOCUSED | LVIS_SELECTED ;
	lvi.iItem = lpDrawItemStruct->itemID;
	BOOL bGet = GetItem(&lvi);

	BOOL bHighlight =((lvi.state & LVIS_DROPHILITED)||((lvi.state & LVIS_SELECTED) && ((GetFocus() == this)|| (GetStyle() & LVS_SHOWSELALWAYS))));

	CRect rcBack = lpDrawItemStruct->rcItem;

	if( bHighlight ) //高亮顯示
	{
		pDC->SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));
		pDC->SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));
		pDC->FillRect(rcBack, &CBrush(::GetSysColor(COLOR_HIGHLIGHT)));
	}
	else
	{

		pDC->SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));
		pDC->FillRect(rcBack, &CBrush(::GetSysColor(COLOR_WINDOW)));


	}
	//繪製文本
	CString strText=L"";
	CRect rcItem;
	if (lpDrawItemStruct->itemAction & ODA_DRAWENTIRE)
	{
		for (int i = 0; i < GetHeaderCtrl()-> GetItemCount();i++)
		{            
			if ( !GetSubItemRect(lpDrawItemStruct->itemID, i, LVIR_LABEL, rcItem ))
				continue;
			strText = GetItemText( lpDrawItemStruct->itemID, i );

			pDC->DrawText(strText,strText.GetLength(), &rcItem, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_BOTTOM);
		}
	}
}
開發者ID:loveunk,項目名稱:diseases-prediction-and-tracking,代碼行數:44,代碼來源:ListControlEx.cpp

示例14: GetFirstChild

bool browsers::CellBrowser::findItem(const wxString name, wxTreeItemId& item, const wxTreeItemId parent) 
{
   wxTreeItemIdValue cookie;
   wxTreeItemId child = GetFirstChild(parent,cookie);
   while (child.IsOk()) 
   {
      if (item.IsOk()) 
      {
         if (child == item) item = wxTreeItemId();
      }
      else if (name == GetItemText(child)) 
      {
         item = child; return true;
      }   
      if (findItem(name, item, child)) return true;
      child = GetNextChild(parent,cookie);
   }
   return false;
}   
開發者ID:BackupTheBerlios,項目名稱:toped-svn,代碼行數:19,代碼來源:browsers.cpp

示例15: GetItemText

/**
 *
 * \param *pNMHDR 
 * \param *pResult 
 */
void	CUnitListBox::OnLvnBegindrag(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMLISTVIEW pNMLV	= reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
	if (pNMLV->iItem >= 0)
	{
		// 獲取文件名
		m_szFileName		= GetItemText(pNMLV->iItem, pNMLV->iSubItem);

		POINT pt ={
			0, 0
		};

		int nOffset = 0;
		int nCount	= GetSelectedCount();
		if (nCount >= 1)
		{
			pt.x = nOffset;
			pt.y = nOffset;
		}

		m_pDragImage = CreateDragImage(pNMLV->iItem, &pt);
		if (m_pDragImage)
		{
			IMAGEINFO img;
			m_ImageList.GetImageInfo(pNMLV->iItem, &img);

			CBitmap* pBitmap = CBitmap::FromHandle(img.hbmImage);
			if (pBitmap)
			{
				m_pDragImage->Replace(0, pBitmap, NULL);
				m_pDragImage->BeginDrag(0, 
					CPoint(nOffset, nOffset));
				m_pDragImage->DragEnter(GetDesktopWindow(), pNMLV->ptAction);

				m_bDragging = TRUE;

				SetCapture ();
			}
		}
	}

	*pResult = 0;
}
開發者ID:lonyzone,項目名稱:oathx-ogrex-editor,代碼行數:48,代碼來源:UnitListBox.cpp


注:本文中的GetItemText函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。