本文整理汇总了C++中GetItemText函数的典型用法代码示例。如果您正苦于以下问题:C++ GetItemText函数的具体用法?C++ GetItemText怎么用?C++ GetItemText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetItemText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetItemText
wxTreeItemId
SamplesTreeCtrl::changeSpeaker( const wxTreeItemId &speech,
const wxTreeItemId ¤tSpeaker,
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 );
}
示例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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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 );
}
示例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);
}
}
}
示例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;
}
示例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;
}