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

#ifndef IDB0120MFH
#define IDB0120MFH
//---------------------------------------------------------------------------
#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 "cxCalc.hpp"
#include "cxCheckBox.hpp"
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDropDownEdit.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxGroupBox.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxMaskEdit.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "FRAME_AtrdListF.h"
#include "FRAME_OpenMapF.h"

//---------------------------------------------------------------------------
class TIDB0120M : 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;
    TPanel *PnlEdit;
    TcxGroupBox *GrpInfo;
    TImage *ImgDesc01;
    TImage *ImgDesc03;
    TImage *ImgDesc04;
    TImage *ImgDesc07;
    TcxLabel *cxLabel1;
    TcxLabel *cxLabel3;
    TcxLabel *cxLabel4;
    TcxLabel *cxLabel7;
    TcxTextEdit *EdATRD_ID;
    TcxTextEdit *EdId;
    TPanel *PnlMap;
    TcxGroupBox *GrpLink;
    TcxGrid *CxLink;
    TcxGridTableView *TvLink;
    TcxGridColumn *ColLink1;
    TcxGridColumn *ColLink2;
    TcxGridColumn *ColLink3;
    TcxGridColumn *ColLink4;
    TcxGridColumn *ColLink5;
    TcxGridColumn *ColLink6;
    TcxGridLevel *GlLink;
    TPanel *PnlLinkEdit;
    TImage *ImgDesc06;
    TcxLabel *cxLabel6;
    TcxTextEdit *EdLinkId;
    TcxButton *BtnLinkAdd;
    TcxButton *BtnLinkDel;
    TcxGroupBox *GrpGis;
    TcxTextEdit *EdATRD_NM;
    TcxTextEdit *EdAREA_CD;
    TFRAMEAtrdList *FRAMEAtrdList1;
    TcxComboBox *CbDRCT_CD;
    TcxButton *BtnUp;
    TcxButton *BtnDown;
    TImage *ImgDesc99;
    TcxLabel *cxLabel2;
    TcxTextEdit *EdDRCT_NM;
    TcxLabel *lblInput;
    TcxLabel *lblInQry;
    TcxLabel *lblDigitErr;
    TcxLabel *lblText1;
    TcxLabel *lblText2;
    TcxLabel *lblText3;
    TcxLabel *lblText4;
    TcxLabel *lblText5;
    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 BtnLinkDelClick(TObject *Sender);
    void __fastcall BtnLinkAddClick(TObject *Sender);
    void __fastcall TvLinkCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
          TShiftState AShift, bool &AHandled);
    void __fastcall FRAMEAtrdList1TvListCellDblClickSect(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall ChkGisZoomClick(TObject *Sender);
    void __fastcall BtnUpClick(TObject *Sender);
    void __fastcall BtnDownClick(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;

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

    void __fastcall FormInit();
    void __fastcall UpdateList();
    void __fastcall UpdateEditLink();
    void __fastcall UpdateNode();

    void __fastcall DisplayInfo(TItsAtrd* AObj);
    void __fastcall DisplayLink(TItsAtrd* AObj);
    void __fastcall RefreshLink();

    void __fastcall ChangeEditMode(int AEdit);

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

#endif

