summaryrefslogtreecommitdiff
path: root/src/gui/setup_colors.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-07 22:09:11 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-07 22:09:11 +0300
commitb7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2 (patch)
treeee27a5a1ace7e5dbc588466dc623013e4d5cea99 /src/gui/setup_colors.cpp
parent7d3059516fc25134d0d29b497e546f2846162399 (diff)
downloadmanaverse-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.gz
manaverse-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.bz2
manaverse-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.xz
manaverse-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.zip
Improve constructors in some classes.
Diffstat (limited to 'src/gui/setup_colors.cpp')
-rw-r--r--src/gui/setup_colors.cpp59
1 files changed, 27 insertions, 32 deletions
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 80cb89d8a..b8ccc7bf2 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -49,41 +49,52 @@ const std::string Setup_Colors::rawmsg =
_("This is what the color looks like");
Setup_Colors::Setup_Colors() :
- mSelected(-1)
+ SetupTab(),
+ SelectionListener(),
+ mColorBox(new ListBox(userPalette)),
+ mScroll(new ScrollArea(mColorBox, true, "setup_colors_background.xml")),
+ mPreview(new BrowserBox(BrowserBox::AUTO_WRAP)),
+ mTextPreview(new TextPreview(rawmsg)),
+ mPreviewBox(new ScrollArea(mPreview, true,
+ "setup_colors_preview_background.xml")),
+ mSelected(-1),
+ mGradTypeLabel(new Label(_("Type:"))),
+ mGradTypeSlider(new Slider(0, 3)),
+ mGradTypeText(new Label),
+ mGradDelayLabel(new Label(_("Delay:"))),
+ mGradDelaySlider(new Slider(20, 100)),
+ mGradDelayText(new TextField()),
+ mRedLabel(new Label(_("Red:"))),
+ mRedSlider(new Slider(0, 255)),
+ mRedText(new TextField),
+ mRedValue(0),
+ mGreenLabel(new Label(_("Green:"))),
+ mGreenSlider(new Slider(0, 255)),
+ mGreenText(new TextField),
+ mGreenValue(0),
+ mBlueLabel(new Label(_("Blue:"))),
+ mBlueSlider(new Slider(0, 255)),
+ mBlueText(new TextField),
+ mBlueValue(0)
{
setName(_("Colors"));
-
- mColorBox = new ListBox(userPalette);
mColorBox->addSelectionListener(this);
-
- mScroll = new ScrollArea(mColorBox, true, "setup_colors_background.xml");
mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
-
- mTextPreview = new TextPreview(rawmsg);
-
- mPreview = new BrowserBox(BrowserBox::AUTO_WRAP);
mPreview->setOpaque(false);
// don't do anything with links
mPreview->setLinkHandler(nullptr);
- mPreviewBox = new ScrollArea(mPreview, true,
- "setup_colors_preview_background.xml");
mPreviewBox->setHeight(20);
mPreviewBox->setScrollPolicy(gcn::ScrollArea::SHOW_NEVER,
gcn::ScrollArea::SHOW_NEVER);
- mGradTypeLabel = new Label(_("Type:"));
-
- mGradTypeSlider = new Slider(0, 3);
mGradTypeSlider->setWidth(180);
mGradTypeSlider->setActionEventId("slider_grad");
mGradTypeSlider->setValue(0);
mGradTypeSlider->addActionListener(this);
mGradTypeSlider->setEnabled(false);
- mGradTypeText = new Label;
-
std::string longText = _("Static");
if (getFont()->getWidth(_("Pulse")) > getFont()->getWidth(longText))
@@ -95,60 +106,44 @@ Setup_Colors::Setup_Colors() :
mGradTypeText->setCaption(longText);
- mGradDelayLabel = new Label(_("Delay:"));
-
- mGradDelayText = new TextField();
mGradDelayText->setWidth(40);
mGradDelayText->setRange(20, 100);
mGradDelayText->setNumeric(true);
mGradDelayText->setEnabled(false);
- mGradDelaySlider = new Slider(20, 100);
mGradDelaySlider->setWidth(180);
mGradDelaySlider->setValue(mGradDelayText->getValue());
mGradDelaySlider->setActionEventId("slider_graddelay");
mGradDelaySlider->addActionListener(this);
mGradDelaySlider->setEnabled(false);
- mRedLabel = new Label(_("Red:"));
-
- mRedText = new TextField;
mRedText->setWidth(40);
mRedText->setRange(0, 255);
mRedText->setNumeric(true);
mRedText->setEnabled(false);
- mRedSlider = new Slider(0, 255);
mRedSlider->setWidth(180);
mRedSlider->setValue(mRedText->getValue());
mRedSlider->setActionEventId("slider_red");
mRedSlider->addActionListener(this);
mRedSlider->setEnabled(false);
- mGreenLabel = new Label(_("Green:"));
-
- mGreenText = new TextField;
mGreenText->setWidth(40);
mGreenText->setRange(0, 255);
mGreenText->setNumeric(true);
mGreenText->setEnabled(false);
- mGreenSlider = new Slider(0, 255);
mGreenSlider->setWidth(180);
mGreenSlider->setValue(mGreenText->getValue());
mGreenSlider->setActionEventId("slider_green");
mGreenSlider->addActionListener(this);
mGreenSlider->setEnabled(false);
- mBlueLabel = new Label(_("Blue:"));
-
- mBlueText = new TextField;
mBlueText->setWidth(40);
mBlueText->setRange(0, 255);
mBlueText->setNumeric(true);
mBlueText->setEnabled(false);
- mBlueSlider = new Slider(0, 255);
mBlueSlider->setWidth(180);
mBlueSlider->setValue(mBlueText->getValue());
mBlueSlider->setActionEventId("slider_blue");