123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "AppGlobalF.h"
- #include "ITSLangTransF.h"
- #pragma hdrstop
- #include "IAN0030MF.h"
- #include "IAN00301F.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "cxButtons"
- #pragma link "cxCalendar"
- #pragma link "cxContainer"
- #pragma link "cxControls"
- #pragma link "cxDropDownEdit"
- #pragma link "cxEdit"
- #pragma link "cxGraphics"
- #pragma link "cxGroupBox"
- #pragma link "cxLabel"
- #pragma link "cxLookAndFeelPainters"
- #pragma link "cxLookAndFeels"
- #pragma link "cxMaskEdit"
- #pragma link "cxPC"
- #pragma link "cxPCdxBarPopupMenu"
- #pragma link "cxSpinEdit"
- #pragma link "cxSplitter"
- #pragma link "cxTextEdit"
- #pragma link "cxTimeEdit"
- #pragma link "dxSkinBlack"
- #pragma link "dxSkinBlue"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinscxPCPainter"
- #pragma link "dxSkinMcSkin"
- #pragma resource "*.dfm"
- TIAN0030M *IAN0030M = NULL;
- //---------------------------------------------------------------------------
- __fastcall TIAN0030M::TIAN0030M(TComponent* Owner)
- : TForm(Owner)
- {
- LangTrans->Translate(this, ITSDb_GetConnection());
- ITSSkin_Load(this);
- CMM_LoadForm(g_sFormsDir, this);
- FTitle = Caption;//"교통정보 제공결과 분석";
- m_pFormList = new TList();
- TsList01->TabVisible = false;
- CbLinkLevel->Properties->Items->Clear();
- CbLinkLevel->Properties->Items->Add(FrmLang->lblNmLink->Caption);//"링크 ( 1레벨 )");
- CbLinkLevel->Properties->Items->Add(FrmLang->lblNmIfsc->Caption);//"서비스링크 ( 2레벨 )");
- CbLinkLevel->Properties->Items->Add(FrmLang->lblNmRoad->Caption);//"도로 ( 3레벨 )");
- //CbLinkLevel->Properties->Items->Add("VMS");
- CbLinkLevel->ItemIndex = 0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::CommClose()
- {
- try
- {
- for (int idx = m_pFormList->Count-1; idx >= 0; idx--)
- {
- m_pFormList->Delete(idx);
- }
- delete m_pFormList;
- CMM_SaveForm(g_sFormsDir, this);
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::FormShow(TObject *Sender)
- {
- Refresh();
- FormInit();
- TmrShow->Enabled = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::FormInit()
- {
- DtStDate->Date = Now() - 1;
- DtEdDate->Date = Now() - 1;
- //DtEdTime->EditValue = Now().FormatString("hh");
- DtStTime->Time = StrToDateTime("00:00");
- DtEdTime->Time = StrToDateTime("23:59");
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::TmrShowTimer(TObject *Sender)
- {
- TmrShow->Enabled = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::RefreshData()
- {
- // 검색조건에 의한 링크 데이터 조회
- try
- {
- //SelListData();
- }
- __finally
- {
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::BtnSearchClick(TObject *Sender)
- {
- Application->ProcessMessages();
- TSqlCursor sqlCrs((TControl*)BtnSearch);
- #if 0
- FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hh");
- FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hh");
- #else
- FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hhnn");
- FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hhnn");
- #endif
- if (FStDateTime > FEdDateTime)
- {
- Application->MessageBox(FrmLang->lblQryDtErr->Caption.c_str(),//L"검색 시작시각이 검색 종료시각 보다 큽니다.",
- FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
- ActiveControl = DtStDate;
- return;
- }
- #if 0
- FStDateTime = FStDateTime + "0000";
- FEdDateTime = FEdDateTime + "5959";
- #else
- FStDateTime = FStDateTime + "00";
- FEdDateTime = FEdDateTime + "59";
- #endif
- FIdList = String(CbLinkLevel->ItemIndex+1);
- String sTitle = "[" + FStDateTime.SubString(1, 12) + "-" + FEdDateTime.SubString(1, 12) + "]";
- try
- {
- Application->ProcessMessages();
- LockWindowUpdate(Handle);
- TcxTabSheet *pSheet = CMM_AddTabSheet(PgTab, sTitle);
- if (!pSheet) return;
- IAN00301 = new TIAN00301(this, Handle, FStDateTime, FEdDateTime, FIdList);
- IAN00301->Parent = pSheet;
- IAN00301->Show();
- PgTab->ActivePage = pSheet;
- pSheet = PgTab->ActivePage;
- m_pFormList->Add(IAN00301);
- }
- __finally
- {
- LockWindowUpdate(0);
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::BtnCloseClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::OnSubFormClose(TMessage Msg)
- {
- int nActiveIdx = PgTab->ActivePageIndex;
- if (nActiveIdx <= 0) return;
- LockWindowUpdate(Handle);
- TcxTabSheet *pSheet = PgTab->ActivePage;
- if (pSheet)
- {
- delete pSheet;
- }
- nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
- m_pFormList->Delete(nActiveIdx);
- LockWindowUpdate(0);
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::PgTabDblClick(TObject *Sender)
- {
- TPoint APoint;
- APoint = PgTab->MouseDownPos;
- if (PgTab->IndexOfTabAt(APoint.x, APoint.y) != -1)
- POST_MSG(Handle, WM_SUBFORM_CLOSE, 0, 0);
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::FormClose(TObject *Sender, TCloseAction &Action)
- {
- CommClose();
- IAN0030M = NULL;
- Action = caFree;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIAN0030M::PgTabCanCloseEx(TObject *Sender, int ATabIndex, bool &ACanClose)
- {
- int nActiveIdx = ATabIndex;
- if (nActiveIdx <= 0) return;
- nActiveIdx--; // 첫번째 탭은 화면에 숨겨져 있다.
- m_pFormList->Delete(nActiveIdx);
- }
- //---------------------------------------------------------------------------
|