//------------------------------------------------------------------------------
// gui numeric control class																	--
// (C) Piero Giubilato 2008-2010, Berkeley Lab										   --
//------------------------------------------------------------------------------

//______________________________________________________________________________
// {Trace}
// [File name] "gui_Numeric.h"
// [Author] "Piero Giubilato"
// [Version] "0.5"
// [Modified by] "Piero Giubilato"
// [Last revision] "20 Jan 2009"
// [Language] "C++"
// [Compiler] "Visual C++ 8.x 9.x"
// [Member of] "Cool SEAL"
// [Project] "SEAL"
// [Description] "Header for the gui_Numeric class"
// [Key documentation]
// "Visual C++ Reference Help"
// "Root reference guide"
// {Trace}
//______________________________________________________________________________

// Overloading check
#if !defined gui_Numeric_H
#define gui_Numeric_H

// Root components
#include <Rtypes.h>
#include <TGNumberEntry.h>
#include <TString.h>

// Application components
#include "gui_Const.h"
#include "gui_Object.h"
#include "gui_Label.h"

// This class provides a functional layer to TGNumberEntry
class gui_Numeric: public gui_Object
{
	private:
		
		// Main interface elements
		TGNumberEntry* numeric;	   // The root NumberEntry itself
		gui_Label* label;
      		
      // Private functions
      void Init(Double_t value, UInt_t left, UInt_t top, UInt_t width, UInt_t height);
		void Init(Double_t value, UInt_t left, UInt_t top, UInt_t width, UInt_t height,
					 Double_t min, Double_t max);
		
		// Private status
		bool hex_Mode;
		
		// Special private memebers	   
		gui_Numeric(const gui_Numeric&) {}
		const gui_Numeric& operator=(const gui_Numeric&) {return *this;}
		
	public:
	   
		// Special member functions
		gui_Numeric(Double_t value, UInt_t left, UInt_t top, UInt_t width, UInt_t height);
		gui_Numeric(Double_t value, UInt_t left, UInt_t top, UInt_t width, UInt_t height, Double_t min, Double_t max);
		~gui_Numeric();

		// Slots for gui calls, MUST be public
		void num_Do(Long_t val);
				
      // gui_Numeric specific methods
      Double_t num_Val() const;
      Double_t num_Val(Double_t val);
      Double_t num_Min() const;
      Double_t num_Min(Double_t min);
      Double_t num_Max() const;
      Double_t num_Max(Double_t max);
      bool num_Limits() const;
      bool num_Limits(bool state);
		bool num_Hex() const;
		void num_Hex(bool state);
      
      // gui_Object overloaded methods (standard interface)
      const TGNumberEntry* Root() const;
      void MoveResize(UInt_t left, UInt_t top, UInt_t width, UInt_t height);
      void color_Set(UInt_t foreColor, UInt_t backColor);
    	const TString Text() const;
		void Text(const char* text);
		bool fontBold() const;
      void fontBold(bool bold);
		//void label_Set(const char* text, UInt_t align, UInt_t foreColor, UInt_t backColor);

      // Cint preprocessor token
		ClassDef(gui_Numeric, 1)
};

// End of Overloading check 
#endif