5#ifndef DCPP_I_GUI_LIST_BOX_HPP_INCLUDED
6#define DCPP_I_GUI_LIST_BOX_HPP_INCLUDED
8#include <duckcpp/core/engine/IGUIElement.hpp>
9#include <duckcpp/core/engine/SColor.hpp>
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 setItemOverrideColor(dcpp::uint32_kt index, dcpp::video::SColor color)=0
set all item colors at given index to color
virtual void clearItemOverrideColor(dcpp::uint32_kt index, EGUI_LISTBOX_COLOR colorType)=0
clear item color at index for given colortype
virtual bool isAutoScrollEnabled() const =0
returns true if automatic scrolling is enabled, false if not.
virtual dcpp::int32_kt getSelected() const =0
returns id of selected item. returns -1 if no item is selected.
virtual void setSelected(const wchar_t *item)=0
sets the selected item. Set this to 0 if no item should be selected
virtual void setSelected(dcpp::int32_kt index)=0
sets the selected item. Set this to -1 if no item should be selected
virtual void clear()=0
clears the list, deletes all items in the listbox
virtual dcpp::video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const =0
return the default color which is used for the given colorType
virtual dcpp::int32_kt insertItem(dcpp::uint32_kt index, const wchar_t *text, dcpp::int32_kt icon=-1)=0
Insert the item at the given index.
virtual void swapItems(dcpp::uint32_kt index1, dcpp::uint32_kt index2)=0
Swap the items at the given indices.
virtual void setDrawBackground(bool draw)=0
Sets whether to draw the background.
virtual dcpp::uint32_kt getItemCount() const =0
returns amount of list items
virtual const wchar_t * getListItem(dcpp::uint32_kt id) const =0
returns string of a list item. the may id be a value from 0 to itemCount-1
virtual IGUIScrollBar * getVerticalScrollBar() const =0
Access the vertical scrollbar.
virtual dcpp::uint32_kt addItem(const wchar_t *text, dcpp::int32_kt icon=-1)=0
adds an list item with an icon
virtual dcpp::int32_kt getIcon(dcpp::uint32_kt index) const =0
Returns the icon of an item.
virtual void removeItem(dcpp::uint32_kt index)=0
Removes an item from the list.
virtual void setItem(dcpp::uint32_kt index, const wchar_t *text, dcpp::int32_kt icon=-1)=0
set the item at the given index
virtual bool hasItemOverrideColor(dcpp::uint32_kt index, EGUI_LISTBOX_COLOR colorType) const =0
has the item at index its color overwritten?
virtual void clearItemOverrideColor(dcpp::uint32_kt index)=0
clear all item colors at index
virtual void setItemOverrideColor(dcpp::uint32_kt index, EGUI_LISTBOX_COLOR colorType, dcpp::video::SColor color)=0
set all item colors of specified type at given index to color
IGUIListBox(IGUIEnvironment *environment, IGUIElement *parent, dcpp::int32_kt id, dcpp::nub::recti rectangle)
constructor
Definition IGUIListBox.hpp:43
virtual dcpp::int32_kt getItemAt(dcpp::int32_kt xpos, dcpp::int32_kt ypos) const =0
get the the id of the item at the given absolute coordinates
virtual void setSpriteBank(IGUISpriteBank *bank)=0
Sets the sprite bank which should be used to draw list icons.
virtual dcpp::video::SColor getItemOverrideColor(dcpp::uint32_kt index, EGUI_LISTBOX_COLOR colorType) const =0
return the overwrite color at given item index.
virtual void setAutoScrollEnabled(bool scroll)=0
set whether the listbox should scroll to newly selected items
virtual void setItemHeight(dcpp::int32_kt height)=0
set global itemHeight
Sprite bank interface.
Definition IGUISpriteBank.hpp:71
Rectangle template.
Definition rect.hpp:27
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
EGUI_LISTBOX_COLOR
Enumeration for listbox colors.
Definition IGUIListBox.hpp:20
@ EGUI_LBC_ICON
Color of icon.
Definition IGUIListBox.hpp:26
@ EGUI_LBC_ICON_HIGHLIGHT
Color of selected icon.
Definition IGUIListBox.hpp:28
@ 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_TEXT
Color of text.
Definition IGUIListBox.hpp:22
@ EGUIET_LIST_BOX
A list box (IGUIListBox)
Definition EGUIElementTypes.hpp:50
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition shared_device.hpp:34
unsigned int uint32_kt
32 bit unsigned variable.
Definition irrTypes.hpp:64
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72