123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "AppGlobalF.h"
- #pragma hdrstop
- #include "VMSM520MF.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 "dxSkinCaramel"
- #pragma link "dxSkinCoffee"
- #pragma link "dxSkinDarkRoom"
- #pragma link "dxSkinDarkSide"
- #pragma link "dxSkinFoggy"
- #pragma link "dxSkinGlassOceans"
- #pragma link "dxSkiniMaginary"
- #pragma link "dxSkinLilian"
- #pragma link "dxSkinLiquidSky"
- #pragma link "dxSkinLondonLiquidSky"
- #pragma link "dxSkinMcSkin"
- #pragma link "dxSkinMoneyTwins"
- #pragma link "dxSkinOffice2007Black"
- #pragma link "dxSkinOffice2007Blue"
- #pragma link "dxSkinOffice2007Green"
- #pragma link "dxSkinOffice2007Pink"
- #pragma link "dxSkinOffice2007Silver"
- #pragma link "dxSkinOffice2010Black"
- #pragma link "dxSkinOffice2010Blue"
- #pragma link "dxSkinOffice2010Silver"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinscxPCPainter"
- #pragma link "dxSkinSeven"
- #pragma link "dxSkinSharp"
- #pragma link "dxSkinSilver"
- #pragma link "dxSkinStardust"
- #pragma link "cxRadioGroup"
- #pragma link "cxClasses"
- #pragma link "cxCustomData"
- #pragma link "cxData"
- #pragma link "cxDataStorage"
- #pragma link "cxDBData"
- #pragma link "cxFilter"
- #pragma link "cxGrid"
- #pragma link "cxGridCustomTableView"
- #pragma link "cxGridCustomView"
- #pragma link "cxGridDBTableView"
- #pragma link "cxGridLevel"
- #pragma link "cxGridTableView"
- #pragma link "cxStyles"
- #pragma link "cxCheckBox"
- #pragma link "cxImage"
- #pragma link "cxButtonEdit"
- #pragma link "cxBlobEdit"
- #pragma resource "*.dfm"
- TVMSM520M *VMSM520M = NULL;
- //---------------------------------------------------------------------------
- __fastcall TVMSM520M::TVMSM520M(TComponent* Owner)
- : TForm(Owner)
- {
- ITSSkin_Load(this);
- //CMM_LoadForm(g_sFormsDir, this);
- FUpdate= false;
- FTitle = Caption;//"VMS 폼 유형 선택";
- FListSymb = new TList;
- EditMode = false;
- m_bSelected = false;
- TvList->OptionsView->DataRowHeight = 0;
- TvList->OptionsView->CellAutoHeight = true;
- TvList->OptionsView->Indicator = true;
- TvList->OptionsCustomize->ColumnMoving = false;
- TvList->OptionsCustomize->ColumnSorting = false;
- TvList->Columns[0]->Width = 60;
- TvList->Columns[0]->Options->HorzSizing = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::CommClose()
- {
- try
- {
- ClearSymbloList();
- SAFE_DELETE(FListSymb);
- //CMM_SaveForm(g_sFormsDir, this);
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::FormShow(TObject *Sender)
- {
- Refresh();
- FormInit();
- TmrShow->Enabled = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::FormInit()
- {
- EdNmbr->Text = "";
- ImgPreView->Picture->Bitmap->FreeImage();
- ImgPreView->Picture->Bitmap = NULL;
- FillVmsFormType();
- FNewDb = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::FillVmsFormType()
- {
- try
- {
- int nRow;
- TcxDataController *pGDC = TvList->DataController;
- TvList->BeginUpdate();
- FOR_STL(TVmsCode*, pObj, VmsFormTypeManager->FLists) {
- if (!pObj->IsUse) continue;
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColLink1->Index] = pObj->CODE;
- pGDC->Values[nRow][ColLink3->Index] = pObj->NAME;
- }
- }
- __finally
- {
- TvList->EndUpdate();
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::TmrShowTimer(TObject *Sender)
- {
- TmrShow->Enabled = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::BtnCloseClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::FormClose(TObject *Sender, TCloseAction &Action)
- {
- CommClose();
- VMSM520M = NULL;
- Action = caFree;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::FormCloseQuery(TObject *Sender, bool &CanClose)
- {
- //
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::DisplayInfo()
- {
- //FormInit();
- int nRow = TvList->DataController->FocusedRecordIndex;
- if( nRow <= -1 )
- return;
- TcxGridDataController *pDc = TvList->DataController;
- nRow = pDc->FocusedRecordIndex;
- #if 0
- if (nRow < FListSymb->Count)
- {
- Graphics::TBitmap *bitmap = (Graphics::TBitmap*)FListSymb->Items[nRow];
- ImgPreView->Picture->Bitmap->Assign(bitmap);
- }
- #endif
- EdNmbr->Text = VarToStr(pDc->Values[nRow][ColLink1->Index]);
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::ClearSymbloList()
- {
- for(int ii = 0; ii < FListSymb->Count; ii++)
- {
- Graphics::TBitmap *bitmap = (Graphics::TBitmap *)FListSymb->Items[ii];
- delete bitmap;
- }
- FListSymb->Clear();
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
- TMouseButton AButton, TShiftState AShift,
- bool &AHandled)
- {
- if (!ACellViewInfo) return;
- DisplayInfo();
- Sleep(200);
- BtnSelImageClick((TObject*)BtnSelImage);
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::TvListFocusedRecordChanged(TcxCustomGridTableView *Sender,
- TcxCustomGridRecord *APrevFocusedRecord, TcxCustomGridRecord *AFocusedRecord,
- bool ANewItemRecordFocusingChanged)
- {
- if (!AFocusedRecord) return;
- DisplayInfo();
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM520M::BtnSelImageClick(TObject *Sender)
- {
- if (EdNmbr->Text == "")
- {
- Application->MessageBox(lblText1->Caption.c_str(),//L"VMS 폼 유형 선택\r\nVMS 폼 유형 목록에서 선택하세요.",
- FTitle.c_str(),
- MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- m_bSelected = true;
- Close();
- }
- //---------------------------------------------------------------------------
|