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

#ifndef VMSM420MFH
#define VMSM420MFH
//---------------------------------------------------------------------------
#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 "FRAME_VmsListF.h"
#include "cxImage.hpp"
#include "cxButtonEdit.hpp"
#include "cxBlobEdit.hpp"

class TVMSM420M : 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 *GrpList;
    TPanel *Panel1;
    TPanel *Panel3;
    TcxGroupBox *cxGroupBox1;
    TcxGrid *CxList;
    TcxGridTableView *TvList;
    TcxGridColumn *ColLink1;
    TcxGridColumn *ColLink2;
    TcxGridColumn *ColLink3;
    TcxGridColumn *ColLink4;
    TcxGridColumn *ColLink5;
    TcxGridColumn *ColLink6;
    TcxGridLevel *GlList;
    TPanel *PnlMenu;
    TcxButton *BtnEdit;
    TcxButton *BtnInsert;
    TcxButton *BtnDelete;
    TcxButton *BtnSave;
    TPanel *PnlCmd;
    TPanel *PnlInfo2;
    TcxLabel *cxLabel18;
    TImage *ImgDesc01;
    TcxLabel *cxLabel1;
    TImage *ImgDesc02;
    TcxTextEdit *EdNmbr;
    TcxLabel *cxLabel2;
    TImage *ImgDesc03;
    TcxTextEdit *EdExpl;
    TcxButtonEdit *EdImageFileName;
    TcxLabel *cxLabel3;
    TImage *ImgDesc04;
    TcxButton *BtnSaveImgFile;
    TSaveDialog *SaveDialog;
    TOpenPictureDialog *OpenBmp;
    TcxTextEdit *EdVmsCd;
    TPanel *Panel2;
    TcxLabel *cxLabel4;
    TImage *ImgDesc12;
    TImage *ImgTemp;
    TImage *ImgPreView;
    TImage *ImgDesc11;
    TLabel *Label10;
    TcxSpinEdit *SePosX;
    TcxSpinEdit *SePosY;
    TcxGrid *CxImageCell;
    TcxGridTableView *TvImageCell;
    TcxGridColumn *cxGridColumn1;
    TcxGridColumn *ColCellId;
    TcxGridColumn *ColCellPosX;
    TcxGridColumn *ColCellPosY;
    TcxGridColumn *ColArea;
    TcxGridColumn *ColIfscId;
    TcxGridColumn *ColIfscNm;
    TcxGridColumn *ColStrNm;
    TcxGridColumn *ColEndNm;
    TcxGridLevel *GlImageCell;
    TLabel *Label2;
    TImage *ImgDesc09;
    TLabel *Label11;
    TcxSpinEdit *SeCellId;
    TcxButton *BtnCellDelete;
    TcxButton *BtnCellApply;
    TcxLabel *lblText1;
    TcxLabel *lblText2;
    TcxLabel *lblText3;
    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 BtnSaveClick(TObject *Sender);
    void __fastcall BtnInsertClick(TObject *Sender);
    void __fastcall BtnDeleteClick(TObject *Sender);
    void __fastcall BtnSaveImgFileClick(TObject *Sender);
    void __fastcall EdImageFileNameClick(TObject *Sender);
    void __fastcall OpenBmpCanClose(TObject *Sender, bool &CanClose);
    void __fastcall TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
          TMouseButton AButton, TShiftState AShift,
          bool &AHandled);
    void __fastcall ColLink2CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
          TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone);
    void __fastcall BtnCellDeleteClick(TObject *Sender);
    void __fastcall BtnCellApplyClick(TObject *Sender);
    void __fastcall ImgPreViewMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
          int X, int Y);
    void __fastcall ColAreaCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
          TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone);
    void __fastcall TvImageCellFocusedRecordChanged(TcxCustomGridTableView *Sender,
          TcxCustomGridRecord *APrevFocusedRecord, TcxCustomGridRecord *AFocusedRecord,
          bool ANewItemRecordFocusingChanged);
    void __fastcall SeCellIdPropertiesChange(TObject *Sender);
    void __fastcall TvListFocusedRecordChanged(TcxCustomGridTableView *Sender, TcxCustomGridRecord *APrevFocusedRecord,
          TcxCustomGridRecord *AFocusedRecord, bool ANewItemRecordFocusingChanged);



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

public:

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

    void __fastcall FormInit();

    void __fastcall ClearSymbloList();

    void __fastcall LoadImageSymbol();
    void __fastcall LoadImageSymbolCell(String ANmbr);

    void __fastcall DisplayInfo();
    bool __fastcall CheckImageUse(String ANmbr);
    bool __fastcall DelVmsImage(String ANmbr);
    bool __fastcall GetNextVmsImgeId(int &ANmbr);
    bool __fastcall UpdateVmsImage(String ANmbr, String AExpl);
    bool __fastcall InsertVmsImage(String ANmbr, String AExpl, String AFileName, String ATypeCd);

    void __fastcall ChangeEditMode(int AEdit);

    void __fastcall UpdateCellColor();
};
//---------------------------------------------------------------------------
extern PACKAGE TVMSM420M *VMSM420M;
//---------------------------------------------------------------------------

#endif

