31 #include "CEGUIBase.h"
32 #include "CEGUIWindow.h"
33 #include "CEGUIWindowManager.h"
34 #include "elements/CEGUITreeItem.h"
35 #include "elements/CEGUITreeProperties.h"
39 # pragma warning(push)
40 # pragma warning(disable : 4251)
80 typedef std::vector<TreeItem*> LBItemList;
85 static const String WidgetTypeName;
110 { populateRenderCache(); }
114 { configureScrollbars(); }
126 size_t getItemCount(
void)
const
127 {
return d_listItems.size(); }
136 size_t getSelectedCount(
void)
const;
146 TreeItem* getFirstSelectedItem(
void)
const;
158 {
return d_lastSelected; }
179 TreeItem* getNextSelectedItemFromList(
const LBItemList &itemList,
181 bool foundStartItem)
const;
191 bool isSortEnabled(
void)
const
194 void setItemRenderArea(
Rect& r)
197 Scrollbar* getVertScrollbar()
198 {
return d_vertScrollbar; }
200 Scrollbar* getHorzScrollbar()
201 {
return d_horzScrollbar; }
210 bool isMultiselectEnabled(
void)
const
211 {
return d_multiselect; }
213 bool isItemTooltipsEnabled(
void)
const
214 {
return d_itemTooltips; }
235 TreeItem* findFirstItemWithText(
const String& text);
237 TreeItem* findNextItemWithText(
const String& text,
238 const TreeItem* start_item);
240 TreeItem* findItemWithTextFromList(
const LBItemList &itemList,
242 const TreeItem* start_item,
243 bool foundStartItem);
264 TreeItem* findFirstItemWithID(uint searchID);
265 TreeItem* findNextItemWithID(uint searchID,
const TreeItem* start_item);
266 TreeItem* findItemWithIDFromList(
const LBItemList &itemList, uint searchID,
267 const TreeItem* start_item,
268 bool foundStartItem);
278 bool isTreeItemInList(
const TreeItem* item)
const;
288 bool isVertScrollbarAlwaysShown(
void)
const;
298 bool isHorzScrollbarAlwaysShown(
void)
const;
314 virtual void initialise(
void);
322 void resetList(
void);
336 void addItem(TreeItem* item);
361 void insertItem(TreeItem* item,
const TreeItem* position);
375 void removeItem(
const TreeItem* item);
384 void clearAllSelections(
void);
385 bool clearAllSelectionsFromList(
const LBItemList &itemList);
398 void setSortingEnabled(
bool setting);
412 void setMultiselectEnabled(
bool setting);
427 void setShowVertScrollbar(
bool setting);
442 void setShowHorzScrollbar(
bool setting);
444 void setItemTooltipsEnabled(
bool setting);
469 void setItemSelectState(TreeItem* item,
bool state);
494 void setItemSelectState(
size_t item_index,
bool state);
513 virtual void setLookNFeel(
const String& look);
528 void handleUpdatedItemData(
void);
543 void ensureItemIsVisible(
const TreeItem* item);
553 Tree(
const String& type,
const String& name);
574 virtual Rect getTreeRenderArea(
void)
const
575 {
return d_itemArea; }
589 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
603 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
615 virtual void cacheTreeBaseImagery()
625 bool containsOpenItemRecursive(
const LBItemList& itemList,
TreeItem* item);
631 void addTreeEvents(
void);
639 void configureScrollbars(
void);
646 void selectRange(
size_t start,
size_t end);
652 float getTotalItemsHeight(
void)
const;
653 void getTotalItemsInListHeight(
const LBItemList &itemList,
654 float *heightSum)
const;
660 float getWidestItemWidth(
void)
const;
661 void getWidestItemWidthInList(
const LBItemList &itemList,
int itemDepth,
662 float *widest)
const;
672 bool getHeightToItemInList(
const LBItemList &itemList,
675 float *height)
const;
685 bool clearAllSelections_impl(
void);
696 TreeItem* getItemFromListAtPoint(
const LBItemList &itemList,
float *bottomY,
697 const Point& pt)
const;
710 bool resetList_impl(
void);
723 virtual bool testClassName_impl(
const String& class_name)
const
725 if (class_name==(
const utf8*)
"Tree")
736 bool handle_scrollChange(
const EventArgs& args);
739 virtual void populateRenderCache();
741 void drawItemList(LBItemList &itemList,
Rect &itemsArea,
float widest,
843 void addTreeProperties(
void);
865 #if defined(_MSC_VER)
866 # pragma warning(pop)
869 #endif // end of guard _CEGUITree_h_