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

#ifndef VMSM600MFH
#define VMSM600MFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <DBClient.hpp>
#include <FMTBcd.hpp>
#include <Provider.hpp>
#include <SqlExpr.hpp>
#include <Menus.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <ComCtrls.hpp>
#include <ADODB.hpp>
#include <Dialogs.hpp>
#include <ExtDlgs.hpp>
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "WindowMsgF.h"
#include "cxButtons.hpp"
#include "cxCalendar.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxDropDownEdit.hpp"
#include "cxEdit.hpp"
#include "cxGraphics.hpp"
#include "cxGroupBox.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxMaskEdit.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSpinEdit.hpp"
#include "cxSplitter.hpp"
#include "cxTextEdit.hpp"
#include "cxTimeEdit.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 "cxClasses.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDBData.hpp"
#include "cxFilter.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridDBTableView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxStyles.hpp"
#include "cxCheckBox.hpp"
#include "cxImage.hpp"
#include "cxButtonEdit.hpp"
#include "cxBlobEdit.hpp"
#include "cxColorComboBox.hpp"
#include "cxCalc.hpp"

//---------------------------------------------------------------------------
#include "CDSVmsCtlrF.h"
#include "CDSVmsObjTypeF.h"
#include "VmsDesignerF.h"
#include "FRAME_VmsSchListF.h"
//---------------------------------------------------------------------------

class TVMSM600M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TShape *ShpTitle;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TShape *ShpList;
    TEdit *EdFocus;
    TPanel *PanelBack;
    TPanel *PnlLeft;
    TcxSplitter *cxSplitter1;
    TcxGroupBox *GrpList;
    TPanel *Panel1;
    TPanel *Panel3;
    TcxGroupBox *GrpSchedule;
    TPanel *PnlMenu;
    TcxButton *BtnSave;
    TPanel *Panel4;
    TImage *ImgDesc01;
    TcxLabel *cxLabel18;
    TcxComboBox *CbSizeType;
    TcxButton *BtnSearch;
    TcxTextEdit *EdVmsNmbr;
    TcxPageControl *PgVmsSch;
    TcxTabSheet *TabSheet3;
    TcxTabSheet *TabSheet0;
    TcxTabSheet *TabSheet1;
    TcxTabSheet *TabSheet2;
    TcxTabSheet *TabSheet4;
    TPanel *PnlTraffic;
    TPanel *PnlCmd;
    TcxButton *BtnListAdd0;
    TcxButton *BtnListDelete0;
    TcxGroupBox *cxGroupBox6;
    TcxGrid *CxForm0;
    TcxGridTableView *TvForm0;
    TcxGridColumn *ColFrm001;
    TcxGridColumn *ColFrm002;
    TcxGridColumn *ColFrm003;
    TcxGridColumn *ColFrm004;
    TcxGridColumn *ColFrm005;
    TcxGridColumn *ColFrm006;
    TcxGridColumn *ColFrm007;
    TcxGridColumn *ColFrm008;
    TcxGridColumn *ColFrm009;
    TcxGridLevel *GlForm0;
    TPanel *PnlDolbal;
    TPanel *Panel5;
    TcxButton *BtnListAdd1;
    TcxButton *BtnListDelete1;
    TcxGroupBox *cxGroupBox3;
    TcxGrid *CxForm1;
    TcxGridTableView *TvForm1;
    TcxGridColumn *cxGridColumn10;
    TcxGridColumn *cxGridColumn11;
    TcxGridColumn *cxGridColumn12;
    TcxGridColumn *cxGridColumn13;
    TcxGridColumn *cxGridColumn14;
    TcxGridColumn *cxGridColumn15;
    TcxGridColumn *cxGridColumn16;
    TcxGridColumn *cxGridColumn17;
    TcxGridColumn *cxGridColumn18;
    TcxGridLevel *GlForm1;
    TPanel *PnlGongsa;
    TPanel *Panel6;
    TcxButton *BtnListAdd2;
    TcxButton *BtnListDelete2;
    TcxGroupBox *cxGroupBox7;
    TcxGrid *CxForm2;
    TcxGridTableView *TvForm2;
    TcxGridColumn *cxGridColumn28;
    TcxGridColumn *cxGridColumn29;
    TcxGridColumn *cxGridColumn30;
    TcxGridColumn *cxGridColumn31;
    TcxGridColumn *cxGridColumn32;
    TcxGridColumn *cxGridColumn33;
    TcxGridColumn *cxGridColumn34;
    TcxGridColumn *cxGridColumn35;
    TcxGridColumn *cxGridColumn36;
    TcxGridLevel *GlForm2;
    TPanel *PnlHongbo;
    TPanel *Panel7;
    TcxButton *BtnListAdd3;
    TcxButton *BtnListDelete3;
    TcxGroupBox *cxGroupBox9;
    TcxGrid *CxForm3;
    TcxGridTableView *TvForm3;
    TcxGridColumn *cxGridColumn46;
    TcxGridColumn *cxGridColumn47;
    TcxGridColumn *cxGridColumn48;
    TcxGridColumn *cxGridColumn49;
    TcxGridColumn *cxGridColumn50;
    TcxGridColumn *cxGridColumn51;
    TcxGridColumn *cxGridColumn52;
    TcxGridColumn *cxGridColumn53;
    TcxGridColumn *cxGridColumn54;
    TcxGridLevel *GlForm3;
    TPanel *PnlDeture;
    TPanel *Panel8;
    TcxButton *BtnListAdd4;
    TcxButton *BtnListDelete4;
    TcxGroupBox *cxGroupBox11;
    TcxGrid *CxForm4;
    TcxGridTableView *TvForm4;
    TcxGridColumn *cxGridColumn64;
    TcxGridColumn *cxGridColumn65;
    TcxGridColumn *cxGridColumn66;
    TcxGridColumn *cxGridColumn67;
    TcxGridColumn *cxGridColumn68;
    TcxGridColumn *cxGridColumn69;
    TcxGridColumn *cxGridColumn70;
    TcxGridColumn *cxGridColumn71;
    TcxGridColumn *cxGridColumn72;
    TcxGridLevel *GlForm4;
    TcxButton *BtnAllEdit;
    TcxButton *BtnAllAdd;
    TPanel *PnlTemp;
    TPanel *PnlEdtBack;
    TPanel *PnlEditForm;
    TImage *ImgForm;
    VmsDesigner *VmsDesigner1;
    TFRAMEVmsSchList *FRAMEVmsSchList1;
    TcxTabSheet *TabSheet5;
    TPanel *PnlCongest;
    TPanel *Panel9;
    TcxButton *BtnListAdd5;
    TcxButton *BtnListDelete5;
    TcxGroupBox *cxGroupBox12;
    TcxGrid *CxForm5;
    TcxGridTableView *TvForm5;
    TcxGridColumn *cxGridColumn89;
    TcxGridColumn *cxGridColumn90;
    TcxGridColumn *cxGridColumn91;
    TcxGridColumn *cxGridColumn92;
    TcxGridColumn *cxGridColumn93;
    TcxGridColumn *cxGridColumn94;
    TcxGridColumn *cxGridColumn95;
    TcxGridColumn *cxGridColumn96;
    TcxGridColumn *cxGridColumn97;
    TcxGridLevel *GlForm5;
    TcxLabel *lblTitle;
    TcxLabel *lblErr2;
    TcxLabel *lblErr3;
    TcxLabel *lblErr4;
    TcxTabSheet *TabSheet7;
    TcxTabSheet *TabSheet8;
    TcxTabSheet *TabSheet6;
    TPanel *PnlSafe;
    TPanel *Panel10;
    TcxButton *BtnListAdd6;
    TcxButton *BtnListDelete6;
    TcxGroupBox *cxGroupBox14;
    TcxGrid *CxForm6;
    TcxGridTableView *TvForm6;
    TcxGridColumn *cxGridColumn118;
    TcxGridColumn *cxGridColumn119;
    TcxGridColumn *cxGridColumn120;
    TcxGridColumn *cxGridColumn121;
    TcxGridColumn *cxGridColumn122;
    TcxGridColumn *cxGridColumn123;
    TcxGridColumn *cxGridColumn124;
    TcxGridColumn *cxGridColumn125;
    TcxGridColumn *cxGridColumn126;
    TcxGridLevel *GlForm6;
    TPanel *PnlVideo;
    TPanel *Panel11;
    TcxButton *BtnListAdd7;
    TcxButton *BtnListDelete7;
    TcxGroupBox *cxGroupBox16;
    TcxGrid *CxForm7;
    TcxGridTableView *TvForm7;
    TcxGridColumn *cxGridColumn147;
    TcxGridColumn *cxGridColumn148;
    TcxGridColumn *cxGridColumn149;
    TcxGridColumn *cxGridColumn150;
    TcxGridColumn *cxGridColumn151;
    TcxGridColumn *cxGridColumn152;
    TcxGridColumn *cxGridColumn153;
    TcxGridColumn *cxGridColumn154;
    TcxGridColumn *cxGridColumn155;
    TcxGridLevel *GlForm7;
    TPanel *PnlStream;
    TPanel *Panel13;
    TcxButton *BtnListAdd8;
    TcxButton *BtnListDelete8;
    TcxGroupBox *cxGroupBox18;
    TcxGrid *CxForm8;
    TcxGridTableView *TvForm8;
    TcxGridColumn *cxGridColumn176;
    TcxGridColumn *cxGridColumn177;
    TcxGridColumn *cxGridColumn178;
    TcxGridColumn *cxGridColumn179;
    TcxGridColumn *cxGridColumn180;
    TcxGridColumn *cxGridColumn181;
    TcxGridColumn *cxGridColumn182;
    TcxGridColumn *cxGridColumn183;
    TcxGridColumn *cxGridColumn184;
    TcxGridLevel *GlForm8;
    TcxTabSheet *TabSheet9;
    TPanel *Panel2;
    TPanel *Panel12;
    TcxButton *BtnListAdd9;
    TcxButton *BtnListDelete9;
    TcxGroupBox *cxGroupBox20;
    TcxGrid *CxForm9;
    TcxGridTableView *TvForm9;
    TcxGridColumn *cxGridColumn218;
    TcxGridColumn *cxGridColumn219;
    TcxGridColumn *cxGridColumn220;
    TcxGridColumn *cxGridColumn221;
    TcxGridColumn *cxGridColumn222;
    TcxGridColumn *cxGridColumn223;
    TcxGridColumn *cxGridColumn224;
    TcxGridColumn *cxGridColumn225;
    TcxGridColumn *cxGridColumn226;
    TcxGridLevel *GlForm9;
    TcxTabSheet *TabSheet10;
    TPanel *Panel14;
    TPanel *Panel15;
    TcxButton *BtnListAdd10;
    TcxButton *BtnListDelete10;
    TcxGroupBox *cxGroupBox22;
    TcxGrid *CxForm10;
    TcxGridTableView *TvForm10;
    TcxGridColumn *cxGridColumn249;
    TcxGridColumn *cxGridColumn250;
    TcxGridColumn *cxGridColumn251;
    TcxGridColumn *cxGridColumn252;
    TcxGridColumn *cxGridColumn253;
    TcxGridColumn *cxGridColumn254;
    TcxGridColumn *cxGridColumn255;
    TcxGridColumn *cxGridColumn256;
    TcxGridColumn *cxGridColumn257;
    TcxGridLevel *GlForm10;
    TcxGridColumn *ColFrm010;
    TcxGridColumn *cxGridColumn19x;
    TcxGridColumn *TvForm2Column1;
    TcxGridColumn *TvForm4Column1;
    TcxGridColumn *TvForm5Column1;
    TcxGridColumn *TvForm6Column1;
    TcxGridColumn *TvForm7Column1;
    TcxGridColumn *TvForm8Column1;
    TcxGridColumn *TvForm9Column1;
    TcxGridColumn *TvForm10Column1;
    TcxGridColumn *TvForm3Column1;
    TcxGroupBox *cxGroupBox5;
    TcxGrid *CxGrid0;
    TcxGridTableView *TvGrid0;
    TcxGridColumn *Col00;
    TcxGridColumn *Col01;
    TcxGridColumn *Col02;
    TcxGridColumn *Col03;
    TcxGridColumn *Col04;
    TcxGridColumn *Col05;
    TcxGridColumn *Col06;
    TcxGridColumn *Col07;
    TcxGridColumn *Col08;
    TcxGridColumn *Col09;
    TcxGridColumn *Col10;
    TcxGridColumn *Col11;
    TcxGridColumn *Col12;
    TcxGridColumn *Col13;
    TcxGridColumn *Col14;
    TcxGridColumn *Col15;
    TcxGridColumn *Col16;
    TcxGridColumn *Col17;
    TcxGridColumn *Col18;
    TcxGridColumn *Col19;
    TcxGridColumn *Col20;
    TcxGridColumn *Col21;
    TcxGridLevel *GlGird0;
    TcxGridColumn *Col22;
    TcxButton *BtnDown;
    TcxButton *BtnUp;
    TcxGridColumn *Col23;
    TcxButton *BtnBestFit;
    TcxCheckBox *ChkAutoWidth;
    TcxGridColumn *Col24;
    TcxButton *BtnSchWeek;
    TcxGridColumn *ColWeek1;
    TcxGridColumn *ColWeek2;
    TcxGridColumn *ColWeek3;
    TcxGridColumn *ColWeek4;
    TcxGridColumn *ColWeek5;
    TcxGridColumn *ColWeek6;
    TcxGridColumn *ColWeek7;
    TcxGridColumn *Col25;
    TLabel *Label1;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
    void __fastcall CbSizeTypePropertiesChange(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall BtnListAdd0Click(TObject *Sender);
    void __fastcall BtnListDelete0Click(TObject *Sender);
    void __fastcall TvGridCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift,
          bool &AHandled);
    void __fastcall TvFormCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift,
          bool &AHandled);
    void __fastcall BtnAllEditClick(TObject *Sender);
    void __fastcall BtnSaveClick(TObject *Sender);
    void __fastcall FRAMEVmsSchList1TvListCellDblClick(TcxCustomGridTableView *Sender,
          TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
          TShiftState AShift, bool &AHandled);
    void __fastcall FRAMEVmsSchList1TvListFocusedRecordChanged(TcxCustomGridTableView *Sender,
          TcxCustomGridRecord *APrevFocusedRecord, TcxCustomGridRecord *AFocusedRecord,
          bool ANewItemRecordFocusingChanged);
    void __fastcall BtnUpClick(TObject *Sender);
    void __fastcall BtnDownClick(TObject *Sender);
    void __fastcall ChkAutoWidthPropertiesChange(TObject *Sender);
    void __fastcall BtnBestFitClick(TObject *Sender);
    void __fastcall BtnSchWeekClick(TObject *Sender);
    void __fastcall Col05CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
    void __fastcall Col00CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
    void __fastcall Col06CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);

private:	// User declarations
    void __fastcall CommClose();
    TcxDataController *m_pGDC;
    String          FTitle;
    bool            FUpdate;
    bool            FNewDb;
    bool            EditMode;
	TList          *FListSymb;

    int             FSelIdx;
    String          FVmsTypeCd;
    int             FVmsWidth;
    int             FVmsHeight;

public:
    String              FVMS_SCH_TYPE;
    int                 FEN_DSPL_SCH_TYPE;
    //TcxGridTableView   *FListSch[eSchTp_max];
    TcxGridTableView   *FListFrm[eSchTp_max];
    TcxTabSheet        *FTabSheet[eSchTp_max];
    TcxLabel           *FLabel[eSchTp_max];
    TcxButton          *FButtonAdd[eSchTp_max];
    TcxButton          *FButtonDel[eSchTp_max];

    TVmsFormDesigner   *m_pEdtDesigner;
    String              FIfscId[10];

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

    void __fastcall InitTcxList(TcxGridTableView *AView);
    void __fastcall FormInit();
    void __fastcall RefreshData();

    void __fastcall ClearSymbloList();

    void __fastcall DisplayInfo();

    void __fastcall ChangeEditMode(int AEdit);

    void __fastcall FormClear();

    void __fastcall LoadVmsScheduleInfo(String AVmsNmbr);

    bool __fastcall CheckVmsFormUse(String AFormId);

    bool __fastcall LoadVmsFormList(String AFormSizeCd);

    bool __fastcall SaveVmsScenario(String AVmsNmbr, TcxGridTableView *AListSch);
    bool __fastcall SaveVmsScenarioWeek(String AVmsNmbr, TcxGridTableView *AListSch);
    bool __fastcall DeleteVmsScenario(String AVmsNmbr);

    void __fastcall DrawTrafficScenarioForm();
    void __fastcall DrawAtmpScenarioForm();
    bool __fastcall LoadTrafficFormObjectInfo(String AFormId, String ABkColor, TVmsFormDesigner *ADesigner);

    void __fastcall DrawVideoStreamScenarioForm(int AFormScheType);
    bool __fastcall LoadVideoStreamFormObjectInfo(String AFormId, String ABkColor, TVmsFormDesigner *ADesigner, String ASymbLibNmbr, String AStreamAddr);
};
//---------------------------------------------------------------------------
extern PACKAGE TVMSM600M *VMSM600M;
//---------------------------------------------------------------------------

#endif

