Loading...
Searching...
No Matches
IGUIListBox.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_LIST_BOX_H_INCLUDED__
#define __I_GUI_LIST_BOX_H_INCLUDED__
#include "IGUIElement.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
class IGUISpriteBank;
enum EGUI_LISTBOX_COLOR
{
EGUI_LBC_TEXT=0,
EGUI_LBC_TEXT_HIGHLIGHT,
EGUI_LBC_ICON,
EGUI_LBC_ICON_HIGHLIGHT,
EGUI_LBC_COUNT
};
class IGUIListBox : public IGUIElement
{
public:
IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {}
virtual u32 getItemCount() const = 0;
virtual const wchar_t* getListItem(u32 id) const = 0;
virtual u32 addItem(const wchar_t* text) = 0;
virtual u32 addItem(const wchar_t* text, s32 icon) = 0;
virtual void removeItem(u32 index) = 0;
virtual s32 getItemAt(s32 xpos, s32 ypos) const = 0;
virtual s32 getIcon(u32 index) const = 0;
virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
virtual void clear() = 0;
virtual s32 getSelected() const = 0;
virtual void setSelected(s32 index) = 0;
virtual void setSelected(const wchar_t *item) = 0;
virtual void setAutoScrollEnabled(bool scroll) = 0;
virtual bool isAutoScrollEnabled() const = 0;
virtual void setItemOverrideColor(u32 index, video::SColor color) = 0;
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0;
virtual void clearItemOverrideColor(u32 index) = 0;
virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0;
virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const = 0;
virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0;
virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0;
virtual void swapItems(u32 index1, u32 index2) = 0;
virtual void setItemHeight( s32 height ) = 0;
virtual void setDrawBackground(bool draw) = 0;
};
} // end namespace gui
} // end namespace irr
#endif
IGUIElement.h
SColor.h
irr::core::rect
Rectangle template.
Definition rect.h:27
irr::gui::IGUIElement::draw
virtual void draw()
Draws the element and its children.
Definition IGUIElement.h:312
irr::gui::IGUIElement::IGUIElement
IGUIElement(EGUI_ELEMENT_TYPE type, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle)
Constructor.
Definition IGUIElement.h:30
irr::gui::IGUIEnvironment
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.h:71
irr::gui::IGUIListBox::getListItem
virtual const wchar_t * getListItem(u32 id) const =0
returns string of a list item. the may id be a value from 0 to itemCount-1
irr::gui::IGUIListBox::insertItem
virtual s32 insertItem(u32 index, const wchar_t *text, s32 icon)=0
Insert the item at the given index.
irr::gui::IGUIListBox::addItem
virtual u32 addItem(const wchar_t *text)=0
adds an list item, returns id of item
irr::gui::IGUIListBox::addItem
virtual u32 addItem(const wchar_t *text, s32 icon)=0
adds an list item with an icon
irr::gui::IGUIListBox::getSelected
virtual s32 getSelected() const =0
returns id of selected item. returns -1 if no item is selected.
irr::gui::IGUIListBox::setAutoScrollEnabled
virtual void setAutoScrollEnabled(bool scroll)=0
set whether the listbox should scroll to newly selected items
irr::gui::IGUIListBox::getItemOverrideColor
virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const =0
return the overwrite color at given item index.
irr::gui::IGUIListBox::setItem
virtual void setItem(u32 index, const wchar_t *text, s32 icon)=0
set the item at the given index
irr::gui::IGUIListBox::removeItem
virtual void removeItem(u32 index)=0
Removes an item from the list.
irr::gui::IGUIListBox::IGUIListBox
IGUIListBox(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUIListBox.h:42
irr::gui::IGUIListBox::hasItemOverrideColor
virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const =0
has the item at index its color overwritten?
irr::gui::IGUIListBox::setItemHeight
virtual void setItemHeight(s32 height)=0
set global itemHeight
irr::gui::IGUIListBox::setItemOverrideColor
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color)=0
set all item colors of specified type at given index to color
irr::gui::IGUIListBox::getItemAt
virtual s32 getItemAt(s32 xpos, s32 ypos) const =0
get the the id of the item at the given absolute coordinates
irr::gui::IGUIListBox::getIcon
virtual s32 getIcon(u32 index) const =0
Returns the icon of an item.
irr::gui::IGUIListBox::getItemCount
virtual u32 getItemCount() const =0
returns amount of list items
irr::gui::IGUIListBox::clearItemOverrideColor
virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType)=0
clear item color at index for given colortype
irr::gui::IGUIListBox::setSelected
virtual void setSelected(const wchar_t *item)=0
sets the selected item. Set this to 0 if no item should be selected
irr::gui::IGUIListBox::clear
virtual void clear()=0
clears the list, deletes all items in the listbox
irr::gui::IGUIListBox::setSelected
virtual void setSelected(s32 index)=0
sets the selected item. Set this to -1 if no item should be selected
irr::gui::IGUIListBox::clearItemOverrideColor
virtual void clearItemOverrideColor(u32 index)=0
clear all item colors at index
irr::gui::IGUIListBox::swapItems
virtual void swapItems(u32 index1, u32 index2)=0
Swap the items at the given indices.
irr::gui::IGUIListBox::setSpriteBank
virtual void setSpriteBank(IGUISpriteBank *bank)=0
Sets the sprite bank which should be used to draw list icons.
irr::gui::IGUIListBox::setDrawBackground
virtual void setDrawBackground(bool draw)=0
Sets whether to draw the background.
irr::gui::IGUIListBox::setItemOverrideColor
virtual void setItemOverrideColor(u32 index, video::SColor color)=0
set all item colors at given index to color
irr::gui::IGUIListBox::getItemDefaultColor
virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const =0
return the default color which is used for the given colorType
irr::gui::IGUIListBox::isAutoScrollEnabled
virtual bool isAutoScrollEnabled() const =0
returns true if automatic scrolling is enabled, false if not.
irr::gui::IGUISpriteBank
Sprite bank interface.
Definition IGUISpriteBank.h:46
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition SColor.h:202
irr::gui
The gui namespace contains useful classes for easy creation of a graphical user interface.
Definition EGUIAlignment.h:11
irr::gui::EGUI_LISTBOX_COLOR
EGUI_LISTBOX_COLOR
Enumeration for listbox colors.
Definition IGUIListBox.h:19
irr::gui::EGUI_LBC_TEXT
@ EGUI_LBC_TEXT
Color of text.
Definition IGUIListBox.h:21
irr::gui::EGUI_LBC_COUNT
@ EGUI_LBC_COUNT
Not used, just counts the number of available colors.
Definition IGUIListBox.h:29
irr::gui::EGUI_LBC_TEXT_HIGHLIGHT
@ EGUI_LBC_TEXT_HIGHLIGHT
Color of selected text.
Definition IGUIListBox.h:23
irr::gui::EGUI_LBC_ICON
@ EGUI_LBC_ICON
Color of icon.
Definition IGUIListBox.h:25
irr::gui::EGUI_LBC_ICON_HIGHLIGHT
@ EGUI_LBC_ICON_HIGHLIGHT
Color of selected icon.
Definition IGUIListBox.h:27
irr::gui::EGUIET_LIST_BOX
@ EGUIET_LIST_BOX
A list box (IGUIListBox).
Definition EGUIElementTypes.h:50
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0