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

#include <vcl.h>
#include "ITSSkinF.h"
#include "ITSUtilF.h"
#include "ITSDbF.h"
#include "AppGlobalF.h"
#include "ITSLangTransF.h"
#pragma hdrstop

#include "ITS0010MF.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FRAME_TrafficLinkListF"
#pragma link "FRAME_TrafficRoadListF"
#pragma link "cxButtons"
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxEdit"
#pragma link "cxGraphics"
#pragma link "cxGroupBox"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxPC"
#pragma link "cxPCdxBarPopupMenu"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinsCore"
#pragma link "dxSkinscxPCPainter"
#pragma link "cxLabel"
#pragma link "FRAME_TrafficIfscListF"
#pragma resource "*.dfm"

TITS0010M *ITS0010M = NULL;
//---------------------------------------------------------------------------
__fastcall TITS0010M::TITS0010M(TComponent* Owner)
    : TForm(Owner)
{
    LangTrans->Translate(this, ITSDb_GetConnection());
    ITSSkin_Load(this);
    CMM_LoadForm(g_sFormsDir, this);

    FRAMETrafficLinkList1->ChkDispExt->Visible = false;
    FRAMETrafficIfscList1->ChkDispExt->Visible = false;
    FRAMETrafficRoadList1->ChkDispExt->Visible = false;
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::CommClose()
{
    try
    {
        CMM_SaveForm(g_sFormsDir, this);
    }
    catch(...)
    {
    }
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::FormShow(TObject *Sender)
{
    Refresh();
    FormInit();
    TmrShow->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::FormInit()
{
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::TmrShowTimer(TObject *Sender)
{
    TmrShow->Enabled = false;

    RefreshData();
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::RefreshData()
{
    // 검색조건에 의한 링크 데이터 조회
    try
    {
        FRAMETrafficLinkList1->UpdateList();
        FRAMETrafficIfscList1->UpdateList();
        FRAMETrafficRoadList1->UpdateList();
        //cxGroupBox3->Caption = "▶ 현재 소통정보";// (최종가공시각: " + FRAMETrafficLinkList1->FLastAnsTime + ")";
	}
	__finally
	{
	}
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::BtnCloseClick(TObject *Sender)
{
    Close();    
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::FormClose(TObject *Sender, TCloseAction &Action)
{
    CommClose();
    ITS0010M = NULL;
    Action = caFree;    
}
//---------------------------------------------------------------------------

void __fastcall TITS0010M::BtnSearchClick(TObject *Sender)
{
    Application->ProcessMessages();
    TSqlCursor sqlCrs((TControl*)BtnSearch);

    RefreshData();
}
//---------------------------------------------------------------------------

