Mana
Loading...
Searching...
No Matches
avatarlistbox.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2010-2012 The Mana Developers
4 *
5 * This file is part of The Mana Client.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include "avatar.h"
24
25#include "gui/widgets/listbox.h"
26
27#include <string>
28
29class Image;
30
31class AvatarListModel : public gcn::ListModel
32{
33public:
34 virtual Avatar *getAvatarAt(int i) = 0;
35
36 std::string getElementAt(int i) override
37 { return getAvatarAt(i)->getName(); }
38};
39
40class AvatarListBox : public ListBox
41{
42public:
44
45 unsigned int getRowHeight() const override;
46
50 void draw(gcn::Graphics *gcnGraphics) override;
51
52 void mousePressed(gcn::MouseEvent &event) override;
53};
void mousePressed(gcn::MouseEvent &event) override
unsigned int getRowHeight() const override
void draw(gcn::Graphics *gcnGraphics) override
Draws the list box.
virtual Avatar * getAvatarAt(int i)=0
std::string getElementAt(int i) override
const std::string & getName() const
Returns the avatar's name.
Definition avatar.h:34
Defines a class for loading and storing images.
Definition image.h:45
A list box, meant to be used inside a scroll area.
Definition listbox.h:36