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

#ifndef PRK0040MFH
#define PRK0040MFH
//---------------------------------------------------------------------------
#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 "CDSPrkPlceF.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"

#define MAX_PARK_CELL_COLOR   20

class TPRK0040M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TShape *ShpTitle;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TShape *ShpList;
    TEdit *EdFocus;
    TPanel *PnlBack;
    TPanel *Panel1;
    TPanel *Panel3;
    TcxGroupBox *cxGroupBox1;
    TSaveDialog *SaveDialog;
    TOpenPictureDialog *OpenBmp;
    TcxGroupBox *cxGroupBox3;
    TPanel *PnlHead;
    TImage *ImgDesc31;
    TcxLabel *cxLabel5;
    TcxComboBox *CbPrk;
    TcxComboBox *CbFlr;
    TcxLabel *cxLabel6;
    TImage *ImgDesc32;
    TcxSpinEdit *SeCmprtCo;
    TImage *ImgDesc33;
    TcxLabel *cxLabel7;
    TPanel *PnlCmd;
    TImage *ImgTemp;
    TPanel *PnlInfo2;
    TPanel *Panel2;
    TcxGrid *CxImageCell;
    TcxGridTableView *TvImageCell;
    TcxGridColumn *ColCellId;
    TcxGridColumn *ColOccu;
    TcxGridColumn *ColComm;
    TcxGridColumn *ColArea;
    TcxGridColumn *ColDevId;
    TcxGridColumn *ColIfscNm;
    TcxGridColumn *ColStrNm;
    TcxGridColumn *ColEndNm;
    TcxGridLevel *GlImageCell;
    TScrollBox *ScrollBox1;
    TImage *ImgPreView;
    TcxButton *BtnSaveImgFile;
    TcxButton *BtnSearch;
    TcxSpinEdit *SeRemain;
    TcxLabel *cxLabel1;
    TImage *ImgDesc34;
    TcxLabel *cxLabel2;
    TcxLabel *cxLabel3;
    TTimer *TmrQry;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall ColLink2CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
          TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone);
    void __fastcall ColAreaCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
          TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone);
    void __fastcall CbPrkPropertiesChange(TObject *Sender);
    void __fastcall CbFlrPropertiesChange(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall TmrQryTimer(TObject *Sender);



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

    String          FImageExt;
    bool            FImageUpdate;
    TColor          m_Color[MAX_PARK_CELL_COLOR];

    int             FOldWidth, FOldHeight;
    int             FNewWidth, FNewHeight;

public:

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

    void __fastcall LoadPrkPlce();
    void __fastcall LoadPrkFlr();
    void __fastcall LoadPrkDetailInfo();

    void __fastcall FormInit();

    TColor GetDisplayColor(int ASeq);

    void __fastcall ClearImage();
    bool __fastcall AssignPrkFlrImage(String AExt, TMemoryStream *AImgStream);
    void __fastcall LoadPrkFlrImage(String APrkNmbr, String AFlrNo);
    void __fastcall LoadPrkFlrDevInfo();

    void __fastcall UpdateCellColor();

    bool __fastcall UpdatePrkFlrInfo(String APrkNmbr, String AFlrNo);
};
//---------------------------------------------------------------------------
extern PACKAGE TPRK0040M *PRK0040M;
//---------------------------------------------------------------------------

#endif

