diff options
Diffstat (limited to 'src/gui')
32 files changed, 247 insertions, 306 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 8d963227..aec9e576 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -62,7 +62,7 @@ BuyDialog::BuyDialog(): mSlider = new Slider(1.0); mQuantityLabel = new Label(strprintf("%d / %d", mAmountItems, mMaxItems)); mQuantityLabel->setAlignment(gcn::Graphics::CENTER); - mMoneyLabel = new gcn::Label(strprintf(_("Price: %s / Total: %s"), + mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"), "", "")); mIncreaseButton = new Button("+", "+", this); diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp index 14cfb1e7..daa66324 100644 --- a/src/gui/changeemaildialog.cpp +++ b/src/gui/changeemaildialog.cpp @@ -21,31 +21,30 @@ #include "changeemaildialog.h" -#include <string> -#include <sstream> - -#include <guichan/widgets/label.hpp> +#include "main.h" +#include "log.h" +#include "logindata.h" -#include "../main.h" -#include "../log.h" -#include "../logindata.h" +#include "gui/button.h" +#include "gui/label.h" +#include "gui/register.h" +#include "gui/textfield.h" +#include "gui/ok_dialog.h" -#include "button.h" -#include "register.h" -#include "textfield.h" -#include "ok_dialog.h" +#include "utils/gettext.h" +#include "utils/strprintf.h" -#include "../utils/gettext.h" -#include "../utils/strprintf.h" +#include <string> +#include <sstream> ChangeEmailDialog::ChangeEmailDialog(Window *parent, LoginData *loginData): Window(_("Change Email Address"), true, parent), mWrongDataNoticeListener(new WrongDataNoticeListener), mLoginData(loginData) { - gcn::Label *accountLabel = new gcn::Label(strprintf(_("Account: %s"), - mLoginData->username.c_str())); - gcn::Label *newEmailLabel = new gcn::Label(_("Type New Email Address twice:")); + gcn::Label *accountLabel = new Label(strprintf(_("Account: %s"), + mLoginData->username.c_str())); + gcn::Label *newEmailLabel = new Label(_("Type New Email Address twice:")); mFirstEmailField = new TextField; mSecondEmailField = new TextField; mChangeEmailButton = new Button(_("Change Email Address"), "change_email", this); diff --git a/src/gui/changeemaildialog.h b/src/gui/changeemaildialog.h index 145c54b1..614f2401 100644 --- a/src/gui/changeemaildialog.h +++ b/src/gui/changeemaildialog.h @@ -22,11 +22,11 @@ #ifndef GUI_CHANGEEMAIL_H #define GUI_CHANGEEMAIL_H -#include <iosfwd> -#include <guichan/actionlistener.hpp> +#include "gui/window.h" + +#include "guichanfwd.h" -#include "window.h" -#include "../guichanfwd.h" +#include <guichan/actionlistener.hpp> class LoginData; class OkDialog; diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp index 4bc97326..7af1371b 100644 --- a/src/gui/changepassworddialog.cpp +++ b/src/gui/changepassworddialog.cpp @@ -21,34 +21,33 @@ #include "changepassworddialog.h" -#include <string> -#include <sstream> - -#include <guichan/widgets/label.hpp> +#include "main.h" +#include "log.h" +#include "logindata.h" -#include "../main.h" -#include "../log.h" -#include "../logindata.h" +#include "gui/button.h" +#include "gui/register.h" +#include "gui/passwordfield.h" +#include "gui/textfield.h" +#include "gui/ok_dialog.h" +#include "gui/label.h" -#include "button.h" -#include "register.h" -#include "passwordfield.h" -#include "textfield.h" -#include "ok_dialog.h" +#include "utils/gettext.h" +#include "utils/strprintf.h" -#include "../utils/gettext.h" -#include "../utils/strprintf.h" +#include <string> +#include <sstream> ChangePasswordDialog::ChangePasswordDialog(Window *parent, LoginData *loginData): Window(_("Change Password"), true, parent), mWrongDataNoticeListener(new WrongDataNoticeListener), mLoginData(loginData) { - gcn::Label *accountLabel = new gcn::Label(strprintf(_("Account: %s"), - mLoginData->username.c_str())); - gcn::Label *oldPassLabel = new gcn::Label(_("Password:")); + gcn::Label *accountLabel = new Label(strprintf(_("Account: %s"), + mLoginData->username.c_str())); + gcn::Label *oldPassLabel = new Label(_("Password:")); mOldPassField = new PasswordField; - gcn::Label *newPassLabel = new gcn::Label(_("Type New Password twice:")); + gcn::Label *newPassLabel = new Label(_("Type New Password twice:")); mFirstPassField = new PasswordField; mSecondPassField = new PasswordField; mChangePassButton = new Button(_("Change Password"), "change_password", this); diff --git a/src/gui/changepassworddialog.h b/src/gui/changepassworddialog.h index ad1c0b2a..ba9f6ede 100644 --- a/src/gui/changepassworddialog.h +++ b/src/gui/changepassworddialog.h @@ -22,11 +22,11 @@ #ifndef CHANGEPASSWORDDIALOG_H #define CHANGEPASSWORDDIALOG_H -#include <iosfwd> -#include <guichan/actionlistener.hpp> +#include "gui/window.h" + +#include "guichanfwd.h" -#include "window.h" -#include "../guichanfwd.h" +#include <guichan/actionlistener.hpp> class LoginData; class OkDialog; diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp index 8922c8f6..f174ceb5 100644 --- a/src/gui/charcreatedialog.cpp +++ b/src/gui/charcreatedialog.cpp @@ -51,8 +51,6 @@ #include <guichan/font.hpp> -#include <string> - CharCreateDialog::CharCreateDialog(Window *parent, int slot): Window(_("Create Character"), true, parent), mSlot(slot) @@ -94,7 +92,7 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot): mNameField->setActionEventId("create"); mNameField->addActionListener(this); - mAttributesLeft = new gcn::Label(strprintf(_("Please distribute %d points"), 99)); + mAttributesLeft = new Label(strprintf(_("Please distribute %d points"), 99)); int w = 200; int h = 330; @@ -285,18 +283,18 @@ void CharCreateDialog::setAttributes(std::vector<std::string> labels, for (unsigned i = 0; i < labels.size(); i++) { - mAttributeLabel[i] = new gcn::Label(labels[i]); + mAttributeLabel[i] = new Label(labels[i]); mAttributeLabel[i]->setWidth(70); mAttributeLabel[i]->setPosition(5, 140 + i*20); add(mAttributeLabel[i]); - mAttributeSlider[i] = new gcn::Slider(min, max); + mAttributeSlider[i] = new Slider(min, max); mAttributeSlider[i]->setDimension(gcn::Rectangle(75, 140 + i*20, 100, 10)); mAttributeSlider[i]->setActionEventId("statslider"); mAttributeSlider[i]->addActionListener(this); add(mAttributeSlider[i]); - mAttributeValue[i] = new gcn::Label(toString(min)); + mAttributeValue[i] = new Label(toString(min)); mAttributeValue[i]->setPosition(180, 140 + i*20); add(mAttributeValue[i]); } diff --git a/src/gui/charcreatedialog.h b/src/gui/charcreatedialog.h index 89509701..e0a63eb7 100644 --- a/src/gui/charcreatedialog.h +++ b/src/gui/charcreatedialog.h @@ -29,6 +29,8 @@ #include "gui/window.h" #include <guichan/actionlistener.hpp> + +#include <string> #include <vector> class LocalPlayer; diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index f2ef2111..3098cc28 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -20,24 +20,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <guichan/font.hpp> - -#include <guichan/widgets/label.hpp> +#include "gui/itempopup.h" -#include "gui.h" -#include "itempopup.h" -#include "palette.h" -#include "scrollarea.h" -#include "textbox.h" +#include "gui/gui.h" +#include "gui/palette.h" +#include "gui/scrollarea.h" +#include "gui/textbox.h" -#include "../graphics.h" +#include "graphics.h" +#include "units.h" -#include "../units.h" +#include "resources/iteminfo.h" -#include "../resources/iteminfo.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" -#include "../utils/gettext.h" -#include "../utils/stringutils.h" +#include <guichan/font.hpp> +#include <guichan/widgets/label.hpp> ItemPopup::ItemPopup(): Popup("ItemPopup") diff --git a/src/gui/magic.cpp b/src/gui/magic.cpp index 117c1f14..a24bfc05 100644 --- a/src/gui/magic.cpp +++ b/src/gui/magic.cpp @@ -19,17 +19,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <guichan/widgets/label.hpp> -#include <guichan/widgets/container.hpp> - #include "magic.h" -#include "button.h" +#include "gui/button.h" -#include "../localplayer.h" +#include "localplayer.h" -#include "../utils/dtor.h" -#include "../utils/gettext.h" +#include "utils/dtor.h" +#include "utils/gettext.h" MagicDialog::MagicDialog(): Window(_("Magic")) diff --git a/src/gui/magic.h b/src/gui/magic.h index 74529396..7f346f6a 100644 --- a/src/gui/magic.h +++ b/src/gui/magic.h @@ -22,13 +22,11 @@ #ifndef MAGIC_H #define MAGIC_H -#include <guichan/actionlistener.hpp> - -#include "window.h" -#include "gccontainer.h" +#include "gui/window.h" -#include "../guichanfwd.h" +#include "guichanfwd.h" +#include <guichan/actionlistener.hpp> /** * The skill dialog. @@ -38,14 +36,8 @@ class MagicDialog : public Window, public gcn::ActionListener { public: - /** - * Constructor. - */ MagicDialog(); - /** - * Destructor. - */ ~MagicDialog(); /** @@ -62,14 +54,8 @@ class MagicDialog : public Window, public gcn::ActionListener * Draw this window. */ void draw(gcn::Graphics *g); - - private: - }; - - - extern MagicDialog *magicDialog; #endif diff --git a/src/gui/npcpostdialog.cpp b/src/gui/npcpostdialog.cpp index 2b178cff..f755c64b 100644 --- a/src/gui/npcpostdialog.cpp +++ b/src/gui/npcpostdialog.cpp @@ -21,6 +21,7 @@ #include "gui/npcpostdialog.h" +#include "gui/label.h" #include "gui/textbox.h" #include "gui/textfield.h" #include "gui/button.h" @@ -35,15 +36,13 @@ #include "utils/gettext.h" -#include <guichan/widgets/label.hpp> - NpcPostDialog::NpcPostDialog(): Window(_("NPC")) { setContentSize(400, 180); // create text field for receiver - gcn::Label *senderText = new gcn::Label("To:"); + gcn::Label *senderText = new Label("To:"); senderText->setPosition(5, 5); mSender = new TextField; mSender->setPosition(senderText->getWidth() + 5, 5); diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index 83794ffe..193f0e27 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -19,18 +19,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "quitdialog.h" -#include <iostream> -#include <string> +#include "gui/quitdialog.h" -#include <guichan/widgets/label.hpp> +#include "main.h" -#include "../main.h" +#include "gui/button.h" +#include "gui/radiobutton.h" -#include "button.h" -#include "radiobutton.h" - -#include "../utils/gettext.h" +#include "utils/gettext.h" QuitDialog::QuitDialog(bool* quitGame, QuitDialog** pointerToMe): Window(_("Quit"), true, NULL), mQuitGame(quitGame), mMyPointer(pointerToMe) @@ -85,7 +81,6 @@ QuitDialog::QuitDialog(bool* quitGame, QuitDialog** pointerToMe): setVisible(true); mOkButton->requestFocus(); - } QuitDialog::~QuitDialog() @@ -98,8 +93,7 @@ QuitDialog::~QuitDialog() delete mSwitchCharacter; } -void -QuitDialog::action(const gcn::ActionEvent &event) +void QuitDialog::action(const gcn::ActionEvent &event) { if (event.getId() == "ok") { diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h index aee671db..7f12c41c 100644 --- a/src/gui/quitdialog.h +++ b/src/gui/quitdialog.h @@ -22,27 +22,28 @@ #ifndef QUITDIALOG_H #define QUITDIALOG_H -#include <iosfwd> -#include <guichan/actionlistener.hpp> +#include "gui/window.h" + +#include "guichanfwd.h" +#include "main.h" -#include "window.h" -#include "../guichanfwd.h" -#include "../main.h" +#include <guichan/actionlistener.hpp> /** * The quit dialog. * * \ingroup Interface */ -class QuitDialog : public Window, public gcn::ActionListener { +class QuitDialog : public Window, public gcn::ActionListener +{ public: /** * Constructor * * @quitGame; to be used for getting out of the while loop in Game - * @pointerToMe; will be set to NULL when the QuitDialog is destroyed + * @pointerToMe will be set to NULL when the QuitDialog is destroyed */ - QuitDialog(bool* quitGame, QuitDialog** pointerToMe); + QuitDialog(bool *quitGame, QuitDialog **pointerToMe); /** * Destructor @@ -62,9 +63,8 @@ class QuitDialog : public Window, public gcn::ActionListener { gcn::Button *mOkButton; gcn::Button *mCancelButton; - bool* mQuitGame; - QuitDialog** mMyPointer; - + bool *mQuitGame; + QuitDialog **mMyPointer; }; #endif diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 9d679acb..c7746b89 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -19,29 +19,28 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <cstdlib> -#include <iostream> -#include <string> - -#include <guichan/widgets/label.hpp> +#include "gui/serverdialog.h" -#include "serverdialog.h" +#include "gui/button.h" +#include "gui/label.h" +#include "gui/listbox.h" +#include "gui/ok_dialog.h" +#include "gui/scrollarea.h" +#include "gui/textfield.h" -#include "button.h" -#include "listbox.h" -#include "ok_dialog.h" -#include "scrollarea.h" -#include "textfield.h" +#include "gui/widgets/layout.h" -#include "widgets/layout.h" +#include "configuration.h" +#include "log.h" +#include "logindata.h" +#include "main.h" -#include "../configuration.h" -#include "../log.h" -#include "../logindata.h" -#include "../main.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" -#include "../utils/gettext.h" -#include "../utils/stringutils.h" +#include <cstdlib> +#include <iostream> +#include <string> const short MAX_SERVERLIST = 5; @@ -74,8 +73,8 @@ void ServersListModel::addElement(Server server) ServerDialog::ServerDialog(LoginData *loginData): Window(_("Choose your server")), mLoginData(loginData) { - gcn::Label *serverLabel = new gcn::Label(_("Server:")); - gcn::Label *portLabel = new gcn::Label(_("Port:")); + gcn::Label *serverLabel = new Label(_("Server:")); + gcn::Label *portLabel = new Label(_("Port:")); mServerNameField = new TextField(mLoginData->hostname); mPortField = new TextField(toString(mLoginData->port)); diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index 492f5a2b..9906e04a 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -22,26 +22,26 @@ #ifndef SERVERDIALOG_H #define SERVERDIALOG_H -#include <iosfwd> -#include <vector> +#include "gui/window.h" -#include <guichan/actionlistener.hpp> -#include <guichan/listmodel.hpp> -#include "./widgets/dropdown.h" +#include "guichanfwd.h" -#include "login.h" -#include "window.h" +#include "net/tmwserv/network.h" -#include "../guichanfwd.h" +#include <guichan/actionlistener.hpp> +#include <guichan/listmodel.hpp> -#include "../net/tmwserv/network.h" +#include <string> +#include <vector> +class DropDown; class LoginData; /** * A server structure to keep pairs of servers and ports. */ -struct Server { +struct Server +{ Server(): port(0) {} @@ -60,18 +60,23 @@ class ServersListModel : public gcn::ListModel * Used to get number of line in the list */ int getNumberOfElements(); + /** * Used to get an element from the list */ std::string getElementAt(int elementIndex); + /** * Used to get the corresponding Server struct */ - Server getServer(int elementIndex) { return servers[elementIndex]; }; + Server getServer(int elementIndex) const + { return servers[elementIndex]; } + /** * Add an Element at the end of the server list */ void addElement(Server server); + /** * Add an Element at the beginning of the server list */ diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 77e726f8..02955470 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -19,29 +19,26 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <string> -#include <cmath> - -#include <guichan/listmodel.hpp> -#include <guichan/widgets/slider.hpp> +#include "gui/browserbox.h" +#include "gui/gui.h" +#include "gui/itemlinkhandler.h" +#include "gui/label.h" +#include "gui/listbox.h" +#include "gui/palette.h" +#include "gui/scrollarea.h" +#include "gui/setup_colors.h" +#include "gui/slider.h" -#include "browserbox.h" -#include "gui.h" -#include "itemlinkhandler.h" -#include "label.h" -#include "listbox.h" -#include "palette.h" -#include "scrollarea.h" -#include "setup_colors.h" -#include "slider.h" -#include "textfield.h" +#include "gui/widgets/layouthelper.h" +#include "gui/widgets/textpreview.h" -#include "widgets/layouthelper.h" +#include "configuration.h" -#include "../configuration.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" -#include "../utils/gettext.h" -#include "../utils/stringutils.h" +#include <string> +#include <cmath> const std::string Setup_Colors::rawmsg = _("This is what the color looks like"); diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h index 52d3f727..b909b873 100644 --- a/src/gui/setup_colors.h +++ b/src/gui/setup_colors.h @@ -26,17 +26,14 @@ #include <guichan/actionlistener.hpp> -#include <guichan/widgets/label.hpp> -#include <guichan/widgets/listbox.hpp> +#include "gui/setuptab.h" +#include "gui/textfield.h" -#include "setuptab.h" -#include "textfield.h" - -#include "../guichanfwd.h" - -#include "widgets/textpreview.h" +#include "guichanfwd.h" class BrowserBox; +class TextField; +class TextPreview; class Setup_Colors : public SetupTab, public gcn::ActionListener, public TextFieldListener @@ -44,11 +41,13 @@ class Setup_Colors : public SetupTab, public gcn::ActionListener, public: Setup_Colors(); ~Setup_Colors(); + void apply(); void cancel(); void action(const gcn::ActionEvent &event); void listen(const TextField *tf); + private: static const std::string rawmsg; @@ -82,4 +81,5 @@ class Setup_Colors : public SetupTab, public gcn::ActionListener, void updateColor(); void updateGradType(); }; + #endif diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index aba8cf35..17d98dc1 100644 --- a/src/gui/setup_keyboard.cpp +++ b/src/gui/setup_keyboard.cpp @@ -20,23 +20,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <SDL_keyboard.h> +#include "gui/setup_keyboard.h" -#include <guichan/widgets/label.hpp> -#include <guichan/listmodel.hpp> +#include "gui/button.h" +#include "gui/listbox.h" +#include "gui/ok_dialog.h" +#include "gui/scrollarea.h" -#include "button.h" -#include "listbox.h" -#include "ok_dialog.h" -#include "scrollarea.h" -#include "setup_keyboard.h" +#include "gui/widgets/layouthelper.h" -#include "widgets/layouthelper.h" +#include "keyboardconfig.h" -#include "../keyboardconfig.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" -#include "../utils/gettext.h" -#include "../utils/stringutils.h" +#include <SDL_keyboard.h> + +#include <guichan/listmodel.hpp> /** * The list model for key function list. @@ -59,7 +59,7 @@ class KeyListModel : public gcn::ListModel /** * Sets element from container. */ - void setElementAt(int i, std::string caption) + void setElementAt(int i, const std::string &caption) { mKeyFunctions[i] = caption; } diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 4afd92ac..5bef6c3c 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -21,12 +21,13 @@ #include "gui/skilldialog.h" -#include "gui/icon.h" #include "gui/button.h" +#include "gui/icon.h" +#include "gui/label.h" #include "gui/listbox.h" +#include "gui/progressbar.h" #include "gui/scrollarea.h" #include "gui/windowcontainer.h" -#include "gui/progressbar.h" #include "gui/widgets/tabbedarea.h" @@ -36,9 +37,7 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -#include <guichan/widgets/label.hpp> #include <guichan/widgets/container.hpp> -#include <guichan/widgets/icon.hpp> #include <vector> @@ -87,7 +86,7 @@ class SkillTab : public GCContainer, public gcn::ActionListener /** * Get the icon associated with the given index */ - Icon* getIcon(int index); + Icon *getIcon(int index); std::vector<Icon *> mSkillIcons; std::vector<gcn::Label *> mSkillNameLabels; @@ -175,13 +174,13 @@ SkillTab::SkillTab(const std::string &type): type(type) mSkillProgress.resize(skillNum); // Set the initial positions of the skill information - for (int a=0; a < skillNum; a++) + for (int a = 0; a < skillNum; a++) { mSkillIcons.at(a) = getIcon(a); mSkillIcons.at(a)->setPosition(1, a*32); add(mSkillIcons.at(a)); - mSkillNameLabels.at(a) = new gcn::Label(""); + mSkillNameLabels.at(a) = new Label(""); mSkillNameLabels.at(a)->setPosition(35, a*32 ); add(mSkillNameLabels.at(a)); @@ -189,11 +188,11 @@ SkillTab::SkillTab(const std::string &type): type(type) mSkillProgress.at(a)->setPosition(35, a*32 + 13); add(mSkillProgress.at(a)); - mSkillExpLabels.at(a) = new gcn::Label(""); + mSkillExpLabels.at(a) = new Label(""); mSkillExpLabels.at(a)->setPosition(45, a*32 + 16); add(mSkillExpLabels.at(a)); - mSkillLevelLabels.at(a) = new gcn::Label(""); + mSkillLevelLabels.at(a) = new Label(""); mSkillLevelLabels.at(a)->setPosition(165, a*32); add(mSkillLevelLabels.at(a)); } diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index 8d1f6a88..a913b9be 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -23,11 +23,9 @@ #define SKILL_H #include "gui/window.h" -#include "gui/gccontainer.h" #include "guichanfwd.h" -#include <guichan/listmodel.hpp> #include <guichan/actionlistener.hpp> #include <list> @@ -44,14 +42,8 @@ class SkillTab; class SkillDialog : public Window, public gcn::ActionListener { public: - /** - * Constructor. - */ SkillDialog(); - /** - * Destructor. - */ ~SkillDialog(); /** diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp index c74ae4a3..b4f7ff3b 100644 --- a/src/gui/speechbubble.cpp +++ b/src/gui/speechbubble.cpp @@ -20,18 +20,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <guichan/font.hpp> - -#include <guichan/widgets/label.hpp> +#include "gui/gui.h" +#include "gui/scrollarea.h" +#include "gui/speechbubble.h" +#include "gui/textbox.h" -#include "gui.h" -#include "scrollarea.h" -#include "speechbubble.h" -#include "textbox.h" +#include "graphics.h" -#include "../graphics.h" +#include "utils/gettext.h" -#include "../utils/gettext.h" +#include <guichan/font.hpp> +#include <guichan/widgets/label.hpp> SpeechBubble::SpeechBubble(): Popup("Speech", "graphics/gui/speechbubble.xml") diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 31b2da90..492ccd50 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -21,16 +21,15 @@ #include "statuswindow.h" -#include <guichan/widgets/label.hpp> +#include "gui/button.h" +#include "gui/label.h" +#include "gui/progressbar.h" +#include "gui/windowcontainer.h" -#include "button.h" -#include "progressbar.h" -#include "windowcontainer.h" +#include "localplayer.h" -#include "../localplayer.h" - -#include "../utils/strprintf.h" -#include "../utils/stringutils.h" +#include "utils/strprintf.h" +#include "utils/stringutils.h" StatusWindow::StatusWindow(LocalPlayer *player): Window(player->getName()), @@ -47,12 +46,12 @@ StatusWindow::StatusWindow(LocalPlayer *player): // Status Part // ---------------------- - mLvlLabel = new gcn::Label("Level:"); - mMoneyLabel = new gcn::Label("Money:"); + mLvlLabel = new Label("Level:"); + mMoneyLabel = new Label("Money:"); - mHpLabel = new gcn::Label("HP:"); + mHpLabel = new Label("HP:"); mHpBar = new ProgressBar(1.0f, 80, 15, 0, 171, 34); - mHpValueLabel = new gcn::Label(""); + mHpValueLabel = new Label; int y = 3; int x = 5; @@ -84,34 +83,34 @@ StatusWindow::StatusWindow(LocalPlayer *player): // ---------------------- // Static Labels - gcn::Label *mStatsTitleLabel = new gcn::Label("Stats"); - gcn::Label *mStatsTotalLabel = new gcn::Label("Total"); + gcn::Label *mStatsTitleLabel = new Label("Stats"); + gcn::Label *mStatsTotalLabel = new Label("Total"); // Derived Stats /* - mStatsAttackLabel = new gcn::Label("Attack:"); - mStatsDefenseLabel= new gcn::Label("Defense:"); - mStatsMagicAttackLabel = new gcn::Label("M.Attack:"); - mStatsMagicDefenseLabel = new gcn::Label("M.Defense:"); - mStatsAccuracyLabel = new gcn::Label("% Accuracy:"); - mStatsEvadeLabel = new gcn::Label("% Evade:"); - mStatsReflexLabel = new gcn::Label("% Reflex:"); - - mStatsAttackPoints = new gcn::Label(""); - mStatsDefensePoints = new gcn::Label(""); - mStatsMagicAttackPoints = new gcn::Label(""); - mStatsMagicDefensePoints = new gcn::Label(""); - mStatsAccuracyPoints = new gcn::Label("% Accuracy:"); - mStatsEvadePoints = new gcn::Label("% Evade:"); - mStatsReflexPoints = new gcn::Label("% Reflex:"); + mStatsAttackLabel = new Label("Attack:"); + mStatsDefenseLabel= new Label("Defense:"); + mStatsMagicAttackLabel = new Label("M.Attack:"); + mStatsMagicDefenseLabel = new Label("M.Defense:"); + mStatsAccuracyLabel = new Label("% Accuracy:"); + mStatsEvadeLabel = new Label("% Evade:"); + mStatsReflexLabel = new Label("% Reflex:"); + + mStatsAttackPoints = new Label; + mStatsDefensePoints = new Label; + mStatsMagicAttackPoints = new Label; + mStatsMagicDefensePoints = new Label; + mStatsAccuracyPoints = new Label("% Accuracy:"); + mStatsEvadePoints = new Label("% Evade:"); + mStatsReflexPoints = new Label("% Reflex:"); */ // New labels for (int i = 0; i < 6; i++) { - mStatsLabel[i] = new gcn::Label(); - mStatsDisplayLabel[i] = new gcn::Label(); + mStatsLabel[i] = new Label; + mStatsDisplayLabel[i] = new Label; } - mCharacterPointsLabel = new gcn::Label(); - mCorrectionPointsLabel = new gcn::Label(); + mCharacterPointsLabel = new Label; + mCorrectionPointsLabel = new Label; // Set button events Id mStatsPlus[0] = new Button("+", "STR+", this); diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index 605145d3..b28fa275 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -22,18 +22,15 @@ #ifndef STATUS_H #define STATUS_H -#include <iosfwd> +#include "gui/window.h" -#include <guichan/actionlistener.hpp> - -#include "window.h" +#include "guichanfwd.h" -#include "../guichanfwd.h" +#include <guichan/actionlistener.hpp> class LocalPlayer; class ProgressBar; - /** * The player status dialog. * diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp index 8c65d64b..a7f8def7 100644 --- a/src/gui/textdialog.cpp +++ b/src/gui/textdialog.cpp @@ -19,20 +19,20 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "textdialog.h" -#include "button.h" +#include "gui/textdialog.h" -#include "../utils/gettext.h" +#include "gui/button.h" +#include "gui/label.h" +#include "gui/textfield.h" -#include <guichan/widgets/label.hpp> -#include <guichan/widgets/textfield.hpp> +#include "utils/gettext.h" TextDialog::TextDialog(const std::string &title, const std::string &msg, Window *parent): Window(title, true, parent), mTextField(new TextField) { - gcn::Label *textLabel = new gcn::Label(msg); + gcn::Label *textLabel = new Label(msg); mOkButton = new Button(_("OK"), "OK", this); gcn::Button *cancelButton = new Button(_("Cancel"), "CANCEL", this); diff --git a/src/gui/textdialog.h b/src/gui/textdialog.h index 3dc9259c..16a1e9d8 100644 --- a/src/gui/textdialog.h +++ b/src/gui/textdialog.h @@ -22,10 +22,11 @@ #ifndef GUI_GUILD_DIALOG_H #define GUI_GUILD_DIALOG_H +#include "window.h" + #include <guichan/actionlistener.hpp> -#include "textfield.h" -#include "window.h" +class TextField; /** * An option dialog. @@ -41,7 +42,7 @@ public: * @see Window::Window */ TextDialog(const std::string &title, const std::string &msg, - Window *parent = NULL); + Window *parent = NULL); /** * Called when receiving actions from the widgets. diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index c133c9f7..b67fb01e 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -19,34 +19,33 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "unregisterdialog.h" +#include "gui/unregisterdialog.h" -#include <string> -#include <sstream> - -#include <guichan/widgets/label.hpp> +#include "main.h" +#include "log.h" +#include "logindata.h" -#include "../main.h" -#include "../log.h" -#include "../logindata.h" +#include "gui/button.h" +#include "gui/checkbox.h" +#include "gui/label.h" +#include "gui/ok_dialog.h" +#include "gui/passwordfield.h" +#include "gui/register.h" +#include "gui/textfield.h" -#include "button.h" -#include "checkbox.h" -#include "register.h" -#include "passwordfield.h" -#include "textfield.h" -#include "ok_dialog.h" +#include "utils/gettext.h" +#include "utils/strprintf.h" -#include "../utils/gettext.h" -#include "../utils/strprintf.h" +#include <string> +#include <sstream> UnRegisterDialog::UnRegisterDialog(Window *parent, LoginData *loginData): Window("Unregister", true, parent), mWrongDataNoticeListener(new WrongDataNoticeListener), mLoginData(loginData) { - gcn::Label *userLabel = new gcn::Label(strprintf(_("Name: %s"), mLoginData->username.c_str())); - gcn::Label *passwordLabel = new gcn::Label(_("Password:")); + gcn::Label *userLabel = new Label(strprintf(_("Name: %s"), mLoginData->username.c_str())); + gcn::Label *passwordLabel = new Label(_("Password:")); mPasswordField = new PasswordField(mLoginData->password); mUnRegisterButton = new Button(_("Unregister"), "unregister", this); mCancelButton = new Button(_("Cancel"), "cancel", this); diff --git a/src/gui/unregisterdialog.h b/src/gui/unregisterdialog.h index 1e3cc88f..5db57b1d 100644 --- a/src/gui/unregisterdialog.h +++ b/src/gui/unregisterdialog.h @@ -22,11 +22,11 @@ #ifndef UNREGISTERDIALOG_H #define UNREGISTERDIALOG_H -#include <iosfwd> #include <guichan/actionlistener.hpp> -#include "window.h" -#include "../guichanfwd.h" +#include "gui/window.h" + +#include "guichanfwd.h" class LoginData; class OkDialog; @@ -37,18 +37,16 @@ class WrongDataNoticeListener; * * \ingroup Interface */ -class UnRegisterDialog : public Window, public gcn::ActionListener { +class UnRegisterDialog : public Window, public gcn::ActionListener +{ public: /** * Constructor * * @see Window::Window */ - UnRegisterDialog(Window *parent,LoginData *loginData); + UnRegisterDialog(Window *parent, LoginData *loginData); - /** - * Destructor - */ ~UnRegisterDialog(); /** diff --git a/src/gui/widgets/avatar.cpp b/src/gui/widgets/avatar.cpp index 2603e3ae..c9e8002e 100644 --- a/src/gui/widgets/avatar.cpp +++ b/src/gui/widgets/avatar.cpp @@ -22,12 +22,11 @@ #include "gui/widgets/avatar.h" #include "gui/icon.h" +#include "gui/label.h" #include "resources/image.h" #include "resources/resourcemanager.h" -#include <guichan/widgets/label.hpp> - namespace { Image *avatarStatusOffline; Image *avatarStatusOnline; @@ -54,7 +53,7 @@ Avatar::Avatar(const std::string &name): mStatus->setSize(12, 12); add(mStatus, 1, 0); - mLabel = new gcn::Label(name); + mLabel = new Label(name); mLabel->setSize(85, 12); add(mLabel, 14, 0); } diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 88d62076..2211eb36 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -40,6 +40,8 @@ #include "utils/strprintf.h" #include "utils/stringutils.h" +#include <guichan/widgets/tabbedarea.hpp> + ChatTab::ChatTab(const std::string &name) : Tab() { setCaption(name); diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 88443aa3..ad7c90bb 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -25,8 +25,6 @@ #include "gui/widgets/tab.h" #include "gui/chat.h" -#include <guichan/widgets/container.hpp> - class BrowserBox; class Recorder; class ScrollArea; @@ -60,10 +58,6 @@ class ChatTab : public Tab * Constructor. */ ChatTab(const std::string &name); - - /** - * Destructor. - */ ~ChatTab(); /** @@ -81,7 +75,6 @@ class ChatTab : public Tab * Adds the text to the message list * * @param msg The message text which is to be sent. - * */ void chatLog(const std::string &nick, const std::string &msg); @@ -91,7 +84,6 @@ class ChatTab : public Tab * command handler * * @param msg The message text which is to be sent. - * */ void chatInput(std::string &msg); diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index 3c95eb26..456735c4 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -41,8 +41,8 @@ float Tab::mAlpha = 1.0; enum { TAB_STANDARD, // 0 TAB_HIGHLIGHTED, // 1 - TAB_SELECTED, // 2 - TAB_UNUSED, // 3 + TAB_SELECTED, // 2 + TAB_UNUSED, // 3 TAB_COUNT // 4 - Must be last. }; diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h index efdc8d26..271316e4 100644 --- a/src/gui/widgets/tab.h +++ b/src/gui/widgets/tab.h @@ -23,7 +23,6 @@ #define TAB_H #include <guichan/widgets/tab.hpp> -#include <guichan/widgets/tabbedarea.hpp> class ImageRect; class TabbedArea; @@ -34,14 +33,7 @@ class TabbedArea; class Tab : public gcn::Tab { public: - /** - * Constructor. - */ Tab(); - - /** - * Destructor. - */ ~Tab(); /** @@ -76,5 +68,3 @@ class Tab : public gcn::Tab }; #endif - - |