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


C++ GetItemImage函数代码示例

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


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

示例1: SetItemImage

void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item)
{
    int image = (GetItemImage(item) == TreeCtrlIcon_Folder)
                    ? TreeCtrlIcon_File
                    : TreeCtrlIcon_Folder;
    SetItemImage(item, image, wxTreeItemIcon_Normal);

    image = (GetItemImage(item) == TreeCtrlIcon_FolderSelected)
                    ? TreeCtrlIcon_FileSelected
                    : TreeCtrlIcon_FolderSelected;
    SetItemImage(item, image, wxTreeItemIcon_Selected);
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:12,代码来源:treetest.cpp

示例2: AppendItem

void browsers::CellBrowser::copyItem(const wxTreeItemId item, const wxTreeItemId newparent) {
   wxTreeItemId newitem = AppendItem(newparent, GetItemText(item));
   SetItemImage(newitem, GetItemImage(item,wxTreeItemIcon_Normal), wxTreeItemIcon_Normal);
   SetItemImage(newitem, GetItemImage(item,wxTreeItemIcon_Expanded), wxTreeItemIcon_Expanded);
   SetItemImage(newparent,0,wxTreeItemIcon_Normal);
   SetItemImage(newparent,1,wxTreeItemIcon_Expanded);
   SetItemTextColour(newitem, GetItemTextColour(newparent));
   wxTreeItemIdValue cookie;
   wxTreeItemId child = GetFirstChild(item,cookie);
   while (child.IsOk()) {
      copyItem(child, newitem);
      child = GetNextChild(item,cookie);
   }
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:14,代码来源:browsers.cpp

示例3: GetItemImage

int SymbolTree::OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2)
{
	// Get the items and compare their icons
	int img1, img2;
	img1 = GetItemImage(item1);
	img2 = GetItemImage(item2);
	if (img1 > img2)
		return 1;
	else if (img1 < img2)
		return -1;
	else {
		// Items  has the same icons, compare text
		return wxTreeCtrl::OnCompareItems(item1, item2);
	}
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:15,代码来源:symbol_tree.cpp

示例4: GetItemImage

void CZoneTree::ConvertMobToIndex(HTREEITEM &hItem, HTREEITEM &hNewItem, HTREEITEM &htiNewParent)
{
	int x;
	HTREEITEM par;

	GetItemImage(htiNewParent, x, x);

	switch(x) {
	case PEOPLE:
		room_data *room;
		mob_index *mob;
					
		par = GetParentItem(htiNewParent);
		room = (room_data*)GetItemData(par);
					
		if(room) {
			mob = room->AddPerson((mob_data*)GetItemData(hItem));
			mob->m_tThis = hNewItem;
		}
					
		SetItemImage(hNewItem, MOB_INDEX, MOB_INDEX);
		SetItemData(hNewItem, (DWORD)mob);
		break;
	}
}
开发者ID:GalacticSoft,项目名称:DikuEdit,代码行数:25,代码来源:ZoneTree.cpp

示例5: GetImageList

VOID CEasySkinTreeCtrl::DrawListImage( CDC * pDC, CRect rcRect, HTREEITEM hTreeItem, bool bSelected )
{
	CMapItemInfo::iterator iter= m_MapItemInfo.find(hTreeItem);
	if( iter == m_MapItemInfo.end() )
	{
		CImageList *pImageList = GetImageList(TVSIL_NORMAL);
		if( pImageList == NULL ) return;

		//获取属性
		INT nImage,nSelectedImage;
		GetItemImage(hTreeItem,nImage,nSelectedImage);

		//获取信息
		IMAGEINFO ImageInfo;
		pImageList->GetImageInfo(bSelected?nSelectedImage:nImage,&ImageInfo);

		//绘画图标
		INT nImageWidth=ImageInfo.rcImage.right-ImageInfo.rcImage.left;
		INT nImageHeight=ImageInfo.rcImage.bottom-ImageInfo.rcImage.top;

		pImageList->Draw(pDC,bSelected?nSelectedImage:nImage,CPoint(rcRect.left-nImageWidth-3,rcRect.top+(rcRect.Height()-nImageHeight)/2+1),ILD_TRANSPARENT);
	}
	else
	{
		CImageEx *pImage = iter->second.pImage;
		pImage->DrawImage(pDC,rcRect.left-pImage->GetWidth()-3,rcRect.top+(rcRect.Height()-pImage->GetHeight())/2+1);
	}
}
开发者ID:alon-zhong,项目名称:EasyClient,代码行数:28,代码来源:EasySkinTreeCtrl.cpp

示例6: GetItemIconIndex

void SymbolTree::UpdateGuiItem(TagEntry& data, const wxString& key)
{
	if (!m_tree)
		return;

	TagNode* node = m_tree->Find(key);
	if ( node ) {
		// Update the new data with the gui tree item id
		data.SetTreeItemId( node->GetData().GetTreeItemId() );
		node->SetData(data);

		// Update Icon if needed
		int iconIndex = GetItemIconIndex(data.GetKind(), data.GetAccess());
		int curIconIndex = -1;
		wxTreeItemId itemId = node->GetData().GetTreeItemId();
		if (itemId.IsOk()) {
			curIconIndex = GetItemImage(itemId);
			if (curIconIndex != iconIndex ) {
				// Need to update the image as well
				SetItemImage(node->GetData().GetTreeItemId(), iconIndex);
				SetItemImage(node->GetData().GetTreeItemId(), iconIndex, wxTreeItemIcon_Selected);

			} // if(curIconIndex != iconIndex )
			//update the linenumber and file
			MyTreeItemData *item_data = new MyTreeItemData(data.GetFile(), data.GetPattern());
			wxTreeItemData *old_data = GetItemData(itemId);
			if (old_data)
				delete old_data;
			SetItemData(itemId, item_data);
		}
	}
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:32,代码来源:symbol_tree.cpp

示例7: GetItemString

TBWidget *TBSelectItemSource::CreateItemWidget(int index, TBSelectItemViewer *viewer)
{
	const char *string = GetItemString(index);
	TBSelectItemSource *sub_source = GetItemSubSource(index);
	TBID image = GetItemImage(index);
	if (sub_source || image)
	{
		if (TBSimpleLayoutItemWidget *itemwidget = new TBSimpleLayoutItemWidget(image, sub_source, string))
			return itemwidget;
	}
	else if (string && *string == '-')
	{
		if (TBSeparator *separator = new TBSeparator)
		{
			separator->SetGravity(WIDGET_GRAVITY_ALL);
			separator->SetSkinBg(TBIDC("TBSelectItem.separator"));
			return separator;
		}
	}
	else if (TBTextField *textfield = new TBTextField)
	{
		textfield->SetSkinBg("TBSelectItem");
		textfield->SetText(string);
		textfield->SetTextAlign(TB_TEXT_ALIGN_LEFT);
		return textfield;
	}
	return nullptr;
}
开发者ID:castlelore,项目名称:turbobadger,代码行数:28,代码来源:tb_select_item.cpp

示例8: GetFirstSelectedItemPosition

void CHostList::OnLButtonDblClk(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	do 
	{
		POSITION pos = GetFirstSelectedItemPosition();
		int index = GetNextSelectedItem(pos);

		if (index < 0)
		{
			break;
		}

		if (GetItemData(index) == 0)
		{
			int nImage = GetItemImage(index,0);
			CString szGName = GetItemText(index,0);

			if (nImage == 1)
			{
				SetItemImage(index,0,2);
				InsertGroupsClient(index,m_GroupsMap[(LPCTSTR)szGName]);
			}
			else
			{
				SetItemImage(index,0,1);
				DeleteGroupsClient(index,m_GroupsMap[(LPCTSTR)szGName]);
			}
		}
	} while (FALSE);

	_MouseClkMonitor(WM_LBUTTONDBLCLK, nFlags, point, TRUE);
}
开发者ID:a3587556,项目名称:trochilus,代码行数:33,代码来源:HostList.cpp

示例9: GetItemImage

void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item)
{
    int image = GetItemImage(item) == TreeCtrlIcon_Folder ? TreeCtrlIcon_File
                                                          : TreeCtrlIcon_Folder;

    SetItemImage(item, image);
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,代码来源:treetest.cpp

示例10: while

void CAnimDialog::OnGetdispinfoIconres(NMHDR* pNMHDR, LRESULT* pResult) 
{
	LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
	// TODO: Add your control notification handler code here
	
  if(pDispInfo->item.mask&LVIF_TEXT) {
    int idx=determinetype(m_restype);
    POSITION pos=resources[idx]->GetStartPosition();
    CString key;
    loc_entry fileloc;
    int i = pDispInfo->item.iItem;
    do {
      resources[idx]->GetNextAssoc(pos,key,fileloc);
      if (m_filter.IsEmpty() || (key.Find(m_filter)!=-1))
      {
        if (!i) break;
        i--;
      }
    }
    while(pos);

    pDispInfo->item.pszText = 
    strncpy(pDispInfo->item.pszText,key,pDispInfo->item.cchTextMax);
  }
  if(pDispInfo->item.mask&LVIF_IMAGE) {
    GetItemImage(pDispInfo);
  }
	*pResult = 0;
}
开发者ID:TeoTwawki,项目名称:dltcep,代码行数:29,代码来源:AnimDialog.cpp

示例11: GetItemString

TBWidget *MenubarItemSource::CreateItemWidget(int index, TBSelectItemViewer *viewer)
{
    const char *string = GetItemString(index);

    TBSelectItemSource *sub_source = GetItemSubSource(index);
    TBID image = GetItemImage(index);

    if (sub_source || image)
    {
        if (TBSimpleLayoutItemWidget *itemwidget = new TBSimpleLayoutItemWidget(image, sub_source, string))
        {
            itemwidget->SetID(GetItem(index)->id);
            return itemwidget;
        }
    }
    else if (string && *string == '-')
    {
        if (TBSeparator *separator = new TBSeparator)
        {
            separator->SetGravity(WIDGET_GRAVITY_ALL);
            separator->SetSkinBg(TBIDC("AESeparator"));
            return separator;
        }
    }
    else if (TBLayout *layout = new MenubarItemWidget(GetItem(index), this, viewer, index))
    {
        layout->SetID(GetItem(index)->id);
        return layout;
    }

    return NULL;
}
开发者ID:AliAkbarMontazeri,项目名称:AtomicGameEngine,代码行数:32,代码来源:UIMenubar.cpp

示例12: EndItem

BOOL CReportCtrlEx2::StartEdit(int nItem, int nSubItem)
{
	// Get the grid width and height
	if (!m_bAllowEdit || /*!_IsValidIndex(nItem) ||*/ nSubItem < 0 || nSubItem >= GetColumnCount())
		return FALSE;

	if (m_ptEditting.x == nItem && m_ptEditting.y == nSubItem)
		return TRUE;

	EndItem(TRUE);
		
	m_ptEditting.x = nItem;
	m_ptEditting.y = nSubItem;
	SetAllItemStates(RC_ITEM_SELECTED, RC_ITEM_UNSELECTED); // unselect all
	//SetItemStates(m_ptEditting.x, RC_ITEM_SELECTED | RC_ITEM_FOCUSED);

	// determine editbox font and alignment
	const DWORD FMT = _GetHeaderTextFormat(nSubItem);
	if (FMT != m_dwPrevEditFmt)
	{
		m_dwPrevEditFmt = FMT;

		// Funny thing:
		// Changing CEdit style among ES_LEFT, ES_CENTER, ES_RIGHT at runtime works
		// sometimes and fails other times. It just cannot guarantee to be succeed.
		// So I decided to destroy and recreate the CEdit every time when the text
		// format changes.
		if (m_pWndEdit->GetSafeHwnd() != NULL)
			m_pWndEdit->DestroyWindow();

		if (!m_pWndEdit->Create(ES_AUTOHSCROLL | ES_NOHIDESEL | WS_CHILD | WS_BORDER | FMT, CRect(0, 0, 1, 1), this, 0))
			return FALSE;
	}
	else
	{
		if (m_pWndEdit->GetSafeHwnd() == NULL
			&& !m_pWndEdit->Create(ES_AUTOHSCROLL | ES_NOHIDESEL | WS_CHILD | WS_BORDER | FMT, CRect(0, 0, 1, 1), this, 0))
		{
			return FALSE;
		}
	}

	m_pWndEdit->SetFont(GetFont());

	CRect rcEdit;
	ListView_GetSubItemRect(GetSafeHwnd(), m_ptEditting.x, m_ptEditting.y, LVIR_LABEL, &rcEdit);
	if (m_ptEditting.y > 0 && GetImageList() != NULL && GetItemImage(m_ptEditting.x, m_ptEditting.y) >= 0)
		rcEdit.DeflateRect(16, 0, 0, 0);

	// Move the editbox to that grid, obtain text from the grid, display the
	// editbox, and, finally, highlights all text in the editbox and set the
	// windows focus to the editbox.
	m_pWndEdit->MoveWindow(&rcEdit);
	m_pWndEdit->SetWindowText(GetItemText(m_ptEditting.x, m_ptEditting.y));
	m_pWndEdit->ShowWindow(SW_SHOW);
	m_pWndEdit->SetSel(0, -1);
	m_pWndEdit->SetFocus();

	return TRUE;
}
开发者ID:jlouzao,项目名称:Minerva,代码行数:60,代码来源:ReportCtrlEx2.cpp

示例13: RemoveAllItems

void
JXCurrentPathMenu::SetPath
	(
	const JCharacter* path
	)
{
	RemoveAllItems();

	JString p = path;
	JCleanPath(&p);

	JString p1, n;
	while (!JIsRootDirectory(p))
		{
		JStripTrailingDirSeparator(&p);
		JSplitPathAndName(p, &p1, &n);
		PrependItem(n);
		SetItemImage(1, GetIcon(p), kJFalse);
		p = p1;
		}

	PrependItem(p);
	SetItemImage(1, GetIcon(p), kJFalse);

	const JXImage* image = NULL;
	GetItemImage(GetItemCount(), &image);
	SetTitle(GetItemText(GetItemCount()), const_cast<JXImage*>(image), kJFalse);
	SetUpdateAction(kDisableNone);
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:29,代码来源:JXCurrentPathMenu.cpp

示例14: GetTitleText

void
JXTextMenu::AdjustPopupChoiceTitle
	(
	const JIndex index
	)
{
	const JString& origTitle = GetTitleText();
	if (origTitle.IsEmpty())
		{
		return;
		}

	JString newTitle;
	JIndex colonIndex;
	const JBoolean foundColon = origTitle.LocateSubstring(":", &colonIndex);
	if (foundColon && colonIndex > 1)
		{
		newTitle = origTitle.GetSubstring(1, colonIndex-1);
		}
	// not empty but no colon => title was empty originally, so replace it

	if (!newTitle.IsEmpty())
		{
		newTitle += ":  ";
		}
	newTitle += GetItemText(index);

	const JXImage* image = NULL;
	GetItemImage(index, &image);

	SetTitle(newTitle, const_cast<JXImage*>(image), kJFalse);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:32,代码来源:JXTextMenu.cpp

示例15: GetItemImage

bool CCWTreeCtrl::IsLeaf(HTREEITEM hItem) const
{
  // ItemHasChildren() won't work in the general case
  int i, dummy;
  BOOL status = GetItemImage(hItem, i, dummy);
  ASSERT(status);
  return (i != GROUP);
}
开发者ID:ByteRisc,项目名称:pwsafe,代码行数:8,代码来源:CWTreeCtrl.cpp


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