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

#ifndef ITSSELAMFH
#define ITSSELAMFH
#include <Classes.hpp>
#include <ComCtrls.hpp>
#include <Controls.hpp>
#include <ExtCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <StdCtrls.hpp>
#include "cxButtons.hpp"
#include "cxCalc.hpp"
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.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 "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinMcSkin.hpp"
#include "FRAME_IfscListF.h"
#include "FRAME_LinkListF.h"
#include "FRAME_NodeListF.h"
#include "FRAME_RoadListF.h"
#include "FRAME_OpenMapF.h"
//---------------------------------------------------------------------------

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

class TITSSELAM : public TForm
{
__published:	// IDE-managed Components
    TcxButton *BtnSearch;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TEdit *EdFocus;
    TShape *ShpList;
    TTimer *TmrShow;
    TPanel *PnlBack;
    TcxGroupBox *cxGroupBox1;
    TcxSplitter *cxSplitter1;
    TPanel *PnlRight;
    TcxGroupBox *cxGroupBox2;
    TcxButton *BtnSelect;
    TcxPageControl *PgList;
    TcxTabSheet *TabNode;
    TcxTabSheet *TabLink;
    TcxTabSheet *TabServiceLink;
    TcxTabSheet *TabRoad;
    TFRAMENodeList *FRAMENodeList1;
    TFRAMELinkList *FRAMELinkList1;
    TFRAMERoadList *FRAMERoadList1;
    TStatusBar *StatusBar;
    TcxSplitter *cxSplitter2;
    TcxGrid *CxList;
    TcxGridTableView *TvList;
    TcxGridColumn *Column01;
    TcxGridColumn *Column02;
    TcxGridColumn *Column03;
    TcxGridColumn *Column99;
    TcxGridLevel *GlList;
    TcxButton *BtnDelete;
    TPanel *Panel1;
    TImage *ImgDesc04;
    TImage *ImgDesc01;
    TcxLabel *cxLabel4;
    TcxLabel *cxLabel1;
    TcxTextEdit *EdPos;
    TcxTextEdit *EdLinkId;
    TcxLabel *lblText1;
    TFRAMEOpenMap *FRAMEOpenMap1;
    TFRAMEIfscList *FRAMEIfscList1;
    TcxGridColumn *ColSeq;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FRAMENodeList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall FRAMELinkList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall FRAMEIfscList1TvListCellClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall FRAMERoadList1TvListCellClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift, bool &AHandled);
    void __fastcall BtnSelectClick(TObject *Sender);
    void __fastcall BtnDeleteClick(TObject *Sender);
    void __fastcall TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift,
          bool &AHandled);
    void __fastcall ColSeqCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
    void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);


private:	// User declarations
    void __fastcall CommClose();
    void __fastcall SetLinkLevel(int ALinkLevel);

    String       FTitle;
    int          FLinkLevel;
    bool         FSelected;
    bool         FMultiSelect;

public:
    String sJs;
    int    FLayerIdx;

    String       FRefreshId;
    String       FLinkId;
    String       FSelPosX, FSelPosY;
    double       FPosX, FPosY;

	int		     FMouseDownPosX, FMouseDownPosY;

public:		// User declarations
    __fastcall TITSSELAM(TComponent* Owner, int ALinkLevel=1);

    void __fastcall LoadLocalSkin();

    void __fastcall FormInit();
    void __fastcall RefreshData();

    void __fastcall SelGisItem(int AType, String AId);
    void __fastcall UpdateSelect(String ALinkId, double X, double Y);
    void __fastcall RefreshSelect();
    void __fastcall DeleteSelect(String ALinkId);

    void __fastcall UpdateNode();
    void __fastcall UpdateEditLink();
    void __fastcall RefreshLink();

    __property int  LinkLevel = {read = FLinkLevel, write=SetLinkLevel };
    __property bool Selected  = {read = FSelected };
    __property bool MultiSelect = {read = FMultiSelect, write=FMultiSelect };

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

#endif

