//*****************************************************************************
// 
// Blackjack - an X windows program of the casino game.
// Copyright (C) 1997  Tom Daley 
// 
// 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 2
// 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, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// 
// The license is in the file COPYING.
// 
// Tom Daley
// 1309 W. Lorraine Ave.
// Woodland Park, CO  80863-2329
// 
// daley@codenet.net (Tom Daley)
// http://users.codenet.net/daley
// 
//*****************************************************************************

#ifndef _USER_INPUT_INCLUDED_
#define _USER_INPUT_INCLUDED_

#include <qlabel.h>
#include <qscrbar.h>
#include <qpushbt.h>

#include "dollar_scroll_bar.h"

//*****************************************************************************

class UserInput : public QWidget {
   private:
      QPushButton *_split_p;
      QPushButton *_double_down_p;
      QPushButton *_hit_p;
      QPushButton *_stand_p;
      QPushButton *_bet_p;
      QtedDollarScrollBar *_bet_sb_p;
   public:
      UserInput(float min_bet, float max_bet, float bet_inc, 
                QWidget *parent=0, const char *name=0);
      enum InputFlags { Stand  = 0x0001,
                        Hit    = 0x0002,
                        Double = 0x0004,
                        Split  = 0x0008,
                        Bet    = 0x0010 };
      void  makeValid(int flags);
      void  makeInvalid(int flags);
      float getBet(void) { return(_bet_sb_p->getValue()); }
      void  setBetLimits(float min_bet, float max_bet, float inc) {
         _bet_sb_p->setRange(min_bet, max_bet, inc);
      }
      
   protected:
      void resizeEvent(QResizeEvent *);
};

#endif

//*****************************************************************************
