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


C++ SetItem函数代码示例

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


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

示例1: GetItem

void CNewHeaderCtrl::SetItemImage( int nItem, int nImage )
{
	// Save the image index
	m_mapImageIndex[nItem] = nImage;

	// Change the item to ownder drawn
	HD_ITEM hditem;

	hditem.mask = HDI_FORMAT;
	GetItem( nItem, &hditem );
	hditem.fmt |= HDF_OWNERDRAW;
	SetItem( nItem, &hditem );

	// Invalidate header control so that it gets redrawn
	Invalidate();
}
开发者ID:flyfaster,项目名称:toysrc,代码行数:16,代码来源:NewHeaderCtrl.cpp

示例2: wxCHECK_RET

void FileCtrl::UpdateItem(const wxListItem &item)
{
   FileData *fd = (FileData*)GetItemData(item);
   wxCHECK_RET(fd, wxT("invalid filedata"));
   
   fd->ReadData();
   
   SetItemText(item, fd->GetFileName());
   SetItemImage(item, fd->GetImageId());
   
   if (GetWindowStyleFlag() & wxLC_REPORT)
   {
      for (int i = 1; i < FileData::FileList_Max; i++)
         SetItem( item.m_itemId, i, fd->GetEntry((FileData::fileListFieldType)i) );
   }
}
开发者ID:DavidBailes,项目名称:audacity,代码行数:16,代码来源:FileDialogPrivate.cpp

示例3: SetItem

bool wxTreeCtrl::SetItemImage(long item, int image, int selImage)
{
    wxTreeItem info;

    info.m_mask = wxTREE_MASK_IMAGE;
    info.m_image = image;
    if ( selImage > -1)
    {
        info.m_selectedImage = selImage;
        info.m_mask |= wxTREE_MASK_SELECTED_IMAGE;
    }

    info.m_itemId = item;

    return SetItem(info);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:16,代码来源:treectrl.cpp

示例4: VERIFY

void CSortHeaderCtrl::SetSortArrow( const int iSortColumn, const BOOL bSortAscending )
{
	m_iSortColumn = iSortColumn;
	m_bSortAscending = bSortAscending;

	// change the item to owner drawn.
	HD_ITEM hditem;

	hditem.mask = HDI_FORMAT;
	VERIFY( GetItem( iSortColumn, &hditem ) );
	hditem.fmt |= HDF_OWNERDRAW;
	VERIFY( SetItem( iSortColumn, &hditem ) );

	// invalidate the header control so it gets redrawn
	Invalidate();
}
开发者ID:kmaki565,项目名称:WinSwitch,代码行数:16,代码来源:SortHeaderCtrl.cpp

示例5: ASSERT

//*****************************************************************************
//*
//*		SetItemText
//*
//*****************************************************************************
//	Set the text of an item
//	hItem		: Is the handle of the item
//	pText		: Is the new text of the item
//	nCol		: Is the column for the text (0=tree column)
//	Returns TRUE if the text was changed or FALSE if an error occurs
BOOL CTreeListCtrl::SetItemText(HTREEITEM hItem, LPCTSTR pText, int nCol) {
	TV_ITEM		sItem;


	ASSERT(::IsWindow(m_hWnd));

	sItem.mask				= TVIF_SUBITEM | TVIF_TEXT;
	sItem.hItem				= hItem;
	sItem.stateMask			= 0;
	sItem.pszText			= (LPTSTR)pText;
	sItem.cchTextMax		= (pText) ? 256 : 0;
	sItem.cChildren			= nCol;


	return SetItem(&sItem);
}
开发者ID:xlat,项目名称:treelist,代码行数:26,代码来源:TreeListCtrl.cpp

示例6: ASSERT

void EXWaitingTreeCtrl::ExpandItem(HTREEITEM hItem)
{
	if (m_hItemToPopulate == NULL)
		return;	// just expand, doesn't want new items

	ASSERT(hItem == m_hItemToPopulate);	// should never fail!!!

	if (m_bShowWaitMsg)
	{
		// display wait msg now, make sure it's visible
		SetRedraw();
		EnsureVisible(m_hItemMsg);
		UpdateWindow();
	}
	// setup animation thread, call PreAnimation
	StartAnimation();
	// draw icon
	if (m_bShowWaitMsg)
		DrawUserIcon();
	// delay redraw after populating
	SetRedraw(FALSE);
	// take a snapshot of the background
	TakeSnapshot();
	// del temporary item (wait msg still shown)
	DeleteItem(m_hItemMsg);
	// fill in with sub items
	BOOL bCheckChildren = PopulateItem(hItem);
	// clean up animation thread, call PostAnimation
	StopAnimation();
	// change parent to reflect current children number
	if (hItem != TVI_ROOT)
	{
		TVITEM item;
		item.hItem = hItem;
		item.mask = TVIF_HANDLE | TVIF_CHILDREN;
		item.cChildren = NeedsChildren(hItem) ? 0 : 1;
		if (bCheckChildren)
			SetItem(&item);
		else if (item.cChildren == 0)
			// restore item's plus button if no children inserted
			SetItemState(hItem, 0, TVIS_EXPANDED);
	}
	// clean up snapshot
	DestroySnapshot();
	// redraw now
	SetRedraw(TRUE);
}
开发者ID:sosoayaen,项目名称:DescentBoardGameTools,代码行数:47,代码来源:EXWaitingTreeCtrl.cpp

示例7: SetItem

void Client::ParseItems(string str)
{
	if (str.length() > 0)
	{
		std::vector<string> itemtokens;
		std::vector<string> tokens;
		boost::split(itemtokens, str, boost::is_any_of("|"));

		for (int i = 0; i < itemtokens.size(); ++i)
		{
			boost::split(tokens, itemtokens[i], boost::is_any_of(","));

			if (tokens.size() == 2)
				SetItem(tokens[0], _atoi64(tokens[1].c_str()));
		}
	}
}
开发者ID:Daizee,项目名称:spitfireiii,代码行数:17,代码来源:Client.cpp

示例8: KillTimer

void CDragDropTreeCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
    CTreeCtrl::OnLButtonUp(nFlags, point);

    if (m_bDragging && m_pImageList != NULL)
    {
        // Stop the scroll timer if it's running.
        KillTimer(1);

        // Terminate the dragging operation and release the mouse.
        m_pImageList->DragLeave(this);
        m_pImageList->EndDrag();
        ::ReleaseCapture();
        m_bDragging = FALSE;
        SelectDropTarget(NULL);

        // Delete the image list created by CreateDragImage.
        delete m_pImageList;
        m_pImageList = NULL;

        // Get the HTREEITEM of the drop target and exit now if it's NULL.
        UINT nFlags;
        HTREEITEM hItem = HitTest(point, &nFlags);
        if (hItem == NULL)
            return;

        if (hItem == m_hDragItem)
            return;
        else if (hItem == GetParentItem(m_hDragItem))
            return;
        else if (IsChildOf(hItem, m_hDragItem))
            return;

        // Move the dragged item and its subitems (if any) to the drop point.
        MoveTree(hItem, m_hDragItem);

        // Mark the item as having children
        TVITEM tvItem;
        tvItem.mask = TVIF_CHILDREN | TVIF_HANDLE;
        tvItem.cChildren = 1;
        tvItem.hItem = hItem;
        SetItem(&tvItem);

        m_hDragItem = NULL;
    }
}
开发者ID:ch3cooli,项目名称:TSVNUtils,代码行数:46,代码来源:DragDropTreeCtrl.cpp

示例9: DeleteAllItems

// Restores the entire list if the filter is empty
void wxAdvancedListCtrl::RestoreList()
{
    if (BackupItems.empty())
        return;

    DeleteAllItems();

    for (size_t x = 0; x < BackupItems.size(); ++x)
    {
        InsertItem(x, wxT(""));

        for (size_t y = 0; y < BackupItems[x].size(); ++y)
        {
            SetItem(BackupItems[x][y]);
        }
    }
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:18,代码来源:lst_custom.cpp

示例10: GetItem

/**
 * \brief Set the correct font for a required field.
 * \param i The line to change.
 * \param b Tell if the field has a value or not.
 */
void bf::item_field_edit::set_required_color( unsigned int i, bool b )
{
  wxListItem prop;
  prop.SetId(i);
  GetItem(prop);

  wxFont font( GetFont() );
  font.SetWeight( wxFONTWEIGHT_BOLD );
  prop.SetFont( font );

  if (b)
    prop.SetTextColour( *wxBLACK );
  else
    prop.SetTextColour( *wxRED );

  SetItem(prop);
} // item_field_edit::set_required_color()
开发者ID:yannicklm,项目名称:bear,代码行数:22,代码来源:item_field_edit.cpp

示例11: DEX_GetDataSourceShortName

BOOL CObjectClassStatistics::EnumDataSources (HPROJECT hPr, BOOL, UINT_PTR *pData)
{
// Namen der Datenquelle besorgen
char cbBuffer[_MAX_PATH];

	DEX_GetDataSourceShortName(hPr, cbBuffer);

// Icon der Datenquelle besorgen
DWORD dwBmp = IMG_DATASOURCE;

	{
	__Interface<ITRiASConnection> Conn;

		if (DEX_GetDataSourcePtr(hPr, *Conn.ppv())) {
		__Interface<ITRiASDatabase> DBase;

			if (SUCCEEDED(Conn -> get_Database (DBase.ppi()))) {
				USES_CONVERSION;

			CComBSTR bstrProgID;		// ProgID des TRiAS-DataBase-TargetObjektes

				if (SUCCEEDED(DBase -> get_Type (&bstrProgID))) {
				__Interface<ITRiASDataServerRegEntries> Entries(CLSID_TRiASDataServerRegEntries);
				__Interface<ITRiASDataServerRegEntry> Entry;

					if (SUCCEEDED(Entries -> FindFromServerProgID (bstrProgID, Entry.ppi()))) 
						Entry -> get_ToolboxBitmap32 ((LONG *)&dwBmp);
				}
			}
		}
	}

// Item in Baum einhängen und mit dummy [+] versehen
	_ASSERTE(0 <= dwBmp && dwBmp < _countof(g_cbBmps));

HTREEITEM hRoot = *reinterpret_cast<HTREEITEM *>(pData);
HTREEITEM hItem = InsertItem(cbBuffer, g_cbBmps[dwBmp], g_cbBmps[dwBmp], hRoot, TVI_LAST);
TV_ITEM tvi;

	tvi.mask = TVIF_HANDLE|TVIF_CHILDREN|TVIF_PARAM;
	tvi.hItem = hItem;
	tvi.cChildren = 1;
	tvi.lParam = reinterpret_cast<LPARAM>(new CDataSourceItemCallback(hPr, hItem));
	SetItem(&tvi);
	return TRUE;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:46,代码来源:ObjectClassStatistics.cpp

示例12: SetItem

void LstOdaSrvDetails::InsertHeader(const wxString &Name, 
                                    const wxColor *NameColor,
                                    const wxColor *NameBGColor)
{
    wxListItem ListItem;
    
    ListItem.SetMask(wxLIST_MASK_TEXT);
    
    // Name Column
    ListItem.SetText(Name);
    ListItem.SetColumn(srvdetails_field_name);
    ListItem.SetId(InsertItem(GetItemCount(), ListItem.GetText()));

    ListItem.SetBackgroundColour(*NameBGColor);
    ListItem.SetTextColour(*NameColor);
    SetItem(ListItem);
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:17,代码来源:lst_srvdetails.cpp

示例13: SetItemText

void CKadContactListCtrl::UpdateContact(int iItem, const Kademlia::CContact* contact, bool bLocalize)
{
	CString id;
	if (!bLocalize) // update the following fields only if really needed (it's quite expensive to always update them)
	{
		contact->getClientID(&id);
		SetItemText(iItem,colID,id);

		id.Format(_T("%i"),contact->getType());
		SetItemText(iItem,colType,id);

		contact->getDistance(&id);
		SetItemText(iItem,colDistance,id);

		SetItem(iItem,0,LVIF_IMAGE,0,contact->getType()>4?4:contact->getType(),0,0,0,0);
	}
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:17,代码来源:KadContactListCtrl.cpp

示例14: GetOptToken

void CUISpinText::SetCurrentValue(){
	xr_token* tok = GetOptToken();

	while (tok->name){
		AddItem_(tok->name, tok->id);
		tok++;
	}
	xr_string val = GetOptTokenValue();

	for (u32 i = 0; i < m_list.size(); i++)
		if (val == m_list[i]._orig.c_str())
		{
			m_curItem	= i;
			break;
		}

	SetItem();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:18,代码来源:UISpinText.cpp

示例15: GetInfo

void CListProcess::Select(long ndx, bool bSelect)
{
  GetInfo(m_itm,ndx);
  long nState = m_itm.GetState();
  if(bSelect != !!(nState & wxLIST_STATE_SELECTED))
  {
    if(bSelect)
    {
      nState |= wxLIST_STATE_SELECTED;
    }
    else
    {
      nState ^= wxLIST_STATE_SELECTED;
    }
    m_itm.SetState(nState);
    SetItem(m_itm);
  }
}
开发者ID:ForensicBioinformatics,项目名称:osiris,代码行数:18,代码来源:CListProcess.cpp


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