//---------------------------------------------------------------------------

#ifndef HelpFormUnitH
#define HelpFormUnitH

#define HLP_WINDOW_MAX 		0
#define HLP_WINDOW_NORMAL   1
#define HLP_WINDOW_MIN		2

//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include "GeneralDialogPanel.h"
#include "PNGButton.hpp"
#include "MessageDef.h"
#include "HelpPanelUnit.h"
#include "TextButton.h"
#include "CapButton.h"

#define TAB_NUM 7

#define TAB_QA	0
#define TAB_FB	1
#define TAB_NT	2
#define TAB_CN	3
#define TAB_SW	4
#define TAB_MN	5
#define TAB_AB	6
//---------------------------------------------------------------------------
class TTabButton : public TPNGButton
{
private:
	virtual void __fastcall Paint(void);
public:
	String Caption;
	void __fastcall SetFontSize(int sz);
	__fastcall virtual TTabButton(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TTabButton(void);
};


class THelpForm : public TForm
{
__published:	// IDE-managed Components
	TGeneralDialogPanel *m_GenerPanel;
	TLabel *m_lblGroupLabel;
	TLabel *m_lblGroup;
	TLabel *m_lblVideoLabel;
	TLabel *m_lblVideo;
	TLabel *m_lblUrlLabel;
	TLabel *m_lblUrl;
	TPNGButton *m_btnMin;
	TPNGButton *m_btnMax;
	TPNGButton *m_btnRest;
	TPaintBox *m_pbUserNoticeNum;
	TMemo *m_memMsg;
	TTextButton *m_btnSubmit;
	TLabel *m_lblMsgHead;
	TLabel *m_lblMsgNum;
	TLabel *m_lblMsgMiddle;
	TLabel *m_lblMsgURL;
	TLabel *m_lblMsgTail;

	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall RestClick(TObject *Sender);
	void __fastcall MinClick(TObject *Sender);
	void __fastcall MaxClick(TObject *Sender);
	void __fastcall FormResize(TObject *Sender);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall FormActivate(TObject *Sender);
	void __fastcall FormDeactivate(TObject *Sender);
	void __fastcall NoticeNumPaint(TObject *Sender);
	void __fastcall UrlClick(TObject *Sender);
	void __fastcall SubmitClick(TObject *Sender);
	void __fastcall MemoMsgChange(TObject *Sender);
	void __fastcall MemoMsgClick(TObject *Sender);
	void __fastcall MsgURLClick(TObject *Sender);
	void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
	void __fastcall GenerPanelMouseEnter(TObject *Sender);
private:
//	void __fastcall AboutClick(TObject *Sender);
//    void __fastcall HelpClick(TObject *Sender);
	void __fastcall TabClick(TObject *Sender);
	void __fastcall panelShowClick(TObject *Sender);

private:	// User declarations
	THelpPanel* m_PanelShow;
	TPngImage* m_PngImage;

	bool m_bMemoHint;
	int m_nUserNoticeNum;

	TTabButton* m_arrTabs[8];           //8¸ö°´Å¥µÄÖ¸Õë
	TPngImage * m_pImgNoticeTip;

	MESSAGE void __fastcall WMNCLButtonDown(Winapi::Messages::TWMNCLButtonDown &Message);

	BEGIN_MESSAGE_MAP
		MESSAGE_HANDLER(WM_NCLBUTTONDOWN, TWMNCLButtonDown, WMNCLButtonDown)
	END_MESSAGE_MAP(TForm)

public:		// User declarations
	int Window_state;

    void __fastcall SetSize( int iState );
	void __fastcall SetNoticeNum( int num, int iType );  //iTyp: 0=public, 1=user
	int __fastcall GetNoticeNum( int iType ); //iTyp: -1=all, 0=public, 1=user
	void __fastcall SetPage( int iPage );

	__fastcall THelpForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE THelpForm *HelpForm;
//---------------------------------------------------------------------------
#endif
