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

#ifndef IST00401FH
#define IST00401FH
//---------------------------------------------------------------------------
#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 "CDSStaIncidentF.h"
//---------------------------------------------------------------------------
#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 "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridChartView.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.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 "cxTrackBar.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinMcSkin.hpp"

class TIST00401 : public TForm
{
__published:	// IDE-managed Components
    TADOQuery *ADOQry;
    TTimer *TmrShow;
    TPanel *PnlTop;
    TPanel *PnlList;
    TPanel *PnlChart;
    TcxSplitter *cxSplitter1;
    TLabel *LblSearch;
    TImage *ImgDesc01;
    TLabel *LblRecords;
    TcxButton *BtnExlSave;
    TcxCheckBox *ChkExpand;
    TcxGrid *CxList;
    TcxGridLevel *GlList;
    TcxPageControl *cxPageControl1;
    TcxTabSheet *cxTabSheet1;
    TcxTabSheet *cxTabSheet2;
    TcxGrid *CxChart1;
    TcxGridChartView *TvChart1;
    TcxGridLevel *GlChart1;
    TcxCheckBox *ChkDisplayVal1;
    TcxLabel *cxLabel2;
    TcxTrackBar *cxTrackBar1;
    TcxLabel *LblPage1;
    TcxButton *BtnGraphSave1;
    TcxGrid *CxChart2;
    TcxGridChartView *TvChart2;
    TcxGridLevel *GlChart2;
    TcxCheckBox *ChkDisplayVal2;
    TcxLabel *cxLabel1;
    TcxTrackBar *cxTrackBar2;
    TcxLabel *LblPage2;
    TcxButton *BtnGraphSave2;
    TcxGridTableView *TvList;
    TcxGridColumn *Column01;
    TcxGridColumn *Column02;
    TcxGridColumn *Column03;
    TcxGridColumn *Column04;
    TcxGridColumn *Column05;
    TcxGridColumn *Column06;
    TcxGridColumn *Column07;
    TcxGridColumn *Column08;
    TcxGridColumn *Column09;
    TcxGridColumn *Column10;
    TcxGridColumn *Column11;
    TcxLabel *lblCnt;
    TcxLabel *lblSect;
    TcxLabel *lblImgSave;
    TcxLabel *lblAll;
    TcxLabel *lblSaveErr;
    TcxLabel *lblSaveOk;
    TcxLabel *lblDesc1;
    TcxLabel *lblDesc2;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall ChkExpandClick(TObject *Sender);
    void __fastcall BtnExlSaveClick(TObject *Sender);
    void __fastcall cxTrackBarMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall cxTrackBarPropertiesChange(TObject *Sender);
    void __fastcall BtnGraphSaveClick(TObject *Sender);
    void __fastcall ChkDisplayValPropertiesChange(TObject *Sender);
    void __fastcall TvListCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FormDestroy(TObject *Sender);
private:	// User declarations
    TcxDataController  *m_pGDC;
    TItsStaIncidentManager *pMngrInci;

public:
    HWND      FParent;
    TItsCode *FCodeIDTU;
    int       FStatType;
    int       FTermType;
	String    FStTime, FEdTime;
    bool      FChkInciType;
    String    FIncidentType;
    String    FTitle;

public:		// User declarations
    __fastcall TIST00401(TComponent* Owner, HWND hHandle,
                         int AStatType, int ATermType, String AStTime, String AEdTime, bool AChkInciType, String AIncidentType, String AStatTypeName);
	__fastcall ~TIST00401(void);

    void __fastcall OnMessage(TMessage &Msg);

    void __fastcall CommClose();

    void __fastcall SetChartLegend(TcxGridChartView *ATvChart, String ACategory, String AValue);
    void __fastcall ChartValueDisplay(TcxGridChartView *ATvChart, bool FDisplayValue);

    void __fastcall FormInit();
    void __fastcall SelIncidentType();
    void __fastcall DspIncidentTypeList();
    void __fastcall DspIncidentTypeChart();
    void __fastcall SelIncidentSect();
    void __fastcall DspIncidentSectList();
    void __fastcall DspIncidentSectChart();
};
//---------------------------------------------------------------------------
extern PACKAGE TIST00401 *IST00401;
//---------------------------------------------------------------------------
#endif

