31 #include "../CEGUIBase.h"
32 #include "../CEGUIWindow.h"
33 #include "../CEGUIWindowManager.h"
34 #include "CEGUITreeItem.h"
35 #include "CEGUITreeProperties.h"
39 # pragma warning(push)
40 # pragma warning(disable : 4251)
78 typedef std::vector<TreeItem*> LBItemList;
83 static const String WidgetTypeName;
108 { populateGeometryBuffer(); }
112 { configureScrollbars(); }
124 size_t getItemCount(
void)
const
125 {
return d_listItems.size(); }
134 size_t getSelectedCount(
void)
const;
144 TreeItem* getFirstSelectedItem(
void)
const;
156 {
return d_lastSelected; }
177 TreeItem* getNextSelectedItemFromList(
const LBItemList &itemList,
179 bool& foundStartItem)
const;
189 bool isSortEnabled(
void)
const
192 void setItemRenderArea(
Rect& r)
195 Scrollbar* getVertScrollbar()
196 {
return d_vertScrollbar; }
198 Scrollbar* getHorzScrollbar()
199 {
return d_horzScrollbar; }
208 bool isMultiselectEnabled(
void)
const
209 {
return d_multiselect; }
211 bool isItemTooltipsEnabled(
void)
const
212 {
return d_itemTooltips; }
233 TreeItem* findFirstItemWithText(
const String& text);
235 TreeItem* findNextItemWithText(
const String& text,
236 const TreeItem* start_item);
238 TreeItem* findItemWithTextFromList(
const LBItemList &itemList,
240 const TreeItem* start_item,
241 bool foundStartItem);
262 TreeItem* findFirstItemWithID(uint searchID);
263 TreeItem* findNextItemWithID(uint searchID,
const TreeItem* start_item);
264 TreeItem* findItemWithIDFromList(
const LBItemList &itemList, uint searchID,
265 const TreeItem* start_item,
266 bool foundStartItem);
276 bool isTreeItemInList(
const TreeItem* item)
const;
286 bool isVertScrollbarAlwaysShown(
void)
const;
296 bool isHorzScrollbarAlwaysShown(
void)
const;
312 virtual void initialise(
void);
320 void resetList(
void);
334 void addItem(TreeItem* item);
359 void insertItem(TreeItem* item,
const TreeItem* position);
373 void removeItem(
const TreeItem* item);
382 void clearAllSelections(
void);
383 bool clearAllSelectionsFromList(
const LBItemList &itemList);
396 void setSortingEnabled(
bool setting);
410 void setMultiselectEnabled(
bool setting);
425 void setShowVertScrollbar(
bool setting);
440 void setShowHorzScrollbar(
bool setting);
442 void setItemTooltipsEnabled(
bool setting);
467 void setItemSelectState(TreeItem* item,
bool state);
492 void setItemSelectState(
size_t item_index,
bool state);
511 virtual void setLookNFeel(
const String& look);
526 void handleUpdatedItemData(
void);
541 void ensureItemIsVisible(
const TreeItem* item);
551 Tree(
const String& type,
const String& name);
572 virtual Rect getTreeRenderArea(
void)
const
573 {
return d_itemArea; }
587 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
601 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
613 virtual void cacheTreeBaseImagery()
623 bool containsOpenItemRecursive(
const LBItemList& itemList,
TreeItem* item);
629 void addTreeEvents(
void);
637 void configureScrollbars(
void);
644 void selectRange(
size_t start,
size_t end);
650 float getTotalItemsHeight(
void)
const;
651 void getTotalItemsInListHeight(
const LBItemList &itemList,
652 float *heightSum)
const;
658 float getWidestItemWidth(
void)
const;
659 void getWidestItemWidthInList(
const LBItemList &itemList,
int itemDepth,
660 float *widest)
const;
670 bool getHeightToItemInList(
const LBItemList &itemList,
673 float *height)
const;
683 bool clearAllSelections_impl(
void);
694 TreeItem* getItemFromListAtPoint(
const LBItemList &itemList,
float *bottomY,
695 const Point& pt)
const;
708 bool resetList_impl(
void);
721 virtual bool testClassName_impl(
const String& class_name)
const
723 if (class_name==(
const utf8*)
"Tree")
734 bool handle_scrollChange(
const EventArgs& args);
737 virtual void populateGeometryBuffer();
739 void drawItemList(LBItemList& itemList,
Rect& itemsArea,
float widest,
841 void addTreeProperties(
void);
863 #if defined(_MSC_VER)
864 # pragma warning(pop)
867 #endif // end of guard _CEGUITree_h_