ManaPlus
|
#include <listmodel.h>
Public Member Functions | |
ListModel () | |
virtual | ~ListModel () |
virtual int | getNumberOfElements ()=0 |
virtual std::string | getElementAt (int i)=0 |
An interface for a model that represents a list. It is used in certain widgets, like the ListBox, to handle a lists with string elements. If you want to use widgets like ListBox, make a derived class from this class that represents your list.
Definition at line 79 of file listmodel.h.
|
inline |
Definition at line 82 of file listmodel.h.
|
inlinevirtual |
|
pure virtual |
Gets an element at a certain index in the list.
i | An index in the list. |
Implemented in NpcDialog, UserPalette, WorldListModel, UpdateTypeModel, UpdateListModel, TargetTypeModel, SortListModelInv, SortListModelBuy, SkillModel, ShopItems, PlayerRelationListModel, OpenGLListModel, NamesModel, ModeListModel, MagicSchoolModel, LangListModel, KeyListModel, ItemsModal, IgnoreChoicesListModel, IconsModel, FontSizeChoiceListModel, ExtendedNamesModel, ColorModel, ColorListModel, AvatarListModel, TypeListModel, and ServersListModel.
Referenced by ColorPage::draw(), DropDown::draw(), ExtendedListBox::draw(), ListBox::draw(), ShopListBox::draw(), SetupItemDropDownStr::fromWidget(), SliderList::getMaxLabelWidth(), DropDown::getSelectedString(), SliderList::getSelectedString(), SetupItemDropDownStr::selectionByValue(), DropDown::setSelectedString(), SliderList::setSelectedString(), PopupMenu::showPopup(), and SliderList::updateLabel().
|
pure virtual |
Gets the number of elements in the list.
Implemented in Party, Guild, NpcDialog, UserPalette, WorldListModel, UpdateTypeModel, UpdateListModel, TypeListModel, TargetTypeModel, SortListModelInv, SortListModelBuy, SkillModel, ShopItems, ServersListModel, PlayerRelationListModel, OpenGLListModel, NamesModel, ModeListModel, MagicSchoolModel, LangListModel, KeyListModel, ItemsModal, IgnoreChoicesListModel, IconsModel, FontSizeChoiceListModel, ExtendedNamesModel, ColorModel, ColorListModel, and BeingsListModel.
Referenced by SliderList::action(), ColorPage::adjustSize(), ListBox::adjustSize(), ShopListBox::adjustSize(), ColorPage::ColorPage(), ColorPage::draw(), ExtendedListBox::draw(), ListBox::draw(), ShopListBox::draw(), AvatarListBox::draw(), SetupItemDropDownStr::fromWidget(), SliderList::getMaxLabelWidth(), SkillListBox::getSelectedInfo(), ListBox::keyPressed(), AvatarListBox::mousePressed(), AvatarListBox::safeDraw(), SetupItemDropDownStr::selectionByValue(), SliderList::setSelected(), ListBox::setSelected(), DropDown::setSelectedString(), SliderList::setSelectedString(), PopupMenu::showPopup(), and SliderList::updateLabel().