31 #include "CEGUIBase.h"
32 #include "CEGUIWindow.h"
33 #include "CEGUIWindowManager.h"
34 #include "elements/CEGUITreeItem.h"
35 #include "elements/CEGUITreeProperties.h"
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
70 typedef std::vector<TreeItem*> LBItemList;
74 static const String WidgetTypeName;
90 void doTreeRender() { populateRenderCache(); }
92 void doScrollbars() { configureScrollbars(); }
113 size_t getSelectedCount(
void)
const;
124 TreeItem* getFirstSelectedItem(
void)
const;
155 TreeItem* getNextSelectedItemFromList(
const LBItemList &itemList,
const TreeItem* start_item,
bool foundStartItem)
const;
166 void setItemRenderArea(
Rect& r)
171 Scrollbar* getVertScrollbar() {
return d_vertScrollbar; }
172 Scrollbar* getHorzScrollbar() {
return d_horzScrollbar; }
183 bool isItemTooltipsEnabled(
void)
const {
return d_itemTooltips;}
203 TreeItem* findFirstItemWithText(
const String& text);
204 TreeItem* findNextItemWithText(
const String& text,
const TreeItem* start_item);
205 TreeItem* findItemWithTextFromList(
const LBItemList &itemList,
const String& text,
const TreeItem* start_item,
bool foundStartItem);
225 TreeItem* findFirstItemWithID(uint searchID);
226 TreeItem* findNextItemWithID(uint searchID,
const TreeItem* start_item);
227 TreeItem* findItemWithIDFromList(
const LBItemList &itemList, uint searchID,
const TreeItem* start_item,
bool foundStartItem);
237 bool isTreeItemInList(
const TreeItem* item)
const;
248 bool isVertScrollbarAlwaysShown(
void)
const;
259 bool isHorzScrollbarAlwaysShown(
void)
const;
275 virtual void initialise(
void);
284 void resetList(
void);
298 void addItem(TreeItem* item);
320 void insertItem(TreeItem* item,
const TreeItem* position);
334 void removeItem(
const TreeItem* item);
344 void clearAllSelections(
void);
345 bool clearAllSelectionsFromList(
const LBItemList &itemList);
358 void setSortingEnabled(
bool setting);
372 void setMultiselectEnabled(
bool setting);
386 void setShowVertScrollbar(
bool setting);
400 void setShowHorzScrollbar(
bool setting);
402 void setItemTooltipsEnabled(
bool setting);
422 void setItemSelectState(TreeItem* item,
bool state);
444 void setItemSelectState(
size_t item_index,
bool state);
462 virtual void setLookNFeel(
const String& look);
476 void handleUpdatedItemData(
void);
491 void ensureItemIsVisible(
const TreeItem* item);
501 Tree(
const String& type,
const String& name);
524 virtual Rect getTreeRenderArea(
void)
const
541 return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name));
556 return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name));
570 virtual void cacheTreeBaseImagery()
585 void addTreeEvents(
void);
592 void configureScrollbars(
void);
599 void selectRange(
size_t start,
size_t end);
606 float getTotalItemsHeight(
void)
const;
607 void getTotalItemsInListHeight(
const LBItemList &itemList,
float *heightSum)
const;
614 float getWidestItemWidth(
void)
const;
615 void getWidestItemWidthInList(
const LBItemList &itemList,
int itemDepth,
float *widest)
const;
624 bool getHeightToItemInList(
const LBItemList &itemList,
const TreeItem *treeItem,
int itemDepth,
float *height)
const;
634 bool clearAllSelections_impl(
void);
646 TreeItem* getItemFromListAtPoint(
const LBItemList &itemList,
float *bottomY,
const Point& pt)
const;
660 bool resetList_impl(
void);
673 virtual bool testClassName_impl(
const String& class_name)
const
675 if (class_name==(
const utf8*)
"Tree")
return true;
683 bool handle_scrollChange(
const EventArgs& args);
686 virtual void populateRenderCache();
688 void drawItemList(LBItemList &itemList,
Rect &itemsArea,
float widest,
Vector3 &itemPos,
RenderCache& cache,
float alpha);
787 void addTreeProperties(
void);
810 #if defined(_MSC_VER)
811 # pragma warning(pop)
814 #endif // end of guard _CEGUITree_h_