summaryrefslogtreecommitdiff
path: root/src/gui/register.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-14 13:21:35 -0600
committerIra Rice <irarice@gmail.com>2009-03-14 13:21:35 -0600
commit3575c7a606c2d24c0d444e9999892c0390fa5ae8 (patch)
tree399bd2ce51577aa721a460884b397f52d4a4590c /src/gui/register.cpp
parentf0c6bed3d879e1c7b9a6d5b7e676a4f1c6a29a54 (diff)
downloadmana-3575c7a606c2d24c0d444e9999892c0390fa5ae8.tar.gz
mana-3575c7a606c2d24c0d444e9999892c0390fa5ae8.tar.bz2
mana-3575c7a606c2d24c0d444e9999892c0390fa5ae8.tar.xz
mana-3575c7a606c2d24c0d444e9999892c0390fa5ae8.zip
Made a label class derived from the guichan label class which utilizes
the palette colors. While technically, this can be accomplished through other means, it's rather clumsy overall, and is prone to introducing in programmer errors. This commit finally catches every case where text is used, and applies the text color from the color dialog to each of them appropriately. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/register.cpp')
-rw-r--r--src/gui/register.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gui/register.cpp b/src/gui/register.cpp
index 13928e41..63a0d29c 100644
--- a/src/gui/register.cpp
+++ b/src/gui/register.cpp
@@ -20,8 +20,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <guichan/widgets/label.hpp>
-
#include "../configuration.h"
#include "../log.h"
#include "../logindata.h"
@@ -29,6 +27,7 @@
#include "button.h"
#include "checkbox.h"
+#include "label.h"
#include "login.h"
#include "ok_dialog.h"
#include "passwordfield.h"
@@ -47,7 +46,8 @@
* to the field which contained wrong data when the Ok button was pressed on
* the error notice.
*/
-class WrongDataNoticeListener : public gcn::ActionListener {
+class WrongDataNoticeListener : public gcn::ActionListener
+{
public:
void setTarget(gcn::TextField *textField);
void action(const gcn::ActionEvent &event);
@@ -63,22 +63,19 @@ void WrongDataNoticeListener::setTarget(gcn::TextField *textField)
void WrongDataNoticeListener::action(const gcn::ActionEvent &event)
{
if (event.getId() == "ok")
- {
mTarget->requestFocus();
- }
}
-
RegisterDialog::RegisterDialog(LoginData *loginData):
Window(_("Register")),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(loginData)
{
- gcn::Label *userLabel = new gcn::Label(_("Name:"));
- gcn::Label *passwordLabel = new gcn::Label(_("Password:"));
- gcn::Label *confirmLabel = new gcn::Label(_("Confirm:"));
- gcn::Label *serverLabel = new gcn::Label(_("Server:"));
- gcn::Label *portLabel = new gcn::Label(_("Port:"));
+ gcn::Label *userLabel = new Label(_("Name:"));
+ gcn::Label *passwordLabel = new Label(_("Password:"));
+ gcn::Label *confirmLabel = new Label(_("Confirm:"));
+ gcn::Label *serverLabel = new Label(_("Server:"));
+ gcn::Label *portLabel = new Label(_("Port:"));
mUserField = new TextField(loginData->username);
mPasswordField = new PasswordField(loginData->password);
mConfirmField = new PasswordField;