Feature #479 » 0016-Ruledit-Make-edit_utype-to-inherit-values_dlg.patch
tools/ruledit/edit_utype.cpp | ||
---|---|---|
#include <QGridLayout>
|
||
#include <QLineEdit>
|
||
#include <QMenu>
|
||
#include <QPushButton>
|
||
#include <QSpinBox>
|
||
#include <QToolButton>
|
||
... | ... | |
/**********************************************************************//**
|
||
Setup edit_utype object
|
||
**************************************************************************/
|
||
edit_utype::edit_utype(ruledit_gui *ui_in, struct unit_type *utype_in) : QDialog()
|
||
edit_utype::edit_utype(ruledit_gui *ui_in, struct unit_type *utype_in) : values_dlg()
|
||
{
|
||
QHBoxLayout *main_layout = new QHBoxLayout(this);
|
||
QGridLayout *unit_layout = new QGridLayout();
|
||
QLabel *label;
|
||
QPushButton *button;
|
||
QMenu *req;
|
||
QMenu *menu;
|
||
int row = 0;
|
||
... | ... | |
unit_layout->addWidget(label, row, 0);
|
||
unit_layout->addWidget(sound_fight_tag_alt, row++, 1);
|
||
button = new QPushButton(QString::fromUtf8(R__("Helptext")), this);
|
||
connect(button, SIGNAL(pressed()), this, SLOT(helptext()));
|
||
unit_layout->addWidget(button, row++, 1);
|
||
rowcount = 0;
|
||
column = 0;
|
||
for (int i = 0; i < UTYF_LAST_USER_FLAG; i++) {
|
||
... | ... | |
int rowcount;
|
||
int column;
|
||
close_help();
|
||
// Save values from text fields.
|
||
gfx_tag_given();
|
||
gfx_tag_alt_given();
|
||
... | ... | |
refresh();
|
||
}
|
||
/**********************************************************************//**
|
||
User pressed helptext button
|
||
**************************************************************************/
|
||
void edit_utype::helptext()
|
||
{
|
||
open_help(utype->helptext);
|
||
}
|
tools/ruledit/edit_utype.h | ||
---|---|---|
// Qt
|
||
#include <QDialog>
|
||
// ruledit
|
||
#include "values_dlg.h"
|
||
class QGridLayout;
|
||
class QLineEdit;
|
||
class QSpinBox;
|
||
... | ... | |
class ruledit_gui;
|
||
class edit_utype : public QDialog
|
||
class edit_utype : public values_dlg
|
||
{
|
||
Q_OBJECT
|
||
... | ... | |
void sound_move_tag_alt_given();
|
||
void sound_fight_tag_given();
|
||
void sound_fight_tag_alt_given();
|
||
void helptext();
|
||
};
|
||
#endif // FC__EDIT_UTYPE_H
|
- « Previous
- 1
- 2
- Next »