31 #include "../Window.h" 32 #include "../WindowManager.h" 33 #include "./TreeItem.h" 34 #include "./Scrollbar.h" 38 # pragma warning(push) 39 # pragma warning(disable : 4251) 50 class CEGUIEXPORT TreeEventArgs :
public WindowEventArgs
53 TreeEventArgs(Window* wnd) : WindowEventArgs(wnd)
74 class CEGUIEXPORT Tree :
public Window
76 friend class TreeItem;
78 typedef std::vector<TreeItem*
79 CEGUI_VECTOR_ALLOC(TreeItem*)> LBItemList;
83 static const String EventNamespace;
84 static const String WidgetTypeName;
94 static const String EventListContentsChanged;
101 static const String EventSelectionChanged;
107 static const String EventSortModeChanged;
113 static const String EventMultiselectModeChanged;
120 static const String EventVertScrollbarModeChanged;
127 static const String EventHorzScrollbarModeChanged;
134 static const String EventBranchOpened;
141 static const String EventBranchClosed;
145 { populateGeometryBuffer(); }
149 { configureScrollbars(); }
162 {
return d_listItems.size(); }
171 size_t getSelectedCount(
void)
const;
181 TreeItem* getFirstSelectedItem(
void)
const;
193 {
return d_lastSelected; }
214 TreeItem* getNextSelectedItemFromList(
const LBItemList &itemList,
216 bool& foundStartItem)
const;
229 void setItemRenderArea(
Rectf& r)
233 {
return d_vertScrollbar; }
236 {
return d_horzScrollbar; }
246 {
return d_multiselect; }
248 bool isItemTooltipsEnabled(
void)
const 249 {
return d_itemTooltips; }
275 TreeItem* findItemWithTextFromList(
const LBItemList &itemList,
278 bool foundStartItem);
299 TreeItem* findFirstItemWithID(uint searchID);
301 TreeItem* findItemWithIDFromList(
const LBItemList &itemList, uint searchID,
303 bool foundStartItem);
313 bool isTreeItemInList(
const TreeItem* item)
const;
323 bool isVertScrollbarAlwaysShown(
void)
const;
333 bool isHorzScrollbarAlwaysShown(
void)
const;
349 virtual void initialise(
void);
357 void resetList(
void);
410 void removeItem(
const TreeItem* item);
419 void clearAllSelections(
void);
420 bool clearAllSelectionsFromList(
const LBItemList &itemList);
433 void setSortingEnabled(
bool setting);
447 void setMultiselectEnabled(
bool setting);
462 void setShowVertScrollbar(
bool setting);
477 void setShowHorzScrollbar(
bool setting);
479 void setItemTooltipsEnabled(
bool setting);
504 void setItemSelectState(
TreeItem* item,
bool state);
529 void setItemSelectState(
size_t item_index,
bool state);
548 virtual void setLookNFeel(
const String& look);
563 void handleUpdatedItemData(
void);
578 void ensureItemIsVisible(
const TreeItem* item);
610 {
return d_itemArea; }
624 {
return static_cast<Scrollbar*
>(getChild(name)); }
638 {
return static_cast<Scrollbar*
>(getChild(name)); }
660 bool containsOpenItemRecursive(
const LBItemList& itemList,
TreeItem* item);
666 void addTreeEvents(
void);
674 void configureScrollbars(
void);
681 void selectRange(
size_t start,
size_t end);
687 float getTotalItemsHeight(
void)
const;
688 void getTotalItemsInListHeight(
const LBItemList &itemList,
689 float *heightSum)
const;
695 float getWidestItemWidth(
void)
const;
696 void getWidestItemWidthInList(
const LBItemList &itemList,
int itemDepth,
697 float *widest)
const;
707 bool getHeightToItemInList(
const LBItemList &itemList,
710 float *height)
const;
720 bool clearAllSelections_impl(
void);
731 TreeItem* getItemFromListAtPoint(
const LBItemList &itemList,
float *bottomY,
745 bool resetList_impl(
void);
752 bool handle_scrollChange(
const EventArgs& args);
755 virtual void populateGeometryBuffer();
756 bool handleFontRenderSizeChange(
const EventArgs& args);
758 void drawItemList(LBItemList& itemList,
Rectf& itemsArea,
float widest,
831 bool d_forceVertScroll;
833 bool d_forceHorzScroll;
841 LBItemList d_listItems;
851 void addTreeProperties(
void);
873 #if defined(_MSC_VER) 874 # pragma warning(pop) 877 #endif // end of guard _CEGUITree_h_ EventArgs based class that is used for objects passed to input event handlers concerning Tree events...
Definition: cegui/include/CEGUI/widgets/Tree.h:50
bool isSortEnabled(void) const
return whether tree sorting is enabled
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:226
TreeItem * getLastSelectedItem(void) const
Return a pointer to the first selected item.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:192
Base class for standard Tree widget.
Definition: cegui/include/CEGUI/widgets/Tree.h:74
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...
Definition: widgets/Listbox.cpp:1183
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
Base class used as the argument to all subscribers Event object.
Definition: cegui/include/CEGUI/EventArgs.h:49
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: cegui/include/CEGUI/GeometryBuffer.h:42
Base class for tree items.
Definition: cegui/include/CEGUI/widgets/TreeItem.h:57
bool isMultiselectEnabled(void) const
return whether multi-select is enabled
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:245
size_t getItemCount(void) const
Return number of items attached to the tree.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:161
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...
Definition: widgets/Listbox.cpp:1175
virtual Scrollbar * createVertScrollbar(const String &name) const
create and return a pointer to a Scrollbar widget for use as vertical scroll bar. ...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:623
virtual void cacheTreeBaseImagery()
Perform caching of the widget control frame and other 'static' areas. This method should not render t...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:650
virtual Rectf getTreeRenderArea(void) const
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:609
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: cegui/include/CEGUI/Element.h:210
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: cegui/include/CEGUI/InputEvent.h:251
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: cegui/include/CEGUI/InputEvent.h:280
Class that encapsulates a re-usable collection of imagery specifications.
Definition: cegui/include/CEGUI/falagard/ImagerySection.h:47
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62
virtual Scrollbar * createHorzScrollbar(const String &name) const
create and return a pointer to a Scrollbar widget for use as horizontal scroll bar.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/widgets/Tree.h:637