added morphs, fix some bugs, new images

added onAlienInRadius trigger
but it not work right((
This commit is contained in:
2011-08-21 22:22:02 +04:00
parent fa68b5a120
commit 894e55bb41
186 changed files with 4040 additions and 3022 deletions

View File

@@ -2,50 +2,61 @@
#define TOUCHBUTTFRAME_H
#include <QtGui/QFrame>
#include <QHBoxLayout>
#include <QBoxLayout>
#include <QDebug>
#include "touch_butt.h"
class TouchButtFrame : public QFrame
{
Q_OBJECT
Q_PROPERTY(QColor ColorYes READ colorYes WRITE setColorYes)
Q_PROPERTY(QColor ColorNo READ colorNo WRITE setColorNo)
Q_PROPERTY(QColor ColorDefault READ colorDefault WRITE setColorDefault)
Q_PROPERTY(QColor ColorPush READ colorPush WRITE setColorPush)
Q_OBJECT
Q_PROPERTY(QColor colorYes READ colorYes WRITE setColorYes)
Q_PROPERTY(QColor colorNo READ colorNo WRITE setColorNo)
Q_PROPERTY(QColor colorDefault READ colorDefault WRITE setColorDefault)
Q_PROPERTY(QColor colorPush READ colorPush WRITE setColorPush)
Q_PROPERTY(QStringList buttons READ buttons WRITE setButtons)
Q_PROPERTY(int currentButton READ currentButton WRITE setCurrentButton)
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
public:
enum Orientation {
Horizontal = 0,
Vertical = 1
};
TouchButtFrame(QWidget * parent = 0,
QColor red = Qt::red, QColor green = Qt::green, QColor white = Qt::white, QColor push = Qt::darkYellow,
Orientation orientation = Vertical);
void addButton(QString caption);
int buttCount();
QColor colorYes() const {return colg;}
QColor colorNo() const {return colr;}
QColor colorDefault() const {return colw;}
QColor colorPush() const {return colp;}
void setColorYes(QColor ColorYes) {colg = ColorYes; resetColors();}
void setColorNo(QColor ColorNo) {colr = ColorNo; resetColors();}
void setColorDefault(QColor ColorDefault) {colw = ColorDefault; resetColors();}
void setColorPush(QColor ColorPush) {colp = ColorPush; resetColors();}
touch_butt * Button(int index);
TouchButtFrame(QWidget * parent = 0,
QColor red = Qt::red, QColor green = Qt::green, QColor white = Qt::white, QColor push = Qt::yellow,
Qt::Orientation orientation = Qt::Horizontal);
void setButtons(const QStringList &captions);
QStringList buttons();
int buttCount() const {return lay->count();}
int currentButton();
void setCurrentButton(int index);
QColor colorYes() const {return colg;}
QColor colorNo() const {return colr;}
QColor colorDefault() const {return colw;}
QColor colorPush() const {return colp;}
void setColorYes(QColor ColorYes) {colg = ColorYes; resetColors();}
void setColorNo(QColor ColorNo) {colr = ColorNo; resetColors();}
void setColorDefault(QColor ColorDefault) {colw = ColorDefault; resetColors();}
void setColorPush(QColor ColorPush) {colp = ColorPush; resetColors();}
void setOrientation(Qt::Orientation orientation)
{if (orientation == Qt::Horizontal) lay->setDirection(QBoxLayout::LeftToRight);
else lay->setDirection(QBoxLayout::TopToBottom);}
Qt::Orientation orientation() const
{if (lay->direction()==0) return Qt::Horizontal;
else return Qt::Vertical;}
void deleteButtons();
void addButton(const QString &caption);
touch_butt * Button(int index);
public slots:
void set_green(int index) {Button(index)->setGreen();}
private slots:
void butt_click(int index);
void butt_toggle(int index, bool checked);
void butt_click(int index);
void butt_toggle(int index, bool checked);
void set_green(int index) {if (Button(index) != 0) Button(index)->setGreen();}
void set_red(int index) {if (Button(index) != 0) Button(index)->setRed();}
void set_white(int index) {if (Button(index) != 0) Button(index)->setWhite();}
private:
QColor colr,colg,colw,colp;
QLayout * lay;
int count;
void resetColors();
QColor colr,colg,colw,colp;
QBoxLayout * lay;
//int count;
void resetColors();
signals:
void click(int index);
void toggle(int index, bool checked);
void click(int index);
void toggle(int index, bool checked);
};
#endif // TOUCHBUTTFRAME_H