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;
144 { populateGeometryBuffer(); }
148 { configureScrollbars(); }
160 size_t getItemCount(
void)
const
161 {
return d_listItems.size(); }
170 size_t getSelectedCount(
void)
const;
180 TreeItem* getFirstSelectedItem(
void)
const;
192 {
return d_lastSelected; }
213 TreeItem* getNextSelectedItemFromList(
const LBItemList &itemList,
215 bool& foundStartItem)
const;
225 bool isSortEnabled(
void)
const
228 void setItemRenderArea(
Rect& r)
231 Scrollbar* getVertScrollbar()
232 {
return d_vertScrollbar; }
234 Scrollbar* getHorzScrollbar()
235 {
return d_horzScrollbar; }
244 bool isMultiselectEnabled(
void)
const
245 {
return d_multiselect; }
247 bool isItemTooltipsEnabled(
void)
const
248 {
return d_itemTooltips; }
269 TreeItem* findFirstItemWithText(
const String& text);
271 TreeItem* findNextItemWithText(
const String& text,
272 const TreeItem* start_item);
274 TreeItem* findItemWithTextFromList(
const LBItemList &itemList,
276 const TreeItem* start_item,
277 bool foundStartItem);
298 TreeItem* findFirstItemWithID(uint searchID);
299 TreeItem* findNextItemWithID(uint searchID,
const TreeItem* start_item);
300 TreeItem* findItemWithIDFromList(
const LBItemList &itemList, uint searchID,
301 const TreeItem* start_item,
302 bool foundStartItem);
312 bool isTreeItemInList(
const TreeItem* item)
const;
322 bool isVertScrollbarAlwaysShown(
void)
const;
332 bool isHorzScrollbarAlwaysShown(
void)
const;
348 virtual void initialise(
void);
356 void resetList(
void);
370 void addItem(TreeItem* item);
395 void insertItem(TreeItem* item,
const TreeItem* position);
409 void removeItem(
const TreeItem* item);
418 void clearAllSelections(
void);
419 bool clearAllSelectionsFromList(
const LBItemList &itemList);
432 void setSortingEnabled(
bool setting);
446 void setMultiselectEnabled(
bool setting);
461 void setShowVertScrollbar(
bool setting);
476 void setShowHorzScrollbar(
bool setting);
478 void setItemTooltipsEnabled(
bool setting);
503 void setItemSelectState(TreeItem* item,
bool state);
528 void setItemSelectState(
size_t item_index,
bool state);
547 virtual void setLookNFeel(
const String& look);
562 void handleUpdatedItemData(
void);
577 void ensureItemIsVisible(
const TreeItem* item);
587 Tree(
const String& type,
const String& name);
608 virtual Rect getTreeRenderArea(
void)
const
609 {
return d_itemArea; }
623 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
637 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
649 virtual void cacheTreeBaseImagery()
659 bool containsOpenItemRecursive(
const LBItemList& itemList,
TreeItem* item);
665 void addTreeEvents(
void);
673 void configureScrollbars(
void);
680 void selectRange(
size_t start,
size_t end);
686 float getTotalItemsHeight(
void)
const;
687 void getTotalItemsInListHeight(
const LBItemList &itemList,
688 float *heightSum)
const;
694 float getWidestItemWidth(
void)
const;
695 void getWidestItemWidthInList(
const LBItemList &itemList,
int itemDepth,
696 float *widest)
const;
706 bool getHeightToItemInList(
const LBItemList &itemList,
709 float *height)
const;
719 bool clearAllSelections_impl(
void);
730 TreeItem* getItemFromListAtPoint(
const LBItemList &itemList,
float *bottomY,
731 const Point& pt)
const;
744 bool resetList_impl(
void);
757 virtual bool testClassName_impl(
const String& class_name)
const
759 if (class_name==(
const utf8*)
"Tree")
770 bool handle_scrollChange(
const EventArgs& args);
773 virtual void populateGeometryBuffer();
775 void drawItemList(LBItemList& itemList,
Rect& itemsArea,
float widest,
877 void addTreeProperties(
void);
899 #if defined(_MSC_VER)
900 # pragma warning(pop)
903 #endif // end of guard _CEGUITree_h_