Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUIListBox.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_GUI_LIST_BOX_HPP_INCLUDED
6#define NIRT_I_GUI_LIST_BOX_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IGUIElement.hpp>
9#include <nirtcpp/core/engine/SColor.hpp>
10
11namespace nirt
12{
13namespace gui
14{
15 class IGUISpriteBank;
16 class IGUIScrollBar;
17
32
33
35
39 class IGUIListBox : public IGUIElement
40 {
41 public:
43 IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
44 : IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {}
45
47 virtual u32 getItemCount() const = 0;
48
50 virtual const wchar_t* getListItem(u32 id) const = 0;
51
53
56 virtual u32 addItem(const wchar_t* text, s32 icon=-1) = 0;
57
59
60 virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon=-1) = 0;
61
63 virtual void setItem(u32 index, const wchar_t* text, s32 icon=-1) = 0;
64
66 virtual void removeItem(u32 index) = 0;
67
69
70 virtual s32 getItemAt(s32 xpos, s32 ypos) const = 0;
71
73 virtual s32 getIcon(u32 index) const = 0;
74
76
80 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
81
83 virtual void clear() = 0;
84
86 virtual s32 getSelected() const = 0;
87
89 virtual void setSelected(s32 index) = 0;
90
92 virtual void setSelected(const wchar_t *item) = 0;
93
95 virtual void setAutoScrollEnabled(bool scroll) = 0;
96
98 virtual bool isAutoScrollEnabled() const = 0;
99
101 virtual void setItemOverrideColor(u32 index, video::SColor color) = 0;
102
104 virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0;
105
107 virtual void clearItemOverrideColor(u32 index) = 0;
108
110 virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0;
111
113 virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
114
116 virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
117
120
122 virtual void swapItems(u32 index1, u32 index2) = 0;
123
125 virtual void setItemHeight( s32 height ) = 0;
126
128 virtual void setDrawBackground(bool draw) = 0;
129
132};
133
134
135} // end namespace gui
136} // end namespace nirt
137
138#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Base class of all GUI elements.
Definition IGUIElement.hpp:24
virtual void draw()
Draws the element and its children.
Definition IGUIElement.hpp:331
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.hpp:73
Default list box GUI element.
Definition IGUIListBox.hpp:40
virtual void swapItems(u32 index1, u32 index2)=0
Swap the items at the given indices.
virtual u32 addItem(const wchar_t *text, s32 icon=-1)=0
adds an list item with an icon
virtual u32 getItemCount() const =0
returns amount of list items
virtual void setItem(u32 index, const wchar_t *text, s32 icon=-1)=0
set the item at the given index
virtual s32 insertItem(u32 index, const wchar_t *text, s32 icon=-1)=0
Insert the item at the given index.
virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const =0
return the overwrite color at given item index.
virtual bool isAutoScrollEnabled() const =0
returns true if automatic scrolling is enabled, false if not.
virtual IGUIScrollBar * getVerticalScrollBar() const =0
Access the vertical scrollbar.
virtual void setItemOverrideColor(u32 index, video::SColor color)=0
set all item colors at given index to color
virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const =0
has the item at index its color overwritten?
virtual void setSelected(const wchar_t *item)=0
sets the selected item. Set this to 0 if no item should be selected
virtual void clear()=0
clears the list, deletes all items in the listbox
virtual void clearItemOverrideColor(u32 index)=0
clear all item colors at index
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
virtual void setDrawBackground(bool draw)=0
Sets whether to draw the background.
virtual void setAutoScrollEnabled(bool scroll)=0
set whether the listbox should scroll to newly selected items
virtual void setSelected(s32 index)=0
sets the selected item. Set this to -1 if no item should be selected
virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const =0
return the default color which is used for the given colorType
virtual void removeItem(u32 index)=0
Removes an item from the list.
virtual void setItemHeight(s32 height)=0
set global itemHeight
virtual void setSpriteBank(IGUISpriteBank *bank)=0
Sets the sprite bank which should be used to draw list icons.
IGUIListBox(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUIListBox.hpp:43
virtual s32 getItemAt(s32 xpos, s32 ypos) const =0
get the the id of the item at the given absolute coordinates
virtual s32 getIcon(u32 index) const =0
Returns the icon of an item.
virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType)=0
clear item color at index for given colortype
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
virtual s32 getSelected() const =0
returns id of selected item. returns -1 if no item is selected.
Default scroll bar GUI element.
Definition IGUIScrollBar.hpp:20
Sprite bank interface.
Definition IGUISpriteBank.hpp:71
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
EGUI_LISTBOX_COLOR
Enumeration for listbox colors.
Definition IGUIListBox.hpp:20
@ EGUI_LBC_TEXT
Color of text.
Definition IGUIListBox.hpp:22
@ EGUI_LBC_COUNT
Not used, just counts the number of available colors.
Definition IGUIListBox.hpp:30
@ EGUI_LBC_TEXT_HIGHLIGHT
Color of selected text.
Definition IGUIListBox.hpp:24
@ EGUI_LBC_ICON
Color of icon.
Definition IGUIListBox.hpp:26
@ EGUI_LBC_ICON_HIGHLIGHT
Color of selected icon.
Definition IGUIListBox.hpp:28
@ EGUIET_LIST_BOX
A list box (IGUIListBox)
Definition EGUIElementTypes.hpp:50
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print