VMSM520MF.cpp 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "AppGlobalF.h"
  6. #pragma hdrstop
  7. #include "VMSM520MF.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma link "cxButtons"
  11. #pragma link "cxCalendar"
  12. #pragma link "cxContainer"
  13. #pragma link "cxControls"
  14. #pragma link "cxDropDownEdit"
  15. #pragma link "cxEdit"
  16. #pragma link "cxGraphics"
  17. #pragma link "cxGroupBox"
  18. #pragma link "cxLabel"
  19. #pragma link "cxLookAndFeelPainters"
  20. #pragma link "cxLookAndFeels"
  21. #pragma link "cxMaskEdit"
  22. #pragma link "cxPC"
  23. #pragma link "cxPCdxBarPopupMenu"
  24. #pragma link "cxSpinEdit"
  25. #pragma link "cxSplitter"
  26. #pragma link "cxTextEdit"
  27. #pragma link "cxTimeEdit"
  28. #pragma link "dxSkinBlack"
  29. #pragma link "dxSkinBlue"
  30. #pragma link "dxSkinCaramel"
  31. #pragma link "dxSkinCoffee"
  32. #pragma link "dxSkinDarkRoom"
  33. #pragma link "dxSkinDarkSide"
  34. #pragma link "dxSkinFoggy"
  35. #pragma link "dxSkinGlassOceans"
  36. #pragma link "dxSkiniMaginary"
  37. #pragma link "dxSkinLilian"
  38. #pragma link "dxSkinLiquidSky"
  39. #pragma link "dxSkinLondonLiquidSky"
  40. #pragma link "dxSkinMcSkin"
  41. #pragma link "dxSkinMoneyTwins"
  42. #pragma link "dxSkinOffice2007Black"
  43. #pragma link "dxSkinOffice2007Blue"
  44. #pragma link "dxSkinOffice2007Green"
  45. #pragma link "dxSkinOffice2007Pink"
  46. #pragma link "dxSkinOffice2007Silver"
  47. #pragma link "dxSkinOffice2010Black"
  48. #pragma link "dxSkinOffice2010Blue"
  49. #pragma link "dxSkinOffice2010Silver"
  50. #pragma link "dxSkinsCore"
  51. #pragma link "dxSkinscxPCPainter"
  52. #pragma link "dxSkinSeven"
  53. #pragma link "dxSkinSharp"
  54. #pragma link "dxSkinSilver"
  55. #pragma link "dxSkinStardust"
  56. #pragma link "cxRadioGroup"
  57. #pragma link "cxClasses"
  58. #pragma link "cxCustomData"
  59. #pragma link "cxData"
  60. #pragma link "cxDataStorage"
  61. #pragma link "cxDBData"
  62. #pragma link "cxFilter"
  63. #pragma link "cxGrid"
  64. #pragma link "cxGridCustomTableView"
  65. #pragma link "cxGridCustomView"
  66. #pragma link "cxGridDBTableView"
  67. #pragma link "cxGridLevel"
  68. #pragma link "cxGridTableView"
  69. #pragma link "cxStyles"
  70. #pragma link "cxCheckBox"
  71. #pragma link "cxImage"
  72. #pragma link "cxButtonEdit"
  73. #pragma link "cxBlobEdit"
  74. #pragma resource "*.dfm"
  75. TVMSM520M *VMSM520M = NULL;
  76. //---------------------------------------------------------------------------
  77. __fastcall TVMSM520M::TVMSM520M(TComponent* Owner)
  78. : TForm(Owner)
  79. {
  80. ITSSkin_Load(this);
  81. //CMM_LoadForm(g_sFormsDir, this);
  82. FUpdate= false;
  83. FTitle = Caption;//"VMS 폼 유형 선택";
  84. FListSymb = new TList;
  85. EditMode = false;
  86. m_bSelected = false;
  87. TvList->OptionsView->DataRowHeight = 0;
  88. TvList->OptionsView->CellAutoHeight = true;
  89. TvList->OptionsView->Indicator = true;
  90. TvList->OptionsCustomize->ColumnMoving = false;
  91. TvList->OptionsCustomize->ColumnSorting = false;
  92. TvList->Columns[0]->Width = 60;
  93. TvList->Columns[0]->Options->HorzSizing = false;
  94. }
  95. //---------------------------------------------------------------------------
  96. void __fastcall TVMSM520M::CommClose()
  97. {
  98. try
  99. {
  100. ClearSymbloList();
  101. SAFE_DELETE(FListSymb);
  102. //CMM_SaveForm(g_sFormsDir, this);
  103. }
  104. catch(...)
  105. {
  106. }
  107. }
  108. //---------------------------------------------------------------------------
  109. void __fastcall TVMSM520M::FormShow(TObject *Sender)
  110. {
  111. Refresh();
  112. FormInit();
  113. TmrShow->Enabled = true;
  114. }
  115. //---------------------------------------------------------------------------
  116. void __fastcall TVMSM520M::FormInit()
  117. {
  118. EdNmbr->Text = "";
  119. ImgPreView->Picture->Bitmap->FreeImage();
  120. ImgPreView->Picture->Bitmap = NULL;
  121. FillVmsFormType();
  122. FNewDb = false;
  123. }
  124. //---------------------------------------------------------------------------
  125. void __fastcall TVMSM520M::FillVmsFormType()
  126. {
  127. try
  128. {
  129. int nRow;
  130. TcxDataController *pGDC = TvList->DataController;
  131. TvList->BeginUpdate();
  132. FOR_STL(TVmsCode*, pObj, VmsFormTypeManager->FLists) {
  133. if (!pObj->IsUse) continue;
  134. nRow = pGDC->AppendRecord();
  135. pGDC->Values[nRow][ColLink1->Index] = pObj->CODE;
  136. pGDC->Values[nRow][ColLink3->Index] = pObj->NAME;
  137. }
  138. }
  139. __finally
  140. {
  141. TvList->EndUpdate();
  142. }
  143. }
  144. //---------------------------------------------------------------------------
  145. void __fastcall TVMSM520M::TmrShowTimer(TObject *Sender)
  146. {
  147. TmrShow->Enabled = false;
  148. }
  149. //---------------------------------------------------------------------------
  150. void __fastcall TVMSM520M::BtnCloseClick(TObject *Sender)
  151. {
  152. Close();
  153. }
  154. //---------------------------------------------------------------------------
  155. void __fastcall TVMSM520M::FormClose(TObject *Sender, TCloseAction &Action)
  156. {
  157. CommClose();
  158. VMSM520M = NULL;
  159. Action = caFree;
  160. }
  161. //---------------------------------------------------------------------------
  162. void __fastcall TVMSM520M::FormCloseQuery(TObject *Sender, bool &CanClose)
  163. {
  164. //
  165. }
  166. //---------------------------------------------------------------------------
  167. void __fastcall TVMSM520M::DisplayInfo()
  168. {
  169. //FormInit();
  170. int nRow = TvList->DataController->FocusedRecordIndex;
  171. if( nRow <= -1 )
  172. return;
  173. TcxGridDataController *pDc = TvList->DataController;
  174. nRow = pDc->FocusedRecordIndex;
  175. #if 0
  176. if (nRow < FListSymb->Count)
  177. {
  178. Graphics::TBitmap *bitmap = (Graphics::TBitmap*)FListSymb->Items[nRow];
  179. ImgPreView->Picture->Bitmap->Assign(bitmap);
  180. }
  181. #endif
  182. EdNmbr->Text = VarToStr(pDc->Values[nRow][ColLink1->Index]);
  183. }
  184. //---------------------------------------------------------------------------
  185. void __fastcall TVMSM520M::ClearSymbloList()
  186. {
  187. for(int ii = 0; ii < FListSymb->Count; ii++)
  188. {
  189. Graphics::TBitmap *bitmap = (Graphics::TBitmap *)FListSymb->Items[ii];
  190. delete bitmap;
  191. }
  192. FListSymb->Clear();
  193. }
  194. //---------------------------------------------------------------------------
  195. void __fastcall TVMSM520M::TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  196. TMouseButton AButton, TShiftState AShift,
  197. bool &AHandled)
  198. {
  199. if (!ACellViewInfo) return;
  200. DisplayInfo();
  201. Sleep(200);
  202. BtnSelImageClick((TObject*)BtnSelImage);
  203. }
  204. //---------------------------------------------------------------------------
  205. void __fastcall TVMSM520M::TvListFocusedRecordChanged(TcxCustomGridTableView *Sender,
  206. TcxCustomGridRecord *APrevFocusedRecord, TcxCustomGridRecord *AFocusedRecord,
  207. bool ANewItemRecordFocusingChanged)
  208. {
  209. if (!AFocusedRecord) return;
  210. DisplayInfo();
  211. }
  212. //---------------------------------------------------------------------------
  213. void __fastcall TVMSM520M::BtnSelImageClick(TObject *Sender)
  214. {
  215. if (EdNmbr->Text == "")
  216. {
  217. Application->MessageBox(lblText1->Caption.c_str(),//L"VMS 폼 유형 선택\r\nVMS 폼 유형 목록에서 선택하세요.",
  218. FTitle.c_str(),
  219. MB_OK|MB_ICONERROR|MB_APPLMODAL);
  220. return;
  221. }
  222. m_bSelected = true;
  223. Close();
  224. }
  225. //---------------------------------------------------------------------------