summaryrefslogtreecommitdiff
path: root/src/gui/textcommandeditor.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-06 00:04:33 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-06 00:04:33 +0300
commit7b155f111daf5d7ae477b16d0f0789b1113bea74 (patch)
tree2d2711ab1f9daed793171383af1a7e1fa6ff737c /src/gui/textcommandeditor.cpp
parentc3afff20d4989ab2835545715bbe67e5b5d9b353 (diff)
downloadplus-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.gz
plus-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.bz2
plus-7b155f111daf5d7ae477b16d0f0789b1113bea74.tar.xz
plus-7b155f111daf5d7ae477b16d0f0789b1113bea74.zip
Fix some issues after auto checking.
Diffstat (limited to 'src/gui/textcommandeditor.cpp')
-rw-r--r--src/gui/textcommandeditor.cpp69
1 files changed, 31 insertions, 38 deletions
diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp
index c3025f516..67e2be0c8 100644
--- a/src/gui/textcommandeditor.cpp
+++ b/src/gui/textcommandeditor.cpp
@@ -164,13 +164,41 @@ public:
};
-TextCommandEditor::TextCommandEditor(TextCommand *command):
- Window(_("Command Editor"), false, nullptr, "commandeditor.xml")
+TextCommandEditor::TextCommandEditor(TextCommand *command) :
+ Window(_("Command Editor"), false, nullptr, "commandeditor.xml"),
+ mIsMagicCommand(command->getCommandType() == TEXT_COMMAND_MAGIC),
+ mCommand(command),
+ mIsMagic(new RadioButton(_("magic"), "magic", mIsMagicCommand)),
+ mIsOther(new RadioButton(_("other"), "magic", !mIsMagicCommand)),
+ mSymbolLabel(new Label(_("Symbol:"))),
+ mSymbolTextField(new TextField()),
+ mCommandLabel(new Label(_("Command:"))),
+ mCommandTextField(new TextField()),
+ mCommentLabel(new Label(_("Comment:"))),
+ mCommentTextField(new TextField),
+ mTargetTypeModel(new TargetTypeModel),
+ mTypeLabel(new Label(_("Target Type:"))),
+ mTypeDropDown(new DropDown(mTargetTypeModel)),
+ mIconsModal(new IconsModal),
+ mIconLabel(new Label(_("Icon:"))),
+ mIconDropDown(new DropDown(mIconsModal)),
+ mManaLabel(new Label(_("Mana:"))),
+ mManaField(new IntTextField(0)),
+ mMagicLvlLabel(new Label(_("Magic level:"))),
+ mMagicLvlField(new IntTextField(0)),
+ mMagicSchoolModel(new MagicSchoolModel),
+ mSchoolLabel(new Label(_("Magic School:"))),
+ mSchoolDropDown(new DropDown(mMagicSchoolModel)),
+ mSchoolLvlLabel(new Label(_("School level:"))),
+ mSchoolLvlField(new IntTextField(0)),
+ mCancelButton(new Button(_("Cancel"), "cancel", this)),
+ mSaveButton(new Button(_("Save"), "save", this)),
+ mDeleteButton(new Button(_("Delete"), "delete", this)),
+ mEnabledKeyboard(keyboard.isEnabled())
{
int w = 350;
int h = 370;
- mEnabledKeyboard = keyboard.isEnabled();
keyboard.setEnabled(false);
setWindowName("TextCommandEditor");
@@ -178,70 +206,35 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
setDefaultSize(w, h, ImageRect::CENTER);
mAdvanced = false;
- mCommand = command;
- mIsMagicCommand = (command->getCommandType() == TEXT_COMMAND_MAGIC);
-
- mIsMagic = new RadioButton(_("magic"), "magic", mIsMagicCommand);
mIsMagic->setActionEventId("magic");
mIsMagic->addActionListener(this);
- mIsOther = new RadioButton(_("other"), "magic", !mIsMagicCommand);
mIsOther->setActionEventId("other");
mIsOther->addActionListener(this);
-
- mSymbolLabel = new Label(_("Symbol:"));
- mSymbolTextField = new TextField();
-
- mCommandLabel = new Label(_("Command:"));
- mCommandTextField = new TextField();
-
- mCommentLabel = new Label(_("Comment:"));
- mCommentTextField = new TextField();
-
- mManaLabel = new Label(_("Mana:"));
- mManaField = new IntTextField(0);
mManaField->setRange(0, 500);
mManaField->setWidth(20);
- mTargetTypeModel = new TargetTypeModel;
- mTypeLabel = new Label(_("Target Type:"));
- mTypeDropDown = new DropDown(mTargetTypeModel);
mTypeDropDown->setActionEventId("type");
mTypeDropDown->addActionListener(this);
- mIconsModal = new IconsModal;
- mIconLabel = new Label(_("Icon:"));
- mIconDropDown = new DropDown(mIconsModal);
mIconDropDown->setActionEventId("icon");
mIconDropDown->addActionListener(this);
mIconDropDown->setSelectedString(mCommand->getIcon());
- mMagicLvlLabel = new Label(_("Magic level:"));
- mMagicLvlField = new IntTextField(0);
mMagicLvlField->setRange(0, 5);
mMagicLvlField->setWidth(20);
- mMagicSchoolModel = new MagicSchoolModel;
- mSchoolLabel = new Label(_("Magic School:"));
- mSchoolDropDown = new DropDown(mMagicSchoolModel);
mSchoolDropDown->setActionEventId("school");
mSchoolDropDown->addActionListener(this);
mSchoolDropDown->setSelected(0);
- mSchoolLvlLabel = new Label(_("School level:"));
- mSchoolLvlField = new IntTextField(0);
mSchoolLvlField->setRange(0, 5);
mSchoolLvlField->setWidth(20);
- mSaveButton = new Button(_("Save"), "save", this);
mSaveButton->adjustSize();
-
- mCancelButton = new Button(_("Cancel"), "cancel", this);
mCancelButton->adjustSize();
-
- mDeleteButton = new Button(_("Delete"), "delete", this);
mDeleteButton->adjustSize();
if (command->getCommandType() == TEXT_COMMAND_MAGIC)