#ifndef TIPPOPUP_H_
#define TIPPOPUP_H_

#include "gType.h" 
#include "GraphBase.h"
#include "my_string.h"
#include "TMenu.h"


//aPanel with Caption, StaticText, Btn, Edit, 
class TTipPopup{
	public:
		static constexpr const unsigned int Color = clNearWhite;
		static constexpr const unsigned int Color4Caption = clRed;
		static constexpr const unsigned int TickNoKeyPoint = 520; 
		static constexpr const int SelCheckCountDownPoint = 100;
		static constexpr const TRect Bound = {
			.Left = 100,
			.Top = 120,
			.Right = 699,
			.Bottom = 319,
			.Width = 699-100+1,
			.Height =319-120+1
		};
		static constexpr struct TRect Caption = {
			.Left = 100 +2,
			.Top = 120 +2,
			.Right = 699 -1,
			.Bottom = 120 +2 +32,
			.Width = 699-100+1 -3,
			.Height = 32
		};
		static constexpr struct TRect Content = {
			.Left = 100 +2,
			.Top = 120 +2 +32,
			.Right = 699 -1,
			.Bottom = 319 -1,
			.Width = 699-100+1 -3,
			.Height =319-120+1 -3 - 32
		};
		static constexpr TPoint ResultTipPoint = {
			.x = 100,
			.y = 200,
		};
	public:
		int IsShow;
		unsigned int TickCountDown2SelfCheck;
		unsigned int Tick4Refresh;
		unsigned int What;
		class TMenu *pMenu;
		char Text[64];
		char NumText[12];
	public:
		TTipPopup(){};
		void Init();
		void DrawSelf(void);
		void Show();
		void ShowLicenseError();
		void Hide();
		void RedrawTip();

		void RePaint(void);
		void DrawLicenseText(int centre_x, int centre_y, unsigned int cClr, unsigned int bClr);
		
		void ClearTickOnKeyPress();
		void ClearTickOnEventOcc();
		void Clear();
		void DoResume();
		int Task1000Ms();
		int ExtRequst(unsigned char Prm);
};






#endif
