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

#ifndef CTV0100MFH
#define CTV0100MFH
//---------------------------------------------------------------------------
#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"
//---------------------------------------------------------------------------

class TCTV0100M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TPanel *PnlCenter;
    TcxPageControl *PgCctvImage;
    TcxTabSheet *TsCctvImage;
    TScrollBox *ScrollBox;
    TcxRadioButton *RBtn01;
    TcxRadioButton *RBtn02;
    TcxRadioButton *RBtn03;
    TImage *ImgNoData;
    TcxButton *BtnSearch;
    TTimer *TmrImage;
    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 RBtn01Click(TObject *Sender);
    void __fastcall ScrollBoxClick(TObject *Sender);
    void __fastcall ScrollBoxMouseWheel(TObject *Sender, TShiftState Shift, int WheelDelta,
          TPoint &MousePos, bool &Handled);
    void __fastcall PnlCenterResize(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall TmrImageTimer(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 TCTV0100M(TComponent* Owner);

    void __fastcall LoadLocalSkin();

    void __fastcall InitMonitoringForm();

    void __fastcall LoadNoStopImage();

    void __fastcall ActivateForm(bool AActivate);

    void __fastcall DrawCctvForm();
    void __fastcall ClearFormList();
    TForm* __fastcall FindCctvForm(int ACtlrNmbr);
    void __fastcall HideCctvForm();
    void __fastcall DeleteCctvForm();
    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 TCTV0100M *CTV0100M;
//---------------------------------------------------------------------------

#endif

