Skip to content

Commit

Permalink
KOTOR: Add removeAllItems method to list box widget
Browse files Browse the repository at this point in the history
  • Loading branch information
vkremianskii authored and DrMcCoy committed May 22, 2018
1 parent 000f945 commit c8d2862
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engines/kotor/gui/widgets/listbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ void WidgetListBox::addItem(const Common::UString &text) {
_items.push_back(text);
}

void WidgetListBox::removeAllItems() {
_selectedIndex = -1;
_startIndex = 0;
_items.clear();
}

void WidgetListBox::refreshItemWidgets() {
for (size_t i = 0; i < _itemWidgets.size(); ++i) {
KotORWidget *itemWidget = _itemWidgets[i];
Expand Down
1 change: 1 addition & 0 deletions src/engines/kotor/gui/widgets/listbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class WidgetListBox : public KotORWidget {
const std::vector<KotORWidget *> &createItemWidgets(uint count = 0);

void addItem(const Common::UString &text);
void removeAllItems();
void refreshItemWidgets();

KotORWidget *createItem(Common::UString name);
Expand Down

0 comments on commit c8d2862

Please sign in to comment.