This commit is contained in:
doitux
2007-11-17 23:04:25 +00:00
parent ad7c79fd5f
commit 189e2d5d0e
2 changed files with 28 additions and 19 deletions
+13 -2
View File
@@ -62,7 +62,7 @@
using namespace std; using namespace std;
mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE), currentGameOver(FALSE), myLastPreActionBetValue(0) : QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE), currentGameOver(FALSE), betSliderChangedByInput(FALSE), myLastPreActionBetValue(0)
{ {
int i; int i;
@@ -3719,7 +3719,11 @@ void mainWindowImpl::quitPokerTH() {
void mainWindowImpl::changeLineEditBetValue(int value) { void mainWindowImpl::changeLineEditBetValue(int value) {
int temp; int temp;
if(betSliderChangedByInput) {
//prevent interval cutting of lineEdit_betValue input from code below
betSliderChangedByInput = FALSE;
}
else {
if(horizontalSlider_bet->maximum() <= 1000 ) { if(horizontalSlider_bet->maximum() <= 1000 ) {
temp = (int)((value/10)*10); temp = (int)((value/10)*10);
if(temp < horizontalSlider_bet->minimum()) if(temp < horizontalSlider_bet->minimum())
@@ -3734,6 +3738,7 @@ void mainWindowImpl::changeLineEditBetValue(int value) {
else else
lineEdit_betValue->setText(QString::number(temp)); lineEdit_betValue->setText(QString::number(temp));
} }
}
} }
@@ -3747,13 +3752,19 @@ void mainWindowImpl::lineEditBetValueChanged(QString valueString) {
if(betValue > horizontalSlider_bet->maximum()) { // print the maximum if(betValue > horizontalSlider_bet->maximum()) { // print the maximum
pushButton_BetRaise->setText(betRaise + " " + QString::number(horizontalSlider_bet->maximum()) + "$"); pushButton_BetRaise->setText(betRaise + " " + QString::number(horizontalSlider_bet->maximum()) + "$");
betSliderChangedByInput = TRUE;
horizontalSlider_bet->setValue(horizontalSlider_bet->maximum());
} }
else { // really print the value else { // really print the value
pushButton_BetRaise->setText(betRaise + " " + valueString + "$"); pushButton_BetRaise->setText(betRaise + " " + valueString + "$");
betSliderChangedByInput = TRUE;
horizontalSlider_bet->setValue(betValue);
} }
} }
else { // print the minimum else { // print the minimum
pushButton_BetRaise->setText(betRaise + " " + QString::number(horizontalSlider_bet->minimum()) + "$"); pushButton_BetRaise->setText(betRaise + " " + QString::number(horizontalSlider_bet->minimum()) + "$");
betSliderChangedByInput = TRUE;
horizontalSlider_bet->setValue(horizontalSlider_bet->minimum());
} }
} }
+1 -3
View File
@@ -439,17 +439,15 @@ private:
bool myActionIsBet; bool myActionIsBet;
bool myActionIsRaise; bool myActionIsRaise;
bool pushButtonBetRaiseIsChecked; bool pushButtonBetRaiseIsChecked;
bool pushButtonCallCheckIsChecked; bool pushButtonCallCheckIsChecked;
bool pushButtonFoldIsChecked; bool pushButtonFoldIsChecked;
bool pushButtonAllInIsChecked; bool pushButtonAllInIsChecked;
bool myButtonsAreCheckable; bool myButtonsAreCheckable;
bool breakAfterCurrentHand; bool breakAfterCurrentHand;
bool currentGameOver; bool currentGameOver;
bool flipHolecardsAllInAlreadyDone; bool flipHolecardsAllInAlreadyDone;
bool betSliderChangedByInput;
QColor active; QColor active;
QColor inactive; QColor inactive;