From a4eabe00d6c32d0d15d77362428fb2d05a0ec0d7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 22 May 2008 06:05:31 +0000 Subject: [ADD] New Dialog widgets [FIX] FlipFlag was misnamed git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@163 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/commands/RandomizeFlagCommand.cpp | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pokemodr/commands/RandomizeFlagCommand.cpp (limited to 'pokemodr/commands/RandomizeFlagCommand.cpp') diff --git a/pokemodr/commands/RandomizeFlagCommand.cpp b/pokemodr/commands/RandomizeFlagCommand.cpp new file mode 100644 index 00000000..4bea5f1a --- /dev/null +++ b/pokemodr/commands/RandomizeFlagCommand.cpp @@ -0,0 +1,44 @@ +/* + * Copyright 2008 Ben Boeckel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +// Header include +#include "RandomizeFlagCommand.h" + +// Pokemod includes +#include "../../pokemod/Dialog.h" + +// Qt includes +#include +#include + +RandomizeFlagCommand::RandomizeFlagCommand(const Pokemod * pokemod, const int command) : + CommandWidget(pokemod, command) +{ + QVBoxLayout* vboxLayout = new QVBoxLayout(this); + QHBoxLayout* hboxLayout = new QHBoxLayout; + boxFlag = new QGroupBox("Flag to randomize"); + varFlag = new KIntNumInput(); + varFlag->setRange(0, INT_MAX); + hboxLayout->addWidget(varFlag); + boxFlag->setLayout(hboxLayout); + vboxLayout->addWidget(boxFlag); +} + +QString RandomizeFlagCommand::commandString() const +{ + return QString("@%1#%2@").arg(Dialog::CommandAbbrStr[m_command]).arg(varFlag->value()); +} -- cgit