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

#ifndef CTV0300MFH
#define CTV0300MFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <Menus.hpp>
#include <ExtCtrls.hpp>
#include <ADODB.hpp>
#include <ImgList.hpp>
#include <Graphics.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------

#include "CenterCommF.h"
#include "DataTypesF.h"
#include "WindowMsgF.h"
#include "CDSCctvCtlrF.h"
#include "cxControls.hpp"
#include "cxGraphics.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinCaramel.hpp"
#include "dxSkinCoffee.hpp"
#include "dxSkinDarkRoom.hpp"
#include "dxSkinDarkSide.hpp"
#include "dxSkinFoggy.hpp"
#include "dxSkinGlassOceans.hpp"
#include "dxSkiniMaginary.hpp"
#include "dxSkinLilian.hpp"
#include "dxSkinLiquidSky.hpp"
#include "dxSkinLondonLiquidSky.hpp"
#include "dxSkinMcSkin.hpp"
#include "dxSkinMoneyTwins.hpp"
#include "dxSkinOffice2007Black.hpp"
#include "dxSkinOffice2007Blue.hpp"
#include "dxSkinOffice2007Green.hpp"
#include "dxSkinOffice2007Pink.hpp"
#include "dxSkinOffice2007Silver.hpp"
#include "dxSkinOffice2010Black.hpp"
#include "dxSkinOffice2010Blue.hpp"
#include "dxSkinOffice2010Silver.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinSeven.hpp"
#include "dxSkinSharp.hpp"
#include "dxSkinSilver.hpp"
#include "dxSkinStardust.hpp"
#include "cxRadioGroup.hpp"
#include "cxButtons.hpp"
#include "cxClasses.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGrid.hpp"
#include "cxGridBandedTableView.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
//---------------------------------------------------------------------------

class TCTV0300M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TcxButton *BtnSearch;
    TcxPageControl *PgCctvImage;
    TcxTabSheet *TsCctvList;
    TcxGrid *CxList;
    TcxGridBandedTableView *TvList;
    TcxGridBandedColumn *ColId;
    TcxGridBandedColumn *ColName;
    TcxGridBandedColumn *ColCommS;
    TcxGridBandedColumn *ColDoorS;
    TcxGridBandedColumn *ColFanS;
    TcxGridBandedColumn *ColHeaterS;
    TcxGridBandedColumn *ColCamS;
    TcxGridBandedColumn *ColTextS;
    TcxGridBandedColumn *ColFanOn;
    TcxGridBandedColumn *ColFanOff;
    TcxGridBandedColumn *ColHeaterOff;
    TcxGridBandedColumn *ColHeaterOn;
    TcxGridBandedColumn *ColBattS;
    TcxGridBandedColumn *ColHamS;
    TcxGridBandedColumn *ColCtrlS;
    TcxGridBandedColumn *ColTemp;
    TcxGridBandedColumn *ColVolt;
    TcxGridBandedColumn *ColVoltOut;
    TcxGridLevel *GlList;
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FormActivate(TObject *Sender);
    void __fastcall FormDeactivate(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
private:	// User declarations
    void __fastcall CommClose();

public:

    int     FScrollWidth;
    int     FCols;
    int     m_nScrollWidth;
    int     FFormWidth;
    int     FFormHeight;
	TList  *FListForm;

    int         FMonitoringType;
    bool        FReady;

public:		// User declarations
    __fastcall TCTV0300M(TComponent* Owner);

    void __fastcall LoadLocalSkin();

    void __fastcall InitMonitoringForm();

    void __fastcall ActivateForm(bool AActivate);

    void __fastcall RefreshCctvStatus(bool ARealtime=false);

    void __fastcall RefreshData();
    void __fastcall SelCctvStopImage();

    void __fastcall OnVmsSelectMessage(TMessage &Msg);
    void __fastcall OnMainFormMessage(TMessage &Msg);
    void __fastcall OnVmsStateRefreshMessage(TMessage &Msg);
    void __fastcall OnVmsFormRefreshMessage(TMessage &Msg);

    bool         IsFormResizing;
    int          FOldWidth, FOldHeight;
    void __fastcall WMEnterSizeMove(TMessage &Msg);
    void __fastcall WMExitSizeMove(TMessage &Msg);

	BEGIN_MESSAGE_MAP
        MESSAGE_HANDLER(WM_VMS_SELECT, TMessage, OnVmsSelectMessage)
        MESSAGE_HANDLER(WM_MAINFORM, TMessage, OnMainFormMessage)
        MESSAGE_HANDLER(WM_VMS_STATE_REFRESH, TMessage, OnVmsStateRefreshMessage)
        MESSAGE_HANDLER(WM_VMS_FORM_REFRESH, TMessage, OnVmsFormRefreshMessage)
        MESSAGE_HANDLER(WM_ENTERSIZEMOVE, TMessage, WMEnterSizeMove)
        MESSAGE_HANDLER(WM_EXITSIZEMOVE, TMessage, WMExitSizeMove)
    END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TCTV0300M *CTV0300M;
//---------------------------------------------------------------------------

#endif

