ManaPlus
extendedlistbox.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2012-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef GUI_WIDGETS_EXTENDEDLISTBOX_H
23 #define GUI_WIDGETS_EXTENDEDLISTBOX_H
24 
26 #include "gui/widgets/listbox.h"
27 
29 {
30  public:
34  ExtendedListBox(const Widget2 *const widget,
35  ListModel *const listModel,
36  const std::string &skin,
37  const unsigned int rowHeight);
38 
40 
41  ~ExtendedListBox() override final;
42 
46  void draw(Graphics *const graphics) override final A_NONNULL(2);
47 
48  void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
49 
50  void adjustSize() override;
51 
52  int getSelectionByMouse(const int y) const override final;
53 
54  protected:
56  int mSpacing;
57  int mHeight;
58  STD_VECTOR<ExtendedListBoxItem> mListItems;
59  STD_VECTOR<ExtendedListBoxItem> mSelectedItems;
60 };
61 
62 #endif // GUI_WIDGETS_EXTENDEDLISTBOX_H
std::vector< ExtendedListBoxItem > mListItems
void safeDraw(Graphics *const graphics)
void draw(Graphics *const graphics)
std::vector< ExtendedListBoxItem > mSelectedItems
int getSelectionByMouse(const int y) const
ExtendedListBox(const Widget2 *const widget, ListModel *const listModel, const std::string &skin, const unsigned int rowHeight)
#define A_NONNULL(...)
Definition: localconsts.h:168
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53