diff options
Diffstat (limited to 'src/gui/char_server.h')
-rw-r--r-- | src/gui/char_server.h | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/src/gui/char_server.h b/src/gui/char_server.h index 2d694ef4..6a11c589 100644 --- a/src/gui/char_server.h +++ b/src/gui/char_server.h @@ -26,31 +26,51 @@ #ifndef _CHAR_SEL_SERVER_H #define _CHAR_SEL_SERVER_H -#include <allegro.h> - #include "../main.h" #include "../net/network.h" #include "gui.h" +#include "window.h" + +#include <allegro.h> + /** - * The action listener for the server select dialog. + * The list model for the server list. * * \ingroup GUI */ -class ServerSelectListener : public gcn::ActionListener { +class ServerListModel : public gcn::ListModel { public: - void action(const std::string& eventId); + int getNumberOfElements(); + std::string getElementAt(int i); }; /** - * The list model for the server list. + * The server select dialog. * * \ingroup GUI */ -class ServerListModel : public gcn::ListModel { +class ServerSelectDialog : public Window, public gcn::ActionListener { public: - int getNumberOfElements(); - std::string getElementAt(int i); + ServerSelectDialog(); + ~ServerSelectDialog(); + + /** + * Initializes the dialog. Should be called after adding it to the GUI. + */ + void init(); + + /** + * Called when receiving actions from the widgets. + */ + void action(const std::string& eventId); + + private: + ServerListModel *serverListModel; + gcn::ListBox *serverList; + gcn::Button *okButton; + gcn::Button *cancelButton; + gcn::ScrollArea *scrollArea; }; void char_server(); |