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(); }
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;
228 void setItemRenderArea(
Rect& r)
231 Scrollbar* getVertScrollbar()
232 {
return d_vertScrollbar; }
234 Scrollbar* getHorzScrollbar()
235 {
return d_horzScrollbar; }
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);
609 {
return d_itemArea; }
623 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
637 {
return (
Scrollbar*)(WindowManager::getSingleton().getWindow(name)); }
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);
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_
static const String EventListContentsChanged
Definition: CEGUITree.h:93
EventArgs based class that is used for objects passed to input event handlers concerning Tree events...
Definition: CEGUITree.h:51
Class used as a two dimensional vector (aka a Point)
Definition: CEGUIVector.h:45
Scrollbar * d_horzScrollbar
horizontal scroll-bar widget
Definition: CEGUITree.h:856
bool isSortEnabled(void) const
return whether tree sorting is enabled
Definition: CEGUITree.h:225
LBItemList d_listItems
list of items in the tree.
Definition: CEGUITree.h:858
static const String EventBranchClosed
Definition: CEGUITree.h:140
TreeItem * getLastSelectedItem(void) const
Return a pointer to the first selected item.
Definition: CEGUITree.h:191
Base class for standard Tree widget.
Definition: CEGUITree.h:75
Property to access the sort setting of the Tree.
Definition: CEGUITreeProperties.h:58
static const String EventSelectionChanged
Definition: CEGUITree.h:100
bool lbi_greater(const ListboxItem *a, const ListboxItem *b)
Helper function used in sorting to compare two list box item text strings via the ListboxItem pointer...
Base class used as the argument to all subscribers Event object.
Definition: CEGUIEventArgs.h:52
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: CEGUIGeometryBuffer.h:42
virtual bool testClassName_impl(const String &class_name) const
Return whether this window was inherited from the given class name at some point in the inheritance h...
Definition: CEGUIWindow.h:3928
Scrollbar * d_vertScrollbar
vertical scroll-bar widget
Definition: CEGUITree.h:854
Base class for tree items.
Definition: CEGUITreeItem.h:58
static const String EventNamespace
Namespace for global events.
Definition: CEGUITree.h:82
virtual bool testClassName_impl(const String &class_name) const
Return whether this window was inherited from the given class name at some point in the inheritance h...
Definition: CEGUITree.h:757
static const String EventHorzScrollbarModeChanged
Definition: CEGUITree.h:126
bool isMultiselectEnabled(void) const
return whether multi-select is enabled
Definition: CEGUITree.h:244
static const String EventVertScrollbarModeChanged
Definition: CEGUITree.h:119
size_t getItemCount(void) const
Return number of items attached to the tree.
Definition: CEGUITree.h:160
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: CEGUITree.h:848
bool lbi_less(const ListboxItem *a, const ListboxItem *b)
Helper function used in sorting to compare two list box item text strings via the ListboxItem pointer...
virtual Scrollbar * createVertScrollbar(const String &name) const
create and return a pointer to a Scrollbar widget for use as vertical scroll bar. ...
Definition: CEGUITree.h:622
static const String EventSortModeChanged
Definition: CEGUITree.h:106
bool d_itemTooltips
true if each item should have an individual tooltip
Definition: CEGUITree.h:852
bool d_sorted
true if tree is sorted
Definition: CEGUITree.h:844
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: CEGUIWindow.h:138
static const String EventMultiselectModeChanged
Definition: CEGUITree.h:112
virtual void cacheTreeBaseImagery()
Perform caching of the widget control frame and other 'static' areas. This method should not render t...
Definition: CEGUITree.h:649
TreeItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: CEGUITree.h:860
static const String EventBranchOpened
Definition: CEGUITree.h:133
Property to access the multi-select setting of the tree.
Definition: CEGUITreeProperties.h:85
virtual Rect getTreeRenderArea(void) const
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
Definition: CEGUITree.h:608
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: CEGUIInputEvent.h:245
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: CEGUITree.h:850
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: CEGUIInputEvent.h:274
bool d_multiselect
true if multi-select is enabled
Definition: CEGUITree.h:846
Class that encapsulates a re-usable collection of imagery specifications.
Definition: CEGUIFalImagerySection.h:48
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57
virtual Scrollbar * createHorzScrollbar(const String &name) const
create and return a pointer to a Scrollbar widget for use as horizontal scroll bar.
Definition: CEGUITree.h:636