本文整理汇总了C++中GetItemImage函数的典型用法代码示例。如果您正苦于以下问题:C++ GetItemImage函数的具体用法?C++ GetItemImage怎么用?C++ GetItemImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetItemImage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetItemImage
void CDownloads_Groups::UpdateDeletedIcon()
{
int img = _DldsMgr.Get_DeletedDownloadCount () ? 7 : 6;
int imgold;
GetItemImage (m_hDeleted, imgold, imgold);
if (img != imgold)
SetItemImage (m_hDeleted, img, img);
}
开发者ID:DragonZX,项目名称:fdm2,代码行数:8,代码来源:Downloads_Groups.cpp
示例17: DeleteItem
void CIMMain::LocalListChange(int dwUserId, char* pNick, int nGroupID)
{
//本地处理
int nImg = 3;
CString sname;
HTREEITEM hti=FindUserITEM(dwUserId + 1000);
if(pNick == NULL && hti)
{
sname=GetItemText(hti);
}
if(hti)
{
if(nGroupID==0)
{
DeleteItem(hti);
return;
}
GetItemImage(hti,nImg,nImg);
DeleteItem(hti);
}
else if(pNick == NULL && !hti)
{
sname = CString("陌生人");
}
else
{
sname = CString(pNick);
}
HTREEITEM insertAfter=TVI_LAST;
// if(nImg==3 || nImg==5)
// insertAfter=TVI_FIRST;
if(nGroupID==1)
{
hti=InsertItem(sname,nImg,nImg,htiFamilier,insertAfter);
Expand(htiFamilier,TVE_EXPAND);
//SetItemImage(htiFamilier,1,1);
}
else if(nGroupID==2)
{
hti=InsertItem(sname,nImg,nImg,htiUnfamilier,insertAfter);
Expand(htiUnfamilier,TVE_EXPAND);
//SetItemImage(htiBlack,1,1);
}
else
{
hti=InsertItem(sname,nImg,nImg,htiBlack,insertAfter);
Expand(htiBlack,TVE_EXPAND);
//SetItemImage(htiBlack,1,1);
}
SetItemData(hti,dwUserId + 1000);
}
开发者ID:lincoln56,项目名称:robinerp,代码行数:58,代码来源:IMMain.cpp
示例18: GetItemImage
BOOL CImageTreeCtrl::Retofline( HTREEITEM hItem )//tree0412
{
int brother_nImage,brother_nSelectedImage;
GetItemImage(hItem,brother_nImage,brother_nSelectedImage);
return is_connection_by_image(brother_nImage,brother_nSelectedImage);
}
开发者ID:jay-github,项目名称:T3000_Building_Automation_System,代码行数:9,代码来源:ImageTreeCtrl.cpp
示例19: EndEdit
BOOL CReportCtrl::SwapItems(int nItem1, int nItem2)
{
EndEdit(TRUE);
if(!_IsValidIndex(nItem1) || !_IsValidIndex(nItem2))
{
return(FALSE);
}
if(nItem1 == nItem2)
{
return(TRUE);
}
_UnsetSortedColumn();
// record previous states first
const DWORD STATES1 = GetItemStates(nItem1);
const DWORD STATES2 = GetItemStates(nItem2);
const DWORD DATA1 = CListCtrl :: GetItemData(nItem1);
const DWORD DATA2 = CListCtrl :: GetItemData(nItem2);
// swap item texts and images
for(int i = 0; i < GetColumnCount(); i++)
{
CString str = GetItemText(nItem1, i);
CListCtrl :: SetItemText(nItem1, i, GetItemText(nItem2, i));
CListCtrl :: SetItemText(nItem2, i, str);
UINT nImg = GetItemImage(nItem1, i);
SetItemImage(nItem1, i, GetItemImage(nItem2, i));
SetItemImage(nItem2, i, nImg);
}
// swap item data
CListCtrl :: SetItemData(nItem1, DATA2);
CListCtrl :: SetItemData(nItem2, DATA1);
// restore states
SetItemStates(nItem1, STATES2);
SetItemStates(nItem2, STATES1);
return(TRUE);
}
开发者ID:340211173,项目名称:hf-2011,代码行数:43,代码来源:Reportctrl.cpp
示例20: GetSelectedItem
void CZoneTree::OnLButtonDblClk(UINT nFlags, CPoint point)
{
HTREEITEM it;
int i;
it = GetSelectedItem();
GetItemImage(it, i, i);
switch(i) {
case AREA_DATA: {
((CWinDEDlg*)GetParent())->OnAreaProperties();
break;
}
case MOB_DATA: {
mob_data *mob;
mob = (mob_data*)GetItemData(it);
((CWinDEDlg*)GetParent())->OnEditMob(mob->vnum);
break;
}
case OBJECT_DATA:{
object_data *obj;
obj = (object_data*)GetItemData(it);
((CWinDEDlg*)GetParent())->OnEditObject(obj->vnum);
break;
}
case ROOM_DATA: {
room_data *room;
room = (room_data*)GetItemData(it);
((CWinDEDlg*)GetParent())->OnEditRoom(room->vnum);
if(((CWinDEDlg*)GetParent())->in_room != room)
{
((CWinDEDlg*)GetParent())->in_room = room;
((CWinDEDlg*)GetParent())->ShowRoom();
}
break;
}
case MOB_INDEX: {
mob_index *m_index;
m_index = (mob_index*)GetItemData(it);
((CWinDEDlg*)GetParent())->OnEditMob(m_index->vnum);
break;
}
case OBJ_INDEX:{
obj_index *o_index;
o_index = (obj_index*)GetItemData(it);
((CWinDEDlg*)GetParent())->OnEditObject(o_index->vnum);
break;
}
}
GetParent()->SetFocus();
}
开发者ID:GalacticSoft,项目名称:DikuEdit,代码行数:55,代码来源:ZoneTree.cpp
注:本文中的GetItemImage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论