diff --git a/pokerth.pro b/pokerth.pro index d68c7054..ae0277af 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -113,6 +113,7 @@ HEADERS += src/game.h \ src/engine/network_engine/clientturn.h \ src/gui/qt/mainwindow/mainwindowimpl.h \ src/gui/qt/mainwindow/mycardspixmaplabel.h \ + src/gui/qt/mainwindow/mysetlabel.h \ src/gui/qt/mainwindow/myrighttabwidget.h \ src/gui/qt/mainwindow/mylefttabwidget.h \ src/gui/qt/mainwindow/startsplash/startsplash.h \ @@ -205,6 +206,7 @@ SOURCES += src/game.cpp \ src/gui/qt/guiwrapper.cpp \ src/gui/qt/mainwindow/mainwindowimpl.cpp \ src/gui/qt/mainwindow/mycardspixmaplabel.cpp \ + src/gui/qt/mainwindow/mysetlabel.cpp \ src/gui/qt/mainwindow/myrighttabwidget.cpp \ src/gui/qt/mainwindow/mylefttabwidget.cpp \ src/gui/qt/mainwindow/startsplash/startsplash.cpp \ diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index 4a01216e..638bd8e0 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -1610,118 +1610,6 @@ true - - - - 95 - 40 - 118 - 111 - - - - - - 9 - 35 - 100 - 40 - - - - - 0 - 20 - - - - - - - Qt::AlignCenter - - - Qt::NoTextInteraction - - - - - - - 95 - 20 - 118 - 16 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 128 - 128 - 128 - - - - - - - 199 - 199 - 199 - - - - - - - - Qt::AlignHCenter|Qt::AlignTop - - @@ -1799,6 +1687,118 @@ Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + 95 + 40 + 118 + 111 + + + + + + 9 + 35 + 100 + 40 + + + + + 0 + 20 + + + + + + + Qt::AlignCenter + + + Qt::NoTextInteraction + + + + + + + 95 + 20 + 118 + 16 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 128 + 128 + 128 + + + + + + + 199 + 199 + 199 + + + + + + + + Qt::AlignHCenter|Qt::AlignTop + + @@ -3052,7 +3052,84 @@ true - + + + + 85 + 17 + 118 + 23 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 128 + 128 + 128 + + + + + + + 199 + 199 + 199 + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + 85 @@ -3132,83 +3209,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 85 - 17 - 118 - 23 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 128 - 128 - 128 - - - - - - - 199 - 199 - 199 - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - @@ -4283,7 +4283,84 @@ true - + + + + 85 + 17 + 118 + 23 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 128 + 128 + 128 + + + + + + + 199 + 199 + 199 + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + 85 @@ -4363,83 +4440,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 85 - 17 - 118 - 23 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 128 - 128 - 128 - - - - - - - 199 - 199 - 199 - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - @@ -4776,7 +4776,7 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - + 85 @@ -5106,7 +5106,84 @@ true - + + + + 85 + 17 + 118 + 23 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 128 + 128 + 128 + + + + + + + 199 + 199 + 199 + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + 85 @@ -5186,83 +5263,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 85 - 17 - 118 - 23 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 128 - 128 - 128 - - - - - - - 199 - 199 - 199 - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - @@ -5590,7 +5590,7 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - + 85 @@ -5920,7 +5920,84 @@ true - + + + + 85 + 17 + 118 + 23 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 240 + 240 + 240 + + + + + + + 240 + 240 + 240 + + + + + + + + + 128 + 128 + 128 + + + + + + + 199 + 199 + 199 + + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + 85 @@ -6000,83 +6077,6 @@ Qt::AlignBottom|Qt::AlignHCenter - - - - 85 - 17 - 118 - 23 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - - - 128 - 128 - 128 - - - - - - - 199 - 199 - 199 - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - @@ -6174,6 +6174,11 @@ QTabWidget
mylefttabwidget.h
+ + MySetLabel + QLabel +
mysetlabel.h
+
MyRightTabWidget QTabWidget diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 4407c9fb..5bf931a2 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -32,6 +32,7 @@ #include "startsplash.h" #include "mycardspixmaplabel.h" +#include "mysetlabel.h" #include "playerinterface.h" #include "boardinterface.h" @@ -2502,7 +2503,8 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { if (event->key() == Qt::Key_F3) { pushButton_BetRaise->click(); } if (event->key() == Qt::Key_F10) { switchLeftToolBox(); } if (event->key() == Qt::Key_F11) { switchRightToolBox(); } -// if (event->key() == Qt::Key_F) { switchFullscreen(); } //f + if (event->key() == Qt::Key_D) { setLabelArray[0]->startTimeOutAnimation(10); } //f + if (event->key() == Qt::Key_E) { setLabelArray[0]->stopTimeOutAnimation(); } //f if (event->key() == Qt::Key_S) { playSound(); } //s if (event->key() == 16777249) { pushButton_break->click(); diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 201aa0b0..c97df685 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -329,7 +329,7 @@ private: QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS]; - QLabel *setLabelArray[MAX_NUMBER_OF_PLAYERS]; + MySetLabel *setLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *actionLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *playerNameLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *playerAvatarLabelArray[MAX_NUMBER_OF_PLAYERS]; diff --git a/src/gui/qt/mainwindow/mysetlabel.cpp b/src/gui/qt/mainwindow/mysetlabel.cpp new file mode 100644 index 00000000..53f7110c --- /dev/null +++ b/src/gui/qt/mainwindow/mysetlabel.cpp @@ -0,0 +1,81 @@ +// +// C++ Implementation: mycardspixmaplabel +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "mysetlabel.h" + +// using namespace std; + +MySetLabel::MySetLabel(QGroupBox* parent) + : QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0) +{ + + timeOutAnimationTimer = new QTimer; + connect(timeOutAnimationTimer, SIGNAL(timeout()), this, SLOT(nextTimeOutAnimationFrame())); +// flipCardsTimer = new QTimer; +// connect(flipCardsTimer, SIGNAL(timeout()), this, SLOT(nextFlipCardsFrame())); +} + + +MySetLabel::~MySetLabel() +{ +} + +void MySetLabel::startTimeOutAnimation(int secs) { + + timeOutValue = secs; + timeOutFrame = 1; + timeOutAnimationWidth = 118; + + timeOutAnimation = TRUE; + timeOutAnimationTimer->start(40); +} + + +void MySetLabel::stopTimeOutAnimation() { + + timeOutAnimationTimer->stop(); + timeOutAnimation = FALSE; + update(); +} + +void MySetLabel::nextTimeOutAnimationFrame() { + + if(timeOutAnimationWidth >=0) { + if(timeOutFrame%(timeOutValue*25/118) == 0) + timeOutAnimationWidth--; + timeOutFrame++; + update(); + } + else stopTimeOutAnimation(); +} + + +void MySetLabel::paintEvent(QPaintEvent * event) { + + if(!timeOutAnimation) { + QLabel::paintEvent(event); + } + + if(timeOutAnimation) { + + QPainter painter(this); + + QLinearGradient linearGrad(QPointF(0, 10), QPointF(113, 10)); + linearGrad.setColorAt(0, Qt::red); + linearGrad.setColorAt(0.5, Qt::yellow); + linearGrad.setColorAt(1, Qt::green); + + painter.setBrush(linearGrad); + + painter.setPen(QColor(0,0,0)); + painter.drawRect(0,6,timeOutAnimationWidth,8); + } +} diff --git a/src/gui/qt/mainwindow/mysetlabel.h b/src/gui/qt/mainwindow/mysetlabel.h new file mode 100644 index 00000000..84d7c4cf --- /dev/null +++ b/src/gui/qt/mainwindow/mysetlabel.h @@ -0,0 +1,47 @@ +// +// C++ Interface: mycardspixmaplabel +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef MYSETLABEL_H +#define MYSETLABEL_H + +#include +#include + +#include + +class MySetLabel : public QLabel +{ +Q_OBJECT +public: + MySetLabel(QGroupBox*); + + ~MySetLabel(); + + void startTimeOutAnimation(int secs); + void stopTimeOutAnimation(); + + void paintEvent(QPaintEvent * event); + +public slots: + + void nextTimeOutAnimationFrame(); + +private: + + QTimer *timeOutAnimationTimer; + bool timeOutAnimation; + + int timeOutAnimationWidth; + int timeOutValue; + int timeOutFrame; +}; + +#endif