Crazy Eddie's GUI System
0.8.7
|
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)
79 CEGUI_VECTOR_ALLOC(
TreeItem*)> LBItemList;
84 static const String WidgetTypeName;
145 { populateGeometryBuffer(); }
149 { configureScrollbars(); }
162 {
return d_listItems.size(); }
193 {
return d_lastSelected; }
214 TreeItem* getNextSelectedItemFromList(
const LBItemList &itemList,
216 bool& foundStartItem)
const;
229 void setItemRenderArea(
Rectf& r)
232 Scrollbar* getVertScrollbar()
233 {
return d_vertScrollbar; }
235 Scrollbar* getHorzScrollbar()
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);
301 TreeItem* findItemWithIDFromList(
const LBItemList &itemList, uint searchID,
303 bool foundStartItem);
420 bool clearAllSelectionsFromList(
const LBItemList &itemList);
479 void setItemTooltipsEnabled(
bool setting);
610 {
return d_itemArea; }
624 {
return static_cast<Scrollbar*
>(getChild(name)); }
638 {
return static_cast<Scrollbar*
>(getChild(name)); }
688 void getTotalItemsInListHeight(
const LBItemList &itemList,
689 float *heightSum)
const;
696 void getWidestItemWidthInList(
const LBItemList &itemList,
int itemDepth,
697 float *widest)
const;
710 float *height)
const;
731 TreeItem* getItemFromListAtPoint(
const LBItemList &itemList,
float *bottomY,
758 void drawItemList(LBItemList& itemList,
Rectf& itemsArea,
float widest,
851 void addTreeProperties(
void);
873 #if defined(_MSC_VER)
874 # pragma warning(pop)
877 #endif // end of guard _CEGUITree_h_
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
Scrollbar * d_horzScrollbar
horizontal scroll-bar widget
Definition: widgets/Tree.h:839
virtual void onSelectionChanged(TreeEventArgs &e)
Handler called internally when the currently selected item or items changes.
bool resetList_impl(void)
Remove all items from the tree.
void ensureItemIsVisible(const TreeItem *item)
Ensure the item at the specified index is visible within the tree.
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: widgets/Tree.h:609
void setItemSelectState(size_t item_index, bool state)
Set the select state of an attached TreeItem.
Tree(const String &type, const String &name)
Constructor for Tree base class.
Base class for tree items.
Definition: TreeItem.h:59
virtual void onSortModeChanged(WindowEventArgs &e)
Handler called internally when the sort mode setting changes.
TreeItem * getLastSelectedItem(void) const
Return a pointer to the first selected item.
Definition: widgets/Tree.h:192
virtual void cacheTreeBaseImagery()
Perform caching of the widget control frame and other 'static' areas. This method should not render t...
Definition: widgets/Tree.h:650
virtual void setLookNFeel(const String &look)
Set the LookNFeel that shoule be used for this window.
bool isVertScrollbarAlwaysShown(void) const
Return whether the vertical scroll bar is always shown.
virtual void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
void addTreeEvents(void)
Add tree specific events.
static const String EventListContentsChanged
Definition: widgets/Tree.h:94
virtual void onBranchOpened(TreeEventArgs &e)
Handler called internally when the user opens a branch of the tree.
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
void setShowHorzScrollbar(bool setting)
Set whether the horizontal scroll bar should always be shown.
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...
static const String EventBranchClosed
Definition: widgets/Tree.h:141
bool getHeightToItemInList(const LBItemList &itemList, const TreeItem *treeItem, int itemDepth, float *height) const
Clear the selected state for all items (implementation)
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
static const String EventHorzScrollbarModeChanged
Definition: widgets/Tree.h:127
static const String EventSortModeChanged
Definition: widgets/Tree.h:107
void selectRange(size_t start, size_t end)
select all strings between positions start and end. (inclusive) including end.
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition: InputEvent.h:281
virtual void onMouseMove(MouseEventArgs &e)
Handler called when the mouse cursor has been moved within this window's area.
static const String EventMultiselectModeChanged
Definition: widgets/Tree.h:113
void addItem(TreeItem *item)
Add the given TreeItem to the tree.
void removeItem(const TreeItem *item)
Removes the given item from the tree. If the item is has the auto delete state set,...
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
virtual ~Tree(void)
Destructor for Tree base class.
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...
static const String EventBranchOpened
Definition: widgets/Tree.h:134
bool containsOpenItemRecursive(const LBItemList &itemList, TreeItem *item)
Checks if a tree item is visible (searches sub-items)
Base class for standard Tree widget.
Definition: widgets/Tree.h:75
virtual void onBranchClosed(TreeEventArgs &e)
Handler called internally when the user closes a branch of the tree.
size_t getSelectedCount(void) const
Return the number of selected items in the tree.
TreeItem * getFirstSelectedItem(void) const
Return a pointer to the first selected item.
bool handle_scrollChange(const EventArgs &args)
Internal handler that is triggered when the user interacts with the scrollbars.
bool isHorzScrollbarAlwaysShown(void) const
Return whether the horizontal scroll bar is always shown.
size_t getItemCount(void) const
Return number of items attached to the tree.
Definition: widgets/Tree.h:161
bool handleFontRenderSizeChange(const EventArgs &args)
handler function for when font render size changes.
virtual void populateGeometryBuffer()
Update the rendering cache.
bool isMultiselectEnabled(void) const
return whether multi-select is enabled
Definition: widgets/Tree.h:245
Scrollbar * d_vertScrollbar
vertical scroll-bar widget
Definition: widgets/Tree.h:837
TreeItem * findFirstItemWithText(const String &text)
Search the tree for an item with the specified text.
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/Tree.h:831
float getTotalItemsHeight(void) const
Return the sum of all item heights.
virtual void onMouseButtonDown(MouseEventArgs &e)
Handler called when a mouse button has been depressed within this window's area.
void clearAllSelections(void)
Clear the selected state for all items.
LBItemList d_listItems
list of items in the tree.
Definition: widgets/Tree.h:841
virtual void onMultiselectModeChanged(WindowEventArgs &e)
Handler called internally when the multi-select mode setting changes.
static const String EventVertScrollbarModeChanged
Definition: widgets/Tree.h:120
TreeItem * getItemAtPoint(const Vector2f &pt) const
Return the TreeItem under the given window local pixel co-ordinate.
void setMultiselectEnabled(bool setting)
Set whether the tree should allow multiple selections or just a single selection.
void insertItem(TreeItem *item, const TreeItem *position)
Insert an item into the tree after a specified item already in the tree.
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
virtual void onListContentsChanged(WindowEventArgs &e)
Handler called internally when the tree contents are changed.
virtual Scrollbar * createHorzScrollbar(const String &name) const
create and return a pointer to a Scrollbar widget for use as horizontal scroll bar.
Definition: widgets/Tree.h:637
void setItemSelectState(TreeItem *item, bool state)
Set the select state of an attached TreeItem.
EventArgs based class that is used for objects passed to input event handlers concerning Tree events.
Definition: widgets/Tree.h:51
virtual void onHorzScrollbarModeChanged(WindowEventArgs &e)
Handler called internally when the forced display of the horizontal scroll bar setting changes.
virtual void initialise(void)
Initialise the Window based object ready for use.
bool clearAllSelections_impl(void)
Clear the selected state for all items (implementation)
TreeItem * findFirstItemWithID(uint searchID)
Search the tree for an item with the specified text.
void setShowVertScrollbar(bool setting)
Set whether the vertical scroll bar should always be shown.
void setSortingEnabled(bool setting)
Set whether the tree should be sorted.
static const String EventNamespace
Namespace for global events.
Definition: widgets/Tree.h:83
String class used within the GUI system.
Definition: String.h:64
bool isSortEnabled(void) const
return whether tree sorting is enabled
Definition: widgets/Tree.h:226
bool d_multiselect
true if multi-select is enabled
Definition: widgets/Tree.h:829
TreeItem * getNextSelected(const TreeItem *start_item) const
Return a pointer to the next selected item after item start_item.
void resetList(void)
Remove all items from the tree.
TreeItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: widgets/Tree.h:843
bool d_sorted
true if tree is sorted
Definition: widgets/Tree.h:827
void handleUpdatedItemData(void)
Causes the tree to update it's internal state after changes have been made to one or more attached Tr...
virtual void onSized(ElementEventArgs &e)
Handler called when the window's size changes.
void configureScrollbars(void)
display required integrated scroll bars according to current state of the tree and update their value...
float getWidestItemWidth(void) const
Return the width of the widest item.
virtual Scrollbar * createVertScrollbar(const String &name) const
create and return a pointer to a Scrollbar widget for use as vertical scroll bar.
Definition: widgets/Tree.h:623
bool d_itemTooltips
true if each item should have an individual tooltip
Definition: widgets/Tree.h:835
bool isTreeItemInList(const TreeItem *item) const
Return whether the specified TreeItem is in the tree.
Class that encapsulates a re-usable collection of imagery specifications.
Definition: ImagerySection.h:49
static const String EventSelectionChanged
Definition: widgets/Tree.h:101
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/Tree.h:833
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
virtual void onVertScrollbarModeChanged(WindowEventArgs &e)
Handler called internally when the forced display of the vertical scroll bar setting changes.