summaryrefslogtreecommitdiff
path: root/src/gui/char_server.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-18 13:40:58 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-18 13:40:58 +0000
commit55372882029946d8193ca4414091b65abd64a6ae (patch)
tree61395d66a6de7a308979acde1551447a85b17025 /src/gui/char_server.h
parent6f44dd9fd801bf279034f5cebb5dc83c8a504799 (diff)
downloadmana-client-55372882029946d8193ca4414091b65abd64a6ae.tar.gz
mana-client-55372882029946d8193ca4414091b65abd64a6ae.tar.bz2
mana-client-55372882029946d8193ca4414091b65abd64a6ae.tar.xz
mana-client-55372882029946d8193ca4414091b65abd64a6ae.zip
Made login dialog and server select dialog into classes.
Diffstat (limited to 'src/gui/char_server.h')
-rw-r--r--src/gui/char_server.h38
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();