#ifndef TBUTTON_H_
#define TBUTTON_H_

#include "GraphLow.h"
#include "GraphBase.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "my_string.h"

class TButton{
	private:
		struct{
			unsigned int Width;
			unsigned int Color;
		}Border;
		u16 CaptionLeftSpacing;
	public:
		bool Enable;
		TMyString Caption;
		int FontSize;
		TRect Bound;
		int DrawMode;	//dmRaised=1 dmLowered=-1 dmNone=0
		u32 Color;
		u32 TextColor;
		u32 SelectedColor;
		u32 SelectedTextColor;
		u32 DisableColor;
		u32 DisableTextColor;
	
		int TabOrder;
	
		TPoint OwnerLeftTop; //ParrentLeftTop;
		TRect Content;
		unsigned int Visible;
		unsigned int Selected;
	public:
		TButton(){};
		TButton(int aX, int aY, int aW, int aH, int OwnerX, int OwnerY, u32 aBorderWidth, u32 aBorderColor){
			Init(aX, aY, aW, aH, OwnerX, OwnerY, aBorderWidth, aBorderColor);
		};
		void Init(int aX, int aY, int aW, int aH, int OwnerX, int OwnerY, u32 aBorderWidth, u32 aBorderColor);
		void SetCaption(      char *p, unsigned int aFontSize);
		void SetCaption(const char *p, unsigned int aFontSize);
		void SetColor(unsigned int aClr);
		void SetTextColor(unsigned int aClr);
		void SetCaptionLeftSpacing(u16 spc);
		void Draw(void);
		void Draw2(void);
		void DrawInPress(void);
		void Show(void);
};

#endif


