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

#ifndef FrmCrsTrafVolDirSubFH
#define FrmCrsTrafVolDirSubFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <DBClient.hpp>
#include <Provider.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <Buttons.hpp>
#include <ADODB.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
#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 "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.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 "cxLabel.hpp"
#include "cxGridBandedTableView.hpp"
#include "cxSpinEdit.hpp"
#include "FRAME_ChartF.h"
#include "cxDropDownEdit.hpp"
#include "cxMaskEdit.hpp"
//---------------------------------------------------------------------------

#define POST_MSG(x,y,z,p)       ::PostMessage(x, y,       (WPARAM)z, (LPARAM)p)
#define USER_MSG(x,y)           ::PostMessage(x, WM_USER, (WPARAM)y, (LPARAM)0)

#define WM_SUBFORM_CLOSE        (WM_USER + 0xF2)    // Sub Form Close
//---------------------------------------------------------------------------
#include "CDSCrossF.h"
//---------------------------------------------------------------------------

class TFrmCrsTrafVolDirSub : public TForm
{
__published:	// IDE-managed Components
    TADOQuery *ADOQry;
    TTimer *TmrShow;
    TPanel *PnlTop;
    TPanel *PnlList;
    TLabel *LblSearch;
    TImage *ImgDesc01;
    TLabel *LblRecords;
    TcxButton *BtnExlSave;
    TcxCheckBox *ChkExpand;
    TcxGrid *CxList;
    TcxGridBandedTableView *TvList;
    TcxGridBandedColumn *Col01;
    TcxGridBandedColumn *Col02;
    TcxGridBandedColumn *Col03;
    TcxGridBandedColumn *Col04;
    TcxGridBandedColumn *Col05;
    TcxGridBandedColumn *ColD40;
    TcxGridBandedColumn *Col07;
    TcxGridBandedColumn *ColD10;
    TcxGridBandedColumn *ColD20;
    TcxGridBandedColumn *ColD30;
    TcxGridBandedColumn *ColD1R;
    TcxGridBandedColumn *ColD1U;
    TcxGridBandedColumn *ColD2L;
    TcxGridBandedColumn *ColD2R;
    TcxGridLevel *GlList;
    TcxLabel *lblText1;
    TcxLabel *lblText2;
    TcxLabel *lblFai;
    TcxLabel *lblCnt;
    TcxGridBandedColumn *ColD1L;
    TcxGridBandedColumn *ColD2U;
    TcxGridBandedColumn *ColD3L;
    TcxGridBandedColumn *ColD3R;
    TcxGridBandedColumn *ColD3U;
    TcxGridBandedColumn *ColD4L;
    TcxGridBandedColumn *ColD4R;
    TcxGridBandedColumn *ColD4U;
    TPanel *PnlChart;
    TcxSplitter *spltChart;
    TFRAMEChart *FRAMEChart1;
    TcxGridBandedColumn *ColCrossId;
    TcxGridBandedColumn *ColCamId;
    TcxGridBandedColumn *ColD1G;
    TcxGridBandedColumn *ColD2G;
    TcxGridBandedColumn *ColD3G;
    TcxGridBandedColumn *ColD4G;
    TcxGridBandedColumn *ColD50;
    TcxGridBandedColumn *ColD5G;
    TcxGridBandedColumn *ColD5L;
    TcxGridBandedColumn *ColD5R;
    TcxGridBandedColumn *ColD5U;
    TcxGridBandedColumn *ColD6G;
    TcxGridBandedColumn *ColD6L;
    TcxGridBandedColumn *ColD6R;
    TcxGridBandedColumn *ColD6U;
    TcxGridBandedColumn *ColD7G;
    TcxGridBandedColumn *ColD7L;
    TcxGridBandedColumn *ColD7R;
    TcxGridBandedColumn *ColD7U;
    TcxGridBandedColumn *ColD8G;
    TcxGridBandedColumn *ColD8L;
    TcxGridBandedColumn *ColD8R;
    TcxGridBandedColumn *ColD8U;
    TcxGridBandedColumn *ColD9G;
    TcxGridBandedColumn *ColD9L;
    TcxGridBandedColumn *ColD9R;
    TcxGridBandedColumn *ColD9U;
    TcxGridBandedColumn *ColD10G;
    TcxGridBandedColumn *ColD10L;
    TcxGridBandedColumn *ColD10R;
    TcxGridBandedColumn *ColD10U;
    TcxGridBandedColumn *ColD60;
    TcxGridBandedColumn *ColD70;
    TcxGridBandedColumn *ColD80;
    TcxGridBandedColumn *ColD90;
    TcxGridBandedColumn *ColD100;
    TcxButton *BtnBestFit;
    TcxGridBandedColumn *ColD1S;
    TcxGridBandedColumn *ColD2S;
    TcxGridBandedColumn *ColD3S;
    TcxGridBandedColumn *ColD4S;
    TcxGridBandedColumn *ColD5S;
    TcxGridBandedColumn *ColD6S;
    TcxGridBandedColumn *ColD7S;
    TcxGridBandedColumn *ColD8S;
    TcxGridBandedColumn *ColD9S;
    TcxGridBandedColumn *ColD10S;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall ChkExpandClick(TObject *Sender);
    void __fastcall BtnExlSaveClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FormDestroy(TObject *Sender);
    void __fastcall CbOptionPropertiesChange(TObject *Sender);
    void __fastcall Col07CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
    void __fastcall BtnBestFitClick(TObject *Sender);
private:	// User declarations
    TcxDataController  *m_pGDC;

public:
    HWND    FParent;
    String  FStDateTime;
    String  FEdDateTime;
    String  FCrossId;
    String  FCamId;
    int     FStatType;
    bool    FLane;
    String  FCrossNm;
    String  FCamNm;
    TCross *FCrossObj;

    TItsMap<String, TCrossVol*> FLists;


public:		// User declarations
    __fastcall TFrmCrsTrafVolDirSub(TComponent* Owner, HWND hHandle, String sFrom, String sTo, String sCrossId, String sCamId, int nStatType, bool isLane, TCross *pObj);

    void __fastcall CommClose();

    void __fastcall FormInit();
    void __fastcall FillChartOptions();
    void __fastcall SelHistory();

    void __fastcall Sel05M();
    void __fastcall Sel05M_Lane();

    void __fastcall Sel15M();
    void __fastcall Sel15M_Lane();

    void __fastcall Sel30M();
    void __fastcall Sel30M_Lane();

    void __fastcall Sel60M();
    void __fastcall Sel60M_Lane();

    void __fastcall SelDay();
    void __fastcall SelDay_Lane();

    void __fastcall SelMonth();
    void __fastcall SelMonth_Lane();

    void __fastcall DspHistory();
    void __fastcall DspChart();
};
//---------------------------------------------------------------------------
//extern PACKAGE TFrmCrsTrafVolDirSub *FrmCrsTrafVolDirSub;
//---------------------------------------------------------------------------
#endif

