SuperTuxKart
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
irr::gui::CGUISTKListBox Class Reference
Inheritance diagram for irr::gui::CGUISTKListBox:
Inheritance graph
[legend]

Classes

struct  ListItem
 

Public Member Functions

 CGUISTKListBox (IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle, bool clip=true, bool drawBack=false, bool moveOverSelect=false)
 constructor
 
virtual ~CGUISTKListBox ()
 destructor
 
virtual u32 getItemCount () const
 returns amount of list items
 
virtual const wchar_t * getCellText (u32 row_num, u32 col_num) const
 
virtual ListItem getItem (u32 id) const
 
virtual void clear ()
 clears the list
 
virtual s32 getSelected () const
 returns id of selected item. returns -1 if no item is selected.
 
virtual void setSelected (s32 id)
 sets the selected item. Set this to -1 if no item should be selected
 
virtual s32 getRowByCellText (const wchar_t *text)
 
virtual void setSelectedByCellText (const wchar_t *text)
 sets the selected item. Set this to -1 if no item should be selected
 
virtual s32 getRowByInternalName (const std::string &text) const
 
virtual bool OnEvent (const SEvent &event)
 called if an event happened.
 
virtual void draw ()
 draws the element and its children
 
virtual u32 addItem (const ListItem &item)
 adds an list item with an icon
 
virtual s32 getIcon (u32 row_num, u32 col_num) const
 Returns the icon of an item.
 
virtual void removeItem (u32 id)
 removes an item from the list
 
virtual s32 getItemAt (s32 xpos, s32 ypos) const
 get the the id of the item at the given absolute coordinates
 
virtual void setSpriteBank (IGUISpriteBank *bank)
 Sets the sprite bank which should be used to draw list icons.
 
virtual void setAutoScrollEnabled (bool scroll)
 set whether the listbox should scroll to newly selected items
 
virtual bool isAutoScrollEnabled () const
 returns true if automatic scrolling is enabled, false if not.
 
virtual void updateAbsolutePosition ()
 Update the position and size of the listbox, and update the scrollbar.
 
virtual void setItemOverrideColor (u32 index, video::SColor color)
 set all item colors at given index to color
 
virtual void setItemOverrideColor (u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color)
 set all item colors of specified type at given index to color
 
virtual void clearItemOverrideColor (u32 index)
 clear all item colors at index
 
virtual void clearItemOverrideColor (u32 index, EGUI_LISTBOX_COLOR colorType)
 clear item color at index for given colortype
 
virtual bool hasItemOverrideColor (u32 index, EGUI_LISTBOX_COLOR colorType) const
 has the item at index its color overwritten?
 
virtual video::SColor getItemOverrideColor (u32 index, EGUI_LISTBOX_COLOR colorType) const
 return the overwrite color at given item index.
 
virtual video::SColor getItemDefaultColor (EGUI_LISTBOX_COLOR colorType) const
 return the default color which is used for the given colorType
 
virtual void setCell (u32 row_num, u32 col_num, const wchar_t *text, s32 icon)
 set the item at the given index
 
virtual void swapItems (u32 index1, u32 index2)
 Swap the items at the given indices.
 
virtual void setItemHeight (s32 height)
 set global itemHeight
 
virtual void setDrawBackground (bool draw)
 Sets whether to draw the background.
 
void setAlternatingDarkness (bool val)
 
gui::IGUIScrollBar * getScrollBar () const
 
void setDisactivated (bool val)
 

Private Member Functions

void recalculateItemHeight ()
 
void selectNew (s32 ypos, bool onlyHover=false)
 
void recalculateScrollPos ()
 
void recalculateIconWidth ()
 

Private Attributes

core::array< ListItemItems
 
s32 Selected
 
s32 ItemHeight
 
s32 ItemHeightOverride
 
s32 TotalItemHeight
 
s32 ItemsIconWidth
 
s32 MousePosY
 
gui::IGUIFont * Font
 
gui::IGUISpriteBank * IconBank
 
gui::IGUIScrollBar * ScrollBar
 
u32 selectTime
 
core::stringw KeyBuffer
 
bool Selecting
 
bool Moving
 
bool DrawBack
 
bool MoveOverSelect
 
bool AutoScroll
 
bool HighlightWhenNotFocused
 
bool m_alternating_darkness
 
bool m_deactivated
 

Member Function Documentation

◆ addItem()

u32 irr::gui::CGUISTKListBox::addItem ( const ListItem item)
virtual

adds an list item with an icon

Parameters
textText of list entry
iconSprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
Returns
returns the id of the new created item

◆ setSpriteBank()

void irr::gui::CGUISTKListBox::setSpriteBank ( IGUISpriteBank *  bank)
virtual

Sets the sprite bank which should be used to draw list icons.

This font is set to the sprite bank of the built-in-font by default. A sprite can be displayed in front of every list item. An icon is an index within the icon sprite bank. Several default icons are available in the skin through getIcon


The documentation for this class was generated from the following files: