diff options
Diffstat (limited to 'src/gui/setup.cpp')
-rw-r--r-- | src/gui/setup.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 4fae514f..2c22a426 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -20,41 +20,42 @@ */ #include <algorithm> - -#include "setup.h" +#include <iostream> #include "button.h" +#include "setup.h" #include "setup_audio.h" +#include "setup_colours.h" #include "setup_joystick.h" -#include "setup_video.h" #include "setup_keyboard.h" #include "setup_players.h" +#include "setup_video.h" #include "tabbedcontainer.h" #include "../utils/dtor.h" -#include <iostream> -extern Window *statusWindow; -extern Window *minimap; extern Window *chatWindow; -extern Window *inventoryWindow; extern Window *equipmentWindow; extern Window *helpWindow; +extern Window *inventoryWindow; +extern Window *minimap; extern Window *skillDialog; +extern Window *statusWindow; Setup::Setup(): Window("Setup") { setCloseButton(true); int width = 310; - int height = 265; + int height = 310; setContentSize(width, height); const char *buttonNames[] = { "Apply", "Cancel", "Reset Windows", 0 }; int x = width; - for (const char **curBtn = buttonNames; *curBtn; ++curBtn) { + for (const char **curBtn = buttonNames; *curBtn; ++curBtn) + { Button *btn = new Button(*curBtn, *curBtn, this); x -= btn->getWidth() + 5; btn->setPosition(x, height - btn->getHeight() - 5); @@ -65,7 +66,7 @@ Setup::Setup(): btn->setEnabled(statusWindow != NULL); } - TabbedContainer *panel = new TabbedContainer(); + TabbedContainer *panel = new TabbedContainer(width, 5, 20, 45, 5, 3); panel->setDimension(gcn::Rectangle(5, 5, width, height - 40)); panel->setOpaque(false); @@ -87,6 +88,10 @@ Setup::Setup(): panel->addTab(tab, "Keyboard"); mTabs.push_back(tab); + tab = new Setup_Colours(); + panel->addTab(tab, "Colours"); + mTabs.push_back(tab); + tab = new Setup_Players(); panel->addTab(tab, "Players"); mTabs.push_back(tab); @@ -98,7 +103,7 @@ Setup::Setup(): Setup::~Setup() { - for_each(mTabs.begin(), mTabs.end(), make_dtor(mTabs)); + delete_all(mTabs); } void Setup::action(const gcn::ActionEvent &event) |