本文整理汇总了C++中SetItemImage函数的典型用法代码示例。如果您正苦于以下问题:C++ SetItemImage函数的具体用法?C++ SetItemImage怎么用?C++ SetItemImage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetItemImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WXUNUSED
void ResultCheckListCtrl::OnUnselectAll(wxCommandEvent& WXUNUSED(event))
{
long Item = -1;
if(GetSelectionCount() == 1)
{
//If user has selected only 1 item, that apply to all files
for ( ;; )
{
Item = GetNextItem(Item);
if(Item == -1)
break;
SetItemImage(Item, 1);
}
}
else
{
//If user has selected more than 1 item, that apply to selected files
for ( ;; )
{
Item = GetNextItem(Item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if(Item == -1)
break;
SetItemImage(Item, 1);
}
}
}
示例2: 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);
}
示例3: 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);
}
}
}
示例4: wxTreeCtrlEx
CLocalTreeView::CLocalTreeView(wxWindow* parent, wxWindowID id, CState *pState, CQueueView *pQueueView)
: wxTreeCtrlEx(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_EDIT_LABELS | wxTR_LINES_AT_ROOT | wxTR_HAS_BUTTONS | wxNO_BORDER),
CSystemImageList(16),
CStateEventHandler(pState),
m_pQueueView(pQueueView)
{
wxGetApp().AddStartupProfileRecord(_T("CLocalTreeView::CLocalTreeView"));
#ifdef __WXMAC__
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
#endif
pState->RegisterHandler(this, STATECHANGE_LOCAL_DIR);
pState->RegisterHandler(this, STATECHANGE_APPLYFILTER);
SetImageList(GetSystemImageList());
#ifdef __WXMSW__
m_pVolumeEnumeratorThread = 0;
CreateRoot();
#else
wxTreeItemId root = AddRoot(_T("/"));
SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Normal);
SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_Selected);
SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Expanded);
SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_SelectedExpanded);
SetDir(_T("/"));
#endif
SetDropTarget(new CLocalTreeViewDropTarget(this));
}
示例5: 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);
}
示例6: if
//---------------------------------------------------------
void CData_Source_PgSQL::Update_Source(const wxTreeItemId &Item)
{
CData_Source_PgSQL_Data *pData = Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL ) return;
if( pData->Get_Type() != TYPE_SOURCE )
{
return;
}
Freeze();
DeleteChildren(Item);
//-----------------------------------------------------
if( !pData->is_Connected() )
{
SetItemImage(Item, IMG_SRC_CLOSED, wxTreeItemIcon_Normal);
SetItemImage(Item, IMG_SRC_CLOSED, wxTreeItemIcon_Selected);
}
else
{
SetItemImage(Item, IMG_SRC_OPENED, wxTreeItemIcon_Normal);
SetItemImage(Item, IMG_SRC_OPENED, wxTreeItemIcon_Selected);
CSG_Table Tables;
RUN_MODULE(DB_PGSQL_Table_List, false, // CTable_List
SET_PARAMETER("CONNECTION", pData->Get_Value())
&& SET_PARAMETER("TABLES" , &Tables)
);
Tables.Set_Index(1, TABLE_INDEX_Ascending, 0, TABLE_INDEX_Ascending);
for(int i=0; i<Tables.Get_Count(); i++)
{
CSG_String s(Tables[i].asString(1));
TSG_Shape_Type Shape;
TSG_Vertex_Type Vertex;
if( CSG_Shapes_OGIS_Converter::to_ShapeType(s, Shape, Vertex) )
{
switch( Shape )
{
case SHAPE_TYPE_Point: Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_POINT ); break;
case SHAPE_TYPE_Points: Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_POINTS ); break;
case SHAPE_TYPE_Line: Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_LINE ); break;
case SHAPE_TYPE_Polygon: Append_Table(Item, Tables[i].asString(0), TYPE_SHAPES, IMG_POLYGON); break;
}
}
else if( !s.Cmp("RASTER" ) ) Append_Table(Item, Tables[i].asString(0), TYPE_GRIDS , IMG_GRIDS );
else if( !s.Cmp("TABLE" ) ) Append_Table(Item, Tables[i].asString(0), TYPE_TABLE , IMG_TABLE );
}
Expand(Item);
}
Thaw();
}
示例7: GetIconIndex
void CLocalTreeView::OnSelectionChanging(wxTreeEvent& event)
{
// On-demand open icon for selected items
wxTreeItemId item = event.GetItem();
if (GetItemImage(item, wxTreeItemIcon_Selected) == -1)
{
int icon = GetIconIndex(opened_dir, GetDirFromItem(item));
SetItemImage(item, icon, wxTreeItemIcon_Selected);
SetItemImage(item, icon, wxTreeItemIcon_SelectedExpanded);
}
}
示例8: while
void browsers::TDTbrowser::collectChildren(laydata::TDTHierTree *root, wxTreeItemId& lroot) {
laydata::TDTHierTree* Child= root->GetChild();
wxTreeItemId nroot;
while (Child) {
SetItemImage(lroot,0,wxTreeItemIcon_Normal);
SetItemImage(lroot,1,wxTreeItemIcon_Expanded);
nroot = AppendItem(lroot, wxString(Child->GetItem()->name().c_str()));
SetItemTextColour(nroot,*wxLIGHT_GREY);
collectChildren(Child, nroot);
Child = Child->GetBrother();
}
}
示例9: SetItemImage
void wxSpinTreeCtrl::UpdateTreeItemIcon(wxTreeItemId id)
{
wxSpinTreeItemData *treeData = (wxSpinTreeItemData*)GetItemData(id);
if ((!treeData) || (!treeData->m_pNode.valid()))
return;
if (treeData->m_pNode->nodeType == "GroupNode")
SetItemImage(id, 1, wxTreeItemIcon_Normal);
else if (treeData->m_pNode->nodeType == "ShapeNode")
SetItemImage(id, wxTreeItemIcon_Normal);
else
SetItemImage(id, 0, wxTreeItemIcon_Normal);
}
示例10: 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);
}
示例11: ASSERT
BOOL CTreeOptionsCtrlEx::SetRadioButton(HTREEITEM hParent, int nIndex)
{
//Validate our parameters
ASSERT(IsGroup(hParent)); //Parent item must be a group item
//Iterate through the child items and turn on the specified one and turn off all the other ones
HTREEITEM hChild = GetNextItem(hParent, TVGN_CHILD);
//Turn of redraw to Q all the changes we're going to make here
SetRedraw(FALSE);
int i=0;
BOOL bCheckedSomeItem = FALSE;
while (hChild)
{
//if we reach a non radio button then break out of the loop
if (!IsRadioButton(hChild))
break;
if (i == nIndex)
{
//Turn this item on
BOOL bOldState;
GetRadioButton(hChild, bOldState);
VERIFY(SetItemImage(hChild, 3, 3));
bCheckedSomeItem = TRUE;
if (!bOldState)
NotifyParent(BN_CLICKED, hChild);
}
else
{
BOOL bEnable;
VERIFY(GetRadioButtonEnable(hChild, bEnable));
//Turn this item off
if (bEnable)
VERIFY(SetItemImage(hChild, 2, 2));
else
VERIFY(SetItemImage(hChild, 4, 4));
}
//Move on to the next item
hChild = GetNextItem(hChild, TVGN_NEXT);
++i;
}
ASSERT(bCheckedSomeItem); //You specified an index which does not exist
//Reset the redraw flag
SetRedraw(TRUE);
return TRUE;
}
示例12: ASSERT
BOOL CTreeOptionsCtrlEx::SetRadioButton(HTREEITEM hItem)
{
//Validate our parameters
ASSERT(IsRadioButton(hItem)); //Must be a radio item to check it
//Iterate through the sibling items and turn them all off except this one
HTREEITEM hParent = GetNextItem(hItem, TVGN_PARENT);
ASSERT(IsGroup(hParent)); //Parent item must be a group item
//Iterate through the child items and turn on the specified one and turn off all the other ones
HTREEITEM hChild = GetNextItem(hParent, TVGN_CHILD);
//Turn of redraw to Q all the changes we're going to make here
SetRedraw(FALSE);
while (hChild)
{
//if we reach a non radio button then break out of the loop
if (!IsRadioButton(hChild))
break;
if (hChild == hItem)
{
//Turn this item on
BOOL bOldState;
GetRadioButton(hChild, bOldState);
BOOL bSuccess = SetItemImage(hChild, 3, 3);
ASSERT(bSuccess);
if (!bOldState)
NotifyParent(BN_CLICKED, hChild);
}
else
{
BOOL bEnable;
VERIFY(GetRadioButtonEnable(hChild, bEnable));
//Turn this item off
if (bEnable)
VERIFY(SetItemImage(hChild, 2, 2));
else
VERIFY(SetItemImage(hChild, 6, 6));
}
//Move on to the next item
hChild = GetNextItem(hChild, TVGN_NEXT);
}
//Reset the redraw flag
SetRedraw(TRUE);
return TRUE;
}
示例13: 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);
}
}
示例14: 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;
}
}
示例15: SetItemImage
void wxGISCheckList::SetItemCheckState(long item, int nState)
{
LPITEM_DATA pdata = (LPITEM_DATA)wxListView::GetItemData(item);
pdata->nCheckState = nState;
bool bCheck = pdata->nCheckState != 0;
SetItemImage(item, bCheck == true ? 1 : 0, bCheck == true ? 1 : 0);
}