• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/wxWidgets-2.8.12/src/msw/

Lines Matching refs:item

53 #define HITEM(item)     ((HTREEITEM)(((item).m_pItem)))
76 // item state changes in the vista tree control. It is only effective in
80 // multi-selection tree, causing seemingly spurious item selection state changes
81 // during Shift or Ctrl-click item selection. (To witness the original broken
83 // solved by using the following class to 'unlock' an item's selection state.
88 // unlock a single item
89 TreeItemUnlocker(HTREEITEM item) { ms_unlockedItem = item; }
98 // check if the item state is currently locked
99 static bool IsLocked(HTREEITEM item)
100 { return ms_unlockedItem != (HTREEITEM)-1 && item != ms_unlockedItem; }
167 // find the first (or last) item and select it
226 // item without changing anything else (if someone knows why Microsoft doesn't
238 // remember the selection state of the item
245 // focused item)
292 wxTreeViewItem(const wxTreeItemId& item, // the item handle
301 hItem = HITEM(item);
341 // get the real data associated with the item
382 // get item
384 // set item
385 void SetItem(const wxTreeItemId& item) { m_item = item; }
388 // all the images associated with the item
391 // item for sort callbacks
432 // returns true if the item is the virtual root
433 #define IS_VIRTUAL_ROOT(item) (HITEM(item) == TVI_ROOT)
455 // override this function to do whatever is needed for each item, return
457 virtual bool OnVisit(const wxTreeItemId& item) = 0;
484 virtual bool OnVisit(const wxTreeItemId& item)
489 if ( (tree->GetRootItem() == item) && tree->HasFlag(wxTR_HIDE_ROOT) )
494 if ( ::IsItemSelected(GetHwndOf(tree), HITEM(item)) )
496 m_selections.Add(item);
524 virtual bool OnVisit(const wxTreeItemId& WXUNUSED(item))
854 _T("can't retrieve virtual root item") );
915 size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
918 wxCHECK_MSG( item.IsOk(), 0u, wxT("invalid tree item") );
920 TraverseCounter counter(this, item, recursively);
956 bool wxTreeCtrl::IsHiddenRoot(const wxTreeItemId& item) const
958 return HITEM(item) == TVI_ROOT && HasFlag(wxTR_HIDE_ROOT);
961 wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const
963 wxCHECK_MSG( item.IsOk(), wxEmptyString, wxT("invalid tree item") );
967 wxTreeViewItem tvItem(item, TVIF_TEXT);
979 void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
981 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
983 if ( IS_VIRTUAL_ROOT(item) )
986 wxTreeViewItem tvItem(item, TVIF_TEXT);
990 // when setting the text of the item being edited, the text control should
998 if ( item == m_idEdited )
1005 int wxTreeCtrl::GetItemImage(const wxTreeItemId& item,
1008 wxCHECK_MSG( item.IsOk(), -1, wxT("invalid tree item") );
1010 if ( IsHiddenRoot(item) )
1012 // no images for hidden root item
1016 wxTreeItemParam *param = GetItemParam(item);
1021 void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image,
1024 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1030 if ( IsHiddenRoot(item) )
1032 // no images for hidden root item
1036 wxTreeItemParam *data = GetItemParam(item);
1042 RefreshItem(item);
1045 wxTreeItemParam *wxTreeCtrl::GetItemParam(const wxTreeItemId& item) const
1047 wxCHECK_MSG( item.IsOk(), NULL, wxT("invalid tree item") );
1049 wxTreeViewItem tvItem(item, TVIF_PARAM);
1052 if ( IS_VIRTUAL_ROOT(item) )
1066 wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const
1068 wxTreeItemParam *data = GetItemParam(item);
1073 void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data)
1075 // first, associate this piece of data with this item
1078 data->SetId(item);
1081 wxTreeItemParam *param = GetItemParam(item);
1088 void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has)
1090 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1092 if ( IS_VIRTUAL_ROOT(item) )
1095 wxTreeViewItem tvItem(item, TVIF_CHILDREN);
1100 void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
1102 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1104 if ( IS_VIRTUAL_ROOT(item) )
1107 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_BOLD);
1112 void wxTreeCtrl::SetItemDropHighlight(const wxTreeItemId& item, bool highlight)
1114 if ( IS_VIRTUAL_ROOT(item) )
1117 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_DROPHILITED);
1122 void wxTreeCtrl::RefreshItem(const wxTreeItemId& item)
1124 if ( IS_VIRTUAL_ROOT(item) )
1128 if ( GetBoundingRect(item, rect) )
1134 wxColour wxTreeCtrl::GetItemTextColour(const wxTreeItemId& item) const
1136 wxCHECK_MSG( item.IsOk(), wxNullColour, wxT("invalid tree item") );
1138 wxMapTreeAttr::const_iterator it = m_attrs.find(item.m_pItem);
1142 wxColour wxTreeCtrl::GetItemBackgroundColour(const wxTreeItemId& item) const
1144 wxCHECK_MSG( item.IsOk(), wxNullColour, wxT("invalid tree item") );
1146 wxMapTreeAttr::const_iterator it = m_attrs.find(item.m_pItem);
1150 wxFont wxTreeCtrl::GetItemFont(const wxTreeItemId& item) const
1152 wxCHECK_MSG( item.IsOk(), wxNullFont, wxT("invalid tree item") );
1154 wxMapTreeAttr::const_iterator it = m_attrs.find(item.m_pItem);
1158 void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item,
1161 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1164 wxMapTreeAttr::iterator it = m_attrs.find(item.m_pItem);
1169 m_attrs[item.m_pItem] =
1179 RefreshItem(item);
1182 void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item,
1185 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1188 wxMapTreeAttr::iterator it = m_attrs.find(item.m_pItem);
1193 m_attrs[item.m_pItem] =
1203 RefreshItem(item);
1206 void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
1208 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1211 wxMapTreeAttr::iterator it = m_attrs.find(item.m_pItem);
1216 m_attrs[item.m_pItem] =
1226 // Reset the item's text to ensure that the bounding rect will be adjusted
1228 SetItemText(item, GetItemText(item));
1230 RefreshItem(item);
1237 bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
1239 wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
1241 if ( item == wxTreeItemId(TVI_ROOT) )
1252 *(HTREEITEM *)&rect = HITEM(item);
1257 // if TVM_GETITEMRECT returned false, then the item is definitely not
1262 // however if it returned true, the item might still be outside the
1268 bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
1270 wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
1272 if ( IS_VIRTUAL_ROOT(item) )
1275 return GetFirstChild(item, cookie).IsOk();
1278 wxTreeViewItem tvItem(item, TVIF_CHILDREN);
1284 bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
1286 wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
1288 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_EXPANDED);
1294 bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
1296 wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
1298 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_SELECTED);
1304 bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
1306 wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
1308 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_BOLD);
1335 wxTreeItemId wxTreeCtrl::GetItemParent(const wxTreeItemId& item) const
1337 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1341 if ( IS_VIRTUAL_ROOT(item) )
1346 else // normal item
1348 hItem = TreeView_GetParent(GetHwnd(), HITEM(item));
1359 wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item,
1362 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1365 cookie = TreeView_GetChild(GetHwnd(), HITEM(item));
1370 wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& WXUNUSED(item),
1379 wxTreeItemId item(hitem);
1381 cookie = item.m_pItem;
1383 return item;
1388 wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item,
1391 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1393 cookie = (long)TreeView_GetChild(GetHwnd(), HITEM(item));
1398 wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& WXUNUSED(item),
1407 wxTreeItemId item(hitem);
1409 cookie = (long)item.m_pItem;
1411 return item;
1416 wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const
1418 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1424 child = GetFirstChild(item, cookie);
1428 child = GetNextChild(item, cookie);
1434 wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const
1436 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1437 return wxTreeItemId(TreeView_GetNextSibling(GetHwnd(), HITEM(item)));
1440 wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const
1442 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1443 return wxTreeItemId(TreeView_GetPrevSibling(GetHwnd(), HITEM(item)));
1451 wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const
1453 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1454 wxASSERT_MSG( IsVisible(item), wxT("The item you call GetNextVisible() for must be visible itself!"));
1456 return wxTreeItemId(TreeView_GetNextVisible(GetHwnd(), HITEM(item)));
1459 wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
1461 wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") );
1462 wxASSERT_MSG( IsVisible(item), wxT("The item you call GetPrevVisible() for must be visible itself!"));
1464 return wxTreeItemId(TreeView_GetPrevVisible(GetHwnd(), HITEM(item)));
1471 bool wxTreeCtrl::IsItemChecked(const wxTreeItemId& item) const
1473 wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
1476 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_STATEIMAGEMASK);
1483 void wxTreeCtrl::SetItemCheck(const wxTreeItemId& item, bool check)
1485 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
1488 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_STATEIMAGEMASK);
1523 // this is how we insert the item as the first child: supply a NULL
1534 tvIns.item.pszText = (wxChar *)text.c_str(); // cast is ok
1538 tvIns.item.pszText = NULL;
1539 tvIns.item.cchTextMax = 0;
1542 // create the param which will store the other item parameters
1545 // we return the images on demand as they depend on whether the item is
1548 tvIns.item.iImage = I_IMAGECALLBACK;
1549 tvIns.item.iSelectedImage = I_IMAGECALLBACK;
1555 tvIns.item.lParam = (LPARAM)param;
1556 tvIns.item.mask = mask;
1579 // associate the application tree item with Win32 tree item handle
1600 int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const
1602 return GetItemImage(item, wxTreeItemIcon_Selected);
1605 void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
1607 SetItemImage(item, image, wxTreeItemIcon_Selected);
1619 // create a virtual root item, the parent for all the others
1644 else // find the item from index
1656 // assert, not check: if the index is invalid, we will append the item
1664 void wxTreeCtrl::Delete(const wxTreeItemId& item)
1667 // tree ctrl will eventually crash after item deletion
1670 if ( !TreeView_DeleteItem(GetHwnd(), HITEM(item)) )
1676 // delete all children (but don't delete the item itself)
1677 void wxTreeCtrl::DeleteChildren(const wxTreeItemId& item)
1685 wxTreeItemId child = GetFirstChild(item, cookie);
1690 child = GetNextChild(item, cookie);
1708 // delete the "virtual" root item.
1723 void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag)
1732 wxCHECK_RET( !IsHiddenRoot(item),
1740 // To avoid that the messages be sent twice when the item is expanded for
1743 wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_EXPANDEDONCE);
1747 if ( TreeView_Expand(GetHwnd(), HITEM(item), flag) != 0 )
1751 wxTreeEvent event(gs_expandEvents[IsExpanded(item) ? IDX_EXPAND
1754 this, item);
1760 void wxTreeCtrl::Expand(const wxTreeItemId& item)
1762 DoExpand(item, TVE_EXPAND);
1765 void wxTreeCtrl::Collapse(const wxTreeItemId& item)
1767 DoExpand(item, TVE_COLLAPSE);
1770 void wxTreeCtrl::CollapseAndReset(const wxTreeItemId& item)
1772 DoExpand(item, TVE_COLLAPSE | TVE_COLLAPSERESET);
1775 void wxTreeCtrl::Toggle(const wxTreeItemId& item)
1777 DoExpand(item, TVE_TOGGLE);
1782 void wxTreeCtrl::ExpandItem(const wxTreeItemId& item, int action)
1784 DoExpand(item, action);
1818 void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select)
1820 wxCHECK_RET( !IsHiddenRoot(item), _T("can't select hidden root item") );
1824 ::SelectItem(GetHwnd(), HITEM(item), select);
1835 wxTreeEvent event(wxEVT_COMMAND_TREE_SEL_CHANGING, this, item);
1838 if ( !TreeView_SelectItem(GetHwnd(), HITEM(item)) )
1852 void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item)
1854 wxCHECK_RET( !IsHiddenRoot(item), _T("can't show hidden root item") );
1857 TreeView_EnsureVisible(GetHwnd(), HITEM(item));
1860 void wxTreeCtrl::ScrollTo(const wxTreeItemId& item)
1862 if ( !TreeView_SelectSetFirstVisible(GetHwnd(), HITEM(item)) )
1894 wxTextCtrl *wxTreeCtrl::EditLabel(const wxTreeItemId& item,
1901 m_idEdited = item;
1903 HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), HITEM(item));
1957 bool wxTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
1964 if ( IS_VIRTUAL_ROOT(item) )
1969 if ( TreeView_GetItemRect(GetHwnd(), HITEM(item),
1978 // couldn't retrieve rect: for example, item isn't visible
2014 void wxTreeCtrl::SortChildren(const wxTreeItemId& item)
2016 wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
2027 TreeView_SortChildren(GetHwnd(), HITEM(item), 0);
2032 tvSort.hParent = HITEM(item);
2101 // the item for which the menu should be shown
2102 wxTreeItemId item;
2115 item = wxTreeItemId(TreeView_GetSelection(GetHwnd()));
2116 if ( item.IsOk() )
2120 GetBoundingRect(item, rect, true);
2132 item = wxTreeItemId(tvhti.hItem);
2136 wxTreeEvent event(wxEVT_COMMAND_TREE_ITEM_MENU, this, item);
2186 // take the focused item
2203 // currently selected item
2224 // already selected item (and nothing else is
2233 else // click on a single selected item
2250 // focused item when right mouse button is pressed on another
2335 // highlight the item as target (hiding drag image is
2390 // the tree control greys out the selected item when it loses focus and
2398 // TreeView_GetItemRect() will return false if item is not visible,
2587 event.m_item = info->item.hItem;
2588 event.m_label = info->item.pszText;
2617 event.m_item = info->item.hItem;
2618 event.m_label = info->item.pszText;
2619 event.m_editCancelled = info->item.pszText == NULL;
2641 // Which item are we trying to get a tooltip for?
2661 event.m_item = info->item.hItem;
2725 wxTreeItemId item;
2727 item = GetSelection();
2730 this, item);
2743 // following messages will allow only the unlocked item's selection
2752 // get info about the item about to be changed
2756 // item's state is locked, don't allow the change
2809 // notify us before painting each item
2821 // nothing to do for this item
2894 wxTreeItemId item = HitTest(wxPoint(point.x, point.y), flags);
2897 event.m_item = item;
2943 // handled the activation of the item we shouldn't proceed with
2944 // also using the same double click for toggling the item expanded
2945 // state -- but OTOH do let the user to expand/collapse the item by
3063 // the item is not refreshed properly after expansion when it has
3083 wxTreeItemId item = event.m_item;
3086 const wxTreeItemParam * const param = GetItemParam(item);
3090 if ( info->item.mask & TVIF_IMAGE )
3092 info->item.iImage =
3095 IsExpanded(item) ? wxTreeItemIcon_Expanded
3099 if ( info->item.mask & TVIF_SELECTEDIMAGE )
3101 info->item.iSelectedImage =
3104 IsExpanded(item) ? wxTreeItemIcon_SelectedExpanded
3143 _T("wxTreeCtrl::SetState(): item index out of bounds") );