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

#ifndef DSRM030MFH
#define DSRM030MFH
//---------------------------------------------------------------------------
#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 "CDSCodeF.h"
#include "CDSFacilityF.h"
#include "CDSNodeF.h"
#include "CDSLinkF.h"
#include "CDSIfscF.h"
#include "CDSRoadF.h"
#include "CDSDsrcSectF.h"
//---------------------------------------------------------------------------
#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 "FRAME_DsrcListF.h"
#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 "cxCalc.hpp"
#include "FRAME_DsrcSectListF.h"
#include "FRAME_OpenMapF.h"

class TDSRM030M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TShape *ShpTitle;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TShape *ShpList;
    TEdit *EdFocus;
    TPanel *PnlBack;
    TPanel *PnlLeft;
    TcxSplitter *cxSplitter1;
    TcxGroupBox *cxGroupBox3;
    TcxGroupBox *GrpMap;
    TPanel *PnlMenu;
    TcxButton *BtnEdit;
    TcxButton *BtnInsert;
    TcxButton *BtnDelete;
    TcxButton *BtnSave;
    TcxLabel *cxLabel11;
    TcxLabel *cxLabel12;
    TcxGroupBox *GrpInfo;
    TcxTextEdit *EdRseSectId;
    TcxTextEdit *EdStartSpotId;
    TcxTextEdit *EdStartSpotNm;
    TcxTextEdit *EdRseSectName;
    TcxTextEdit *EdEndSpotId;
    TcxTextEdit *EdEndSpotNm;
    TcxTextEdit *EdRseSectLength;
    TImage *ImgDesc01;
    TcxLabel *cxLabel1;
    TImage *ImgDesc02;
    TcxLabel *cxLabel2;
    TImage *ImgDesc03;
    TcxLabel *cxLabel3;
    TImage *ImgDesc04;
    TcxLabel *cxLabel4;
    TImage *ImgDesc05;
    TcxLabel *cxLabel5;
    TcxGroupBox *GrpLink;
    TcxGrid *CxLink;
    TcxGridTableView *TvLink;
    TcxGridColumn *ColLink1;
    TcxGridColumn *ColLink2;
    TcxGridColumn *ColLink3;
    TcxGridColumn *ColLink4;
    TcxGridLevel *GlLink;
    TcxGridColumn *ColLink5;
    TcxGridColumn *ColLink6;
    TcxGroupBox *cxGroupBox4;
    TPanel *PnlLinkEdit;
    TImage *ImgDesc06;
    TcxLabel *cxLabel6;
    TcxTextEdit *EdLinkId;
    TcxButton *BtnLinkAdd;
    TcxButton *BtnLinkDel;
    TcxGroupBox *cxGroupBox5;
    TcxSplitter *cxSplitter2;
    TFRAMEDsrcList *FRAMEDsrcList1;
    TcxCheckBox *cxCheckBox1;
    TcxCheckBox *cxCheckBox2;
    TFRAMEDsrcSectList *FRAMEDsrcSectList1;
    TcxGridColumn *ColLink7;
    TcxLabel *cxLabel14;
    TcxCheckBox *ChkViewIcon;
    TcxCheckBox *ChkGisZoom;
    TFRAMEOpenMap *FRAMEOpenMap1;
    TcxGridColumn *ColSeq;
    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 BtnEditClick(TObject *Sender);
    void __fastcall BtnInsertClick(TObject *Sender);
    void __fastcall BtnDeleteClick(TObject *Sender);
    void __fastcall BtnSaveClick(TObject *Sender);
    void __fastcall FRAMEDsrcList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall cxCheckBox1Click(TObject *Sender);
    void __fastcall cxCheckBox2Click(TObject *Sender);
    void __fastcall BtnLinkDelClick(TObject *Sender);
    void __fastcall BtnLinkAddClick(TObject *Sender);
    void __fastcall TvLinkCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
          TShiftState AShift, bool &AHandled);
    void __fastcall FRAMEDsrcSectList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall ChkGisZoomClick(TObject *Sender);
    void __fastcall ChkViewIconClick(TObject *Sender);
    void __fastcall ColSeqCustomDrawCell(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;

public:
    String sJs;
    int    FLayerIdx;

    TItsDsrcSectManager *MyItsDsrcSectManager;

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

    void __fastcall FormInit();
    void __fastcall UpdateRseIcon();
    void __fastcall UpdateList();
    void __fastcall UpdateEditLink();
    void __fastcall AddRemoveLink(String ALinkId);

    void __fastcall DisplayInfo(TItsDsrcSect* AObj);
    void __fastcall DisplaySectLink(TItsDsrcSect* AObj);
    void __fastcall RefreshSectLink();

    void __fastcall ChangeEditMode(int AEdit);

    void __fastcall OpenMapCallback(TObject *ASender, const String AFunc, const String AArgs, const bool AFirst);
};
//---------------------------------------------------------------------------
extern PACKAGE TDSRM030M *DSRM030M;
//---------------------------------------------------------------------------

#endif

