//--------------------------------------------------------------------------- #include #include #include #include #include #ifdef EXCEPTION_REPORT #include // Exception ó¸® - by monkman (2009.09.02) #include // For process count of Windows XP #endif #pragma hdrstop #include "Main.h" #include "About.h" #include "CaptureEdit.h" #include "ColorChart.h" #include "ColorLibrary_f.h" #include "Define.h" #include "EnlargeCanvas.h" #include "Environment.h" #include "FileManager_F.h" #include "FullView.h" #include "History.h" #include "MainImage.h" #include "MainMenu.h" #include "NewCanvas.h" #include "Palette.h" #include "PenManager.h" #include "ProtectCard.h" #include "ResizeCanvas.h" #include "StatusProgress.h" #include "TPrint_F.h" // #include "TPrint_F.h" by jeegeo #include "LeadToolsFileOption.h" #include "Undo.h" #include "VecDraw.h" #include "Grid_F.h" #include "Combination.h" #include "CombiResult.h" #include "DataTrans.h" #include "Motivelib_F.h" #include "Windowlib_F.h" #include "Window.h" #include "N3DMapping.h" #include "N3DPattern.h" #include "ImageVectorizer_F.h" // HotKey - by monkman (2010.07.01) #include "HotKey.h" #include "HotKey_F.h" #include "CaptureEdit.h" #include "UserColor_F.h" #include "Layer_F.h" #include "TexWork_F.h" #include "Vector_F.h" // ¹ÝÀü °Å¿ï ¸ðµå¸¦ È®ÀÎÇϱâ À§ÇØ Ãß°¡ -0- - by monkman (2005.05.09) #include "RasterizeDialogBox_F.h" // º¤ÅÍ ¿ÀºêÁ§Æ® ºñÆ®¸ÊÈ­ ¸Þ½ÃÁö ¹Ú½º - by monkman (2005.05.23) #include "Filter_F.h" // FilterForm Ãß°¡ - by monkman (2007.08.17) #ifdef TRIAL #include "IdMultipartFormData.hpp" #include "TrialLock.h" #endif #ifdef EXCEPTION_REPORT #include "ExceptionReport_F.h" #endif #ifdef LOCK_TEX #include "Seedx.h" #endif #if !(defined LOCK_IFC) && !(defined LOCK_USB) #if ((defined LOCK_CRYPKEY) && (defined WEB_LOCK)) || (defined LOCK_HASP) #include "AutoUpdate_F.h" #endif #endif #include "PenAndNaviDock_F.h" #include "PenAndNaviConjoinhost_F.h" #include "PenAndNaviTabDockHost_F.h" #include "PenAndNaviTab_F.h" #include "Common.h" #include "Library_F.h"; #ifdef WORKSHEET #include "WorkSheet_F.h" #endif #include "NewGrouping_F.h" #include "CombiDetail.h" #include "StyleCombo_F.h" #define LID_TRADITIONAL_CHINESE 0x0404 #define LID_JAPANESE 0x0411 #define LID_KOREAN 0x0412 #define LID_SIMPLIFIED_CHINESE 0x0804 //--------------------------------------------------------------------------- #pragma package(smart_init) // LEADTOOLS V.15 - by monkman (2007.05.04) #pragma link "lttwn_bu.lib" #pragma link "ltkrn_bu.lib" #pragma link "ltdis_bu.lib" #pragma link "ltimgclr_bu.lib" #pragma link "ltimgefx_bu.lib" #pragma link "ltimgcor_bu.lib" // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) // LEADTOOLS V.15 Dialog ¹®Á¦¸¦ TFilterFormÀ¸·Î ´ëüÇϸ鼭 ÁÖ¼®Ã³¸® /* #pragma link "ltdlgclr_bu.lib" #pragma link "ltdlgkrn_bu.lib" #pragma link "ltdlgutl_bu.lib" #pragma link "ltdlgctrl_bu.lib" #pragma link "ltdlgcom_bu.lib" #pragma link "ltdlgimgefx_bu.lib" */ //--------------------------------------------------------------------------- #pragma link "sensapi.lib" // ³×Æ®¿öÅ© ¿¬°á À¯¹« - by monkman (2008.12.15) //--------------------------------------------------------------------------- #ifdef EXCEPTION_REPORT #pragma link "psapi.lib" // Exception ó¸® - by monkman (2009.09.02) #endif //--------------------------------------------------------------------------- //#pragma link "TntDialogs" //#pragma link "TntMenus" #pragma link "RzLabel" #pragma link "RzTabs" #pragma link "RzEdit" #pragma link "IdHTTP" #pragma resource "*.dfm" #pragma resource "Cursor.res" //--------------------------------------------------------------------------- #define IDS_TDCSP StringTable[0] #define IDS_TDCSA StringTable[1] #define IDS_FILE StringTable[2] #define IDS_F256COLOR StringTable[3] #define IDS_FFULLCOLOR StringTable[4] #define IDS_FFILEMANAGER StringTable[5] #define IDS_FREOPEN StringTable[6] #define IDS_FCLOSE StringTable[7] #define IDS_FCLOSEALL StringTable[8] #define IDS_FRESIZECANVAS StringTable[9] #define IDS_FENLARGECANVAS StringTable[10] #define IDS_FSCANNING StringTable[11] #define IDS_FSCANNERSETUP StringTable[12] #define IDS_FSMALLFONT StringTable[13] #define IDS_FLARGEFONT StringTable[14] #define IDS_FEXIT StringTable[15] #define IDS_EDIT StringTable[16] #define IDS_ECUT StringTable[17] #define IDS_ECOPY StringTable[18] #define IDS_EPASTE StringTable[19] #define IDS_CAPTURE StringTable[20] #define IDS_COVERWRITE StringTable[21] #define IDS_CINSERT StringTable[22] #define IDS_CEDIT StringTable[23] #define IDS_CDELETEALL StringTable[24] #define IDS_IMAGE StringTable[25] #define IDS_IINTENSITYDETECT StringTable[26] #define IDS_ISOLARIZE StringTable[27] #define IDS_IEFFECT StringTable[28] #define IDS_IEPOSTERIZE StringTable[29] #define IDS_IEMOSAIC StringTable[30] #define IDS_IEAVERAGE StringTable[31] #define IDS_IEMEDIAN StringTable[32] #define IDS_IESHARPEN StringTable[33] #define IDS_IEADDNOISE StringTable[34] #define IDS_IEEMBOSS StringTable[35] #define IDS_IEUNDERLAY StringTable[36] #define IDS_IEEDGEENHANCE StringTable[37] #define IDS_IEOILIFY StringTable[38] #define IDS_ISPATIALFILTER StringTable[39] #define IDS_ISGRADIENT StringTable[40] #define IDS_ISLAPLACIAN StringTable[41] #define IDS_ISSOBEL StringTable[42] #define IDS_ISPREWITT StringTable[43] #define IDS_ISSHIFTANDDIFFERENCE StringTable[44] #define IDS_ISLINESEGMENT StringTable[45] #define IDS_VIEW StringTable[46] #define IDS_VSPECIALPEN StringTable[47] #define IDS_VFULLVIEW StringTable[48] #define IDS_VPALETTE StringTable[49] #define IDS_VMAINMENU StringTable[50] #define IDS_VSTATUSBAR StringTable[51] #define IDS_WINDOW StringTable[52] #define IDS_WCASCADE StringTable[53] #define IDS_WTILE StringTable[54] #define IDS_WARRANGEICONS StringTable[55] #define IDS_WMINIMIZEALL StringTable[56] #define IDS_HELP StringTable[57] #define IDS_HABOUT StringTable[58] #define IDS_VLAYER StringTable[59] //TEXTILE #define IDS_T1 StringTable[60] #define IDS_T2 StringTable[61] #define IDS_T3 StringTable[62] #define IDS_T4 StringTable[63] #define IDS_T5 StringTable[64] #define IDS_T6 StringTable[65] #define IDS_T7 StringTable[66] #define IDS_T8 StringTable[67] #define IDS_T9 StringTable[68] #define IDS_T10 StringTable[69] #define IDS_T11 StringTable[70] #define IDS_T12 StringTable[71] #define IDS_T13 StringTable[72] #define IDS_T14 StringTable[73] #define IDS_T15 StringTable[74] #define IDS_T16 StringTable[75] #define IDS_T17 StringTable[76] #define IDS_T18 StringTable[77] #define IDS_T19 StringTable[78] #define IDS_T20 StringTable[79] #define IDS_T21 StringTable[80] #define IDS_T22 StringTable[81] #define IDS_T23 StringTable[82] #define IDS_T24 StringTable[83] #define IDS_T25 StringTable[84] #define IDS_T26 StringTable[85] #define IDS_T27 StringTable[86] #define IDS_T28 StringTable[87] #define IDS_T29 StringTable[88] #define IDS_T30 StringTable[89] #define IDS_T31 StringTable[90] #define IDS_T32 StringTable[91] #define IDS_T33 StringTable[92] #define IDS_T34 StringTable[93] #define IDS_T35 StringTable[94] #define IDS_T36 StringTable[95] #define IDS_T37 StringTable[96] #define IDS_T38 StringTable[97] #define IDS_T39 StringTable[98] #define IDS_T40 StringTable[99] #define IDS_T41 StringTable[100] #define IDS_T42 StringTable[101] #define IDS_T43 StringTable[102] #define IDS_T44 StringTable[103] #define IDS_T45 StringTable[104] #define IDS_T46 StringTable[105] #define IDS_T47 StringTable[106] #define IDS_T48 StringTable[107] #define IDS_T49 StringTable[108] #define IDS_T50 StringTable[109] #define IDS_T51 StringTable[110] #define IDS_T52 StringTable[111] #define IDS_T53 StringTable[112] #define IDS_T54 StringTable[113] #define IDS_T55 StringTable[114] #define IDS_T56 StringTable[115] #define IDS_T57 StringTable[116] #define IDS_T58 StringTable[117] #define IDS_T59 StringTable[118] #define IDS_T60 StringTable[119] #define IDS_T61 StringTable[120] #define IDS_T62 StringTable[121] //WEAVE #define IDS_W1 StringTable[122] #define IDS_W2 StringTable[123] #define IDS_W3 StringTable[124] #define IDS_W4 StringTable[125] #define IDS_W5 StringTable[126] #define IDS_W6 StringTable[127] #define IDS_W7 StringTable[128] #define IDS_W8 StringTable[129] #define IDS_W9 StringTable[130] #define IDS_W10 StringTable[131] #define IDS_W11 StringTable[132] #define IDS_W12 StringTable[133] #define IDS_W13 StringTable[134] #define IDS_W14 StringTable[135] #define IDS_W15 StringTable[136] #define IDS_W16 StringTable[137] #define IDS_W17 StringTable[138] #define IDS_W18 StringTable[139] #define IDS_W19 StringTable[140] #define IDS_W20 StringTable[141] #define IDS_W21 StringTable[142] #define IDS_W22 StringTable[143] #define IDS_W23 StringTable[144] //KNIT #define IDS_K1 StringTable[145] #define IDS_K2 StringTable[146] #define IDS_K3 StringTable[147] #define IDS_K4 StringTable[148] #define IDS_K5 StringTable[149] #define IDS_K6 StringTable[150] #define IDS_K7 StringTable[151] #define IDS_K8 StringTable[152] #define IDS_K9 StringTable[153] #define IDS_K10 StringTable[154] #define IDS_K11 StringTable[155] #define IDS_TWorkArea StringTable[156] #define IDS_TMotive StringTable[157] #define IDS_TSAVE StringTable[158] #define IDS_DeleteAll StringTable[159] #define IDS_WMLoad StringTable[160] #define IDS_TOOLSREARRANGE StringTable[161] #define IDS_N3D StringTable[162] #define IDS_RASTERIZE StringTable[163] #define IDS_IMAGEVECTORIZER StringTable[164] //SK°ü·Ã - by maxleo21c(07.01.11) #ifdef SK_SMART #define IDS_SK_MSG1 StringTable[165] //À¥¿¡¼­ ´Ù¿î¹ÞÀº ÆÄÀÏÀÔ´Ï´Ù. À¥¿¡ ´Ù½Ã ¾÷·Îµå ÇϽðڽÀ´Ï±î? #define IDS_SK_MSG2 StringTable[166] //ÆÄÀÏ ¾÷·Îµå ¿Ï·á!! #define IDS_SK_MSG3 StringTable[167] //E_focus¿¡ Á¢±ÙÀÌ ¾ÈµË´Ï´Ù. #define IDS_SK_MSG4 StringTable[168] //E_focus ÆÄÀÏ ¿Ã¸®±â ½ÇÆÐ #define IDS_SK_MSG5 StringTable[169] //E_focus ÆÄÀÏ ¿Ã¸®±â ¼º°ø #define IDS_SK_MSG6 StringTable[170] //¾÷·Îµå ÁÖ¼Ò°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù. #define IDS_SK_MSG7 StringTable[171] //FileÀÌ LinkµÇ¾î ÀÖÁö ¾Ê¾Æ ¿­¼ö ¾ø½À´Ï´Ù #endif #define IDS_COLORCHANGE StringTable[172] // »ö ¹Ù²Ù±â #define IDS_SMOOTH StringTable[173] // ¼± Á¤¸® #define IDS_WORKSHEET StringTable[174] // ÀÛ¾÷Áö½Ã¼­ //Added #define IDS_ISGrayScale StringTable[175] #define IDS_PROGRAM_UPDATE StringTable[176] #define IDS_ImageVectorizer StringTable[177] #define IDS_BUY_ITEM StringTable[178] #define IDS_PEN_FULLVIEW StringTable[179] #define IDS_CANVAS_TAB StringTable[180] #define IDS_SHORTCUTSETTING StringTable[181] // resource #define IDS_RESOURCE_NOT_ENOUGH StringTable[182] #define IDS_MSG_CLOSE StringTable[183] #define IDS_AVAIL_RESOURCE StringTable[184] #define IDS_WORKSHEET StringTable[185] #define IDS_RTIME_D StringTable[186] #define IDS_RTIME_H StringTable[187] #define IDS_RTIME_M StringTable[188] #define IDS_RTIME5_ALARM StringTable[189] #define IDS_EXPIRED_CAPTION StringTable[190] #define IDS_EXPIRED_MSG StringTable[191] #define IDS_ERR_OFFLINESET StringTable[192] #define IDS_MENU_RENEW StringTable[193] #define IDS_RENEW_FAIL StringTable[194] #define IDS_RTIME1_ALARM StringTable[195] #define IDS_NET_WARNING_MESSAGE StringTable[196] #define IDS_MEMORY_WARNING_MESSAGE StringTable[197] // Exception Mail //#define IDS_SENDMAILTRANSFER StringTable[] //gabriel: default file ext index #define DefaultExtensionIndex 9 //--------------------------------------------------------------------------- //const static int WindowCount = 2; // âÀÇ °¹¼ö //TPenAndNaviDockForm* PenAndNaviDockWindows[WindowCount]; // µµÅ·Æû ¼±¾ð //--------------------------------------------------------------------------- TMainForm *MainForm; //--------------------------------------------------------------------------- // TMainForm //--------------------------------------------------------------------------- //########################################################################### /* C++ Builder 5¿¡¼­ ÆûÀº TMyForm(TComponent* Owner) TForm(Owner) FormCreate](TObject *Sender) ÀÇ ¼ø¼­·Î ½ÇÇڵȴ٠À̶§ AutoCreate FormÀº FormCreate(TObject *Sender)¸¦ ¼öÇàÇϰí TMyForm(TComponent* Owner)À¸·Î µ¹¾Æ¿Í¼­ StringTable°ú °°Àº Ŭ·¡½ºÀÇ »ý¼ºÀÚ¸¦ È£ÃâÇÏÁö ¾ÊÁö¸¸ µ¿ÀûÀ¸·Î ÇÒ´çÇÑ ÆûÀº FormCreate(TObject *Sender)¸¦ ¼öÇàÇϰí TMyForm(TComponent* Owner)À¸·Î µ¹¾Æ¿Í¼­ StringTable°ú °°Àº Ŭ·¡½ºÀÇ »ý¼ºÀÚ¸¦ È£!Ãâ!ÇÑ!´Ù! ±×·¯¹Ç·Î °¢°¢¿¡ µû¶ó StringTable.CreateÀÇ È£Ãâ ¼ø¼­¸¦ ´Þ¸®ÇؾßÇÑ´Ù // by jeegeo */ //########################################################################### //--------------------------------------------------------------------------- __fastcall TMainForm::TMainForm(TComponent* Owner) : TForm(Owner) { // Log »ý¼º - by monkman (2010.05.07) #ifdef LOG CreateLog(); #endif #ifdef TRIAL_HOOK // Keyboard Hooking - by monkman (2008.11.07) hInstDLL = NULL; StartMessageHook = NULL; StopMessageHook = NULL; #endif L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION)); L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION)); // LEADTOOLS V.15 - by monkman (2007.05.04) g_hTwainSession = NULL; bFirst = 0; if(GetSystemMetrics(SM_CXSCREEN)>=1280&&GetSystemMetrics(SM_CYSCREEN)>=1024){ HorzScrollBar->Tracking=false; HorzScrollBar->Visible=false; VertScrollBar->Tracking=false; VertScrollBar->Visible=false; } else { HorzScrollBar->Tracking=true; HorzScrollBar->Visible=true; VertScrollBar->Tracking=true; VertScrollBar->Visible=true; } #ifdef LOCK_USB USBLock = new TUSBLock; turn = true; CheckLock(); #endif //============================================= 2001.5.23 by lhskys windows version ¾Ë¾Æ³»±â... /* String version; TRegIniFile *RegIniFile; RegIniFile = new TRegIniFile(RegFilename); version = RegIniFile->ReadString("Common", "Windows Version", "" ); if(version == ""){ String S; TRegistry *Registry = new TRegistry; try { Registry->RootKey = HKEY_LOCAL_MACHINE; Registry->OpenKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\",false); S = Registry->ReadString("ProductName"); if(S == ""){ Registry->OpenKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\",false); S = Registry->ReadString("ProductName"); } } __finally { delete Registry; } TRegIniFile *RegIniFile; RegIniFile = new TRegIniFile(RegFilename); if (RegIniFile){ if ( S == "Microsoft Windows 98" )RegIniFile->WriteString("Common", "Windows Version", "98"); else if ( S == "Microsoft Windows 2000" )RegIniFile->WriteString("Common", "Windows Version", "2000"); } }*/ //============================================== #ifdef N_SCREENCAM Screencam1->Visible = false; #endif FILEOPEN = true; //2001.4.11. by lhskys Open Ãß°¡ WReopenMove = false; WaSave = false; MoSave = false; ReadN3D=false; Width = GetSystemMetrics(SM_CXSCREEN); // Height = GetSystemMetrics(SM_CYSCREEN); // Full ScreenÀ¸·Î ½ÇÇà ¾ÈµÇ´Â ¹®Á¦ ¶§¹®¿¡.. by celberus // Drag·Î ÆÄÀÏ Open Ãß°¡ - by monkman (2010.10.01) DragAcceptFiles(Handle, true); // vista, win7¿¡¼­´Â ±ÇÇÑÀÌ ÀÖ¾î¾ß ¿ÜºÎ¿¡¼­ µé¾î¿À´Â °ÍÀ» ó¸®ÇÒ¼öÀÖÀ¸¹Ç·Î // User Interface Privilege Isolation (UIPI) message filter¿¡ Ãß°¡ÇØÁØ´Ù. OSVERSIONINFO osinfo; osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osinfo); if (osinfo.dwMajorVersion >= 6) { HANDLE popapi; CHANGEWINDOWMESSAGEFILTER ChangeWindowMessageFilter; popapi = LoadLibrary(L"user32.dll"); ChangeWindowMessageFilter=(CHANGEWINDOWMESSAGEFILTER)GetProcAddress((HINSTANCE)popapi,"ChangeWindowMessageFilter"); ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD); ChangeWindowMessageFilter (0x0049, MSGFLT_ADD); } #ifdef WEB_LOCK rtime = 0; WebLockT1->Enabled = true; WebLockT2->Enabled = true; WebLockT3->Enabled = true; #endif #ifdef SK_SMART strSmartParam = NULL; nSmartParamCount = 0; #endif SetChangeFont(0,0); } //--------------------------------------------------------------------------- // Drag·Î ÆÄÀÏ Open Ãß°¡ - by monkman (2010.10.01) void __fastcall TMainForm::TPMDropFiles(TWMDropFiles &msg) { int nLength; bool bAdd; UINT nFileCount; String strFullPath, strDirName, strFileName; TCursor cur; TMainImageForm *Child = NULL; TPException ec = EC_NONE; // DXF ·Îµù½Ã ÇØ»óµµ Á¶Àý TNewCanvasForm *Form = NULL; TGraphicFileFormat ExtIndex; FILEINFO FileInfo; int bpp; nFileCount = DragQueryFile((HDROP)msg.Drop, 0xFFFFFFFF, NULL, 0); for (int i = 0; i < nFileCount; i++) { strFullPath.SetLength(MAX_PATH); nLength = DragQueryFile((HDROP)msg.Drop, i, strFullPath.c_str(), strFullPath.Length()); strFullPath.SetLength(nLength); strDirName = ExtractFileDir(strFullPath); strFileName = ExtractFileName(strFullPath); ExtIndex = FindExtension(ExtractFileExt(strFullPath)); // BitsPerPixel °áÁ¤ switch (ExtIndex) { // 8bit case gffTEX: case gffWEA: case gffWAV: case gffKNT: bpp = 8; break; case gffTFC: case gffT3D: case gffVST: case gffDXF: bpp = 24; break; case gffNON: break; default: L_FileInfo(strFullPath.c_str(), &FileInfo, sizeof(FILEINFO), 0, NULL); bpp = FileInfo.BitsPerPixel; break; } if (ExtIndex != gffNON) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; //MainMenuMan->ExitMenu(); MainMenuForm->ExitForm(0); if (MainImageForm) MainImageForm->iMainImage->Deactivate(); if (ExtIndex == gffDXF) { if ((Form = new TNewCanvasForm(NULL))==NULL) { ec = EC_FORM_NOT_CREATE; if (Child) delete Child; Screen->Cursor = cur; } if (Form->ShowModal()==mrOk) { if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; if (Child) delete Child; Screen->Cursor = cur; } Child->CanvasInfor = Form->CanvasInfor; if ((ec = Child->InitFormFile(strDirName, strFileName, ExtIndex, bpp, true)) != EC_NONE) { if (Child) delete Child; Screen->Cursor = cur; } } delete Form; } else { if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; if (Child) delete Child; Screen->Cursor = cur; } if ((ec = Child->InitFormFile(strDirName, strFileName, ExtIndex, bpp, true)) != EC_NONE) { if (Child) delete Child; Screen->Cursor = cur; } } Screen->Cursor = cur; } } DragFinish((HDROP)msg.Drop); } //--------------------------------------------------------------------------- //ÇöÀç IMEÀÇ »óŸ¦ È®ÀÎÇϱâ À§Çؼ­ Ãß°¡ÇÑ ÇÔ¼ö void __fastcall TMainForm::SetChangeFont(HKL hKeyboardLayout, LPCTSTR szSelectedFont) { // Check keyboard layout if (hKeyboardLayout == 0) hKeyboardLayout = GetKeyboardLayout(0); if (LOWORD(hKeyboardLayout) == LID_KOREAN) sFontLanguage = "KOREAN"; else sFontLanguage = "NONE"; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ApplicationMessage(tagMSG &Msg, bool &Handled) { // Tablet Message ó¸® if (Msg.message == WT_PACKET) { if (Tablet) { TMessage message; message.LParam = Msg.lParam; message.WParam = Msg.wParam; WTPKT Result = Tablet->WTMPacket(message); if (Result&PK_CURSOR) PenManagerForm->Pen->Cursor = Tablet->curNew; Handled = true; } } else if (Msg.message == WM_NCLBUTTONDOWN || Msg.message == WM_LBUTTONDOWN){ // TMainImageForm *mif = (TMainImageForm *)this->ActiveMDIChild; // if (mif != NULL && !mif->Active){ // mif->FormActivate(mif); // } // Tablet message°¡ ¹ß»ýÇÏÁö ¾Ê´Â °æ¿ì¸¦ ´ëºñÇØ Ȱ¼ºÈ­ ½ÃÄÑÁÜ if (Tablet) Tablet->Activate(); TWinControl *winCtrl = FindWinControl(Msg.hwnd); if (winCtrl != NULL) { if (winCtrl != Screen->ActiveControl) { if (IsEditableControl(Screen->ActiveControl)) { // ÀԷµǴø ÇѱÛÀ» ¸¶¹«¸® Áþ±â À§ÇÔ - by monkman (2010.07.28) EditFinish(Screen->ActiveControl); } // Mouse DownµÈ ControlÀÌ EditableÀÌ ¾Æ´Ï¸é g_FocusControl·Î focus À̵¿ if (IsEditableControl(winCtrl) == false) g_FocusControl->SetFocus(); } } } else if (Msg.message == WM_IME_STARTCOMPOSITION) { //±ÛÀÚ¸¦ ÀÔ·ÂÇÏ´Ù°¡ IME¸¦ º¯°æÇÒ ¼ö Àֱ⠶§¹®¿¡ CompositionÇϱâÀü¿¡ //ÆùÆ®ÀÇ IME¸¦ ÀçÈ®ÀÎÇÑ´Ù. ÇѱÛÀ϶§¿¡¸¸ Á¶ÇÕ󸮸¦ ÇÏ°í ´Ù¸¥ ¾ð¾î´Â //WM_IME_CHAR¿¡¼­ ó¸®Çϵµ·Ï Çß´Ù. Áß±¹¾î °°Àº °æ¿ì Çѱ۰ú ´Þ¶ó //¿¡·¯°¡ ¹ß»ýÇÑ´Ù. SetChangeFont(0,0); Handled = true; return; } else if (Msg.message == WM_IME_COMPOSITION) { if (VectorForm != NULL && VectorForm->UseComboBoxForText == false && MainMenuForm->UseEditFunction == true) { if (TexActionManager->ForceSwitch == true) { VectorForm->TextProc(Msg, Handled); // Message ó¸® ¿Ï·á Ç¥½Ã // Handled °ªÀº TextProc¿¡¼­ ¸®ÅϵǴ °ªÀ¸·Î ó¸® } } } else if ((Msg.message >= WM_KEYFIRST && Msg.message <= WM_KEYLAST) || Msg.message == WM_IME_CHAR) { if (MainImageForm != NULL && MainMenuForm != NULL) { // Vector Text ÀÔ·Â ±â´É°ü·Ã ó¸® if (VectorForm != NULL && VectorForm->UseComboBoxForText == false && MainMenuForm->UseEditFunction == true) { if (TexActionManager->ForceSwitch == true) VectorForm->TextProc(Msg, Handled); } // Vector Text ÀÔ·Â ±â´É ÀÌ¿ÜÀÇ Key Message ó¸® else { TWinControl *winCtrl = FindWinControl(Msg.hwnd); if (winCtrl != NULL) TexActionManager->Enabled = !IsEditableControl(winCtrl); if (TexActionManager->Enabled == true) { if (Msg.message == WM_KEYDOWN || Msg.message == WM_SYSKEYDOWN || Msg.message == WM_KEYUP || Msg.message == WM_SYSKEYUP) { // Çѱ۷ΠÀÔ·ÂÇØµµ Key¸¦ ó¸® Çϱâ À§ÇØ ÀÔ·ÂµÈ Key¿¡ ÇØ´çÇÏ´Â Virtual Key·Î ó¸®Çϵµ·Ï ÇÔ if (Msg.wParam == VK_PROCESSKEY) Msg.wParam = ImmGetVirtualKey(Msg.hwnd); WORD key = Msg.wParam; TShiftState shift; int shortcutCode = key; if (GetAsyncKeyState(VK_MENU) & 0x8000) { shift << ssAlt; shortcutCode |= 0x8000; } if (GetAsyncKeyState(VK_SHIFT) & 0x8000) { shift << ssShift; shortcutCode |= 0x2000; } if (GetAsyncKeyState(VK_CONTROL) & 0x8000) { shift << ssCtrl; shortcutCode |= 0x4000; } if (Msg.message == WM_KEYDOWN || Msg.message == WM_SYSKEYDOWN) { // HotKey·Î µî·ÏµÇ¾î ÀÖÀ¸¸é HotKey·Î ó¸® if (TexActionManager->FindAction(shortcutCode)) return; // WindowLibFormÀ» »ç¿ëÁßÀÎ °æ¿ì if (WindowLibForm != NULL && winCtrl != NULL && winCtrl->Owner == WindowLibForm) { WindowLibForm->FormKeyDown(key, shift); } // MotiveLibFormÀ» »ç¿ëÁßÀÎ °æ¿ì else if (MotiveLibForm != NULL && winCtrl != NULL && winCtrl->Owner == MotiveLibForm) { MotiveLibForm->FormKeyDown(key, shift); } else { // »ç¿ëÇϰí ÀÖ´Â SubMenu°¡ ¾øÀ» ¶§ PaletteForm ¶Ç´Â PenManagerForm¿¡¼­ KeyDown ó¸® if (MainMenuForm->Item == T_NONE) { if (PaletteForm != NULL && PaletteForm->Item != PAL_NONE) PaletteForm->iMainImageKeyDown(key, shift); else if (PenManagerForm != NULL) PenManagerForm->iMainImageKeyDown(key, shift); } // °¢ SubMenu¿¡ ´ëÇÑ KeyDown ó¸® MainMenuForm->iMainImageKeyDown(MainImageForm, key, shift); } } else if (Msg.message == WM_KEYUP || Msg.message == WM_SYSKEYUP) { MainMenuForm->iMainImageKeyUp(MainImageForm, key, shift); } } // Message ó¸® ¿Ï·á Ç¥½Ã Handled = true; } } } } } //--------------------------------------------------------------------------- void __fastcall TMainForm::Timer50msTimer(TObject *Sender) { if (MainImageForm) MainImageForm->Timer50ms(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Timer200msTimer(TObject *Sender) { if (MainImageForm) MainImageForm->Timer200ms(); MainMenuForm->Timer200ms(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Timer1000msTimer(TObject *Sender) { // ½Ã°£ Ç¥½Ã Á¦°Å // TDateTime Date1; // Date1 = Now(); // String S; // DateTimeToString(S,"yyyy-mm-dd ampm hh-nn-ss",Date1.CurrentDateTime()); // StatusBar->Panels->Items[StatusBarDate]->Text = S; //StatusBar->Panels->Items[StatusBarDate]->Text = DateTimeToStr(Now()); if (MainImageForm) MainImageForm->Timer1000ms(); #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC if (ProtectCard->isHacking) Application->Terminate(); #endif #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::AutosaveTimerTimer(TObject *Sender) { if (MainImageForm && bAutoSave) { MainImageForm->TimerAutoSave(); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::FNewCanvas256ItemClick(TObject *Sender) { BEGIN_TEX; TCursor cur; TMainImageForm *Child = NULL; TNewCanvasForm *Form = NULL; TPException ec = EC_NONE; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï Æû´Ý±â - by monkman (2005.02.24) if (VectorForm) { if (!VectorForm->ExitReflectionMirror()) {END_TEX; return;} } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PenManagerForm->spread_sw[4] = 0; PenManagerForm->aspread = false; PenManagerForm->acolor = 0; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } #endif #endif if ((Form = new TNewCanvasForm(NULL))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (MainImageForm) { if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainImageForm->ARViewExitForm(); } if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } if (MainImageForm) MainImageForm->AutoRepUpdateMenu(true); //lhskys »õ·Î¿î MainMenu »ý¼º if ((ec = Child->InitForm(Form->CanvasInfor, 8))!=EC_NONE) goto fail; Screen->Cursor = cur; PaletteForm->FormActivateCOLOR(); } delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif END_TEX; return; fail: if (Form) { if (Child) delete Child; Screen->Cursor = cur; delete Form; } EXCEPTION_MESSAGE_OK(ec); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FNewCanvasFullItemClick(TObject *Sender) { BEGIN_TEX; TCursor cur; TMainImageForm *Child = NULL; TNewCanvasForm *Form; TPException ec = EC_NONE; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï Æû´Ý±â - by monkman (2005.02.24) if (VectorForm) { if (!VectorForm->ExitReflectionMirror()) {END_TEX; return;} } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PenManagerForm->spread_sw[4] = 0; PenManagerForm->aspread = false; PenManagerForm->acolor = 0; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } #endif #endif Form = new TNewCanvasForm(NULL); if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (MainImageForm) { if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainImageForm->ARViewExitForm(); } if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } MainImageForm->AutoRepUpdateMenu(true); //lhskys »õ·Î¿î MainMenu »ý¼º if ((ec = Child->InitForm(Form->CanvasInfor, 24))!=EC_NONE) goto fail; Screen->Cursor = cur; PaletteForm->FormActivateCOLOR(); } delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif END_TEX; return; fail: if (Child) delete Child; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FGPNewCanvas(TUnionBitmap *newBitmap, int usedColor) { BEGIN_LOG(""); TCursor cur; TMainImageForm *Child = NULL; TNewCanvasForm *Form; TPException ec = EC_NONE; TPCanvasInfor canvasInfor; canvasInfor.Orientation = coPortrait; // CanvasInfor.SetSize(cstA4); //2001.4.2 by lhskys ȯ°æ¼³Á¤ -> Á¾ÀÌ Size ‹š¹®¿¡ ¸·À½ TIniFile *IniFile = new TIniFile(AppDataItem+"\\status.ini"); if (IniFile) { canvasInfor.DotsPerInch = IniFile->ReadInteger("CanvasInfor", "DPI", 160); canvasInfor.SetSize(cstFree, newBitmap->Width, newBitmap->Height); // canvasInfor.SetSize((TPCanvasSizeType)IniFile->ReadInteger("MainImage", "Size", 0)); //2001.4.2 by lhskys ȯ°æ¼³Á¤ -> Á¾ÀÌ Size // cbSizeType->ItemIndex = IniFile->ReadInteger("MainImage", "Size", 0); //2001.4.2 by lhskys ȯ°æ¼³Á¤ -> Á¾ÀÌ Size delete IniFile; } PenManagerForm->spread_sw[4] = 0; PenManagerForm->aspread = false; PenManagerForm->acolor = 0; TUnionBitmap *mainBitmap = new TUnionBitmap; mainBitmap->Create(newBitmap->Width, newBitmap->Height, newBitmap->BitsPerPixel, newBitmap->RGB); mainBitmap->Copy(newBitmap, SRCCOPY); MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } #endif #endif // Form = new TNewCanvasForm(NULL); // if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (MainImageForm) { if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainImageForm->ARViewExitForm(); } if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } MainImageForm->AutoRepUpdateMenu(true); //lhskys »õ·Î¿î MainMenu »ý¼º if ((ec = Child->InitFormImage(canvasInfor, mainBitmap, usedColor))!=EC_NONE) goto fail; Screen->Cursor = cur; // PaletteForm->FormActivateCOLOR(); // } // delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } delete mainBitmap; #endif #endif MainMenuForm->Item = T_NEWGROUP; END_LOG; return; fail: if (Child) delete Child; if (mainBitmap) delete mainBitmap; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FManagerItemClick(TObject *Sender) { BEGIN_TEX; TPException ec = EC_NONE; #ifdef SK_SMART //³×Æ®¿öÅ© ó¸® - by maxleo21c (06.11.27) -------------------------------- bool bWebUpload = false; if ( MainImageForm && !(MainImageForm->TargetInternetURL.myString=="") ) { if (Application->MessageBox(IDS_SK_MSG1.c_str(), L"Information", MB_ICONINFORMATION | MB_YESNO) == IDYES) { bWebUpload = true; TGraphicFileFormat gff = MainImageForm->gff; String tFilename = MainImageForm->FileName; ParsedURL targetInternetURL; // by maxleo21c (06.11.27) MainImageForm->TargetInternetURL.Copy(targetInternetURL); MainImageForm->FileName = targetInternetURL.remoteFilename; String FileExt = MainImageForm->FileName.SubString(MainImageForm->FileName.Length()-3, 4); if (FileExt == ".tfc") { MainImageForm->gff = gffTFC; } else if (FileExt == ".svg") { MainImageForm->gff = gffSVG; } else { MainImageForm->gff = gffSVG; } String fullLocalPath = MainImageForm->DirName+"\\" + MainImageForm->FileName; ec = MainImageForm->SaveToFile(MainImageForm->DirName, MainImageForm->FileName, MainImageForm->gff, cmZLib); if (ec != EC_NONE) { //070807 //IDS_SK_MSG4 :: E_focus ÆÄÀÏ ¿Ã¸®±â ½ÇÆÐ Application->MessageBox(IDS_SK_MSG4.c_str(), L"Wanning", MB_ICONINFORMATION | MB_OK); END_TEX; return; } MainImageForm->gff = gffJPG; String fileExtension = ExtractFileExt(MainImageForm->FileName); MainImageForm->FileName = MainImageForm->FileName.Delete(MainImageForm->FileName.Pos(fileExtension), MainImageForm->FileName.Length()); MainImageForm->FileName = MainForm->FMOnFileName(MainImageForm->FileName, gffJPG); fullLocalPath = MainImageForm->DirName+"\\JPEG\\" + MainImageForm->FileName; // À§ÀÇ ³»¿ëÀ» ÁÖ¼®Ã³¸® ÇÏÁö ¾ÊÀº ÀÌÀ¯´Â E-Focus¿¡¼­ ÀÌ ³»¿ëÀ» °¡Áö°í ÆÄÀÏÀ» // °¡Áö°í °¡±â ¶§¹®ÀÌ´Ù. ÁÖ¼®Ã³¸® ÇÏÁö ¾Êµµ·Ï Á¶½ÉÇÒ °Í ****** // MainImageForm->SaveToFile¿¡¼­ svgÆÄÀÏÀ̸é jpg¸¦ ¹«Á¶°Ç ÀúÀåÇϱ⠶§¹®¿¡ ÇÊ¿ä¾ø¾îÁ³´Ù. // ÁÖ¼®Ã³¸®. 0700808 //MainImageForm->SaveToFile(fullLocalPath); HANDLE hFile=NULL; HANDLE hMutex=NULL; wchar_t lpMes[256]; int strLength=0; DWORD cbWritten; String mailslot_Name = L"\\\\.\\mailslot\\YoungWoo_TexSeries" + MainImageForm->mailslot_Number; int count=0; for(;;) { if (count>20) break; hMutex = CreateMutex(NULL, FALSE, L"YoungWooForSK_Mutex"); if (hMutex) { count=0; break; } count++; } if (hMutex) { WaitForSingleObject(hMutex, INFINITE); for(;;) { if (count>20) break; hFile = CreateFile(mailslot_Name.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL); if (hFile) break; } count++; } if (hMutex==NULL || hFile==INVALID_HANDLE_VALUE || hFile == NULL) { if (hFile) CloseHandle(hFile); if (hMutex) ReleaseMutex(hMutex); //IDS_SK_MSG4 :: E_focus ÆÄÀÏ ¿Ã¸®±â ½ÇÆÐ Application->MessageBox(IDS_SK_MSG4.c_str(), L"Wanning", MB_ICONINFORMATION | MB_OK); END_TEX; return; } wsprintf(lpMes,fullLocalPath.c_str()); WriteFile(hFile,lpMes,wcslen(lpMes)+1,&cbWritten,NULL); CloseHandle(hFile); ReleaseMutex(hMutex); // for (int i=0; MDIChildCount-1 >= i; i++) { // if (static_cast(MDIChildren[i]) == MainImageForm) { // delete MDIChildren[i]; // } // } MainImageForm->Close(); //IDS_SK_MSG4 :: E_focus ÆÄÀÏ ¿Ã¸®±â ¼º°ø Application->MessageBox(IDS_SK_MSG5.c_str(), L"Wanning", MB_ICONINFORMATION | MB_OK); END_TEX; return; } } #endif //------------------------------------------------------------------------ // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï Æû´Ý±â - by monkman (2005.02.24) if (VectorForm) { if (!VectorForm->ExitReflectionMirror()) { END_TEX; return; } } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (MainMenuForm->Item != T_VECTOR) MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } #endif #endif if ((FileManagerForm = new TFileManagerForm(this)) == NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } if (MainImageForm) { if (MainImageForm->iMainImage->uBitmap->BitsPerPixel == 8) //gabriel FileManagerForm->Extension = DefaultExtensionIndex; else FileManagerForm->Extension = MainImageForm->iMainImage->uBitmap->BitsPerPixel; } else { FileManagerForm->Extension = DefaultExtensionIndex; //gabriel: <-- 8 } FileManagerForm->CompressCheckBox->Checked = (CompressMethod == cmNone) ? false: true; FileManagerForm->FilterComboBox->Filter = #ifdef TRIAL "Texpro Textile 256 Colors Trial File (*.ttex)|*.ttex|" "Texpro Textile Full Colors Trial File (*.ttfc)|*.ttfc|" // "Texpro Textile 3D Trial File (*.tt3d)|*.tt3d|" "Texpro Weave Trial File (*.twea)|*.twea|" "Texpro Knit Trial File (*.tknt)|*.tknt|" "Texpro Vector Trial File (*.tvst)|*.tvst|" #endif "Texpro Textile 256 Colors File (*.tex)|*.tex|" "Texpro Textile Full Colors File (*.tfc)|*.tfc|" // #ifndef N_3D // "Texpro Textile 3D File (*.t3d)|*.t3d|" // #endif "Texpro Weave File (*.wea)|*.wea|" "Texpro Weave File - V7.01 (*.wav)|*.wav|" "Texpro Knit File (*.knt)|*.knt|" "Texpro Vector File (*.vst)|*.vst|" "Microsoft Windows Bitmap (*.bmp)|*.bmp|" "JPEG (*.jpg)|*.jpg|" "Macintosh PICT (*.pct)|*.pct|" "PC Paintbrush File Format (*.pcx)|*.pcx|" "PNG (*.png)|*.png|" "PSD (*.psd)|*.psd|" "SUN Raster (*.ras)|*.ras|" "Targa Image File (*.tga)|*.tga|" "TIFF uncomp (*.tif)|*.tif|" "Encapsulated PostScript File (*.eps)|*.eps|" "Drawing Interchange File Format (*.dxf)|*.dxf|" "Scalable Vector Graphics (*.svg)|*.svg|" // "Texpro Pile File (*.pil)|*.pil|" "Texpro Textile 256 Color File -V10.0 (*.tex)|*.tex|" "Texpro Textile Full Color File -V10.0 (*.tfc)|*.tfc|" "Texpro Vector File -V10.0 (*.vst)|*.vst|" // #ifndef NOTN3D // "Texpro Textile New 3D File (*.n3d)|*.n3d|" // #endif "ALL Files (*.*)|*.*"; //================================================================= FileManagerForm->OnRead = FMOnRead; FileManagerForm->OnFileName = FMOnFileName; if (MainImageForm) { FileManagerForm->rztbSave->Enabled = true; FileManagerForm->rztbSaveAs->Enabled = true; FileManagerForm->OnSave = FMOnSave; FileManagerForm->OnMerge = FMOnMerge; } else { FileManagerForm->rztbSave->Enabled = false; FileManagerForm->rztbSaveAs->Enabled = false; } FileManagerForm->ShowModal(); delete FileManagerForm; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif END_TEX; return; fail: EXCEPTION_MESSAGE_OK(ec); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FCloseItemClick(TObject *Sender) { if (ActiveMDIChild) ActiveMDIChild->Close(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FResizeCanvasItemClick(TObject *Sender) { BEGIN_LOG(""); TPException ec = EC_NONE; TCursor cur; TResizeCanvasForm *Form; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #endif #endif Form = new TResizeCanvasForm(this); Form->CanvasInfor = MainImageForm->CanvasInfor; if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if(!(Form->edNSWidth->Value > 0)){ ShowMessage("Floating point division by zero."); goto next; }else if(!(Form->edNSHeight->Value > 0)){ ShowMessage("Floating point division by zero."); goto next; } MainImageForm->ResizeCanvas(Form->NewDPI, Form->NewSize.cx, Form->NewSize.cy); Current_DPI = Form->NewDPI; MainImageForm->Ruler->DPI = Form->NewDPI; MainImageForm->Undo->RemoveAll(); MainImageForm->UndoSave(UK_ALL, Rect(0,0,MainImageForm->iMainImage->uBitmap->Width,MainImageForm->iMainImage->uBitmap->Height)); Screen->Cursor = cur; } next: delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FEnlargeCanvasItemClick(TObject *Sender) { BEGIN_LOG(""); TPException ec = EC_NONE; TCursor cur; TEnlargeCanvasForm *Form; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #endif #endif Form = new TEnlargeCanvasForm(this); Form->CanvasInfor = MainImageForm->CanvasInfor; if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if((!MainImageForm->AutoRepeat) || (Form->NewSize.cx >= MainImageForm->iMainImage->uBitmap->Width && Form->NewSize.cy >= MainImageForm->iMainImage->uBitmap->Height)){ MainImageForm->EnlargeCanvas(Form->NewSize.cx, Form->NewSize.cy); MainImageForm->Undo->RemoveAll(); }else if(MainImageForm->AutoRepeat){ EXCEPTION_MESSAGE_OK(EC_AUTOREPEATENLARGE); } Screen->Cursor = cur; } delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FScannerSetupItemClick(TObject *Sender) { if (isScanning == -1 || g_hTwainSession == NULL) { isScanning = 0; if (L_IsTwainAvailable(Application->Handle)) { FScanningItem->Enabled = true; FScannerSetupItem->Enabled = true; isScanning = 1; AppData.hWnd = Application->Handle; AppData.uStructSize = sizeof(APPLICATIONDATA); L_TwainInitSession(&g_hTwainSession, &AppData); } else { FScanningItem->Enabled = false; FScannerSetupItem->Enabled = false; if (MainMenuForm) MainMenuForm->sbScan->Enabled = false; return; } } int nRet; //nRet = L_TwainSelect(Application->Handle); // LEADTOOLS V.15 - by monkman (2007.05.04) nRet = L_TwainSelectSource(g_hTwainSession, NULL); if (nRet != SUCCESS && nRet != ERROR_TWAIN_CANCEL) MessageDlg(IDS_MESSAGE_ERRORDEVICE, mtError, TMsgDlgButtons() << mbOK, 0); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FScanningItemClick(TObject *Sender) { if(!MainImageForm) return; if (isScanning <= 0 || g_hTwainSession == NULL) { MessageDlg(IDS_MESSAGE_ERRORDEVICE, mtError, TMsgDlgButtons() << mbOK, 0); return; } BEGIN_LOG(""); RECT r; BITMAPHANDLE hBitmap; int nRet; RGBQUAD rgb[256]; HDC dcSrc = NULL/*, dcDst = NULL*/; // convert by celberus Byte c[256]; int x, y, w, h, uuu; Byte *bp; TPException ec = EC_NONE; TCursor OldCursor = Screen->Cursor; Screen->Cursor = crDefault; TPItemImage *Image = MainImageForm->iMainImage; // ti -> Image·Î º¯°æ by celberus memset(&hBitmap, 0, sizeof(BITMAPHANDLE)); if (L_InitBitmap(&hBitmap, sizeof(BITMAPHANDLE), 0, 0, 24)Handle, &hBitmap); //nRet = L_TwainAcquireExt(Application->Handle, &hBitmap, TWAIN_SHOWUI|TWAIN_NATIVEXFER, NULL, NULL);//ÀåÁø¸¸ // LEADTOOLS V.15 - by monkman (2007.05.04) nRet = L_TwainAcquire(g_hTwainSession, &hBitmap, sizeof(BITMAPHANDLE), NULL, LTWAIN_SHOW_USER_INTERFACE | LTWAIN_MODAL_USER_INTERFACE, NULL, NULL); if (nRet < SUCCESS) goto fail; if (!hBitmap.Flags.Allocated) goto fail; if (Image->uBitmap->BitsPerPixel==8) { if (L_ColorResBitmap(&hBitmap, &hBitmap, sizeof(BITMAPHANDLE), 8, CRF_OPTIMIZEDPALETTE, NULL, NULL, 250, NULL, NULL)WorkArea->Reset(true); r.left = 0; r.top = 0; r.right = Image->uBitmap->Width; r.bottom = Image->uBitmap->Height; Image->uBitmap->FillRect(r, PaletteForm->DIB256Palette->GetBGCOLORREF(8)); if (Image->LayerMask) Image->LayerMask->FillRect(r, PALETTEINDEX(255)); L_GetBitmapColors(&hBitmap, 0, 256, rgb); Image->uBitmap->PutColors(0, 256, rgb); if (hBitmap.Width>Image->uBitmap->Width) w = Image->uBitmap->Width; else w = hBitmap.Width; if (hBitmap.Height>Image->uBitmap->Height) h = Image->uBitmap->Height; else h = hBitmap.Height; if ((dcSrc = L_CreateLeadDC(&hBitmap))==NULL) { ec = EC_RESOURCE_LACK; SAVE_EXCEPTION(ec); goto fail; } // if ((dcDst = Image->uBitmap->CreateDC())==NULL) { ec = EC_RESOURCE_LACK; SAVE_EXCEPTION(ec); goto fail; } convert by celberus // BitBlt(dcDst, 0, 0, w, h, dcSrc, 0, 0, SRCCOPY); Image->uBitmap->UnionBitBlt(dcSrc, 0, 0, w, h, 0, 0, SRCCOPY, true); // convert by celberus if (Image->LayerMask) Image->LayerMask->FillRect(Rect(0, 0, w, h), 0); // Image->uBitmap->DeleteDC(dcDst); dcDst = NULL; // convert by celberus L_DeleteLeadDC(dcSrc); dcSrc = NULL; r.right = w; r.bottom = h; memset(c, 0, 256); if (!Image->uBitmap->StartScanLine()) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } for (y=0; yuBitmap->GetScanLine(y); for (x=0; xuBitmap->PutScanLine(y); } Image->uBitmap->StopScanLine(); for (x=0; x<250; x++) { MainImageForm->Palette->SetNormal(x+2, rgb[x].rgbRed, rgb[x].rgbGreen, rgb[x].rgbBlue); } MainImageForm->Palette->ToRGBQUAD(rgb, 256); Image->uBitmap->PutColors(0, 256, rgb); for (x=251; x>=1; x--) { if (c[x]==1) { MainImageForm->Palette->UseColor = x; break; } } } else { if (L_ColorResBitmap(&hBitmap, &hBitmap, sizeof(BITMAPHANDLE), 24, CRF_BYTEORDERBGR, NULL, NULL, 0, NULL, NULL)WorkArea->Reset(true); r.left = 0; r.top = 0; r.right = Image->uBitmap->Width; r.bottom = Image->uBitmap->Height; Image->uBitmap->FillRect(r, PaletteForm->DIB256Palette->GetBGCOLORREF(24)); if (Image->LayerMask) Image->LayerMask->FillRect(r, clWhite); if (hBitmap.Width>Image->uBitmap->Width) w = Image->uBitmap->Width; else w = hBitmap.Width; if (hBitmap.Height>Image->uBitmap->Height) h = Image->uBitmap->Height; else h = hBitmap.Height; if ((dcSrc = L_CreateLeadDC(&hBitmap))==NULL) { ec = EC_RESOURCE_LACK; SAVE_EXCEPTION(ec); goto fail; } // if ((dcDst = Image->uBitmap->CreateDC())==NULL) { ec = EC_RESOURCE_LACK; SAVE_EXCEPTION(ec); goto fail; } convert by celberus // BitBlt(dcDst, 0, 0, w, h, dcSrc, 0, 0, SRCCOPY); Image->uBitmap->UnionBitBlt(dcSrc, 0, 0, w, h, 0, 0, SRCCOPY, true); // convert by celberus if (Image->LayerMask) Image->LayerMask->FillRect(Rect(0, 0, w, h), 0); // Image->uBitmap->DeleteDC(dcDst); convert by celberus L_DeleteLeadDC(dcSrc); r.right = w; r.bottom = h; } MainImageForm->WorkArea->SetRectangle(r); MainImageForm->WorkAreaChange(); UpdateMenuItems(MainImageForm); // WorkAreaChange() ³»ºÎ ±¸Á¶ º¯°æÀ¸·Î Ãß°¡ - by monkman (2010.03.17) L_FreeBitmap(&hBitmap); RepaintColor(); Screen->Cursor = OldCursor; END_LOG; return; fail: Image->uBitmap->StopScanLine(); if (dcSrc) { // if (dcDst) Image->uBitmap->DeleteDC(dcDst); convert by celberus L_DeleteLeadDC(dcSrc); } L_FreeBitmap(&hBitmap); Screen->Cursor = OldCursor; if (nRet == ERROR_TWAIN_BUMMER) { MessageDlg(IDS_MESSAGE_ERRORDEVICE, mtError, TMsgDlgButtons() << mbOK, 0); END_LOG; return; } EXCEPTION_MESSAGE_OK(ec); END_LOG; /* RECT r; BITMAPHANDLE hBitmap; int nRet; RGBQUAD rgb[256]; HDC dcSrc = NULL, dcDst = NULL; Byte c[256]; int x, y, w, h; Byte *bp; TCursor OldCursor = Screen->Cursor; Screen->Cursor = crDefault; TTexpiaImage *ti = MainImageForm->iMainImage; memset(&hBitmap, 0, sizeof(BITMAPHANDLE)); try { if (L_InitBitmap(&hBitmap, sizeof(BITMAPHANDLE), 0, 0, 24)Handle, &hBitmap)Bitmap->BitsPerPixel==8) { if (L_ColorResBitmap(&hBitmap, &hBitmap, sizeof(BITMAPHANDLE), 8, CRF_OPTIMIZEDPALETTE, NULL, 250, NULL, NULL)WorkArea->Reset(true); r.left = 0; r.top = 0; r.right = ti->Bitmap->Width; r.bottom = ti->Bitmap->Height; ti->Bitmap->FillRect(r, PaletteForm->DIB256Palette->GetBGCOLORREF(8)); L_GetBitmapColors(&hBitmap, 0, 256, rgb); ti->Bitmap->PutColors(0, 256, rgb); if (hBitmap.Width>ti->Bitmap->Width) w = ti->Bitmap->Width; else w = hBitmap.Width; if (hBitmap.Height>ti->Bitmap->Height) h = ti->Bitmap->Height; else h = hBitmap.Height; if ((dcSrc = L_CreateLeadDC(&hBitmap))==NULL) throw EC_RESOURCE_LACK; if ((dcDst = ti->Bitmap->CreateDC())==NULL) throw EC_RESOURCE_LACK; BitBlt(dcDst, 0, 0, w, h, dcSrc, 0, 0, SRCCOPY); ti->Bitmap->DeleteDC(dcDst); dcDst = NULL; L_DeleteLeadDC(dcSrc); dcSrc = NULL; r.right = w; r.bottom = h; memset(c, 0, 256); if (!ti->Bitmap->StartScanLine()) throw EC_MEMORY_LACK; for (y=0; yBitmap->GetScanLine(y); for (x=0; xBitmap->PutScanLine(y); } ti->Bitmap->StopScanLine(); for (x=0; x<=249; x++) { MainImageForm->Palette->SetNormal(x+2, rgb[x].rgbRed, rgb[x].rgbGreen, rgb[x].rgbBlue); } MainImageForm->Palette->ToRGBQUAD(rgb, 256); ti->Bitmap->PutColors(0, 256, rgb); for (x=251; x>=1; x--) { if (c[x]==1) { MainImageForm->Palette->UseColor = x; break; } } MainImageForm->WorkArea->SetRectangle(r); MainImageForm->WorkAreaChange(); L_FreeBitmap(&hBitmap); } else { if (L_ColorResBitmap(&hBitmap, &hBitmap, sizeof(BITMAPHANDLE), 24, CRF_BYTEORDERBGR, NULL, 0, NULL, NULL)WorkArea->Reset(true); r.left = 0; r.top = 0; r.right = ti->Bitmap->Width; r.bottom = ti->Bitmap->Height; ti->Bitmap->FillRect(r, PaletteForm->DIB256Palette->GetBGCOLORREF(24)); if (hBitmap.Width>ti->Bitmap->Width) w = ti->Bitmap->Width; else w = hBitmap.Width; if (hBitmap.Height>ti->Bitmap->Height) h = ti->Bitmap->Height; else h = hBitmap.Height; if ((dcSrc = L_CreateLeadDC(&hBitmap))==NULL) throw EC_RESOURCE_LACK; if ((dcDst = ti->Bitmap->CreateDC())==NULL) throw EC_RESOURCE_LACK; BitBlt(dcDst, 0, 0, w, h, dcSrc, 0, 0, SRCCOPY); ti->Bitmap->DeleteDC(dcDst); L_DeleteLeadDC(dcSrc); r.right = w; r.bottom = h; MainImageForm->WorkArea->SetRectangle(r); MainImageForm->WorkAreaChange(); L_FreeBitmap(&hBitmap); } } catch (int ec) { ti->Bitmap->StopScanLine(); if (dcSrc) { if (dcDst) ti->Bitmap->DeleteDC(dcDst); L_DeleteLeadDC(dcSrc); } L_FreeBitmap(&hBitmap); EXCEPTION_MESSAGE_OK(ec); } RepaintColor(); Screen->Cursor = OldCursor; */ } //--------------------------------------------------------------------------- void __fastcall TMainForm::OnPrintSetupDlgShow(TObject *Sender) { SetWindowPos(PrinterSetupDialog->Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FPrinterSetupItemClick(TObject *Sender) { if (!PrinterAvailable()) { Application->MessageBox(IDS_MESSAGE_NO_PRINTER.c_str(), L"Warning", MB_OK); return; } PrinterSetupDialog->Execute(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FPrintingItemClick(TObject *Sender) { BEGIN_LOG(""); if (!PrinterAvailable()) { Application->MessageBox(IDS_MESSAGE_NO_PRINTER.c_str(), L"Warning", MB_OK); return; } TTPrintForm *PrintForm = NULL; TUnionBitmap *Pattern = NULL; //ColorChipµîÀ» ºÙ¿©ÁØ´Ù. int mx, my, WW, HH; //DPI //Pattern¿¡ ºÙ¿©ÁØ´Ù. by k3dogs TSize r = {1, 1}; bool FitSize; double rx, ry, DPI; int PrintPosition = 0; float WRatio = 0.0, HRatio = 0.0; TPException ec = EC_NONE; TColor GridColor; //±×¸®µå ÇÁ¸°Æ®Çϱâ À§ÇØ by k3dogs TGrid Grid; int GridMark; TColor GridMarkColor; double ColorChipZoom; try { if ((PrintForm = new TTPrintForm(this))==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } PrintForm->InitForm(); if (PrintForm->ShowModal()==mrOk) { if (Printer()->Printing) { Application->MessageBox(IDS_COMMON_PRINTSPOOLING.c_str(), L"Information", MB_OK); goto fail; } if ((Pattern = new TUnionBitmap)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } DPI = MainImageForm->CanvasInfor.DotsPerInch; FitSize = PrintForm->cbFitSize->Checked; ColorChipZoom = PrintForm->NumEdColorZoom->Value; GridColor = FullViewForm->rGridColor; Grid = FullViewForm->rGrid; GridMark = FullViewForm->rGridMark; GridMarkColor = FullViewForm->rGridMarkColor; #if defined(TEXSTYLIST) //====================== 2002.1. by lhskys ÇÁ¸°Æ®À§Ä¡ if(PrintForm->LT->Checked){ PrintPosition = 1; }else if(PrintForm->MT->Checked){ PrintPosition = 2; }else if(PrintForm->RT->Checked){ PrintPosition = 3; }else if(PrintForm->LM->Checked){ PrintPosition = 4; }else if(PrintForm->MM->Checked){ PrintPosition = 5; }else if(PrintForm->RM->Checked){ PrintPosition = 6; }else if(PrintForm->LB->Checked){ PrintPosition = 7; }else if(PrintForm->MB->Checked){ PrintPosition = 8; }else if(PrintForm->RB->Checked){ PrintPosition = 9; }else if(PrintForm->freeposition){ PrintPosition = 10; WRatio = PrintForm->ViewImage->Left * 10000 / PrintForm->Panel->Width; HRatio = PrintForm->ViewImage->Top * 10000 / PrintForm->Panel->Height; PrintForm->freeposition = false; } //====================== #endif if (FitSize) { WW = GetDeviceCaps(Printer()->Handle, HORZRES)*MainImageForm->CanvasInfor.DotsPerInch/ GetDeviceCaps(Printer()->Handle, LOGPIXELSX); HH = GetDeviceCaps(Printer()->Handle, VERTRES)*MainImageForm->CanvasInfor.DotsPerInch/ GetDeviceCaps(Printer()->Handle, LOGPIXELSY); } switch (PrintForm->PrintHeader) { case phNo: r.cx = StrToInt(PrintForm->SpinEditRepeatX->Text); r.cy = StrToInt(PrintForm->SpinEditRepeatY->Text); if (!MainImageForm->ComboHeaderNoMethod(Pattern, r, PrintForm->EditRepeat->IntValue, PrintForm->ComboBoxRepeat->ItemIndex)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if (PrintForm->GridCheck->Checked == true) // MainImageForm->PrintGrid(Pattern, r, GridColor, Grid, GridMark, GridMarkColor); //by k3dogs ±×¸®µå Ãâ·Â. //by siuaa 080408 ¿ëÁö Å©±â ¸ÂÃã optionÀÇ ¿Ã¹Ù¸¥ µ¿ÀÛÀ» À§ÇØ DPI = DPI * 100 / PrintForm->EditZoom->IntValue; if (FitSize) { rx = (double)WW / (Pattern->Width * PrintForm->EditZoom->IntValue / 100); ry = (double)HH / (Pattern->Height * PrintForm->EditZoom->IntValue / 100); if (rx < ry) { if (rx < 1.0) DPI = DPI / rx; } else { if (ry < 1.0) DPI = DPI / ry; } } break; case phYes: if (!MainImageForm->ComboHeaderYesMethod(Pattern, ColorChipZoom)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if (PrintForm->GridCheck->Checked == true) { // r.cx = 1; r.cy = 1; MainImageForm->PrintGrid(Pattern, r, GridColor, Grid, GridMark, GridMarkColor); //by k3dogs ±×¸®µå Ãâ·Â. } //by siuaa 080408 ¿ëÁö Å©±â ¸ÂÃã optionÀÇ ¿Ã¹Ù¸¥ µ¿ÀÛÀ» À§ÇØ DPI = DPI * 100 / PrintForm->EditZoom->IntValue; if (FitSize) { rx = (double)WW / (Pattern->Width * PrintForm->EditZoom->IntValue / 100); ry = (double)HH / (Pattern->Height * PrintForm->EditZoom->IntValue / 100); if (rx < ry) { if (rx < 1.0) DPI = DPI / rx; } else { if (ry < 1.0) DPI = DPI / ry; } } break; case phUsedColor: TSize colorChipArea; MainImageForm->ComboHeaderUsedColorMethod(Pattern, false, 100, colorChipArea); if (colorChipArea.cy < 0) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } break; case phMosaic: mx = PrintForm->MosaicXEdit->Value; my = PrintForm->MosaicYEdit->Value; if (!MainImageForm->ComboHeaderMosaicMethod(Pattern, mx, my)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } break; } #ifdef TRIAL //MakeWaterMarkBitmap(Pattern); #endif #if defined(TEXSTYLIST) if(PrintForm->cbFitSize->Checked==false && /*PrintForm->rgSize->ItemIndex!=0 &&*/ PrintForm->cbCurrentPage->Checked==true){ unsigned int targetPageIndex = PrintForm->UpDown1->Position; if (!SendToPrinterOnePage(Pattern, DPI, "TexStylist - "+MainImageForm->FileName, PrintForm->SpinEditPage->Value, PrintForm->cbMethod->ItemIndex, targetPageIndex, r, PrintForm->ComboBoxRepeat->ItemIndex, PrintForm->PrintHeader,PrintPosition, WRatio, HRatio, MainImageForm->Number)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } } else{ if (!SendToPrinter(Pattern, DPI, "TexStylist - "+MainImageForm->FileName, PrintForm->SpinEditPage->Value, PrintForm->cbMethod->ItemIndex, r, PrintForm->ComboBoxRepeat->ItemIndex, PrintForm->PrintHeader, PrintPosition, WRatio, HRatio, MainImageForm->Number)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } } //if (!SendToPrinter(Pattern, DPI, "TexStylist - "+MainImageForm->FileName, // PrintForm->SpinEditPage->Value, PrintForm->cbMethod->ItemIndex, PrintPosition, WRatio, HRatio, MainImageForm->Number)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } #else if (!SendToPrinter(Pattern, DPI, "TexStylist - "+MainImageForm->FileName, PrintForm->SpinEditPage->Value, PrintForm->cbMethod->ItemIndex)) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } #endif delete Pattern; Pattern=NULL; } if (PrintForm) { delete PrintForm; PrintForm=NULL; } } catch (EPrinter&) // EPrinterError { if (Pattern) {delete Pattern; Pattern=NULL;} if (PrintForm) {delete PrintForm; PrintForm=NULL;} END_LOG; return; } END_LOG; return; fail: if (Pattern) delete Pattern; Pattern=NULL; if (PrintForm) delete PrintForm; PrintForm=NULL; EXCEPTION_MESSAGE_OK(ec); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FFontItemClick(TObject *Sender) { TRegIniFile *RegIniFile; MainMenuForm->ExitForm(1); FontDialog1->Font->Assign(SmallFont); if (FontDialog1->Execute()) { SmallFont->Assign(FontDialog1->Font); TIniFile *IniFile = new TIniFile(AppDataItem + "\\status.ini"); if (IniFile) { SaveFont(IniFile, SmallFont, "Font"); delete IniFile; } SetSmallFont(StatusBar->Font); ColorLibraryForm->SetFont(); ColorChartForm->SetFont(); PenManagerForm->SetFont(); FullViewForm->SetFont(); PaletteForm->SetFont(); CombiForm->SetFont(); ResultForm->SetFont(); if(AboutBox)AboutBox->SetFont(); if(N3DMappingForm)N3DMappingForm->SetFont(); if(N3DPatternForm)N3DPatternForm->SetFont(); if(UserColorLibForm)UserColorLibForm->SetFont(); if(LayerForm)LayerForm->SetFont(); if(MainImageForm)MainImageForm->SetFont(); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::FEnvironmentItemClick(TObject *Sender) { BEGIN_LOG(""); int unit; MainMenuForm->ExitForm(1); TEnvironmentForm *Form = new TEnvironmentForm(this); Form->InitialMainMenuSelect(); Form->ShowModal(); TIniFile *IniFile = new TIniFile(AppDataItem+"\\status.ini"); if (IniFile) { unit = IniFile->ReadInteger("MainImage", "Unit", 0); if (MainImageForm) { if (unit == 0) { MainImageForm->CurrentUnit = uCm; MainImageForm->UnitChange(uCm); } else if (unit == 1) { MainImageForm->CurrentUnit = uInch; MainImageForm->UnitChange(uInch); } else { MainImageForm->CurrentUnit = uDot; MainImageForm->UnitChange(uDot); } } int UndoMaxCount = IniFile->ReadInteger("Undo", "MaxCount", 10); MainImageForm->Undo->SetMaxUndoNum(UndoMaxCount); bAutoSave = IniFile->ReadBool("AutoSave", "Check", false); if (bAutoSave) { AutosaveTimer->Interval = IniFile->ReadInteger("AutoSave", "Min", 5) * 60000; } bAutoSaveJpg = IniFile->ReadBool("AutoSave", "JPG", false); // Vector Quality, Speed Mode Ãß°¡ - by monkman (2008.03.28) nVectorMode = IniFile->ReadInteger("VectorForm", "VectorMode", 0); // 0:Quality, 1:Speed bVectorAntiAlias = IniFile->ReadBool("VectorForm", "AntiAlias", false); delete IniFile; } delete Form; if (MainImageForm) MainImageForm->ApplyEnvironment(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FExitItemClick(TObject *Sender) { Close(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::ECutItemClick(TObject *Sender) { BEGIN_LOG(""); if (VectorForm && !MainMenuForm->UseEditFunction) VecDraw->InitCopy(true); else MainImageForm->EditCut(); END_LOG; } //--------------------------------------------------------------------------- /// Ctrl + C ó¸® ÇÔ¼ö /** Vector»ç¿ëÁßÀÏ °æ¿ì¿¡´Â Vector Object°¡ ¼±ÅõǾî ÀÖ´Â °æ¿ì¿¡ Copy/Paste°¡ 󸮵ȴÙ. Vector TextBox°¡ »ç¿ëÁßÀÏ °æ¿ì¿¡´Â TextÀÇ ÀϺθ¦ ¼±ÅÃÇÏ¿© Copy/PasteÇϱ⠶§¹®¿¡ InitCopy°¡ ¾Æ´Ñ MainImageForm->EditCopy()ÇÔ¼ö¿¡¼­ ó¸®ÇÑ´Ù. ÇöÀç Vector TextLineÀº 󸮵ÇÁö ¾Ê°í ÀÖ´Ù. ÃßÈÄ Æ÷ÇԵǾî¾ß ÇÏ¸ç ±âŸ Vector ±â´ÉÀÌ Ãß°¡µÉ¶§ ÁÖÀÇ ÇØ¼­ ó¸®ÇØ¾ß ÇÑ´Ù. by david 090206 */ void __fastcall TMainForm::ECopyItemClick(TObject *Sender) { BEGIN_LOG(""); if (VectorForm && !MainMenuForm->UseEditFunction) VecDraw->InitCopy(false); else MainImageForm->EditCopy(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::EPasteItemClick(TObject *Sender) { BEGIN_LOG(""); if (VectorForm && !MainMenuForm->UseEditFunction) VecDraw->InitPaste(); else MainImageForm->EditPaste(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::COverwriteItemClick(TObject *Sender) { BEGIN_LOG(""); TCaptureData *cd = NULL; for (int i = 0; i < CaptureData->Count; i++) { cd = (TCaptureData *)CaptureData->Items[i]; if (cd->IsWorkArea == false) { // À̹ÌÁö ĸÃÄµÈ °Í¸¸ (ÀÛ¾÷±¸¿ªÀÌ ¾Æ´Ñ °æ¿ì) - by monkman (2010.10.04) CaptureData->Remove(cd); delete cd; break; } } CaptureData->Insert(0, MainImageForm->MakeCapture(false)); UpdateMenuItems(NULL); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::CInsertItemClick(TObject *Sender) { BEGIN_LOG(""); TCaptureData *cd = NULL; // ÀÛ¾÷±¸¿ªÀ¸·Î ÀâÀº ĸÃÄ À̹ÌÁö´Â Ç×»ó ÃÖ»óÀ§¿¡ ÀÖµµ·Ï ÇÔ - by monkman (2010.10.04) if (CaptureData->Count > 0) { cd = (TCaptureData *)CaptureData->First(); if (cd->IsWorkArea == true) { CaptureData->Insert(1, MainImageForm->MakeCapture(false)); // ĸÃÄµÈ À̹ÌÁö Áß Ã¹¹øÂ° À̹ÌÁö°¡ ÀÛ¾÷±¸¿ªÀÏ °æ¿ì } else { CaptureData->Insert(0, MainImageForm->MakeCapture(false)); } } else { CaptureData->Insert(0, MainImageForm->MakeCapture(false)); // ±âÁ¸ ĸÃÄµÈ À̹ÌÁö°¡ ¾øÀ» °æ¿ì } UpdateMenuItems(NULL); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::CDeleteAllItemClick(TObject *Sender) { BEGIN_LOG(""); TCaptureData *cd = NULL; PostMessage(MainMenuForm->Handle, TPM_EXITFUNCTION, 0, 0); // À̹ÌÁö ĸÃÄ->¸ðµÎ »èÁ¦ ÀÌÈÄ ÆÐÅÏ Ã¤¿ì±â Æû ´ÝÈ÷°Ô by tmddn85 for (int i = 0; i < CaptureData->Count; i++) { cd = (TCaptureData *)CaptureData->Items[i]; if (cd->IsWorkArea == false) { // À̹ÌÁö ĸÃÄµÈ °Í¸¸ (ÀÛ¾÷±¸¿ªÀÌ ¾Æ´Ñ °æ¿ì) - by monkman (2010.10.04) CaptureData->Remove(cd); delete cd; } } UpdateMenuItems(NULL); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::CEditItemClick(TObject *Sender) { TCaptureEditForm *Form = new TCaptureEditForm(this); Form->InitForm(); Form->ShowModal(); delete Form; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IIntensityDetectItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) INTENSITYDETECTDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(INTENSITYDETECTDLGPARAMS)); DlgParams.uStructSize = sizeof(INTENSITYDETECTDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uChannel = IDB_CHANNEL_MASTER; DlgParams.uLow = 0; DlgParams.uHigh = 255; DlgParams.uDlgFlags = DLG_INTENSITYDETECT_SHOW_PREVIEW | DLG_INTENSITYDETECT_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); //if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgIntensityDetect(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { // LEADTOOLS V.15 Dialog ¹®Á¦ - by monkman (2007.06.28) nRet = L_IntensityDetectBitmap(DlgParams.pBitmap, DlgParams.uLow, DlgParams.uHigh, DlgParams.crInColor, DlgParams.crOutColor, DlgParams.uChannel); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftIntensityDetect, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_IntensityDetectBitmap(DlgParams.pBitmap, DlgParams.uLow, DlgParams.uHigh, DlgParams.crInColor, DlgParams.crOutColor, DlgParams.uChannel); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISolarizeItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) SOLARIZEDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(SOLARIZEDLGPARAMS)); DlgParams.uStructSize = sizeof(SOLARIZEDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uDlgFlags = DLG_SOLARIZE_SHOW_PREVIEW | DLG_SOLARIZE_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgSolarize(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SolarizeBitmap(DlgParams.pBitmap, DlgParams.nThreshold); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftSolarize, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SolarizeBitmap(DlgParams.pBitmap, DlgParams.nThreshold); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEPosterizeItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) POSTERIZEDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(POSTERIZEDLGPARAMS)); DlgParams.uStructSize = sizeof(POSTERIZEDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.nLevels = 2; DlgParams.uDlgFlags = DLG_POSTERIZE_SHOW_PREVIEW | DLG_POSTERIZE_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgPosterize(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_PosterizeBitmap(DlgParams.pBitmap, DlgParams.nLevels); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftPosterize, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_PosterizeBitmap(DlgParams.pBitmap, DlgParams.nLevels); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEMosaicItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) MOSAICDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(MOSAICDLGPARAMS)); DlgParams.uStructSize = sizeof(MOSAICDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uDim = 2; DlgParams.uDlgFlags = DLG_MOSAIC_SHOW_PREVIEW | DLG_MOSAIC_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgMosaic(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_MosaicBitmap(DlgParams.pBitmap, DlgParams.uDim); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftMosaic, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_MosaicBitmap(DlgParams.pBitmap, DlgParams.uDim); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEAverageItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) AVERAGEDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(AVERAGEDLGPARAMS)); DlgParams.uStructSize = sizeof(AVERAGEDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uDim = 3; DlgParams.uDlgFlags = DLG_AVERAGE_SHOW_PREVIEW | DLG_AVERAGE_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgAverage(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_AverageFilterBitmap(DlgParams.pBitmap, DlgParams.uDim); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftAverage, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_AverageFilterBitmap(DlgParams.pBitmap, DlgParams.uDim); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEMedianItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) MEDIANDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(MEDIANDLGPARAMS)); DlgParams.uStructSize = sizeof(MEDIANDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uDim = 3; DlgParams.uDlgFlags = DLG_MEDIAN_SHOW_PREVIEW | DLG_MEDIAN_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgMedian(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_MedianFilterBitmap(DlgParams.pBitmap, DlgParams.uDim); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftMedian, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_MedianFilterBitmap(DlgParams.pBitmap, DlgParams.uDim); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IESharpenItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) SHARPENDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(SHARPENDLGPARAMS)); DlgParams.uStructSize = sizeof(SHARPENDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uDlgFlags = DLG_SHARPEN_SHOW_PREVIEW | DLG_SHARPEN_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgSharpen(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SharpenBitmap(DlgParams.pBitmap, DlgParams.nSharpness); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftSharpen, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SharpenBitmap(DlgParams.pBitmap, DlgParams.nSharpness); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEAddNoiseItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) ADDNOISEDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(ADDNOISEDLGPARAMS)); DlgParams.uStructSize = sizeof(ADDNOISEDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uChannel = CHANNEL_MASTER; DlgParams.uRange = 0; DlgParams.uDlgFlags = DLG_ADDNOISE_SHOW_PREVIEW | DLG_ADDNOISE_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgAddNoise(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_AddBitmapNoise(DlgParams.pBitmap, DlgParams.uRange, DlgParams.uChannel); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftAddNoise, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_AddBitmapNoise(DlgParams.pBitmap, DlgParams.uRange, DlgParams.uChannel); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEEmbossItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) EMBOSSDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(EMBOSSDLGPARAMS)); DlgParams.uStructSize = sizeof(EMBOSSDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.uDepth = 50; DlgParams.uDirection = EMBOSS_S; DlgParams.uDlgFlags = DLG_EMBOSS_SHOW_PREVIEW | DLG_EMBOSS_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgEmboss(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_EmbossBitmap(DlgParams.pBitmap, DlgParams.uDirection, DlgParams.uDepth); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftEmboss, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_EmbossBitmap(DlgParams.pBitmap, DlgParams.uDirection, DlgParams.uDepth); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEEdgeEnhanceItemClick(TObject *Sender) { BEGIN_LOG(""); BITMAPHANDLE WrkBitmap; RECT r; if(MainImageForm->WorkArea->Mask){ r = MainImageForm->WorkArea->Range; }else{ r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } TTexpiaBitmap *tempBitmap = new TTexpiaBitmap; // convert by celberus TUnionBitmap *theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus BITMAPHANDLE *bh = tempBitmap->Handle; // convert by celberus L_INT nRet; TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; nRet = L_CopyBitmap(&WrkBitmap, bh, sizeof(BITMAPHANDLE)); if (nRet==SUCCESS) { nRet = L_SpatialFilterBitmap(&WrkBitmap, FLT_LAPLACE_1); if (nRet==SUCCESS) { MainImageForm->UndoSave(UK_PATTERN); nRet = L_CombineBitmap(bh, 0, 0, BITMAPWIDTH(bh), BITMAPHEIGHT(bh), &WrkBitmap, 0, 0, CB_OP_ADD); } L_FreeBitmap(&WrkBitmap); } Screen->Cursor = cur; // MainImageForm->iMainImage->uBitmap->CopyFromRect(tempBitmap, 0, 0, SRCCOPY); // convert by celberus MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top , tempBitmap, 0, 0, SRCCOPY); //by linuxjun MainImageForm->iMainImage->Repaint(); // convert by celberus delete tempBitmap; // convert by celberus END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISGradientItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) GRADIENTFILTERDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(GRADIENTFILTERDLGPARAMS)); DlgParams.uStructSize = sizeof(GRADIENTFILTERDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.pFilter = FLT_GRADIENT_NE; DlgParams.uDlgFlags = DLG_GRADIENTFILTER_SHOW_PREVIEW | DLG_GRADIENTFILTER_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgGradientFilter(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftGradient, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISLaplacianItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) LAPLACIANFILTERDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(LAPLACIANFILTERDLGPARAMS)); DlgParams.uStructSize = sizeof(LAPLACIANFILTERDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.pFilter = FLT_LAPLACE_3; DlgParams.uDlgFlags = DLG_LAPLACIANFILTER_SHOW_PREVIEW | DLG_LAPLACIANFILTER_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgLaplacianFilter(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftLaplacian, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISSobelItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) SOBELFILTERDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(SOBELFILTERDLGPARAMS)); DlgParams.uStructSize = sizeof(SOBELFILTERDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.pFilter = FLT_SOBEL_HORZ; DlgParams.uDlgFlags = DLG_SOBELFILTER_SHOW_PREVIEW | DLG_SOBELFILTER_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgSobelFilter(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftSobel, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISPrewittItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) PREWITTFILTERDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(PREWITTFILTERDLGPARAMS)); DlgParams.uStructSize = sizeof(PREWITTFILTERDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.pFilter = FLT_PREWITT_HORZ; DlgParams.uDlgFlags = DLG_PREWITTFILTER_SHOW_PREVIEW | DLG_PREWITTFILTER_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgPrewittFilter(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftPrewitt, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISShiftandDifferenceItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) SHIFTDIFFERENCEFILTERDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(SHIFTDIFFERENCEFILTERDLGPARAMS)); DlgParams.uStructSize = sizeof(SHIFTDIFFERENCEFILTERDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.pFilter = FLT_SHIFTDIFF_HORZ; DlgParams.uDlgFlags = DLG_SHIFTDIFFERENCEFILTER_SHOW_PREVIEW | DLG_SHIFTDIFFERENCEFILTER_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgShiftDifferenceFilter(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftShiftDifference, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISLineSegmentItemClick(TObject *Sender) { BEGIN_LOG(""); L_INT nRet; // LEADTOOLS V.15 - by monkman (2007.05.04) LINESEGMENTFILTERDLGPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(LINESEGMENTFILTERDLGPARAMS)); DlgParams.uStructSize = sizeof(LINESEGMENTFILTERDLGPARAMS); DlgParams.pBitmap = bh; DlgParams.pFilter = FLT_LINESEG_LTOR; DlgParams.uDlgFlags = DLG_LINESEGMENTFILTER_SHOW_PREVIEW | DLG_LINESEGMENTFILTER_SHOW_TOOL_ZOOMLEVEL; // LEADTOOLS V.15ÀÇ Dialog ¹®Á¦·Î ÄÄÆÄÀÏµÈ ÇÁ·Î±×·¥ÀÌ 64bit Vista¿¡¼­ µ¹¾Æ°¡Áö ¾Ê´Â´Ù. // ³ªÁß¿¡ ÀÌ ¹®Á¦°¡ ÇØ°áµÇ¸é "LEADTOOLS V.15 Dialog ¹®Á¦" ºÎºÐÀÇ ÁÖ¼®À» Ç®°í // TFilterFormÀ» »ç¿ëÇÑ ºÎºÐÀÇ Äڵ带 »èÁ¦ÇØÁØ´Ù. - by monkman (2007.06.28) /* nRet = L_DlgInit(DLG_INIT_COLOR); if (nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) goto fail; // Error Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; nRet = L_DlgLineSegmentFilter(Handle, &DlgParams); if (nRet == SUCCESS_DLG_OK) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } nRet = L_DlgFree(); */ //--> TFilterFormÀ¸·Î ´ëü ½ÃÀÛ Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftLineSegment, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_SpatialFilterBitmap(DlgParams.pBitmap, DlgParams.pFilter); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; //nRet = L_DlgFree(); // LEADTOOLS V.15 Dialog ¹®Á¦·Î ÁÖ¼®Ã³¸® if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEOilifyItemClick(TObject *Sender) { // L_INT nChange = 3; // L_UINT32 uProcess; // // BITMAPHANDLE *bh = MainImageForm->iMainImage->uBitmap->Handle; // HINSTANCE hLibrary = LoadLibrary("ltdlg13n.dll"); // if (hLibrary) { // TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); // if (DlgGetChange(Handle, bh, &nChange, &uProcess, // DLG_IMG_SHOWPREVIEW | DLG_IMG_OILIFY, NULL)==SUCCESS) { // TCursor cur = Screen->Cursor; // Screen->Cursor = crHourGlass; // if (nChange) { // MainImageForm->Undo->Save(UK_PATTERN); // L_OilifyBitmap(bh, nChange); // MainImageForm->iMainImage->Repaint(); // } // Screen->Cursor = cur; // } // FreeLibrary(hLibrary); // } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEUnderlayItemClick(TObject *Sender) { // } //--------------------------------------------------------------------------- void __fastcall TMainForm::GrayScaleItemClick(TObject *Sender) { BEGIN_LOG(""); // GrayScale Filter Ãß°¡ - by monkman(2007.08.17) L_INT nRet; GRAYSCALEPARAMS DlgParams; TCursor cur = Screen->Cursor; RECT r; TTexpiaBitmap *tempBitmap = NULL; TUnionBitmap *theBitmap = NULL; BITMAPHANDLE *bh = NULL; if (MainImageForm->WorkArea->Mask) { r = MainImageForm->WorkArea->Range; } else { r.left = 0; r.top = 0; r.right = MainImageForm->iMainImage->uBitmap->Width; r.bottom = MainImageForm->iMainImage->uBitmap->Height; } tempBitmap = new TTexpiaBitmap; // convert by celberus theBitmap = MainImageForm->iMainImage->uBitmap; // convert by celberus tempBitmap->Create(r.right-r.left, r.bottom - r.top, theBitmap->BitsPerPixel, theBitmap->RGB); // convert by celberus MainImageForm->iMainImage->uBitmap->CopyToTexpia(tempBitmap, 0, 0, theBitmap->Width, theBitmap->Height, r.left, r.top, SRCCOPY); // convert by celberus bh = tempBitmap->Handle; // convert by celberus memset(&DlgParams, 0, sizeof(GRAYSCALEPARAMS)); DlgParams.nRed = 333; DlgParams.nGreen = 333; DlgParams.nBlue = 334; DlgParams.pBitmap = bh; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); Screen->Cursor = cur; FilterForm = new TFilterForm(this); FilterForm->InitForm(ftGrayScale, &DlgParams); if (FilterForm->ShowModal() == mrOk) { nRet = L_GrayScaleBitmapExt(DlgParams.pBitmap, DlgParams.nRed, DlgParams.nGreen, DlgParams.nBlue); if (nRet == SUCCESS) { Screen->Cursor = crHourGlass; MainImageForm->iMainImage->uBitmap->Copy(r.left, r.top, r.right-r.left, r.bottom-r.top, tempBitmap, 0, 0, SRCCOPY); MainImageForm->iMainImage->Repaint(); // convert by celberus Screen->Cursor = cur; } } if (FilterForm) { delete FilterForm; FilterForm = NULL; } //<-- TFilterFormÀ¸·Î ´ëü ³¡ - by monkman (2007.06.28) if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; return; fail: Screen->Cursor = cur; if (tempBitmap) { delete tempBitmap; tempBitmap = NULL; } END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::VPenItemClick(TObject *Sender) { if (VPenItem->Checked) { VPenItem->Checked = false; PenManagerForm->Visible = false; } else { VPenItem->Checked = true; PenManagerForm->Visible = true; } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VFullViewItemClick(TObject *Sender) { if (VFullViewItem->Checked) { VFullViewItem->Checked = false; FullViewForm->Visible = false; } else { VFullViewItem->Checked = true; FullViewForm->Visible = true;; FullViewForm->InitForm(MainImageForm->iMainImage); } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VPaletteItemClick(TObject *Sender) { if (VPaletteItem->Checked) { VPaletteItem->Checked = false; PaletteForm->Visible = false; } else { VPaletteItem->Checked = true; PaletteForm->Visible = true; PaletteForm->InitForm(MainImageForm->Palette); } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VMainMenuItemClick(TObject *Sender) { MainMenuForm->ExitForm(1); if (VMainMenuItem->Checked) { VMainMenuItem->Checked = false; MainMenuForm->Visible = false; } else { VMainMenuItem->Checked = true; MainMenuForm->Visible = true; } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VLayerItemClick(TObject *Sender) { if (VLayerItem->Checked) { VLayerItem->Checked = false; LayerForm->Visible = false; } else { MainMenuForm->ExitForm(); VLayerItem->Checked = true; LayerForm->Show(); LayerForm->InitForm(); } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VStatusBarItemClick(TObject *Sender) { if (VStatusBarItem->Checked) { VStatusBarItem->Checked = false; StatusBar->Visible = false; } else { VStatusBarItem->Checked = true; StatusBar->Visible = true; } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VToolsRearrangeItemClick(TObject *Sender) { ToolsRearrange(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::WCascadeItemClick(TObject *Sender) { int i; //---- Must be done backwards through the MDIChildren array ---- added by k3dogs(20001114) for (i=0; MDIChildCount-1 >= i; i++) if (MDIChildren[i]->WindowState == wsMinimized) MDIChildren[i]->WindowState = wsNormal; Cascade(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::WTileItemClick(TObject *Sender) { int i; //---- Must be done backwards through the MDIChildren array ---- for (i=0; MDIChildCount-1 >= i; i++) if (MDIChildren[i]->WindowState == wsMinimized) MDIChildren[i]->WindowState = wsNormal; Tile(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::WArrangeItemClick(TObject *Sender) { ArrangeIcons(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::WMinimizeItemClick(TObject *Sender) { int i; //---- Must be done backwards through the MDIChildren array ---- for (i=MDIChildCount-1; i >= 0; i--) MDIChildren[i]->WindowState = wsMinimized; } //--------------------------------------------------------------------------- void __fastcall TMainForm::HAboutItemClick(TObject *Sender) { AboutBox = new TAboutBox(this); AboutBox->ShowModal(); delete AboutBox; AboutBox=NULL; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormActivate(TObject *Sender) { TestPanel->Left = MainForm->ClientWidth - TestPanel->Width - 3; TestPanel->Top = MainForm->ClientHeight - TestPanel->Height - StatusBar->Height - 3; #ifdef TEST TestTimer->Enabled = true; TestPanel->Visible = true; #endif TMainImageForm *Child = NULL; TPCanvasInfor p; TPException ec = EC_NONE; String FileName, DirName; int TextileDPI; if (bFirst==1) { //======================================== //parameter·Î ÆÄÀÏ ¿­±â¸¦ ±âŸ È®ÀåÀÚ±îÁö Ãß°¡ÇÔ //ÀÌ·£µå ¿ä±¸»çÇ×À¸·Î Å×½ºÆ® ÈÄ Ãß°¡ by david 2011.01.12 if (ParamStr(1) != "") { int bpp = 0; TGraphicFileFormat ExtIndex; FILEINFO FileInfo; #ifdef SK_SMART String FileExt; if (ParamStr(1).SubString(1, 7).LowerCase() == "http://") { String *param = new String[ParamCount()]; for (int i=1, j=0; i<=ParamCount(); i++, j++) param[j]=ParamStr(i); if (!RunWebDownLoadFile(param, ParamCount())) return; delete[] param; } else { DirName = ExcludeTrailingBackslash(ExtractFilePath(ParamStr(1))); FileName = ExtractFileName(ParamStr(1)); FileExt = ExtractFileExt(ParamStr(1)); if (FileExt.LowerCase() == ".tex") { OpenFile(DirName, FileName, gffTEX, 8); //<-- (DirName, DirName + "\\" + FileName, gffTEX, 8) } else if (FileExt.LowerCase() == ".tfc") { OpenFile(DirName, FileName, gffTFC, 24); //<-- (DirName, DirName + "\\" + FileName, gffTEX, 8) } } #else // HJ ERP ¿¬µ¿°ü·Ã ÄÚµå ÀÛ¼º texstylist.exe hj task_parameter filepath ÇüÅ·Π¿Ã°Í if (ParamStr(1) == "hj") { String task_parameter = ParamStr(2); String filePath = ParamStr(3); erpAPI = new HJerpAPI(task_parameter, HJIdHTTP); DirName = String(ExtractFileDir(filePath)); FileName = String(ExtractFileName(filePath)); ExtIndex = FindExtension(ExtractFileExt(filePath)); // Seq ÇÁ·Î±×·¥ ¿Àǽà ERP --> Texstyist ·Î Àü´ÞÇÑ Parameter °ª Àü¼Û erpAPI->Action(HJerpAPI::ActionI); } else { DirName = String(ExtractFileDir(ParamStr(1))); FileName = String(ExtractFileName(ParamStr(1))); ExtIndex = FindExtension(ExtractFileExt(ParamStr(1))); } // BitsPerPixel °áÁ¤ switch (ExtIndex) { // 8bit case gffTEX: case gffWEA: case gffWAV: case gffKNT: bpp = 8; break; #ifndef N_3D case gffT3D: bpp = 24; break; #endif case gffTFC: bpp = 24; break; case gffVST: case gffDXF: bpp = 24; break; #ifdef TRIAL case gffTEX_TRIAL: bpp = 8; break; case gffTFC_TRIAL: case gffT3D_TRIAL: bpp = 24; break; #endif case gffNON: break; default: L_FileInfo(ParamStr(1).c_str(), &FileInfo, sizeof(FILEINFO), 0, NULL); bpp = FileInfo.BitsPerPixel; break; } if (bpp > 0) OpenFile(DirName, FileName, ExtIndex, bpp); #endif } else { if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } p.Orientation = coPortrait; //================================ //2001.4.10. by lhskys congi¿¡¼­ Á¾ÀÌ size ³Ö±â TIniFile *IniFile = new TIniFile(AppDataItem+"\\status.ini"); int cst; if(Size_Type == "cstA4"){p.SetSize(cstA4); cst = 0; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstA3"){p.SetSize(cstA3); cst = 1; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstA2"){p.SetSize(cstA2); cst = 2; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstA1"){p.SetSize(cstA1); cst = 3; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstA0"){p.SetSize(cstA0); cst = 4; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstLetter"){p.SetSize(cstLetter); cst = 6; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstLegal"){p.SetSize(cstLegal); cst = 7; IniFile->WriteInteger("MainImage","Size",cst); }else if(Size_Type == "cstTabloid"){p.SetSize(cstTabloid); cst = 8; IniFile->WriteInteger("MainImage","Size",cst); } //====================================== //2001.4.10. by lhskys ±îÁö TextileDPI = IniFile->ReadInteger("CanvasInfor", "DPI", 160); p.DotsPerInch = TextileDPI; // p.SetSize(cstA4); if (IniFile) delete IniFile; if ((ec = Child->InitForm(p, 24))!=EC_NONE) goto fail; } //======================================== bFirst = 2; ToolsRearrange(); } return; fail: if (Child) delete Child; EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormCloseQuery(TObject *Sender, bool &CanClose) { TSearchRec sr; int iAttributes; String strDirName; DWORD dwNetworkFlag; String strErrorReport; TIniFile *IniFile = NULL; // HJ È£Àü½Ç¾÷ ERP ¿¬µ¿¸ðµå·Î Ų°æ¿ì + ÀÛ¾÷ Á¾·á - seungmin if (erpAPI) { // TODO saving Çϰí Á¾·áÇÏ´Â °ÍÀÎÁö, svaing ¾ÈÇϰí Á¾·áÇÏ´Â °ÍÀÎÁö ¾Ë¾Æº¼ Çʿ䰡 ÀÖ´Ù. erpAPI->Action(HJerpAPI::ActionS); // ÀúÀåÇϰí Á¾·áÇÏ´Â °ÍÀ¸·Î º¸³Ù´Ù. delete erpAPI; // erp API ¸Þ¸ð¸® ÇÒ´çÀ» ÇØÁ¦ÇÑ´Ù. } if (TexWork){ #ifndef TRIAL if (TexWork->Modify ){ String msg; if(TexWork->OpenDialog1->FileName != String(""))msg = TexWork->OpenDialog1->FileName; else msg = String("Noname.fst"); int Btn = MessageDlg(IDS_MESSAGE_SAVECHANGE + " " + msg, mtWarning, TMsgDlgButtons()<tbSaveClick(this); } TexWork->Modify = false; } #endif bool val=true; TexWork->FormCloseQuery(this, val); } #ifndef LOCK_USB if (MotiveLibForm) MotiveLibForm->DefaultSave();//gabriel if (WindowLibForm) WindowLibForm->DefaultSave();//gabriel #endif #ifndef TRIAL if (MotiveLibForm) MotiveLibForm->DefaultSave();//gabriel if (WindowLibForm) WindowLibForm->DefaultSave();//gabriel #endif #ifdef EXCEPTION_REPORT // ¿À·ù º¸°í ±â´É »ç¿ë üũ - by monkman (2009.02.17) IniFile = new TIniFile(AppDataBin + "\\Configuration.ini"); if (IniFile) { strErrorReport = IniFile->ReadString("Common", "ErrorReport", "true"); if (strErrorReport.LowerCase() == "true") { // Exception Log File ó¸® - by monkman (2008.12.12) strDirName = AppDataBin + "\\Exception"; if (DirectoryExists(strDirName)) { iAttributes = faReadOnly | faHidden | faSysFile | faVolumeID | faDirectory | faArchive | faAnyFile; if (FindFirst(strDirName+"\\*.log", iAttributes, sr) == 0) { // *.log ÆÄÀÏÀÌ Çϳª¶óµµ ÀÖ´ÂÁö °Ë»ö - by monkman (2008.12.12) if (sr.Name.IsEmpty() == false) { dwNetworkFlag = NETWORK_ALIVE_LAN | NETWORK_ALIVE_WAN | NETWORK_ALIVE_AOL; if (IsNetworkAlive(&dwNetworkFlag)) { // ³×Æ®¿öÅ© ¿¬°á À¯¹« - by monkman (2008.12.15) ExceptionReportForm = new TExceptionReportForm(this); if (ExceptionReportForm) { ExceptionReportForm->ShowModal(); delete ExceptionReportForm; ExceptionReportForm = NULL; } } } FindClose(sr); } } } delete IniFile; } IniFile = NULL; #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteTempUndoFile(){ BEGIN_LOG(""); //Char tp[MAX_PATH+1], fn[MAX_PATH+1]; Char tp[MAX_PATH+1]; GetTempPath(MAX_PATH, tp); HANDLE hSrch = NULL; // WIN32_FIND_DATA wfdFor_Directory; WIN32_FIND_DATA wfd; String tempPath=tp; String tempDir; String newPath; String fname; String FindingCondition; Char *tempString; BOOL FindResult=TRUE; ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA)); // ÃʱâÈ­ - by monkman (2009.05.12) tempDir = ExtractFileDir(tempPath); FindingCondition=tempDir+"\\*.undo"; if ((hSrch=FindFirstFile(FindingCondition.c_str(),&wfd)) != INVALID_HANDLE_VALUE) { // ÇÚµé üũ - by monkman (2009.05.12) do { fname=tempDir+"\\"+wfd.cFileName; if (FileExists(fname)) { DeleteFile(fname.c_str()); } FindResult = FindNextFile(hSrch,&wfd); } while (FindResult); } FindClose(hSrch); END_LOG; return; } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteTUBFile(){ BEGIN_LOG(""); //Char tp[MAX_PATH+1], fn[MAX_PATH+1]; Char tp[MAX_PATH+1]; GetTempPath(MAX_PATH, tp); HANDLE hSrch = NULL; // WIN32_FIND_DATA wfdFor_Directory; WIN32_FIND_DATA wfd; String tempPath=tp; String tempDir; String newPath; String fname; String FindingCondition; Char *tempString; BOOL FindResult=TRUE; ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA)); // ÃʱâÈ­ - by monkman (2009.05.12) tempDir = ExtractFileDir(tempPath); FindingCondition=tempDir+"\\*.tub"; if ((hSrch=FindFirstFile(FindingCondition.c_str(),&wfd)) != INVALID_HANDLE_VALUE) { // ÇÚµé üũ - by monkman (2009.05.12) do { fname = tempDir+"\\"+wfd.cFileName; if (FileExists(fname)) { DeleteFile(fname.c_str()); } FindResult = FindNextFile(hSrch,&wfd); } while (FindResult); } FindClose(hSrch); END_LOG; return; } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteTBKFile(){ BEGIN_LOG(""); //Char tp[MAX_PATH+1], fn[MAX_PATH+1]; Char tp[MAX_PATH+1]; GetTempPath(MAX_PATH, tp); HANDLE hSrch = NULL; // WIN32_FIND_DATA wfdFor_Directory; WIN32_FIND_DATAW wfd; /* String tempPath=tp; String backupDir; String newPath; String fname; String FindingCondition; */ String backupDir; String fname; String FindingCondition; //Char *tempString; BOOL FindResult=TRUE; ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA)); // ÃʱâÈ­ - by monkman (2009.05.12) backupDir = String(DefaultDir + "\\Backup"); // tempDir = ExtractFileDir(tempPath); FindingCondition= backupDir + String("\\*.bak"); if ((hSrch=FindFirstFile(FindingCondition.c_str(),&wfd)) != INVALID_HANDLE_VALUE) { // ÇÚµé üũ - by monkman (2009.05.12) do { fname= backupDir + String("\\") + String(wfd.cFileName); // if (WideFileExists(fname) && isTimeExpired(fname)) { if (FileExists(fname) && isTimeExpired(fname)) { DeleteFile(fname.c_str()); } FindResult = FindNextFile(hSrch,&wfd); } while (FindResult); } FindClose(hSrch); END_LOG; return; } //--------------------------------------------------------------------------- #ifdef EXCEPTION_REPORT void __fastcall TMainForm::AppException(System::TObject *Sender, Sysutils::Exception *E) { // Exception ó¸® - by monkman (2009.09.02) // Âü°íÀÚ·á //http://www.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_tip&no=885 //http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_tip&no=888 HANDLE hFile = NULL; DWORD dwWrite; BYTE Value; BYTE cKey = 0, cShiftKey = 0; Char *pData = NULL; int nDataCount = 0; Char strText[MAX_PATH]; SYSTEMTIME stUTC, stLocal; String strProgram, strMsg; bool bFirst = false; // Canvas Information TMainImageForm *mifForm = NULL; Char pCanvasName[MAX_PATH]; // OS Information OSVERSIONINFOEX osviOSInfo; // System Information SYSTEM_INFO siSystemInfo; // Memory Information MEMORYSTATUSEX mem_stateex; // ½Ã½ºÅÛ ¸Þ¸ð¸® PROCESS_MEMORY_COUNTERS pmc; // ÇöÀç ÇÁ·Î¼¼½ºÀÇ ¸Þ¸ð¸® »ç¿ë·®À» üũÇÏ´Â ±¸Á¶Ã¼ // HDD Information DWORD dwDrives; String strDrv; int nDiskSize = 0, nDiskFree = 0; // Monitor Information HDC hDC = NULL; int nMonitorHorz, nMonitorVert, nMonitorColors; // Printer Information Char pPrinter[1025] = L""; // Process Information HANDLE hSnapShot = NULL, hProcess = NULL; PROCESSENTRY32 peProc; Char cProcContinueFlag; int nProcRamUsage; String strExceptionDirName, strExceptionFileName; bool bOldModify; String strVerInfo[10] = {"CompanyName", "FileDescription", "FileVersion" , "InternalName", "LegalCopyright", "LegalTradeMarks", "OriginalFileName" , "ProductName", "ProductVersion", "Comments"}; String strTemp; Char *pBuf = NULL; LPVOID pValue = NULL; DWORD dwFileVersionInfoSize; unsigned int nLen; WORD *dwID = NULL; int nAddress = 0; String strObj = "", strAddress = ""; // Exception Áß¿¡¼­ ¿¹¿Ü°¡ µÇ´Â ExceptionÀº °É·¯³½´Ù EConvertError *ecConvert = NULL; EInvalidCast *ecInvalidCast = NULL; EDBEditError *ecEDBEditError = NULL; EPrinter *ecEPrinter = NULL; Char cUnicodeFile = 0xFEFF; ecConvert = dynamic_cast(E); ecInvalidCast = dynamic_cast(E); ecEDBEditError = dynamic_cast(E); ecEPrinter = dynamic_cast(E); // EConvertError¿Í EInvalidCast ¿¡·¯´Â ¹«½ÃÇÑ´Ù (¿¡·¯¸Þ½ÃÁö´Â Ãâ·ÂÇϱâ À§ÇØ fail·Î..) - by monkman (2009,10.08) if (ecConvert || ecInvalidCast || ecEDBEditError || ecEPrinter) goto fail; pData = new Char[0x100000]; // 0x100000 = 1024 * 1024 (´õ ÇÊ¿äÇÒ °æ¿ì º¯°æ) if (pData == NULL) goto fail; GetSystemTime(&stUTC); SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal); memset(strText, 0, sizeof(Char)*MAX_PATH); // Exception ÄÁÆ®·Ñ/ÄÄÆ÷³ÍÆ® Á¶»ç if (Sender) { if (Sender->InheritsFrom(__classid(TControl))) { TControl *ctrl= (TControl *)Sender; while (ctrl) { strObj = ctrl->Name+ "->" + strObj; ctrl = ctrl->Parent; } strObj = "[Control]" + strObj; } if (Sender->InheritsFrom(__classid(TComponent))) { TComponent *Comp= (TComponent *)Sender; strObj = Comp->Name; if (Comp->Owner) { strObj = Comp->Owner->Name + "->" + strObj; } strObj = "[Component]"; } } // ExceptionÀÌ ¹ß»ýÇÑ ÆÄÀÏ ÀúÀå!! strExceptionDirName = AppDataBin + "\\Exception"; if (!DirectoryExists(strExceptionDirName)) CreateDir(strExceptionDirName); if (MainImageForm) { strExceptionFileName = MainImageForm->FileName + ".log"; } else { strExceptionFileName = "NotMainForm.log"; } //if (FileExists(strExceptionDirName+"\\"+strExceptionFileName) == false) bFirst = true; // Textile, Weave, Knit°¡ ¼­·Î °°Àº ÆÄÀÏ¿¡¼­ ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖÀ¸¹Ç·Î, Çì´õ´Â Ç×»ó ±â·ÏÇÏ´Â °ÍÀ¸·Î º¯°æ - by monkman (2009.09.24) //if (bFirst) { strProgram = ExtractFileName(Application->ExeName) + " " + TexStylistVersion; nDataCount += _stprintf(pData+nDataCount, L"[ %s", strProgram.c_str()); // N3D, NotN3D ¿©ºÎ #if defined(NOTN3D) nDataCount += _stprintf(pData+nDataCount, L" - NotN3D"); #else nDataCount += _stprintf(pData+nDataCount, L" - N3D"); #endif // Lock Á¾·ù #if defined(TRIAL) nDataCount += _stprintf(pData+nDataCount, L" : TRIAL ]\r\n\r\n"); #elif defined(LOCK_CRYPKEY) nDataCount += _stprintf(pData+nDataCount, L" : CrypKey ]\r\n\r\n"); #elif defined(LOCK_IFC) nDataCount += _stprintf(pData+nDataCount, L" : IFC ]\r\n\r\n"); #elif defined(LOCK_USB) nDataCount += _stprintf(pData+nDataCount, L" : USB ]\r\n\r\n"); #elif defined(LOCK_TEX) nDataCount += _stprintf(pData+nDataCount, L" : Double ]\r\n\r\n"); #else nDataCount += _stprintf(pData+nDataCount, L" : HASP ]\r\n\r\n"); #endif nDataCount += _stprintf(pData+nDataCount, L"===========================================================================\r\n"); // ±¸ºÐ¼± dwFileVersionInfoSize = GetFileVersionInfoSize(Application->ExeName.c_str(), &dwFileVersionInfoSize); if (dwFileVersionInfoSize > 0) { pBuf = new Char[dwFileVersionInfoSize]; if (pBuf) { GetFileVersionInfo(Application->ExeName.c_str(), 0, dwFileVersionInfoSize, pBuf); strTemp = "VarFileInfo\\Translation"; VerQueryValue(pBuf, strTemp.c_str(), &pValue, &nLen); dwID = (WORD *)pValue; for (int i = 0; i < 10; i++) { strTemp = "StringFileInfo\\" + IntToHex(dwID[0], 4) + IntToHex(dwID[1], 4) + "\\" + strVerInfo[i]; if (VerQueryValue(pBuf, strTemp.c_str(), &pValue, &nLen)) { strProgram = strVerInfo[i] + " : " + String((Char *)pValue); nDataCount += _stprintf(pData+nDataCount, L"%s\r\n", strProgram.c_str()); } } delete []pBuf; pBuf = NULL; } } else { strProgram = "No version information found"; nDataCount += _stprintf(pData+nDataCount, L"[%s]\r\n", strProgram.c_str()); } nDataCount += _stprintf(pData+nDataCount, L"===========================================================================\r\n"); // ±¸ºÐ¼± //} // MainImageForm Á¤º¸ if (MainImageForm && MainImageForm->iMainImage && MainImageForm->iMainImage->uBitmap) { nDataCount += _stprintf(pData+nDataCount, L"MainImage:\r\n"); nDataCount += _stprintf(pData+nDataCount, L" LayerCount : %d\r\n", MainImageForm->iMainImage->LayerList->Count); nDataCount += _stprintf(pData+nDataCount, L" BitsPerPixel : %d\r\n", MainImageForm->iMainImage->uBitmap->BitsPerPixel); nDataCount += _stprintf(pData+nDataCount, L" Width, Height: %d, %d\r\n" , MainImageForm->CanvasInfor.Width, MainImageForm->CanvasInfor.Height); nDataCount += _stprintf(pData+nDataCount, L" DPI: %d\r\n" , MainImageForm->CanvasInfor.DotsPerInch); if (MainImageForm->iMainImage->uBitmap->BitsPerPixel == 8) { nDataCount += _stprintf(pData+nDataCount, L" UseColorCount: %d\r\n", MainImageForm->Palette->UseColor); } if (MainImageForm->Undo) { nDataCount += _stprintf(pData+nDataCount, L"Undo :\r\n"); nDataCount += _stprintf(pData+nDataCount, L" UndoCount : %d\r\n", MainImageForm->Undo->GetListCount()+1); } if (MainImageForm->WorkArea) { nDataCount += _stprintf(pData+nDataCount, L"WorkArea :\r\n"); nDataCount += _stprintf(pData+nDataCount, L" Range (LTRB) : %d, %d, %d, %d\r\n", MainImageForm->WorkArea->Range.left , MainImageForm->WorkArea->Range.top, MainImageForm->WorkArea->Range.right, MainImageForm->WorkArea->Range.bottom); } if (MainImageForm->iMainImage->SubBitmap) { nDataCount += _stprintf(pData+nDataCount, L"SubBitmap:\r\n"); nDataCount += _stprintf(pData+nDataCount, L" Width, Height: %d, %d\r\n" , MainImageForm->iMainImage->SubBitmap->Width, MainImageForm->iMainImage->SubBitmap->Height); } } nDataCount += _stprintf(pData+nDataCount, L"---------------------------------------------------------------------------\r\n"); // ±¸ºÐ¼± nDataCount += _stprintf(pData+nDataCount, L"Type : EXCEPTION\r\n"); nDataCount += _stprintf(pData+nDataCount, L"Time : %d-%d-%d %d:%d:%d\r\n", stLocal.wYear, stLocal.wMonth , stLocal.wDay, stLocal.wHour, stLocal.wMinute, stLocal.wSecond); // ½Ã°£ nDataCount += _stprintf(pData+nDataCount, L"%s\r\n", strObj.c_str()); // ÄÁÆ®·ÑÀ̳ª ÄÄÆ÷³ÍÆ® // ExceptionÀÌ ¹ß»ýÇÑ ÁÖ¼Ò nAddress = (int)ExceptAddr(); strAddress = IntToHex(nAddress, 2); if (strAddress.Length() < 8) { strAddress = "0x" + String::StringOfChar('0', 8-strAddress.Length()) + strAddress; } else { strAddress = "0x" + strAddress; } nDataCount += _stprintf(pData+nDataCount, L"Address : %s\r\n", strAddress.c_str()); // ExceptionÀÌ ¹ß»ýÇÑ ÁÖ¼Ò nDataCount += _stprintf(pData+nDataCount, L"Message : %s\r\n", E->Message.c_str()); // ¸Þ½ÃÁö if ((hFile = CreateFile(String(strExceptionDirName+"\\"+strExceptionFileName).c_str(), GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; if (SetFilePointer(hFile, 0, 0, FILE_END) == 0xFFFFFFFF) goto fail; // ¸Ç µÚÂÊ¿¡ Ãß°¡ // UnicodeÀÏ °æ¿ì ÀúÀå - by monkman (2010.07.21) #ifdef UNICODE if (!WriteFile(hFile, &cUnicodeFile, sizeof(Char), &dwWrite, NULL)) goto fail; #endif //if (!WriteFile(hFile, &cKey, sizeof(BYTE), &dwWrite, NULL)) goto fail; // ·£´ý Ű //if (!WriteFile(hFile, &nDataCount, sizeof(int), &dwWrite, NULL)) goto fail; // µ¥ÀÌÅÍ ±æÀÌ if (!WriteFile(hFile, pData, sizeof(Char)*nDataCount, &dwWrite, NULL)) goto fail; // Çʼö Á¤º¸ // LOG°¡ ÀÖ´Ù¸é Ãß°¡ - by monkman (2010.05.07) #ifdef LOG if (ExceptionLog(hFile) == false) goto fail; #endif nDataCount = 0; // ÆÄÀÏ¿¡ ÀÏ´Ü ±â·ÏÇßÀ¸¹Ç·Î ´Ù½Ã ÃʱâÈ­ // ¸ðµç ĵ¹ö½º Á¤º¸ nDataCount += _stprintf(pData+nDataCount, L"Canvas Information:\r\n"); for (int i = 0; i < MDIChildCount; i++) { mifForm = dynamic_cast(MDIChildren[i]); if (mifForm && mifForm->iMainImage && mifForm->iMainImage->uBitmap) { nDataCount += _stprintf(pData+nDataCount, L" Canvas [%d]:\r\n", i); memset(pCanvasName, 0, MAX_PATH); _tcsncpy(pCanvasName, mifForm->Caption.c_str(), mifForm->Caption.Length()); nDataCount += _stprintf(pData+nDataCount, L" [%d] Name : %ls\r\n", i, pCanvasName); nDataCount += _stprintf(pData+nDataCount, L" [%d] LayerCount : %d\r\n", i, mifForm->iMainImage->LayerList->Count); nDataCount += _stprintf(pData+nDataCount, L" [%d] BitsPerPixel : %d\r\n", i, mifForm->iMainImage->uBitmap->BitsPerPixel); nDataCount += _stprintf(pData+nDataCount, L" [%d] Width, Height: %d, %d\r\n" , i, mifForm->CanvasInfor.Width, mifForm->CanvasInfor.Height); nDataCount += _stprintf(pData+nDataCount, L" [%d] DPI: %d\r\n" , i, mifForm->CanvasInfor.DotsPerInch); if (mifForm->iMainImage->uBitmap->BitsPerPixel == 8) { nDataCount += _stprintf(pData+nDataCount, L" [%d] UseColorCount: %d\r\n", i, mifForm->Palette->UseColor); } if (mifForm->Undo) { nDataCount += _stprintf(pData+nDataCount, L" [%d] UndoCount : %d\r\n", i, mifForm->Undo->GetListCount()+1); } if (mifForm->WorkArea) { nDataCount += _stprintf(pData+nDataCount, L" [%d] WorkArea Range (LTRB) : %d, %d, %d, %d\r\n", i, mifForm->WorkArea->Range.left , mifForm->WorkArea->Range.top, mifForm->WorkArea->Range.right, mifForm->WorkArea->Range.bottom); } if (mifForm->iMainImage->SubBitmap) { nDataCount += _stprintf(pData+nDataCount, L" [%d] SubBitmap Width, Height: %d, %d\r\n" , i, mifForm->iMainImage->SubBitmap->Width, mifForm->iMainImage->SubBitmap->Height); } } } // OS Á¤º¸ memset(&osviOSInfo, 0, sizeof(OSVERSIONINFOEX)); osviOSInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if (GetVersionEx((OSVERSIONINFO *)&osviOSInfo) == false) { osviOSInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx((OSVERSIONINFO *)&osviOSInfo); } nDataCount += _stprintf(pData+nDataCount, L"Operating System:\r\n"); switch (osviOSInfo.dwPlatformId) { case VER_PLATFORM_WIN32_NT: if (osviOSInfo.dwMajorVersion <= 4) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows NT\r\n"); if (osviOSInfo.dwMajorVersion == 5 && osviOSInfo.dwMinorVersion == 0) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows 2000\r\n"); if (osviOSInfo.dwMajorVersion == 5 && osviOSInfo.dwMinorVersion == 1) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows XP\r\n"); if (osviOSInfo.dwMajorVersion == 6 && osviOSInfo.dwMinorVersion == 0) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows Vista\r\n"); if (osviOSInfo.dwMajorVersion == 6 && osviOSInfo.dwMinorVersion == 1) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows 7\r\n"); if (osviOSInfo.dwMajorVersion == 6 && osviOSInfo.dwMinorVersion == 2) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows 8\r\n"); break; case VER_PLATFORM_WIN32_WINDOWS: if (osviOSInfo.dwMajorVersion == 4 && osviOSInfo.dwMinorVersion == 0) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows 95\r\n"); if (osviOSInfo.dwMajorVersion == 4 && osviOSInfo.dwMinorVersion == 10) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows 98\r\n"); if (osviOSInfo.dwMajorVersion == 4 && osviOSInfo.dwMinorVersion == 90) nDataCount += _stprintf(pData+nDataCount, L" Microsoft Windows ME\r\n"); break; case VER_PLATFORM_WIN32s: break; } // System Á¤º¸ GetSystemInfo(&siSystemInfo); nDataCount += _stprintf(pData+nDataCount, L"CPU :\r\n"); switch (siSystemInfo.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_INTEL: if (siSystemInfo.wProcessorLevel == 4) { nDataCount += _stprintf(pData+nDataCount, L" INTEL 80486\r\n"); } else if (siSystemInfo.wProcessorLevel == 5) { nDataCount += _stprintf(pData+nDataCount, L" INTEL Pentium\r\n"); } else { nDataCount += _stprintf(pData+nDataCount, L" INTEL\r\n"); } break; case PROCESSOR_ARCHITECTURE_MIPS: if (siSystemInfo.wProcessorLevel == 3) { nDataCount += _stprintf(pData+nDataCount, L" MIPS R3000\r\n"); } else if (siSystemInfo.wProcessorLevel == 4) { nDataCount += _stprintf(pData+nDataCount, L" MIPS R4000\r\n"); } else if (siSystemInfo.wProcessorLevel == 5) { nDataCount += _stprintf(pData+nDataCount, L" MIPS R5000\r\n"); } else { nDataCount += _stprintf(pData+nDataCount, L" MIPS\r\n"); } break; case PROCESSOR_ARCHITECTURE_UNKNOWN: nDataCount += _stprintf(pData+nDataCount, L" UNKNOWN\r\n"); break; case PROCESSOR_ARCHITECTURE_SHX: if (siSystemInfo.wProcessorLevel == 3) { nDataCount += _stprintf(pData+nDataCount, L" SH3 or SH3-DSP\r\n"); } else if (siSystemInfo.wProcessorLevel == 4) { nDataCount += _stprintf(pData+nDataCount, L" SH4\r\n"); } else { nDataCount += _stprintf(pData+nDataCount, L" SHX\r\n"); } break; case PROCESSOR_ARCHITECTURE_ARM: if (siSystemInfo.wProcessorLevel == 4) { nDataCount += _stprintf(pData+nDataCount, L" ARM version 4\r\n"); } else { nDataCount += _stprintf(pData+nDataCount, L" ARM\r\n"); } break; } nDataCount += _stprintf(pData+nDataCount, L" PageSize : %d MB\r\n", siSystemInfo.dwPageSize); nDataCount += _stprintf(pData+nDataCount, L" MinimumApplicationAddress : %d\r\n", siSystemInfo.lpMinimumApplicationAddress); nDataCount += _stprintf(pData+nDataCount, L" MaximumApplicationAddress : %d\r\n", siSystemInfo.lpMaximumApplicationAddress); nDataCount += _stprintf(pData+nDataCount, L" ActiveProcessorMask : %d\r\n", siSystemInfo.dwActiveProcessorMask); nDataCount += _stprintf(pData+nDataCount, L" NumberOfProcessors : %d\r\n", siSystemInfo.dwNumberOfProcessors); nDataCount += _stprintf(pData+nDataCount, L" ProcessorType : %d\r\n", siSystemInfo.dwProcessorType); nDataCount += _stprintf(pData+nDataCount, L" AllocationGranularity : %d KB\r\n", siSystemInfo.dwAllocationGranularity/0x400); nDataCount += _stprintf(pData+nDataCount, L" ProcessorRevision : %d\r\n", siSystemInfo.wProcessorRevision); // Memory nDataCount += _stprintf(pData+nDataCount, L"Memory :\r\n"); mem_stateex.dwLength = sizeof(MEMORYSTATUSEX); GlobalMemoryStatusEx(&mem_stateex); GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)); nDataCount += _stprintf(pData+nDataCount, L" (Global) MemoryLoad : %d \%\r\n", mem_stateex.dwMemoryLoad); nDataCount += _stprintf(pData+nDataCount, L" (Global) TotalPhys : %d MB\r\n", mem_stateex.ullTotalPhys/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Global) AvailPhys : %d MB\r\n", mem_stateex.ullAvailPhys/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Global) TotalPageFile : %d MB\r\n", mem_stateex.ullTotalPageFile/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Global) AvailPageFile : %d MB\r\n", mem_stateex.ullAvailPageFile/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Global) TotalVirtual : %d MB\r\n", mem_stateex.ullTotalVirtual/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Global) AvailVirtual : %d MB\r\n", mem_stateex.ullAvailVirtual/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) PageFaultCount : %d\r\n", pmc.PageFaultCount); nDataCount += _stprintf(pData+nDataCount, L" (Process) PeakWorkingSetSize : %d MB\r\n", pmc.PeakWorkingSetSize/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) WorkingSetSize : %d MB\r\n", pmc.WorkingSetSize/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) QuotaPeakPagedPoolUsage : %d MB\r\n", pmc.QuotaPeakPagedPoolUsage/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) QuotaPagedPoolUsage : %d MB\r\n", pmc.QuotaPagedPoolUsage/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) QuotaPeakNonPagedPoolUsage : %d MB\r\n", pmc.QuotaPeakNonPagedPoolUsage/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) QuotaNonPagedPoolUsage : %d MB\r\n", pmc.QuotaNonPagedPoolUsage/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) PagefileUsage : %d MB\r\n", pmc.PagefileUsage/0x100000); nDataCount += _stprintf(pData+nDataCount, L" (Process) PeakPagefileUsage : %d MB\r\n", pmc.PeakPagefileUsage/0x100000); // HDD nDataCount += _stprintf(pData+nDataCount, L"Disk :\r\n"); dwDrives = GetLogicalDrives(); for (int nDrv = 3; nDrv < 26; nDrv++) { // Cµå¶óÀÌºê ºÎÅÍ if ((dwDrives >> nDrv) & 0x00000001) { strDrv = String(Char('A'+ nDrv-1)) + ":"; if (GetDriveType(strDrv.c_str()) != DRIVE_FIXED) continue; // HDD¸¸ °Ë»çÇϵµ·Ï ÇÔ nDiskSize = DiskSize(nDrv) / 0x100000; // 0x100000 = 1024 * 1024; nDiskFree = DiskFree(nDrv) / 0x100000; nDataCount += _stprintf(pData+nDataCount, L" %s Drive Disk (DiskFree MB / DiskSize MB) : %d MB / %d MB\r\n", strDrv.c_str(), nDiskFree, nDiskSize); } } // Monitor hDC = GetDC(NULL); nMonitorHorz = GetDeviceCaps(hDC, HORZRES); nMonitorVert = GetDeviceCaps(hDC, VERTRES); nMonitorColors = GetDeviceCaps(hDC, PLANES) * GetDeviceCaps(hDC, BITSPIXEL); ReleaseDC(NULL, hDC); nDataCount += _stprintf(pData+nDataCount, L"Monitor :\r\n"); nDataCount += _stprintf(pData+nDataCount, L" Horizontal : %d\r\n", nMonitorHorz); nDataCount += _stprintf(pData+nDataCount, L" Vertical : %d\r\n", nMonitorVert); nDataCount += _stprintf(pData+nDataCount, L" Colors (Bits) : %d\r\n", nMonitorColors); // Printer GetProfileString(L"windows", L"device", NULL, pPrinter, 1024); nDataCount += _stprintf(pData+nDataCount, L"Printer :\r\n"); nDataCount += _stprintf(pData+nDataCount, L" %s\r\n", pPrinter); // Process hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL); if (hSnapShot == NULL) goto fail; peProc.dwSize = sizeof(PROCESSENTRY32); cProcContinueFlag = Process32First(hSnapShot, &peProc); // ù ¹øÂ° ÇÁ·Î¼¼½º Á¤º¸ nDataCount += _stprintf(pData+nDataCount, L"Process :\r\n"); nDataCount += _stprintf(pData+nDataCount, L" PID CPU Memory\t\tProcess\r\n"); while (cProcContinueFlag) { hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, peProc.th32ProcessID); GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc)); nProcRamUsage = pmc.WorkingSetSize/0x400; nDataCount += _stprintf(pData+nDataCount, L" %10d%10d%10d KB\t\t%s\r\n", peProc.th32ProcessID, peProc.cntUsage, nProcRamUsage, peProc.szExeFile); cProcContinueFlag = Process32Next(hSnapShot, &peProc); // ´ÙÀ½ ÇÁ·Î¼¼½º } nDataCount += _stprintf(pData+nDataCount, L"===========================================================================\r\n"); // ±¸ºÐ¼± // Á¤ºñÆÀ ¿äûÀ¸·Î ¾ÏȣȭºÎºÐ ÁÖ¼®Ã³¸® - by monkman (2009.09.25) // ±âÁ¸ ¾ÏȣȭµÈ ·Î±× ÆÄÀÏÀÇ È®ÀåÀÚ´Â elf À̰í, ¾ÏȣȭµÇÁö ¾ÊÀº ·Î±× ÆÄÀÏÀÇ È®ÀåÀÚ´Â logÀÌ´Ù // ¾Ïȣȭ /* do { cKey = (BYTE)random(8); // 8ÀÌ ¾Æ´Ñ ·£´ýÇÑ ¼ö¸¦ ¾òÀ½ } while (cKey == 0); for (int i = 0; i < nDataCount; i++) { cShiftKey = (i + cKey) % 8; if (cShiftKey == 0) cShiftKey = cKey; Value = pData[i]; pData[i] = ((Value << (8-cShiftKey)) & 0xFF) | ((Value >> cShiftKey) & 0xFF); } */ if (!WriteFile(hFile, pData, sizeof(Char)*nDataCount, &dwWrite, NULL)) goto fail; // Ãß°¡ Á¤º¸ if (pData) delete []pData; pData = NULL; if (hSnapShot) CloseHandle(hSnapShot); hSnapShot = NULL; if (hFile) CloseHandle(hFile); hFile = NULL; Application->ShowException(E); return; fail: if (pData) delete []pData; pData = NULL; if (hSnapShot) CloseHandle(hSnapShot); hSnapShot = NULL; if (hFile) CloseHandle(hFile); hFile = NULL; Application->ShowException(E); return; } #endif //--------------------------------------------------------------------------- void __fastcall TMainForm::FormCreate(TObject *Sender) { // Exception ó¸® - by monkman (2009.09.02) #ifdef EXCEPTION_REPORT Application->OnException = AppException; #endif // Á¾·á½Ã¿¡ Áö¿öÁöÁö ¾ÊÀº ÆÄÀÏ »èÁ¦ DeleteTUBFile(); DeleteTBKFile(); int Items, Items_country; TIniFile *IniFile; TPException ec = EC_NONE; String path, tpath; String strHotKeyFile; bool bPen_Fullview; DeleteTempUndoFile(); //by linuxjun // HotKey - monkman (2010.06.30) TexActionManager = new TTexActionManager(this); Application->OnMessage = ApplicationMessage; Application->OnActivate = ApplicationActivate; Application->OnDeactivate = ApplicationDeactivate; Application->OnModalBegin = ApplicationModalBegin; Application->OnModalEnd = ApplicationModalEnd; Screen->OnActiveControlChange = ScreenActiveControlChange; Application->OnHint = ShowHint; PrinterSetupDialog->OnShow = OnPrintSetupDlgShow; //Screen->OnActiveFormChange = UpdateMenuItems; Screen->Cursors[crPen] = LoadCursor(HInstance, L"TEXPIAPEN"); //LoadFromMainRegIniFile(); //splash·Î ¿Å±è by david MessageStringTable.Create(DirectoryBin, Language, "Message"); if ((ProtectCard = new TProtectCard)==NULL) { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); goto fail; } //ifdef lock_crypkey ---> protectcard is not needed...... #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC Items = ProtectCard->Init(RegFilename); if (Items==0 || (Items&PCN_TEXSTYLIST)!=PCN_TEXSTYLIST) { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); goto fail; } if (!ProtectCard->CheckPassword()) { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); goto fail; } #else if (!ProtectCard->Init()) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } //========================================================================= if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); goto fail; } //========================================================================= #endif #endif // #ifndef LOCK_CRYPKEY CommonStringTable.Create(DirectoryBin, Language, "Common"); StringTable.Create(DirectoryItem, Language, "Main"); #ifdef TRIAL_HOOK // Keyboard Hooking - by monkman (2008.11.07) hInstDLL = LoadLibrary(L"YWMsgCheck.dll"); if (hInstDLL) { StartMessageHook = (TStartMessageHook)GetProcAddress(hInstDLL, "StartMessageHook"); if (StartMessageHook) { StartMessageHook(Handle); } else { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } } else { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } #endif if ((SmallFont = new TFont)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } IniFile = new TIniFile(AppDataItem + "\\status.ini"); if (IniFile) { LoadFont(IniFile, SmallFont, "Font"); bAutoSave = IniFile->ReadBool("AutoSave", "Check", false); if (bAutoSave) { AutosaveTimer->Interval = IniFile->ReadInteger("AutoSave", "Min", 5) * 60000; } bAutoSaveJpg = IniFile->ReadBool("AutoSave", "JPG", false); // Vector Speed - by monkman (2007.09.12) nVectorMode = IniFile->ReadInteger("VectorForm", "VectorMode", 0); bVectorAntiAlias = IniFile->ReadBool("VectorForm", "AntiAlias", false); // HotKey - monkman (2010.06.30) strHotKeyFile = IniFile->ReadString("HotKey", "File", "TexStylist"); bool HotKeyEnable = TexActionManager->LoadFromFile(DirectoryBin+"\\TexStylist\\HotKey\\" + strHotKeyFile + ".hkf", DirectoryBin+"\\TexStylist\\HotKey\\"+Language+".hdw"); TexActionManager->ForceSwitch = HotKeyEnable; //true; bPen_Fullview = IniFile->ReadBool("MenuView", "PenAndFullView", false); delete IniFile; } else { SmallFont->Name = DefaultFontName; SmallFont->Size = 10; } setMemCheck(); // by celberus if ((Tablet = new TTablet)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if (!Tablet->Init(Handle, RegFilename.c_str())) { delete Tablet; Tablet = NULL; } if ((PrinterColor = new TPrinterColor)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((StandardColor = new TStandardColor(DirectoryColor+"\\Standard.tpc"))==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((TextileColor = new TTextileColor(DirectoryColor+"\\Textile.tpc"))==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((Pantone1000 = new TPantone1000(DirectoryColor+"\\Thousand.ptc"))==NULL) { //k3dogs Palette¿¡¼­ ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; //Pantone Color Code¸¦ } //ã±â À§Çؼ­ if ((PantoneTextile = new TPantoneTextile(DirectoryColor+"\\Textile.ptc"))==NULL) { //20001211 ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((MainMenuForm = new TMainMenuForm(this))==NULL) goto fail; MainMenuForm->Parent = this; MainMenuForm->InitMainMenuForm(); MainMenuForm->Visible = true; MainMenuForm->OnUpdateMenu = UpdateMenuItems; //CreateDockableWindows(); if ((FullViewForm = new TFullViewForm(this))==NULL) goto fail; FullViewForm->OnSuperChange = MainMenuForm->SuperChange; FullViewForm->OnUpdateMenu = UpdateMenuItems; if ((PenManagerForm = new TPenManagerForm(this))==NULL) goto fail; PenManagerForm->OnUpdateMenu = UpdateMenuItems; if (bPen_Fullview) { VPenandFullviewItem->Checked = true; PenAndNaviTabForm = new TPenAndNaviTabForm(this); PenAndNaviTabForm->Parent = this; PenAndNaviTabForm->Visible = true; PenManagerForm->BorderStyle = Forms::bsNone; PenManagerForm->Parent = PenAndNaviTabForm->TabSheet1; PenAndNaviTabForm->TabSheet1->Caption = PenManagerForm->Caption; PenManagerForm->Left = 0; PenManagerForm->Top = 0; FullViewForm->BorderStyle = Forms::bsNone; FullViewForm->Parent = PenAndNaviTabForm->TabSheet2; PenAndNaviTabForm->TabSheet2->Caption = FullViewForm->Caption; FullViewForm->Left = 0; FullViewForm->Top = 0; } else { FullViewForm->Parent = this; PenManagerForm->Parent = this; } FullViewForm->Visible = true; PenManagerForm->Visible = true; if ((PaletteForm = new TPaletteForm(this))==NULL) goto fail; PaletteForm->Parent = this; PaletteForm->Visible = true; PaletteForm->OnChoiceColor = MainMenuForm->ChoiceColor; PaletteForm->OnColorChange = MainMenuForm->ColorChange; PaletteForm->OnCursorIndexChange = MainMenuForm->CursorIndexChange; PaletteForm->OnUpdateMenu = UpdateMenuItems; #ifndef NOTN3D if ((N3DMappingForm = new TN3DMappingForm(this))==NULL) goto fail; N3DMappingForm->Parent = this; N3DMappingForm->Visible = false; if ((N3DPatternForm = new TN3DPatternForm(this))==NULL) goto fail; N3DPatternForm->Parent = this; N3DPatternForm->Visible = false; #endif if ((LayerForm = new TLayerForm(this))==NULL) goto fail; LayerForm->Parent = this; LayerForm->Visible = false; LayerForm->FormStyle = fsStayOnTop; LayerForm->OnUpdateMenu = UpdateMenuItems; /* if ((WindowLibForm = new TWindowLibForm(this))==NULL) goto fail; WindowLibForm->Parent = this; WindowLibForm->Visible = false; if ((MotiveLibForm = new TMotiveLibForm(this))==NULL) goto fail; MotiveLibForm->Parent = this; MotiveLibForm->Visible = false; MotiveLibForm->OnUpdateMenu = UpdateMenuItems; */ ToolsRearrange(); if ((ColorChartForm = new TColorChartForm(this))==NULL) goto fail; ColorChartForm->Parent = this; if ((ColorLibraryForm = new TColorLibraryForm(this))==NULL) goto fail; ColorLibraryForm->Parent = this; ColorLibraryForm->OnColorChange = ::RepaintColor; if ((UserColorLibForm = new TUserColorLibForm(this))==NULL) goto fail; UserColorLibForm->Parent = this; if ((CaptureData = new TList)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } TexWork = NULL; if (LibraryRegCheck()){ if ((LibraryForm = new TLibraryForm(this)) == NULL) goto fail; //LibraryForm->Parent = this; LibraryForm->Visible = false; VLibraryItem->Visible = true; } else { VLibraryItem->Visible = false; } #ifdef WEB_LOCK MACaddress = GetMACaddress(); if (!_tcscmp(MACaddress.c_str(), _T("000000000000"))) { Application->MessageBox(IDS_NET_WARNING_MESSAGE.c_str(), _T("ERROR"), MB_OK); WebLockT1->Enabled = false; WebLockT2->Enabled = false; WebLockT3->Enabled = false; Application->Terminate(); return; } LogObj = new ActvLog(Application); if(!checkInetConnect() || (checkRemainTime(Application) == -100)) { // Off-lineÀÏ °æ¿ìÀÇ Ã³¸® OffLineSet(); } else { // On-lineÀÏ °æ¿ìÀÇ Ã³¸® rtime = checkRemainTime(Application, MACaddress); } StatusBar->Panels->Add(); StatusBar->Panels->Items[StatusBarRTime]->Alignment = taCenter; StatusBar->Panels->Items[StatusBarRTime]->Style = psText; StatusBar->Panels->Items[StatusBarRTime]->Width = 150; StatusBar->Panels->Items[StatusBarLogo]->Alignment = taCenter; StatusBar->Panels->Items[StatusBarLogo]->Style = psOwnerDraw; StatusBar->Panels->Items[StatusBarLogo]->Width = 120; // MainForm ½ÃÀÛ°ú µ¿½Ã¿¡ ¸ÕÀú AddLog.. LogObj->AddLog(rtime); #ifndef EDU_ASP RenewActivation->Visible = true; RenewActivation->Caption = IDS_MENU_RENEW; #endif #else WebLockT1->Enabled = false; WebLockT2->Enabled = false; WebLockT3->Enabled = false; #endif #ifdef TRIAL ClipboardFormat = RegisterClipboardFormat(L"TexproTrial"); #else ClipboardFormat = RegisterClipboardFormat(L"Texpro"); #endif if ((StatusProgress = new TStatusProgress(StatusBar, StatusBarHint))==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((FileHistory = new TFileHistory(String(AppDataItem + "\\Main.ini"), 8, FReopenItem, &OpenFile))==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((VecDraw = new TVecDraw(this))==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((CombiForm = new TCombiForm(this)) == NULL) goto fail; CombiForm->Parent = this; CombiForm->InitForm(); // ÃʱâÈ­¸¦ ¿©±â¼­ÇÏ´Â °ÍÀ¸·Î º¯°æ - by monkman (2011.02.18) if ((ResultForm = new TResultForm(this)) == NULL) goto fail; ResultForm->Parent = this; #ifdef WORKSHEET // WorkSheet ÆûÀº ¿©±â¼­ »ý¼º - by monkman (2011.02.18) if ((WorkSheetForm = new TWorkSheetForm(this)) == NULL) goto fail; WorkSheetForm->Parent = this; // Textile ÀÛ¾÷Áö½Ã¼­¿Í´Â ´Ù¸¥ ÀÛ¾÷Áö½Ã¼­ÀÓ - by monkman (2011.03.21) VTexWork->Visible = true; #endif // STY, STI ÀÛ¾÷ÇÏ´ø ºÎºÐÀÌ ³²¾ÆÀÖµµ·Ï ¼öÁ¤ - by monkman (2010.09.09) if ((DataTransForm = new TDataTransForm(this)) == NULL) goto fail; DataTransForm->Parent = this; DataTransForm->InitForm(); DataTransForm->Visible = false; bFirst = 1; CompressMethod = cmZLib; //if (L_IsTwainAvailable(Application->Handle)) { // FScanningItem->Enabled = true; // FScannerSetupItem->Enabled = true; //} else { // FScanningItem->Enabled = false; // FScannerSetupItem->Enabled = false; //} // LEADTOOLS V.15 - by monkman (2007.05.04) //ƯÁ¤ 64bit ÄÄÇ»ÅÍ¿¡¼­ ½ºÄ³³Ê°¡ ¼³Ä¡ µÇ¾îÁ® ÀÖÀ» ¾ÊÀ»°æ¿ì twunk_16.exe ȣȯ¼º ¹®Á¦ ¸Þ¼¼Áö°¡ //³ªÅ¸³ª´Â ¹®Á¦°¡ ¹ß»ýÇØ¼­ 64bit À©µµ¿ì¸é À̺κÐÀ» ¹«Á¶°Ç ³Ñ¾î°£´Ù. //ÃßÈÄ ½ºÄ³³Ê ¹öưÀ» ´­·¶À»¶§ leadtools ÇÔ¼ö¸¦ È£ÃâÇØ¼­ È®ÀÎÇϵµ·Ï ó¸®ÇÔ. //¹®Á¦°¡ ¹ß»ýÇÏ´Â ÄÄÇ»ÅÍ´Â ÃßÈÄ ½ºÄ³³Ê ¼³Á¤ ¹öưÀ» ´­·¶À»¶§¿¡µµ °°Àº ¹®Á¦°¡ ¹ß»ýÇÏ´Â °ÍÀ¸·Î È®ÀÎ µÊ. //leadtools¿¡¼­ ÇöÀç 64bit ȣȯ ÇÔ¼ö °³¹ßÁßÀ¸·Î È®ÀÎ µÊ. 2012.7.25 by david if (Is64BitWindows()) { //Application->MessageBox("64bit Windows", "Warning", MB_ICONERROR | MB_OK ); isScanning = -1; } else { isScanning = 0; //Application->MessageBox("32bit Windows", "Warning", MB_ICONERROR | MB_OK ); if (L_IsTwainAvailable(Application->Handle)) { FScanningItem->Enabled = true; FScannerSetupItem->Enabled = true; isScanning = 1; AppData.hWnd = Application->Handle; AppData.uStructSize = sizeof(APPLICATIONDATA); L_TwainInitSession(&g_hTwainSession, &AppData); } else { FScanningItem->Enabled = false; FScannerSetupItem->Enabled = false; } } srand(clock()); //======================================== SetSmallFont(StatusBar->Font); //=================================== source code befre lock_crypkey defined............. #ifdef LOCK_CRYPKEY // japan, education, demo.... must be definde.... #ifdef PROFESSIONAL Caption = "Texpro Design CAD System - TexStylist (Professional)"; #endif #ifdef TRIAL Caption = "Texpro Design CAD System - TexStylist (Trial)"; #endif #else // if lock_crypkey is not defined.... #ifdef LOCK_IFC Caption = "Texpro Design CAD System - TexStylist (Professional)"; #else #ifdef NETHASP switch (Items >> 14) { case 1: Caption = "Texpro NetHASP Design CAD System - TexStylist (Education)";break; case 2: Caption = "Texpro NetHASP Design CAD System - TexStylist (Demo)"; break; default: Caption = "Texpro NetHASP Design CAD System - TexStylist (Professional)"; break; } #else switch (Items >> 14) { case 1: Caption = "Texpro Design CAD System - TexStylist (Education)";break; case 2: Caption = "Texpro Design CAD System - TexStylist (Demo)"; break; default: Caption = "Texpro Design CAD System - TexStylist (Professional)"; break; } #endif #endif #endif // end of define lock_crypkey.... //============================================================================== FileItem->Caption = IDS_FILE; FNewCanvas256Item->Caption = IDS_F256COLOR; FNewCanvasFullItem->Caption = IDS_FFULLCOLOR; FSaveItem->Caption = IDS_TSAVE; FManagerItem->Caption = IDS_FFILEMANAGER; FReopenItem->Caption = IDS_FREOPEN; FCloseItem->Caption = IDS_FCLOSE; // FCloseAllItem->Caption = IDS_FCLOSEALL; FResizeCanvasItem->Caption = IDS_FRESIZECANVAS; FEnlargeCanvasItem->Caption = IDS_FENLARGECANVAS; FScannerSetupItem->Caption = IDS_FSCANNERSETUP; FScanningItem->Caption = IDS_FSCANNING; FPrinterSetupItem->Caption = IDS_COMMON_PRINTERSETUP; FPrintingItem->Caption = IDS_COMMON_PRINTING; FFontItem->Caption = IDS_COMMON_FONTSETUP; FEnvironmentItem->Caption = IDS_COMMON_ENVIRONMENTSETUP; // FExitItem->Caption = IDS_COMMON_EXIT; FRasterizeItem->Caption = IDS_RASTERIZE; FExitItem->Caption = IDS_FEXIT; EditItem->Caption = IDS_EDIT; ECutItem->Caption = IDS_ECUT; ECopyItem->Caption = IDS_ECOPY; EPasteItem->Caption = IDS_EPASTE; CaptureItem->Caption = IDS_CAPTURE; COverwriteItem->Caption = IDS_COVERWRITE; CInsertItem->Caption = IDS_CINSERT; CDeleteAllItem->Caption = IDS_CDELETEALL; CEditItem->Caption = IDS_CEDIT; ImageItem->Caption = IDS_IMAGE; IIntensityDetectItem->Caption = IDS_IINTENSITYDETECT; ISolarizeItem->Caption = IDS_ISOLARIZE; ImageEffectsItem->Caption = IDS_IEFFECT; IEPosterizeItem->Caption = IDS_IEPOSTERIZE; IEMosaicItem->Caption = IDS_IEMOSAIC; IEAverageItem->Caption = IDS_IEAVERAGE; IEMedianItem->Caption = IDS_IEMEDIAN; IESharpenItem->Caption = IDS_IESHARPEN; IEAddNoiseItem->Caption = IDS_IEADDNOISE; IEEmbossItem->Caption = IDS_IEEMBOSS; IEUnderlayItem->Caption = IDS_IEUNDERLAY; IEEdgeEnhanceItem->Caption = IDS_IEEDGEENHANCE; IEOilifyItem->Caption = IDS_IEOILIFY; ImageSpatialFiltersItem->Caption = IDS_ISPATIALFILTER; ISGradientItem->Caption = IDS_ISGRADIENT; ISLaplacianItem->Caption = IDS_ISLAPLACIAN; ISSobelItem->Caption = IDS_ISSOBEL; ISPrewittItem->Caption = IDS_ISPREWITT; ISShiftandDifferenceItem->Caption = IDS_ISSHIFTANDDIFFERENCE; ISLineSegmentItem->Caption = IDS_ISLINESEGMENT; GrayScaleItem->Caption = IDS_ISGrayScale; ViewItem->Caption = IDS_VIEW; VPenItem->Caption = IDS_VSPECIALPEN; VFullViewItem->Caption = IDS_VFULLVIEW; VPaletteItem->Caption = IDS_VPALETTE; VLayerItem->Caption = IDS_VLAYER; VMainMenuItem->Caption = IDS_VMAINMENU; VStatusBarItem->Caption = IDS_VSTATUSBAR; VN3DItem->Caption = IDS_N3D; WindowItem->Caption = IDS_WINDOW; WCascadeItem->Caption = IDS_WCASCADE; WTileItem->Caption = IDS_WTILE; WArrangeItem->Caption = IDS_WARRANGEICONS; WMinimizeItem->Caption = IDS_WMINIMIZEALL; HelpItem->Caption = IDS_HELP; HAboutItem->Caption = IDS_HABOUT; WorkArea1->Caption = IDS_TWorkArea; Motive1->Caption = IDS_TMotive; Save->Caption = IDS_TSAVE; MotiveSave->Caption = IDS_TSAVE; DeleteAll1->Caption = IDS_DeleteAll; DeleteAll3->Caption = IDS_DeleteAll; ReOpen1->Caption = IDS_WMLoad; MotiveLoad->Caption = IDS_WMLoad; VToolsRearrangeItem->Caption = IDS_TOOLSREARRANGE; //TEXTILE N6->Caption = IDS_T1; Textile21->Caption = IDS_T2; Textile31->Caption = IDS_T3; Textile41->Caption = IDS_T4; Textile51->Caption = IDS_T5; N8->Caption = IDS_T6; N9->Caption = IDS_T7; N15->Caption = IDS_T8; N18->Caption = IDS_T9; N25->Caption = IDS_T10; Top1->Caption = IDS_T11; sub1->Caption = IDS_T12; N10->Caption = IDS_T13; N11->Caption = IDS_T14; N12->Caption = IDS_T15; N13->Caption = IDS_T16; N14->Caption = IDS_T17; N16->Caption = IDS_T18; N17->Caption = IDS_T19; N19->Caption = IDS_T20; CMY1->Caption = IDS_T21; HLS1->Caption = IDS_T22; N20->Caption = IDS_T23; N21->Caption = IDS_T24; N22->Caption = IDS_T25; N23->Caption = IDS_T26; N24->Caption = IDS_T27; N26->Caption = IDS_T28; N27->Caption = IDS_T29; N28->Caption = IDS_T30; N29->Caption = IDS_T31; N30->Caption = IDS_T32; N31->Caption = IDS_T33; N32->Caption = IDS_T34; N33->Caption = IDS_T35; N34->Caption = IDS_T36; N35->Caption = IDS_T37; N36->Caption = IDS_T38; N37->Caption = IDS_T39; N38->Caption = IDS_T40; N39->Caption = IDS_T41; N40->Caption = IDS_T42; N41->Caption = IDS_T43; N42->Caption = IDS_T44; N43->Caption = IDS_T45; N44->Caption = IDS_T46; N45->Caption = IDS_T47; N46->Caption = IDS_T48; N47->Caption = IDS_T49; N48->Caption = IDS_T50; N49->Caption = IDS_T51; N50->Caption = IDS_T52; N51->Caption = IDS_T53; N52->Caption = IDS_T54; N53->Caption = IDS_T55; N84->Caption = IDS_T56; Top2->Caption = IDS_T57; N77->Caption = IDS_T58; N78->Caption = IDS_T59; N79->Caption = IDS_T60; N80->Caption = IDS_T61; N81->Caption = IDS_T62; //WEAVE N82->Caption = IDS_W1; Weave21->Caption = IDS_W2; N54->Caption = IDS_W3; N57->Caption = IDS_W4; N63->Caption = IDS_W5; N55->Caption = IDS_W6; II1->Caption = IDS_W7; III1->Caption = IDS_W8; N56->Caption = IDS_W9; N58->Caption = IDS_W10; N59->Caption = IDS_W11; N60->Caption = IDS_W12; N61->Caption = IDS_W13; N62->Caption = IDS_W14; N64->Caption = IDS_W15; N65->Caption = IDS_W16; N66->Caption = IDS_W17; N67->Caption = IDS_W18; N68->Caption = IDS_W19; N69->Caption = IDS_W20; N70->Caption = IDS_W21; N71->Caption = IDS_W22; N72->Caption = IDS_W23; //KNIT N83->Caption = IDS_K1; N73->Caption = IDS_K2; N74->Caption = IDS_K3; knit2->Caption = IDS_K4; knit3->Caption = IDS_K5; knit4->Caption = IDS_K6; Markchartform1->Caption = IDS_K7; Mark1->Caption = IDS_K8; N75->Caption = IDS_K9; knittingform1->Caption = IDS_K10; N76->Caption = IDS_K11; //======================================== miHotKey->Caption = IDS_SHORTCUTSETTING; // added by maxleo21c (05.05.10) ImageVectorizer->Caption = IDS_ImageVectorizer; BuyItem->Caption = IDS_BUY_ITEM; VPenandFullviewItem->Caption = IDS_PEN_FULLVIEW; VCanvasTabItem->Caption = IDS_CANVAS_TAB; VTexWork->Caption = IDS_WORKSHEET; #ifndef LOCK_USB //¿¡·¯°¡ ¹ß»ýÇÏ¸é ¿¡·¯ÆÄÀÏ·Î º¯È¯ÇÏ°í ÆÄÀÏÀ» Áö¿ìÁö´Â ¾Ê´Â´Ù. by david 080827 path = FullPathName(InstallPath + "\\Motive", "Default.wal"); tpath = InstallPath + "\\Motive\\Error-" + DateToStr(Date()) + ".wal"; if (FileExists(path)) {//gabriel if (!WindowLibForm->MergeWALibraryFile(path, gffNON)) { RenameFile(path, tpath); } } path = FullPathName(InstallPath + "\\Motive", "Default.mtl"); tpath = InstallPath + "\\Motive\\Error" + DateToStr(Date()) + ".mtl"; if (FileExists(path)) {//gabriel if (!MotiveLibForm->MergeMotifLibraryFile(path, gffNON)) { RenameFile(path, tpath); } } #endif //============================================================================== #if !(defined LOCK_IFC) && !(defined LOCK_USB) #if ((defined LOCK_CRYPKEY) && (defined WEB_LOCK)) || (defined LOCK_HASP) if (Language == "Korean") { HelpRow3->Visible = true; ProgramUpdate->Visible = true; ProgramUpdate->Caption = IDS_PROGRAM_UPDATE; } #endif #endif if (Language == "Korean") { BuyItem->Visible = true; } //============================================================================== MenuVisibleChange(); g_FocusControl = new TWinControl(this); g_FocusControl->Parent = this; return; fail: // ::doDestroy(Undo); doDestroy(FileHistory) doDestroy(StatusProgress) doDestroy(CaptureData) doDestroy(UserColorLibForm) doDestroy(ColorLibraryForm) doDestroy(ColorChartForm) doDestroy(LayerForm) doDestroy(MotiveLibForm) doDestroy(PaletteForm) doDestroy(FullViewForm) doDestroy(PenManagerForm) doDestroy(MainMenuForm) doDestroy(LibraryForm) doDestroy(PantoneTextile) doDestroy(Pantone1000) // k3dogs 20001211 doDestroy(TextileColor) doDestroy(StandardColor) doDestroy(PrinterColor) if (Tablet) doDestroy(Tablet) doDestroy(SmallFont) doDestroy(ProtectCard) if (ec == EC_NONE) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); } EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormDestroy(TObject *Sender) { String strExceptionDirName; #ifdef LOCK_USB DeleteTUBFile(); DeleteTBKFile(); #endif #ifdef TRIAL_HOOK // Keyboard Hooking - by monkman (2008.11.07) if (hInstDLL) { StopMessageHook = (TStopMessageHook)GetProcAddress(hInstDLL, "StopMessageHook"); if (StopMessageHook) { StopMessageHook(); } if (hInstDLL) FreeLibrary(hInstDLL); } StartMessageHook = NULL; StopMessageHook = NULL; hInstDLL = NULL; #endif // LEADTOOLS V.15 - by monkman (2007.05.04) if (g_hTwainSession) L_TwainEndSession(&g_hTwainSession); doDestroy(CombiForm); #ifdef WORKSHEET doDestroy(WorkSheetForm); #endif doDestroy(ResultForm); doDestroy(DataTransForm); doDestroy(VecDraw)//by jeegeo // ::doDestroy(Undo); doDestroy(FileHistory) doDestroy(StatusProgress) if (CaptureData) { CDeleteAllItemClick(NULL); delete CaptureData; CaptureData = NULL; } doDestroy(UserColorLibForm); //080401 //::doDestroy(LayerForm); doDestroy(WindowLibForm) doDestroy(MotiveLibForm) doDestroy(PaletteForm); doDestroy(PenManagerForm); if (TexWork){delete TexWork; TexWork = NULL; }; if (PenAndNaviTabForm) {delete PenAndNaviTabForm; PenAndNaviTabForm = NULL;}; if (LibraryForm){ delete LibraryForm; LibraryForm = NULL; } //::doDestroy(MainMenuForm); doDestroy(PantoneTextile) doDestroy(Pantone1000) // k3dogs 20001211 doDestroy(TextileColor) doDestroy(StandardColor) doDestroy(PrinterColor) if (Tablet) doDestroy(Tablet) doDestroy(SmallFont) doDestroy(ProtectCard) Screen->OnActiveFormChange = NULL; #ifdef LOCK_USB if (USBLock) { delete USBLock; USBLock = NULL; } #endif #ifdef TRIAL_HOOK // TrialLock - by monkman (2008.11.13) TTrialLock *TrialLock = new TTrialLock(Application, TRL_TEXSTYLIST); TrialLock->SV(); delete TrialLock; #endif /////////////////////////////////////////////////////////////////////////// #ifdef TRIAL_COMM String r_code; String logout_address = "http://www.texclub.com"; if (!CheckInet(logout_address)) { //MessageDlg("Internet Not connection!", mtWarning, TMsgDlgButtons() << mbOK, 0); Application->MessageBox(L"ȨÆäÀÌÁö¿Í ¿¬°áÀÌ µÇÁö ¾Ê½À´Ï´Ù. ÀÎÅͳÝÀ» È®ÀÎÇϽñ⠹ٶø´Ï´Ù.", L"Information", IDOK); return; } logout_address = L"http://www.texclub.com/distribute/logout.php "; r_code = TrialSendMsg(logout_address, "1", Hashcode); #endif // DeleteFile(AppDataItem + "\\Text.ini"); // DeleteFile(AppDataItem + "\\VectorSpray.ini"); // DeleteFile(AppDataItem + "\\VectorText.ini"); // HotKey - monkman (2010.06.30) TexActionManager->ForceSwitch = false; if (TexActionManager) { delete TexActionManager; } TexActionManager = NULL; // Log »èÁ¦ - by monkman (2010.05.07) // ExceptionÀÌ ¹ß»ýÇÑ ÆÄÀÏ ÀúÀå!! #ifdef LOG strExceptionDirName = AppDataBin + "\\Exception"; if (!DirectoryExists(strExceptionDirName)) CreateDir(strExceptionDirName); SaveLog(strExceptionDirName); DeleteLog(); #endif if (g_FocusControl != NULL) { delete g_FocusControl; g_FocusControl = NULL; } #ifdef WEB_LOCK if (LogObj) { LogObj->AddLog(rtime); delete LogObj; LogObj = NULL; } #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormResize(TObject *Sender) { #ifdef WEB_LOCK int w = StatusBar->Width-(160+80+100+100+270); #else int w = StatusBar->Width-(160+80+100+100+200); #endif StatusBar->Panels->Items[StatusBarHint]->Width = w<100 ? 100 : w; if (StatusProgress) StatusProgress->Resize(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormShow(TObject *Sender) { if (MDIChildCount>0) ToolsRearrange(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N6Click(TObject *Sender) { String filename; filename = "all_textile1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile21Click(TObject *Sender) { String filename; filename = "all_textile2.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile31Click(TObject *Sender) { String filename; filename = "all_textile3.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile41Click(TObject *Sender) { String filename; filename = "all_textile4.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile51Click(TObject *Sender) { String filename; filename = "all_textile5.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N8Click(TObject *Sender) { String filename; filename = "start1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::sub1Click(TObject *Sender) { String filename; filename = "pen1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N10Click(TObject *Sender) { String filename; filename = "pen2.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N11Click(TObject *Sender) { String filename; filename = "pen3.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N12Click(TObject *Sender) { String filename; filename = "pen4.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N13Click(TObject *Sender) { String filename; filename = "pen5.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N14Click(TObject *Sender) { String filename; filename = "color_selection.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N16Click(TObject *Sender) { String filename; filename = "view1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N17Click(TObject *Sender) { String filename; filename = "view2.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N19Click(TObject *Sender) { String filename; filename = "palette.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::CMY1Click(TObject *Sender) { String filename; filename = "cmy.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::HLS1Click(TObject *Sender) { String filename; filename = "HLS.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N20Click(TObject *Sender) { String filename; filename = "color_library.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N21Click(TObject *Sender) { String filename; filename = "color_file.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N22Click(TObject *Sender) { String filename; filename = "color_chart.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N23Click(TObject *Sender) { String filename; filename = "protection.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N24Click(TObject *Sender) { String filename; filename = "color_undo.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N26Click(TObject *Sender) { String filename; filename = "menu.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N27Click(TObject *Sender) { String filename; filename = "selection.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N28Click(TObject *Sender) { String filename; filename = "copy_move.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N29Click(TObject *Sender) { String filename; filename = "color_change.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N30Click(TObject *Sender) { String filename; filename = "clear.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N31Click(TObject *Sender) { String filename; filename = "color_group.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N32Click(TObject *Sender) { String filename; filename = "repeat.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N33Click(TObject *Sender) { String filename; filename = "drawing.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N34Click(TObject *Sender) { String filename; filename = "reproportion.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N35Click(TObject *Sender) { String filename; filename = "fill.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N36Click(TObject *Sender) { String filename; filename = "spread_fill.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N37Click(TObject *Sender) { String filename; filename = "stipple.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N38Click(TObject *Sender) { String filename; filename = "style.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N39Click(TObject *Sender) { String filename; filename = "pattern_repeat.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N40Click(TObject *Sender) { String filename; filename = "stripe.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N41Click(TObject *Sender) { String filename; filename = "color_separate.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N42Click(TObject *Sender) { String filename; filename = "stitch.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N43Click(TObject *Sender) { String filename; filename = "text.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N44Click(TObject *Sender) { String filename; filename = "color_combo.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N45Click(TObject *Sender) { String filename; filename = "smooth.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N46Click(TObject *Sender) { String filename; filename = "scratch.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N47Click(TObject *Sender) { String filename; filename = "jacquard.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N48Click(TObject *Sender) { String filename; filename = "file.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N49Click(TObject *Sender) { String filename; filename = "printer.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N50Click(TObject *Sender) { String filename; filename = "scanner.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N51Click(TObject *Sender) { String filename; filename = "undo.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N52Click(TObject *Sender) { String filename; filename = "shadow.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N53Click(TObject *Sender) { String filename; filename = "layer.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N84Click(TObject *Sender) { String filename; filename = "after_make.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Top2Click(TObject *Sender) { String filename; filename = "TOP.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N77Click(TObject *Sender) { String filename; filename = "Tfile.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N78Click(TObject *Sender) { String filename; filename = "Tedit.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N79Click(TObject *Sender) { String filename; filename = "Tview.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N80Click(TObject *Sender) { String filename; filename = "Twindow.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N81Click(TObject *Sender) { String filename; filename = "Thelp.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N82Click(TObject *Sender) { String filename; filename = "all_weave1.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Weave21Click(TObject *Sender) { String filename; filename = "all_weave2.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N55Click(TObject *Sender) { String filename; filename = "yarn_making1.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::II1Click(TObject *Sender) { String filename; filename = "yarn_making2.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::III1Click(TObject *Sender) { String filename; filename = "yarn_making3.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N56Click(TObject *Sender) { String filename; filename = "yarn_scan.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N58Click(TObject *Sender) { String filename; filename = "setting.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N59Click(TObject *Sender) { String filename; filename = "sketch.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N60Click(TObject *Sender) { String filename; filename = "selection(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N61Click(TObject *Sender) { String filename; filename = "preview(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N62Click(TObject *Sender) { String filename; filename = "rotate(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N64Click(TObject *Sender) { String filename; filename = "yarn_table.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N65Click(TObject *Sender) { String filename; filename = "yarn_dye.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N66Click(TObject *Sender) { String filename; filename = "yarn_arrange.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N67Click(TObject *Sender) { String filename; filename = "texture_table.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N68Click(TObject *Sender) { String filename; filename = "texture_selection.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N69Click(TObject *Sender) { String filename; filename = "weaving.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N70Click(TObject *Sender) { String filename; filename = "printer(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N71Click(TObject *Sender) { String filename; filename = "yarn_brightness.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N72Click(TObject *Sender) { String filename; filename = "weaving_window_file(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N83Click(TObject *Sender) { String filename; filename = "all_knit.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N73Click(TObject *Sender) { String filename; filename = "window(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N74Click(TObject *Sender) { String filename; filename = "copymove(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knit2Click(TObject *Sender) { String filename; filename = "clear(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knit3Click(TObject *Sender) { String filename; filename = "repeat(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knit4Click(TObject *Sender) { String filename; filename = "drawing(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Markchartform1Click(TObject *Sender) { String filename; filename = "markchartform.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Mark1Click(TObject *Sender) { String filename; filename = "mark_fill.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N75Click(TObject *Sender) { String filename; filename = "resize_canvas.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knittingform1Click(TObject *Sender) { String filename; filename = "knitting.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N76Click(TObject *Sender) { String filename; filename = "printer(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::CaptureItemClick(TObject *Sender) { if(MainMenuForm->Item == T_FILL) MainMenuForm->ExitForm(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::UpdateMenuItems(TObject *Sender) { TCaptureData *cd = NULL; // Component clicÇÒ¶§ µé¾î¿Í¼­ ¼Óµµ ÀúÇϸ¦ ¹ß»ýÇϹǷΠÀÌ·¸°Ô ó¸®Çß´Ù. // Vector Text´Â MainImage¿¡ SetFocus¸¦ ÁÖ¾î¾ß¸¸ ¹æÇâ۰¡ ÀÛµ¿Çϰí, ¿ì¸® ÇÁ·Î±×·¥Àº // MainÀÌ ¸ðµç ÆûÀÇ ParentÀ̱⠶§¹®¿¡ ÀÌ·± ¹®Á¦°¡ ¹ß»ýÇÏ´Â °Í °°´Ù. // Main FormActivate¿¡ µé¾î¿À¸é Ç×»ó ÀÌ ÇÔ¼ö¸¦ È£ÃâÇÏ°Ô µÇ¾úÀÖ´Ù. if (VectorForm && VectorForm->V_Item == M_D_NEWTEXT) return; // - 05.07.25 maxleo21c // »öÁ¤¸® ÇÒ¶§ MainMenu1ÀÇ ´ÜÃà۰¡ ½ÇÇàµÇ¾î¾ß ÇÏÁö ¾Ê¾Æ¾ß Çϴµ¥ À̰÷¿¡ µé¾î¿Í¼­ // °¢ ¸Þ´º¸¦ enalbed trueÇØ ¹ö¸®±â ¶§¹®¿¡ ¸·¾Ò´Ù. µå·´Áö¸¸ ¾î¶»°Ô Çϸ®¿À~ if (MainMenuForm && MainMenuForm->Item == T_NEWGROUP) return; // - 05.07.30 maxleo21c if (bFirst==0) return; UpdateTools(Sender); FResizeCanvasItem->Enabled = MDIChildCount > 0; FEnlargeCanvasItem->Enabled = MDIChildCount > 0; FCloseItem->Enabled = MDIChildCount > 0; // FCloseAllItem->Enabled = MDIChildCount > 0; FPrintingItem->Enabled = MDIChildCount > 0; FRasterizeItem->Enabled = MDIChildCount > 0; ImageVectorizer->Enabled = MDIChildCount > 0; EditItem->Enabled = MDIChildCount > 0; CaptureItem->Enabled = false; ImageItem->Enabled = false; COverwriteItem->Enabled = false; CInsertItem->Enabled = false; if (MainImageForm) { if (MainImageForm->iMainImage) { if (MainImageForm->iMainImage->uBitmap->BitsPerPixel==24) { CaptureItem->Enabled = true; ImageItem->Enabled = true; } } if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { COverwriteItem->Enabled = true; CInsertItem->Enabled = true; } } if (MainImageForm->AutoRepeat){ FResizeCanvasItem->Enabled= false; FEnlargeCanvasItem->Enabled= false; } } if (CaptureData) { if (CaptureData->Count > 0) { for (int i = 0; i < CaptureData->Count; i++) { cd = (TCaptureData *)CaptureData->Items[i]; if (cd->IsWorkArea == false) { // À̹ÌÁö ĸÃÄµÈ °Í¸¸ (ÀÛ¾÷±¸¿ªÀÌ ¾Æ´Ñ °æ¿ì) - by monkman (2010.10.04) CEditItem->Enabled = true; CDeleteAllItem->Enabled = true; break; } else if (i == CaptureData->Count-1) { // À̹ÌÁö ĸÃÄµÈ °ÍÀÌ ¾øÀ» °æ¿ì CEditItem->Enabled = false; CDeleteAllItem->Enabled = false; } } } else { CEditItem->Enabled = false; CDeleteAllItem->Enabled = false; } } ViewItem->Enabled = MDIChildCount > 0; VPenItem->Checked = PenManagerForm->Visible; VFullViewItem->Checked = FullViewForm->Visible; VPaletteItem->Checked = PaletteForm->Visible; VMainMenuItem->Checked = MainMenuForm->Visible; if(MainImageForm&&MainImageForm->new3d){ LayerForm->Visible = false; VLayerItem->Checked = false; VLayerItem->Enabled = false; } else { VLayerItem->Checked = LayerForm->Visible; VLayerItem->Enabled = MDIChildCount > 0; } if (N3DMappingForm) VN3DItem->Checked = N3DMappingForm->Visible; if (MotiveLibForm) MotiveLoad->Checked = MotiveLibForm->Visible; MotiveLoad->Enabled = MDIChildCount > 0; if (WindowLibForm) ReOpen1->Checked = WindowLibForm->Visible; ReOpen1->Enabled = MDIChildCount > 0; if (MainMenuForm && MainMenuForm->Item == T_FILL) { // by maxleo21c (05.07.14) MainMenuForm->UpdateMenuItems(); } VStatusBarItem->Checked = StatusBar->Visible; VToolsRearrangeItem->Enabled = MDIChildCount > 0; WCascadeItem->Enabled = MDIChildCount > 0; WTileItem->Enabled = MDIChildCount > 0; WArrangeItem->Enabled = MDIChildCount > 0; WMinimizeItem->Enabled = MDIChildCount > 0; FNewCanvasFullItem->Enabled = true; if (isScanning) { FScannerSetupItem->Enabled = true; FScanningItem->Enabled = true; } Timer50ms->Enabled = MDIChildCount > 0; Timer200ms->Enabled = MDIChildCount > 0; Timer1000ms->Enabled = MDIChildCount > 0; PenManagerForm->Enabled = MDIChildCount > 0; FullViewForm->Enabled = MDIChildCount > 0; PaletteForm->Enabled = MDIChildCount > 0; // MainMenuForm->Enabled = MDIChildCount > 0; // By Greenfish if (MDIChildCount == 0) PaletteForm->ExitForm(); // PaletteÀÇ SubMenuµéÀ» ´Ý´Â´Ù - by monkman (2009.09.14) if (MDIChildCount == 0) MainMenuForm->CloseMainMenuItem(); // MainMenu ´ÝÇôµµ Filemanager´Â »ç¿ë °¡´ÉÇÏ°Ô if (MainImageForm && MainImageForm->reflection){ LayerForm->Enabled = false; } else LayerForm->Enabled = MDIChildCount > 0; // ÁÖ¼®À¸·Î ó¸® -by maxleo21c (05.06.09) // ÀÌ·¸°Ô µÇ¾î Àֱ⠶§¹®¿¡ mainimage°¡ ¾øÀ»°æ¿ì¿¡ ´ÝÈ÷Áö ¾Ê´Â´Ù. // if (MotiveLibForm) MotiveLibForm->Enabled = MDIChildCount > 0; #ifdef NOTN3D VN3DItem->Visible = false; #endif } //--------------------------------------------------------------------- // Private Function //--------------------------------------------------------------------- #ifdef TRIAL_HOOK // Keyboard Hooking - by monkman (2008.11.07) void __fastcall TMainForm::WMMessageHook(TMessage &msg) { if (msg.Msg == WM_YOUNGWOO) { if (LOBYTE(LOWORD(msg.WParam)) == VK_SNAPSHOT) { if (OpenClipboard(Handle) && IsClipboardFormatAvailable(CF_BITMAP)) { EmptyClipboard(); } CloseClipboard(); } } return; } #endif //--------------------------------------------------------------------------- //void TMainForm::WTPacket(TMessage &msg) //{ // if (Tablet) { // WTPKT Result = Tablet->WTMPacket(msg); // // StatusBar->Panels->Items[StatusBarHint]->Text = Format("%d x %d", // // OPENARRAY(TVarRec, ((int)Tablet->MaxNPressure, (int)Tablet->prsNew))); // if (Result&PK_CURSOR) PenManagerForm->Pen->Cursor = Tablet->curNew; // } //} ////--------------------------------------------------------------------- void TMainForm::TPMDestroyChildForm(TMessage &msg) { UpdateMenuItems(NULL); MainImageForm = (TMainImageForm *)ActiveMDIChild; } //--------------------------------------------------------------------- //Áߺ¹½ÇÇà¹æÁö - by maxleo21c (06.06.22) // TextileÀÌ ¿­·Á ÀÖÀ¸¸é ¾Æ·¡¿Í °°ÀÌ ½ÇÇà void __fastcall TMainForm::WMCopyData(TMessage &Msg) { COPYDATASTRUCT *CD; CD = (COPYDATASTRUCT*)(Msg.LParam); // Char´Â 2byte Å©±âÀÌ´Ù. TS3.1ÀÇ char¿Í´Â ´Ù¸£´Ù. TS3.1Àº 1byteÀÌ´Ù. // ÇØ´ç ¸Þ½ÃÁö¸¦ SendMessage ÇØÁÖ´Â ÇÔ¼ö´Â ProjectÀÇ cpp ÆÄÀÏ¿¡ ÀÖ´Ù. ±× ºÎºÐÀ» Ãß°¡ÀûÀ¸·Î º¯°æÇØÁà¾ß ÇÑ´Ù. (°Å±â¼­ cbData ¹ÙÀÌÆ® Å©±â¸¦ Á¦´ë·Î º¯°æÇØÁÖ¾î¾ß ÇÑ´Ù.) Char* rsd = (Char *) malloc(CD->cbData*sizeof(Char) ); StrCopy(rsd, (Char*)CD->lpData); String ParamStr = rsd; //String FileName, DirName, FileExt; String FileExt; String FileName, DirName; DirName = String(ExtractFileDir(ParamStr)); FileName = String(ExtractFileName(ParamStr)); FileExt = ExtractFileExt(ParamStr); #ifdef SK_SMART int paramCount = CD->dwData; String *param = new String[paramCount]; for (int i=0, j=0; iActivate(); if (mif) mif->FormActivate(mif); // HotKey - by monkman (2010.07.01) TexActionManager->Enabled = true; //ÇöÀç SystemÀÇ Beeper ¼³Á¤ ºÒ·¯¿À±â SystemParametersInfo(SPI_GETBEEP, 0, PVOID(&m_IsSystemBeeperOn), 0); // Beeper°¡ OnÀÎ °æ¿ì Off if (m_IsSystemBeeperOn == true) SystemParametersInfo(SPI_SETBEEP, 0, NULL, SPIF_SENDWININICHANGE); } //--------------------------------------------------------------------- void __fastcall TMainForm::ApplicationDeactivate(TObject *Sender) { // pauseTimer(); // HotKey - by monkman (2010.07.01) TexActionManager->Enabled = false; // ±âÁ¸ SystemÀÇ Beeper ¼³Á¤À¸·Î ȯ¿ø SystemParametersInfo(SPI_SETBEEP, static_cast(m_IsSystemBeeperOn), NULL, SPIF_SENDWININICHANGE); } //--------------------------------------------------------------------- void __fastcall TMainForm::ApplicationModalBegin(TObject *Sender) { // HotKey - by monkman (2010.07.01) // TexHotKeyManager->Enabled = false; Çϸé LBUTTONDOWN, ActiveControlChanged µî¿¡ ÀÇÇØ // Ȱ¼ºÈ­ µÉ ¼öµµ ÀÖÀ¸¹Ç·Î Switch·Î ºñȰ¼ºÈ­ ½ÃÄѵд٠TexActionManager->ForceSwitch = false; } //--------------------------------------------------------------------- void __fastcall TMainForm::ApplicationModalEnd(TObject *Sender) { // HotKey - by monkman (2010.07.01) // Debugging Áß HotKey¸¦ Á¦¾îÇÏ¸é ºÒÆíÇϹǷΠHotKey¸¦ »ç¿ëÇÒ ¼ö ¾øµµ·Ï ÇÑ´Ù - by monkman (2010.10.02) TexActionManager->ForceSwitch = true; } //--------------------------------------------------------------------- void __fastcall TMainForm::ScreenActiveControlChange(TObject *Sender) { // HotKey - by monkman (2010.07.01) // TabŰ µîÀ¸·Î Æ÷Ä¿½º¸¦ °¡Áú ¼ö ÀÖ´Â ÄÁÆ®·ÑÀÌ ¼±ÅõǾî À̺¥Æ®°¡ // ¹ß»ýÇÒ ¶§ µé¾î¿Â´Ù. Application->OnMessage() ¿¡¼­ ¸ÕÀú °Ë»ç¸¦ ¼öÇàÇÑ ÈÄ // ÀÌ À̺¥Æ®·Î µé¾î¿À°Ô µÈ´Ù. TWinControl *WinControl = NULL; TCustomForm *ActiveControlForm = NULL; WinControl = dynamic_cast(Screen->ActiveControl); if (WinControl && WinControl->Focused() == true) { ActiveControlForm = dynamic_cast(WinControl->Owner); if (ActiveControlForm != Screen->ActiveCustomForm) { if (IsEditableControl(WinControl)) TexActionManager->Enabled = false; else TexActionManager->Enabled = true; } else { TexActionManager->Enabled = true; } } } //--------------------------------------------------------------------- void __fastcall TMainForm::ShowHint(TObject *Sender) { Application->HintPause = 100; StatusBar->Panels->Items[StatusBarHint]->Text = Application->Hint; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ToolsRearrange() { PenFormPos = Point(ClientWidth-PenManagerForm->Width-2, 2); FullViewFormPos = Point(ClientWidth-FullViewForm->Width-2, PenFormPos.y+PenManagerForm->Height+1); PaletteFormPos = Point(ClientWidth-PaletteForm->Width-2, FullViewFormPos.y+FullViewForm->Height+1); MainMenuFormPos = Point(ClientWidth-MainMenuForm->Width-2, PaletteFormPos.y+PaletteForm->Height+1); LayerFormPos = Point(ClientWidth-LayerForm->Width-2, MainMenuFormPos.y+MainMenuForm->Height+1); if (PenAndNaviTabForm) { PenAndNaviTabForm->Left = PenFormPos.x; PenAndNaviTabForm->Top = PenFormPos.y; PaletteForm->Left = PaletteFormPos.x; PaletteForm->Top = PenAndNaviTabForm->Top + PenAndNaviTabForm->Height; MainMenuForm->Left = MainMenuFormPos.x; MainMenuForm->Top = PaletteForm->Top + PaletteForm->Height; if (MainMenuForm->ActivatedSubMenu) { TForm *SubMenu = MainMenuForm->NowActivatedForm; SubMenu->Left = MainMenuForm->Left; SubMenu->Top = MainMenuForm->Top + MainMenuForm->Height; SubMenu->Width = MainMenuForm->Width; // SubMenu°¡ MainForm Å©±â¸¦ ³Ñ¾î°£´Ù¸é MainMenu ¿ÞÂÊ¿¡ SubMenu¸¦ ±×·ÁÁØ´Ù. if (SubMenu->Top + SubMenu->Height > this->ClientHeight) { SubMenu->Left = MainMenuForm->Left - SubMenu->Width; if (MainMenuForm->Top + SubMenu->Height > this->ClientHeight) { SubMenu->Top = this->ClientHeight - SubMenu->Height; } else { SubMenu->Top = MainMenuForm->Top; } } } LayerForm->Left = LayerFormPos.x; LayerForm->Top = MainMenuForm->Top + MainMenuForm->Height; } else { PenManagerForm->Left = PenFormPos.x; PenManagerForm->Top = PenFormPos.y; FullViewForm->Left = FullViewFormPos.x; FullViewForm->Top = FullViewFormPos.y; PaletteForm->Left = PaletteFormPos.x; PaletteForm->Top = PaletteFormPos.y; MainMenuForm->Left = MainMenuFormPos.x; MainMenuForm->Top = MainMenuFormPos.y; if (MainMenuForm->ActivatedSubMenu) { TForm *SubMenu = MainMenuForm->NowActivatedForm; SubMenu->Left = MainMenuForm->Left; SubMenu->Top = MainMenuForm->Top + MainMenuForm->Height; SubMenu->Width = MainMenuForm->Width; // SubMenu°¡ MainForm Å©±â¸¦ ³Ñ¾î°£´Ù¸é MainMenu ¿ÞÂÊ¿¡ SubMenu¸¦ ±×·ÁÁØ´Ù. if (SubMenu->Top + SubMenu->Height > this->ClientHeight) { SubMenu->Left = MainMenuForm->Left - SubMenu->Width; if (MainMenuForm->Top + SubMenu->Height > this->ClientHeight) { SubMenu->Top = this->ClientHeight - SubMenu->Height; } else { SubMenu->Top = MainMenuForm->Top; } } } LayerForm->Left = LayerFormPos.x; LayerForm->Top = LayerFormPos.y; } } //--------------------------------------------------------------------- TPException __fastcall TMainForm::FMOnRead(TFMReadParameter rp, bool changeFileFormat) { BEGIN_LOG(""); TCursor cur; TMainImageForm *Child = NULL; TPException ec = EC_NONE; // DXF ·Îµù½Ã ÇØ»óµµ Á¶Àý TNewCanvasForm *Form = NULL; cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainMenuForm->ExitForm(1); if (MainImageForm) MainImageForm->iMainImage->Deactivate(); // if (rp.ExtIndex == gffOldTEX) rp.ExtIndex = gffTEX; // if (rp.ExtIndex == gffOldTFC) rp.ExtIndex = gffTFC; // DXF ·Îµù½Ã ÇØ»óµµ Á¶Àý if (rp.ExtIndex == gffDXF) { if ((Form = new TNewCanvasForm(NULL))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } if (Form->ShowModal()==mrOk) { if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } Child->CanvasInfor = Form->CanvasInfor; if ((ec = Child->InitFormFile(rp.DirName, rp.FileName, rp.ExtIndex, rp.bpp, changeFileFormat)) != EC_NONE) goto fail; } delete Form; } else { if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } if ((ec = Child->InitFormFile(rp.DirName, rp.FileName, rp.ExtIndex, rp.bpp, changeFileFormat)) != EC_NONE) goto fail; } Screen->Cursor = cur; END_LOG; return EC_NONE; fail: if (Child) delete Child; Screen->Cursor = cur; END_LOG; return ec; } //--------------------------------------------------------------------- //bool __fastcall TMainForm::FMOnMerge(String FileName, TGraphicFileFormat ExtIndex) bool __fastcall TMainForm::FMOnMerge(String FileName, TGraphicFileFormat ExtIndex) { #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); return false; } #endif #endif BEGIN_LOG(""); bool rtn = false; // if (ExtIndex == gffOldTEX) ExtIndex = gffTEX; // if (ExtIndex == gffOldTFC) ExtIndex = gffTFC; if (ExtIndex == gffVST #ifdef TRIAL || ExtIndex == gffVST_TRIAL #endif ){ rtn = MainImageForm->LoadVectorFromFile(FileName, ExtIndex); } else { rtn = MainImageForm->InitMerge(FileName, ExtIndex); } END_LOG; return rtn; } //--------------------------------------------------------------------- String __fastcall TMainForm::FMOnFileName(String FileName, TGraphicFileFormat ExtIndex) { // remade by celberus //String fileExtension; String fileExtension; switch (ExtIndex) { #ifdef TRIAL case gffTEX_TRIAL: fileExtension = String(".ttex"); break; case gffTFC_TRIAL: fileExtension = String(".ttfc"); break; case gffT3D_TRIAL: fileExtension = String(".tt3d"); break; case gffWEA_TRIAL: fileExtension = String(".twea"); break; case gffKNT_TRIAL: fileExtension = String(".tknt"); break; case gffVST_TRIAL: fileExtension = String(".tvst"); break; #endif case gffTEX: /*case gffOldTEX:*/ fileExtension = String(".tex"); break; case gffTFC: /*case gffOldTFC:*/ fileExtension = String(".tfc"); break; case gffVST: fileExtension = String(".vst"); break; #ifndef N_3D case gffT3D: if(T3D_Item) {fileExtension = String(".t3d");} break; #ifdef NOTN3D #else case gffN3D: if(T3D_Item) {fileExtension = String(".n3d");} break; #endif #endif case gffWEA: fileExtension = String(".wea"); break; case gffWAV: fileExtension = String(".wav"); break; case gffKNT: fileExtension = String(".knt"); break; case gffBMP: fileExtension = String(".bmp"); break; case gffJPG: fileExtension = String(".jpg"); break; case gffPCT: fileExtension = String(".pct"); break; case gffPCX: fileExtension = String(".pcx"); break; case gffPNG: fileExtension = String(".png"); break; case gffPSD: fileExtension = String(".psd"); break; case gffRAS: fileExtension = String(".ras"); break; case gffTGA: fileExtension = String(".tga"); break; case gffTIF: fileExtension = String(".tif"); break; case gffEPS: fileExtension = String(".eps"); break; case gffDXF: fileExtension = String(".dxf"); break; case gffSVG: fileExtension = String(".svg"); break; // for SVG - by maxleo21c(06.06.17) // case gffPIL: fileExtension = String(".pil"); break; case gffALL: return FileName; // case gffGIF: FileIndex = '.gif'; break; // by mecbong } // if (LWideowerCase(WideExtractFileExt(FileName)) == fileExtension) { if (LowerCase(ExtractFileExt(FileName)) == fileExtension) { return FileName; } else { return FileName + fileExtension; } } //--------------------------------------------------------------------- //TPException __fastcall TMainForm::FMOnSave(String DirName, String FileName, // TGraphicFileFormat ExtIndex, TCompressMethod cm) TPException __fastcall TMainForm::FMOnSave(String DirName, String FileName, TGraphicFileFormat ExtIndex, TCompressMethod cm) { #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); return EC_HASPKEYNOTFOUND; } #endif #endif if (MainImageForm->WorkArea && MainImageForm->WorkArea->Mask) { int nSaveMode; // IDCANCEL Cancel button was selected. // IDNO No button was selected. // IDYES Yes button was selected. nSaveMode = Application->MessageBox(IDS_MESSAGE_WORKAREASAVEOPTION.c_str(), L"Information", MB_YESNOCANCEL); if(nSaveMode == IDCANCEL) { return EC_NONE; } else if(nSaveMode == IDNO) { TTexpiaBitmap *TempMask; TPException TempException; TempMask = MainImageForm->WorkArea->Mask; MainImageForm->WorkArea->Mask = NULL; TempException = MainImageForm->SaveToFile(DirName, FileName, ExtIndex, cm); MainImageForm->WorkArea->Mask = TempMask; return TempException; //by bomchun(06.10.10) Àüü ÀúÀå½Ã¿¡´Â ÀÛ¾÷±¸¿ª ¸¶½ºÅ©°ªÀ» Àá½Ã NULL·Î ¸¸µçÈÄ ÀúÀåÇÑ´Ù } } return MainImageForm->SaveToFile(DirName, FileName, ExtIndex, cm); } //--------------------------------------------------------------------------- //void __fastcall TMainForm::OpenFile(String DirName, String FileName, int Index, WORD bpp) void __fastcall TMainForm::OpenFile(String DirName, String FileName, int Index, WORD bpp) { BEGIN_LOG(""); TCursor cur; TMainImageForm *Child = NULL; TPException ec = EC_NONE; MainMenuForm->ExitForm(1); cur = Screen->Cursor; Screen->Cursor = crHourGlass; if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } if ((ec = Child->InitFormFile(DirName, FileName, (TGraphicFileFormat)Index, bpp))!=EC_NONE) goto fail; Screen->Cursor = cur; END_LOG; return; fail: if (Child) delete Child; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); END_LOG; } //--------------------------------------------------------------------- //bool __fastcall TMainForm::isTimeExpired(String fileName) bool __fastcall TMainForm::isTimeExpired(String fileName) { typedef struct { // ³¯Â¥, ½Ã°£ ±¸Á¶Ã¼ WORD Day:5; WORD Month:4; WORD Year:7; } DOSDATE; typedef struct { WORD Second:5; WORD Minute:6; WORD Hour:5; } DOSTIME; HANDLE hFile = INVALID_HANDLE_VALUE; FILETIME fLocTime; DOSDATE Date; DOSTIME Time; BY_HANDLE_FILE_INFORMATION info; TDateTime currentTime; unsigned short currentYear, currentMonth, currentDay; //hFile = CreateFile (fileName.c_str() , GENERIC_READ | GENERIC_WRITE , 0 , NULL, // OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , NULL); // File ¹Þ±â hFile = CreateFile (fileName.c_str() , GENERIC_READ | GENERIC_WRITE , 0 , NULL, OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , NULL); // File ¹Þ±â if (hFile == INVALID_HANDLE_VALUE) { return false; } currentTime = Now(); currentTime.DecodeDate(¤tYear, ¤tMonth, ¤tDay); GetFileInformationByHandle (hFile , &info); FileTimeToLocalFileTime ( &info.ftLastWriteTime , &fLocTime); FileTimeToDosDateTime (&fLocTime , (WORD*)&Date , (WORD*)&Time); CloseHandle(hFile); if (Date.Month != currentMonth) { if (currentDay > 6) return true; } else { if (currentDay > Date.Day + 7) { return true; } } return false; } //--------------------------------------------------------------------- // Public Function //--------------------------------------------------------------------------- void __fastcall TMainForm::UpdateTools(TObject *Sender) { //MainImageForm = (TMainImageForm *)ActiveMDIChild; //=============================================== for Auto Repeat by kjs if (MainImageForm) { // source code if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainMenuForm->AutoRepUpdateItem(); else MainMenuForm->UpdateItem(); // MainMenuForm->ARExitForm(false); RepaintColor(); } else { PaletteForm->InitForm(NULL); } //================================================ /* if (MainImageForm) { // source code MainMenuForm->UpdateItem(); RepaintColor(); // FullViewForm->InitForm(MainImageForm->iMainImage->uBitmap); // PenManagerForm->FormChange(MainImageForm->Palette); } */ } //--------------------------------------------------------------------------- void __fastcall TMainForm::education(String str) { #ifndef N_SCREENCAM String screencam, cam, camdir; TRegistry *Registry; SHELLEXECUTEINFO screeninfo; Registry = new TRegistry; if (!Registry) return; Registry->RootKey = HKEY_LOCAL_MACHINE; Registry->OpenKey(RegFilename+"\\Directory",TRUE); screencam = Registry->ReadString("screencam"); delete Registry; memset(&screeninfo,0,sizeof(screeninfo)); screeninfo.cbSize = sizeof(screeninfo); screeninfo.lpVerb = L"open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = L"scplayer.exe"; cam = screencam + "\\TexStylist\\" + str; camdir = "\"" + cam + "\""; screeninfo.lpParameters = camdir.c_str(); screeninfo.fMask = SEE_MASK_NOCLOSEPROCESS; screeninfo.nShow = SW_SHOWDEFAULT; if(!ShellExecuteEx(&screeninfo)) { ShowMessage("can't play screencam movie."); return; } #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::educationknit(String str) { #ifndef N_SCREENCAM String screencam, cam, camdir; TRegistry *Registry; SHELLEXECUTEINFO screeninfo; Registry = new TRegistry; if (!Registry) return; Registry->RootKey = HKEY_LOCAL_MACHINE; Registry->OpenKey(RegFilename+"\\Directory",TRUE); screencam = Registry->ReadString("screencam"); delete Registry; memset(&screeninfo,0,sizeof(screeninfo)); screeninfo.cbSize = sizeof(screeninfo); screeninfo.lpVerb = L"open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = L"scplayer.exe"; cam = screencam + "\\knit\\" + str; camdir = "\"" + cam + "\""; screeninfo.lpParameters = camdir.c_str(); screeninfo.fMask = SEE_MASK_NOCLOSEPROCESS; screeninfo.nShow = SW_SHOWDEFAULT; if(!ShellExecuteEx(&screeninfo)) { ShowMessage("can't play screencam movie."); return; } #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::educationweave(String str) { #ifndef N_SCREENCAM String screencam, cam, camdir; TRegistry *Registry; SHELLEXECUTEINFO screeninfo; Registry = new TRegistry; if (!Registry) return; Registry->RootKey = HKEY_LOCAL_MACHINE; Registry->OpenKey(RegFilename+"\\Directory",TRUE); screencam = Registry->ReadString("screencam"); delete Registry; memset(&screeninfo,0,sizeof(screeninfo)); screeninfo.cbSize = sizeof(screeninfo); screeninfo.lpVerb = L"open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = L"scplayer.exe"; cam = screencam + "\\weave\\" + str; camdir = "\"" + cam + "\""; screeninfo.lpParameters = camdir.c_str(); screeninfo.fMask = SEE_MASK_NOCLOSEPROCESS; screeninfo.nShow = SW_SHOWDEFAULT; if(!ShellExecuteEx(&screeninfo)) { ShowMessage("can't play screencam movie."); return; } #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::SaveClick(TObject *Sender) //2001.4.3. by lhskys ÀÛ¾÷±¸¿ª save { BEGIN_LOG(""); WindowLibForm->Save(this); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::WorkareaClick(TObject *Sender) //2001.4.6. by lhskys ÀÛ¾÷±¸¿ª save { BEGIN_LOG(""); if(MainMenuForm->Item != T_WIN)MainMenuForm->InitWindowForm(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteAll1Click(TObject *Sender) { BEGIN_LOG(""); WindowLibForm->WDeleteAll(this); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::MotiveSaveClick(TObject *Sender) { BEGIN_LOG(""); // By GreenFish ¸ðƼºêµéÀ» ÀúÀåÇÏ´Â ÇÔ¼ö MotiveLibForm->MotiveSave(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::MotiveLoadClick(TObject *Sender) { // By GreenFish BEGIN_TEX; if (MotiveLoad->Checked) { Motive1->Checked = false; MotiveLibForm->Visible = false; } else { Motive1->Checked = true; MotiveLibForm->Show(); } UpdateMenuItems(Sender); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ReOpen1Click(TObject *Sender) { BEGIN_TEX; // if (ReOpen1->Checked) { // ÁÖ¼®Ã³¸® ¿Ö ÀÌ·¸°Ô ÇßÀ»±î? by maxleo21c (05.06.09) if (WorkArea1->Checked) { WorkArea1->Checked = false; WindowLibForm->Visible = false; } else { WorkArea1->Checked = true; WindowLibForm->Show(); } UpdateMenuItems(Sender); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteAll3Click(TObject *Sender) { BEGIN_LOG(""); MotiveLibForm->MDeleteAll(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FRasterizeItemClick(TObject *Sender) { MainMenuForm->ExitForm(1); //WindowForm->sbOffClick(this); if (WindowForm) WindowForm->WindowOff(); else TWorkAreaMenu::WindowOff(); MainImageForm->UndoSave(UK_PATTERN); HDC dcDst; // int countX = MainImageForm->iMainImage->uBitmap->CountX; int countY = MainImageForm->iMainImage->uBitmap->CountY; int Value = 0; int cnt; TPLayer *dstLayer = NULL; bool bAntialiasing = true; if (VecDraw->NVector->DataList->Count <= 0) return; BEGIN_LOG(""); BEGIN_TEX; bAntialiasing = VecDraw->IsAntialiasing(); if (bAntialiasing) { if (MainImageForm->iMainImage->Index == 0 && MainImageForm->iMainImage->LayerList->Count == 1) { // º¤ÅÍ ¿ÀºêÁ§Æ®ÀÇ ºñÆ®¸ÊÈ­ ¼³Á¤ Value = RasterizeDialogFunc(true); if (Value == 1) VecDraw->NVector->bCancelAntialiasing = true; else if (Value == 2) VecDraw->NVector->bCancelAntialiasing = false; else { END_TEX; END_LOG; return; } } else { // º¤ÅÍ ¿ÀºêÁ§Æ®ÀÇ ºñÆ®¸ÊÈ­ ¼³Á¤ Value = RasterizeDialogFunc(true); switch (Value) { case 0 : // Cancel END_TEX; END_LOG; return; case 1 : // None Antialiasing VecDraw->NVector->bCancelAntialiasing = true; break; case 2 : // Antialiasing VecDraw->NVector->bCancelAntialiasing = false; if (MainImageForm->AutoRepeat){ ShowMessage(IDS_MESSAGE_AUTOREPEATCLOSE); END_TEX; END_LOG; return; } dstLayer = (TPLayer *) MainImageForm->iMainImage->LayerList->Items[0]; MainImageForm->Undo->LayerChange(MainImageForm->iMainImage->uBitmap->getLayerOrder(),dstLayer->LBitmap->getLayerOrder()); MainImageForm->UndoSave(UK_PATTERN); if (MainImageForm->iMainImage->FlattenLayer(true)) { cnt = MainImageForm->iMainImage->LayerList->Count; if (LayerForm) { LayerForm->LayerGrid->RowCount = 2; LayerForm->ChangeFormSize(); // MainImageForm->RemoveUndoAll(); //by linuxjun Undo_Method MainImageForm->LayerCNT = cnt; } if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainMenuForm->AutoRepUpdateItem(); else MainMenuForm->UpdateItem(); ::RepaintImage(); } else { SAVE_EXCEPTION(EC_MEMORY_LACK); EXCEPTION_MESSAGE_OK(EC_MEMORY_LACK); END_TEX; END_LOG; return; } break; } } } else { // º¤ÅÍ ¿ÀºêÁ§Æ®ÀÇ ºñÆ®¸ÊÈ­ ¼³Á¤ Value = RasterizeDialogFunc(false); if (Value == 1) VecDraw->NVector->bCancelAntialiasing = true; else { END_TEX; END_LOG; return; } } for( int n = 0; n < countX * countY; n ++ ) // { if (MainImageForm->iMainImage->LayerMask) { dcDst = MainImageForm->iMainImage->LayerMask->CreateDC(n); // VecDraw->ConvertToBitmapMask(this, dcDst, MainImageForm->iMainImage->uBitmap->uRect[0][n].left, MainImageForm->iMainImage->uBitmap->uRect[0][n].top); // MainImageForm->iMainImage->LayerMask->Table[0][n].blank = false; // º¤ÅͰ¡ ±×·ÁÁöÁö ¾Ê¾Ò´ø ºÎºÐÀ» ÇöÀç·Î¼­´Â ¾Ë ¼ö ¾ø¾î ÀüºÎ ºñÆ®¸ÊÈ­ µÈ°É·Î.. MainImageForm->iMainImage->LayerMask->DeleteDC(dcDst, n); // convert by celberus dcDst = NULL; } dcDst = MainImageForm->iMainImage->uBitmap->CreateDC(n); // VecDraw->ConvertToBitmap(this, dcDst, true, MainImageForm->iMainImage->uBitmap->uRect[0][n].left, MainImageForm->iMainImage->uBitmap->uRect[0][n].top, n == countX * countY - 1); // MainImageForm->iMainImage->uBitmap->Table[0][n].blank = false; // º¤ÅͰ¡ ±×·ÁÁöÁö ¾Ê¾Ò´ø ºÎºÐÀ» ÇöÀç·Î¼­´Â ¾Ë ¼ö ¾ø¾î ÀüºÎ ºñÆ®¸ÊÈ­ µÈ°É·Î.. MainImageForm->iMainImage->uBitmap->DeleteDC(dcDst, n); // convert by celberus dcDst = NULL; } // shin // vista¿¡¼­ 256Ä®¶ó ºñÆ®¸ÊÀÇ DC¿¡ Èò ¹ÙÅÁ(255)¿¡ °ËÀº »ö(0)À¸·Î ±×¸± ¶§ // ÆÈ·¹Æ®¿¡ Èò »ö(255)ÀÌ ÀÖ´Â °æ¿ì ±× ÆÈ·¹Æ® ¹øÈ£·Î ä¿öÁö´Â ºÎºÐÀÌ À־ // Åõ¸íÇØ¾ßÇÒ ¹è°æºÎºÐÀÌ Èò»öÀ¸·Î ³ª¿À´Â ¹®Á¦¶§¹®¿¡ ¾Æ·¡ÀÇ ³»¿ë Ãß°¡. if (MainImageForm->iMainImage->uBitmap->BitsPerPixel == 8 && MainImageForm->iMainImage->LayerMask){ MainImageForm->iMainImage->LayerMask->StartScanLine(); Byte *src; for (int y = 0; y < MainImageForm->iMainImage->LayerMask->Height; y++){ src = MainImageForm->iMainImage->LayerMask->GetScanLine(y); for (int x = 0; x < MainImageForm->iMainImage->LayerMask->Width; x++){ if (src[x] != 0 && src[x] != 255){ //src[x] = 255; int r, g, b; r = PaletteForm->DIB256Palette->Palette->ColorData[src[x]]->RGB.rgbRed; g = PaletteForm->DIB256Palette->Palette->ColorData[src[x]]->RGB.rgbGreen; b = PaletteForm->DIB256Palette->Palette->ColorData[src[x]]->RGB.rgbBlue; int sum = r + g + b; if (sum/3 < 256/2){ src[x] = 0; } else { src[x] = 255; } } } MainImageForm->iMainImage->LayerMask->PutScanLine(y); } MainImageForm->iMainImage->LayerMask->StopScanLine(); } MainImageForm->iMainImage->uBitmap->SetAllToModified(); // if (MainImageForm->iMainImage->LayerMask) { MainImageForm->iMainImage->LayerMask->SetAllToModified(); // } MainImageForm->CorrectPaletteIndex(); // MainImageForm->iMainImage->isRepaintAll = true; // //MainImageForm->iMainImage->Repaint(); // convert by celberus ::RepaintColor(); VecDraw->FullViewBitmapDraw(-1, -1, -1, -1); if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainImageForm->RedrawingRepeat(false, true); // for using clibboard to copy END_TEX; END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::VN3DItemClick(TObject *Sender) { BEGIN_TEX; MainMenuForm->ExitForm(1); if (VN3DItem->Checked) { VN3DItem->Checked = false; if (N3DMappingForm) N3DMappingForm->Visible = false; } else { VN3DItem->Checked = true; if (N3DMappingForm) N3DMappingForm->Visible = true; } UpdateMenuItems(Sender); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::AutoRepPreView() { BEGIN_LOG(""); TCursor cur; TMainImageForm *Child = NULL; TNewCanvasForm *Form = NULL; TPException ec = EC_NONE; PenManagerForm->spread_sw[4] = 0; PenManagerForm->aspread = false; PenManagerForm->acolor = 0; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } #endif #endif if ((Form = new TNewCanvasForm(NULL))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } // if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (MainImageForm) { if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainImageForm->ARViewExitForm(); } if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; SAVE_EXCEPTION(ec); goto fail; } MainImageForm->AutoRepUpdateMenu(true); //lhskys »õ·Î¿î MainMenu »ý¼º if ((ec = Child->InitForm(Form->CanvasInfor, 8))!=EC_NONE) goto fail; Screen->Cursor = cur; // } delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif END_LOG; return; fail: if (Form) { if (Child) delete Child; Screen->Cursor = cur; delete Form; } EXCEPTION_MESSAGE_OK(ec); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormMouseWheel(TObject *Sender, TShiftState Shift, int WheelDelta, TPoint &MousePos, bool &Handled) { // º¤ÅÍÆû¿¡¼­ »ç¿ëµÇ´Â ¸¶¿ì½ºÈÙ¶§¹®¿¡ ¸ÞÀÎÀÇ Æ÷Áö¼Çº¯°æÀ» ¸·±â À§Çؼ­ -by maxleo21c (04.11.12) if (MainImageForm && MainImageForm->CanUseMouseWheelInVectorForm()) return; if (MainMenuForm && ((MainMenuForm->Item == T_NEWGROUP && NewGroupingForm && NewGroupingForm->Visible) || (MainMenuForm->Item == T_VECTOR && DetailForm && DetailForm->Visible) || (MainMenuForm->Item == T_STYLECOMBO && StyleComboForm && StyleComboForm->Visible) /*|| MainMenuForm->Item == T_COMBO)*/)) // added by maxleo21c (05.03.08) MainMenuForm->iMainImageMouseWheel(Shift, WheelDelta); else if (MainImageForm) { if (!MainForm->MotiveLoad->Checked) MainImageForm->iMainImage->SetPosition(MainImageForm->iMainImage->PositionX, MainImageForm->iMainImage->PositionY-WheelDelta); } if (MainImageForm && MainMenuForm && MainMenuForm->Item == T_VECTOR) MainImageForm->SetCaretPositionForTextBox(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::TestTimerTimer(TObject *Sender) { MEMORYSTATUS mem_state; mem_state.dwLength = sizeof(MEMORYSTATUS); GlobalMemoryStatus(&mem_state); TestLabel1->Caption = "TotalPhys : " + (String)(mem_state.dwTotalPhys / 1024); TestLabel2->Caption = "AvailPhys : " + (String)(mem_state.dwAvailPhys / 1024); TestLabel3->Caption = "TotalVirtual : " + (String)(mem_state.dwTotalVirtual / 1024); TestLabel4->Caption = "AvailVirtual : " + (String)(mem_state.dwAvailVirtual / 1024); if (MainImageForm == NULL) return; TUnionBitmap *theBitmap = MainImageForm->iMainImage->uBitmap; TList **ActivateList; ActivateList = theBitmap->GetActivateList(); if(ActivateList == NULL) return; TestLabel5->Caption = "ZOOM 0 : " + (String)ActivateList[0]->Count; TestLabel6->Caption = "ZOOM 1 : " + (String)ActivateList[1]->Count; TestLabel7->Caption = "ZOOM 2 : " + (String)ActivateList[2]->Count; TestLabel8->Caption = "ZOOM 3 : " + (String)ActivateList[3]->Count; //mem_state.dwMemoryLoad; // percent of memory in use //mem_state.dwAvailPhys; // free physical memory bytes //mem_state.dwTotalPageFile; // bytes of paging file //mem_state.dwAvailPageFile; // free bytes of paging file } //--------------------------------------------------------------------------- void __fastcall TMainForm::TimeCheckStart(void) { time_start = ::GetTickCount(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::TimeCheckEnd(void) { time_end = ::GetTickCount(); time_end -= time_start; TestLabel9->Caption = (String)time_end + "msec"; } //--------------------------------------------------------------------------- void __fastcall TMainForm::TestPanelClick(TObject *Sender) { TestPanel->BringToFront(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::setMemCheck() { OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osvi); osVersion = osvi.dwPlatformId; //WINDOWS 98 == 1, WIN_NT==2; // if(osVersion < 2) { MemoryTimer->Enabled = true; MemLabel1->Caption = IDS_RESOURCE_NOT_ENOUGH; MemLabel2->Caption = IDS_MSG_CLOSE; MemLabel3->Caption = IDS_AVAIL_RESOURCE; MemPanel->Width = 35; MemPanel->Height = 25; // MemPanel->Width = max(MemLabel1->Width, max(MemLabel2->Width, MemLabel3->Width)) + 20; MemPanel->Top = ClientHeight - StatusBar->Height - MemPanel->Height - GetSystemMetrics(SM_CYBORDER); MemPanel->Left = ClientWidth - MemPanel->Width - GetSystemMetrics(SM_CXBORDER); MemPanel->BringToFront(); // isMemPanelSmall = false; isMemPanelSmall = true; // } } //--------------------------------------------------------------------------- void __fastcall TMainForm::MemoryTimerTimer(TObject *Sender) { typedef LONG (CALLBACK* GETRES)(int); #define GFSR_SYSTEMRESOURCES 0 #define GFSR_GDIRESOURCES 1 #define GFSR_USERRESOURCES 2 if (osVersion < 2) { HINSTANCE hInst = LoadLibrary(L"RSRC32.dll"); if (hInst != NULL) // 98 or 95ÀÎ °æ¿ì { GETRES pGetRes = (GETRES) GetProcAddress(hInst, "_MyGetFreeSystemResources32@4");//); if (pGetRes) { long lSysRes = (*pGetRes)(GFSR_SYSTEMRESOURCES); if(lSysRes < 20) // ¸®¼Ò½º ºÎÁ·ÀÏ ¶§ { // MemLabel3->Caption = IDS_AVAIL_RESOURCE + " " + String(lSysRes) + "%"; MemLabel1->Caption = String(lSysRes) + "%"; MemPanel->Visible = true; // MemPanel->BringToFront(); } else { MemPanel->Visible = false; } } FreeLibrary(hInst); } } else { MEMORYSTATUS mem_state; mem_state.dwLength = sizeof(MEMORYSTATUS); // sizeof(MEMORYSTATUS) //mem_state.dwMemoryLoad; // percent of memory in use //mem_state.dwTotalPhys; // bytes of physical memory // RAM //mem_state.dwAvailPhys; // free physical memory bytes //mem_state.dwTotalPageFile; // bytes of paging file //mem_state.dwAvailPageFile; // free bytes of paging file //mem_state.dwTotalVirtual; // user bytes of address space //mem_state.dwAvailVirtual; // free user bytes GlobalMemoryStatus(&mem_state); if (mem_state.dwAvailPhys < mem_state.dwTotalPhys * 0.1) { if (isMemPanelSmall == false) { MemLabel3->Caption = IDS_AVAIL_RESOURCE + " " + String((int)((double)mem_state.dwAvailPhys * 100 / mem_state.dwTotalPhys)) + "%"; } else { MemLabel1->Caption = String((int)((double)mem_state.dwAvailPhys * 100 / mem_state.dwTotalPhys)) + "%"; } MemPanel->Visible = true; // MemPanel->BringToFront(); } else { MemPanel->Visible = false; } } } //--------------------------------------------------------------------------- void __fastcall TMainForm::MemPanelClick(TObject *Sender) { /* if (isMemPanelSmall == false) { MemPanel->Width = 35; MemPanel->Height = 25; MemPanel->Top = ClientHeight - StatusBar->Height - MemPanel->Height - GetSystemMetrics(SM_CYBORDER); MemPanel->Left = ClientWidth - MemPanel->Width - GetSystemMetrics(SM_CXBORDER); MemLabel1->Caption = "??%"; isMemPanelSmall = true; } else { MemPanel->Width = max(MemLabel1->Width, max(MemLabel2->Width, MemLabel3->Width)) + 20; MemPanel->Height = 81; MemPanel->Top = ClientHeight - StatusBar->Height - MemPanel->Height - GetSystemMetrics(SM_CYBORDER); MemPanel->Left = ClientWidth - MemPanel->Width - GetSystemMetrics(SM_CXBORDER); MemLabel1->Caption = IDS_RESOURCE_NOT_ENOUGH; isMemPanelSmall = false; } */ } //--------------------------------------------------------------------------- void __fastcall TMainForm::pauseTimer() { oldTimer50 = Timer50ms->Enabled; oldTimer200 = Timer200ms->Enabled; oldTimer1000 = Timer1000ms->Enabled; Timer50ms->Enabled = false; Timer200ms->Enabled = false; Timer1000ms->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TMainForm::resumeTimer() { Timer50ms->Enabled = oldTimer50; Timer200ms->Enabled = oldTimer200; Timer1000ms->Enabled = oldTimer1000; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FSaveItemClick(TObject *Sender) { BEGIN_TEX; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï Æû´Ý±â - by monkman (2005.02.24) if (VectorForm) { if (!VectorForm->ExitReflectionMirror()) { // MainMenuForm->shFile->Brush->Color = clBlack; // MainMenuForm->shFile->Pen->Color = clBlack; END_TEX; return; } } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if(MainImageForm) MainImageForm->SaveToCurrentFile(); END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::miHotKeyClick(TObject *Sender) { // HotKey - by monkman (2010.07.01) TexActionManager->ForceSwitch = false; HotKeyForm = new THotKeyForm(this); HotKeyForm->ShowModal(); delete HotKeyForm; HotKeyForm = NULL; TexActionManager->ForceSwitch = true; } //--------------------------------------------------------------------------- void __fastcall TMainForm::TrialCheckTimerTimer(TObject *Sender) { #ifdef TRIAL_COMM String r_code; String login_address = "http://www.texclub.com"; String logout_address = "http://www.texclub.com/distribute/logout.php "; static bool notConnected = false; TrialCheckTimer->Enabled = false; if (!CheckInet(login_address)) { if (notConnected) Application->Terminate(); //MessageDlg("Internet not connected! Computer will be shut down automatically in 2 minutes!", mtWarning, TMsgDlgButtons() << mbOK, 0); Application->MessageBox(L"ȨÆäÀÌÁö¿Í ¿¬°áÀÌ µÇÁö ¾Ê½À´Ï´Ù. ÀÎÅͳÝÀ» È®ÀÎÇϽñ⠹ٶø´Ï´Ù.\n\ ÇÁ·Î±×·¥ÀÌ 30ÃÊ ¾È¿¡ ÀÚµ¿ Á¾·áµË´Ï´Ù. ÆÄÀÏ ÀúÀå µî ÀÛ¾÷À» ¸¶¹«¸® ÇϽñ⠹ٶø´Ï´Ù.", L"Information", IDOK); notConnected = true; TrialCheckTimer->Interval = 30000; } else { login_address = "http://www.texclub.com/distribute/login.php"; r_code = TrialSendMsg(login_address, "2", Hashcode); //time check if (r_code == "suc") {//¼º°ø notConnected = false; TrialCheckTimer->Interval = 30000; } else if (r_code == "mis") {//½ÇÆÐ if (notConnected) { Application->Terminate(); return; } Application->MessageBox(L"Time Check ½ÇÆÐ·Î ÇÁ·Î±×·¥ÀÌ 30ÃÊ ¾È¿¡ ÀÚµ¿ Á¾·áµË´Ï´Ù. ÆÄÀÏ ÀúÀå µî ÀÛ¾÷À» ¸¶¹«¸® ÇϽñ⠹ٶø´Ï´Ù.", L"Information", MB_OK); notConnected = true; TrialCheckTimer->Interval = 30000; } else if (r_code == "dup") {//Áߺ¹ if (notConnected) { Application->Terminate(); return; } if (Application->MessageBox(L"´Ù¸¥ ÄÄÇ»ÅÍ¿¡¼­ »ç¿ëÁßÀÔ´Ï´Ù.\n\ ´Ù¸¥ ÄÄÇ»Å͸¦ Logout ½Ã۰í ÇÁ·Î±×·¥À» °è¼Ó »ç¿ëÇϽðڽÀ´Ï±î?", L"Information", MB_OKCANCEL) == IDOK) { r_code = TrialSendMsg(logout_address, "1", "all"); r_code = TrialSendMsg(login_address, "1", Hashcode); if (r_code != "suc") { Application->MessageBox(L"login ½ÇÆÐ·Î ÇÁ·Î±×·¥ÀÌ 30ÃÊ ¾È¿¡ ÀÚµ¿ Á¾·áµË´Ï´Ù. ÆÄÀÏ ÀúÀå µî ÀÛ¾÷À» ¸¶¹«¸® ÇϽñ⠹ٶø´Ï´Ù.", L"Information", MB_OK); notConnected = true; TrialCheckTimer->Interval = 30000; } else { notConnected = false; } } else { //MessageDlg("Internet not connected! Computer will be shut down automatically in 2 minutes!", mtWarning, TMsgDlgButtons() << mbOK, 0); Application->MessageBox(L"ÇÁ·Î±×·¥ÀÌ 30ÃÊ ¾È¿¡ ÀÚµ¿ Á¾·áµË´Ï´Ù. ÆÄÀÏ ÀúÀå µî ÀÛ¾÷À» ¸¶¹«¸® ÇϽñ⠹ٶø´Ï´Ù.", L"Information", MB_OK); notConnected = true; TrialCheckTimer->Interval = 30000; } } else { if (notConnected) { Application->Terminate(); return; } Application->MessageBox(L"ȨÆäÀÌÁö¿Í ¿¬°áÀÌ µÇÁö ¾Ê½À´Ï´Ù. ÀÎÅͳÝÀ» È®ÀÎÇϽñ⠹ٶø´Ï´Ù.\n\ ÇÁ·Î±×·¥ÀÌ 30ÃÊ ¾È¿¡ ÀÚµ¿ Á¾·áµË´Ï´Ù. ÆÄÀÏ ÀúÀå µî ÀÛ¾÷À» ¸¶¹«¸® ÇϽñ⠹ٶø´Ï´Ù.", L"Information", MB_OK); notConnected = true; TrialCheckTimer->Interval = 30000; } } TrialCheckTimer->Enabled = true; #endif } //--------------------------------------------------------------------------- #ifdef TRIAL_COMM String __fastcall TMainForm::TrialSendMsg(String add, String type, String hashcode) { String r_code; TIdMultiPartFormDataStream* pData = NULL; TIdHTTP *IdHTTP = new TIdHTTP(this); pData = new TIdMultiPartFormDataStream(); pData->AddFormField( "user_id", User_ID.c_str() ); pData->AddFormField( "user_pass", User_PW.c_str() ); pData->AddFormField( "hashcode", hashcode.c_str()); //hashcode: random code pData->AddFormField( "program", "texstylist"); pData->AddFormField( "version", TrialVersion); pData->AddFormField( "ptype", type.c_str()); //1:login, 2:time check r_code = IdHTTP->Post(add, pData); if (pData != NULL) delete pData; pData = NULL; delete IdHTTP; return r_code; } #endif //--------------------------------------------------------------------------- ///ÇöÀç ½ÇÇà ÁßÀÎ TextileÀÇ °³¼ö¸¦ È®ÀÎ ÇÏ´Â ÇÔ¼ö by david 090501 int __fastcall TMainForm::GetCountExecutingProgram() { int number=0; // Initialization 0 HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // This function has system information String name; if(snap) // Excution snapshat handle { BOOL p_Count; // For count process PROCESSENTRY32 p_Entry; // Declare process struct p_Entry.dwSize = sizeof(PROCESSENTRY32); // A Function of PROCESSENTRY32 p_Count = Process32First(snap, &p_Entry); // Search a executing process while(p_Count) { p_Count = Process32Next(snap, &p_Entry); // Repeat to search executing process name = p_Entry.szExeFile; name = name.LowerCase(); if (name == "texstylist.exe") number++; // Increase number of executing process } CloseHandle(snap); // Close snapshot handle } return number; } //--------------------------------------------------------------------------- void __fastcall TMainForm::USBLockTimerTimer(TObject *Sender) { #ifdef LOCK_USB CheckLock(); #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::CheckLock() { #ifdef LOCK_USB if (turn){ bool bOK = false; String strUSBRoot; strUSBRoot = ExtractFileDrive(Application->ExeName); //strUSBRoot = "J:"; if (DirectoryExists(strUSBRoot)) { bOK = USBLock->Check(strUSBRoot, UL_TEXSTYLIST, true); } if (!bOK){ if (USBLock) { delete USBLock; USBLock = NULL; } Application->MessageBox(L"Authetication is not valid.", L"WARNING", MB_OK); Application->Terminate(); } } else { USBLock->CheckReverseEngineeringTools(); } turn = !turn; #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::ImageVectorizerClick(TObject *Sender) { if (MainImageForm && MainMenuForm) { if (ImageVectorizerForm) { ImageVectorizerForm->Visible = true; //ImageVectorizerForm->Show(); return; } BEGIN_LOG(""); BEGIN_TEX; MainMenuForm->ExitForm(1); ImageVectorizerForm = new TImageVectorizerForm(MainForm); ImageVectorizerForm->Parent = MainForm; ImageVectorizerForm->Visible = true; MainMenuForm->Item = T_VECTORIZE; END_TEX; END_LOG; //ImageVectorizerForm->Show(); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ProgramUpdateClick(TObject *Sender) { #if !(defined LOCK_IFC) && !(defined LOCK_USB) #if ((defined LOCK_CRYPKEY) && (defined WEB_LOCK)) || (defined LOCK_HASP) TAutoUpdateForm *AutoUpdateForm = new TAutoUpdateForm(this); AutoUpdateForm->AutoUpdate(true); if (AutoUpdateForm->InitForm(false)) { if (AutoUpdateForm->ShowModal() == mrOk) { delete AutoUpdateForm; return; } } delete AutoUpdateForm; #endif #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::BuyItemClick(TObject *Sender) { BuyItemLabel->URL = "http://www.texclub.com/cms2/goods_order_step1.php"; BuyItemLabel->Click(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::ShowPenAndNaviDockPanel(TPanel* APanel, bool MakeVisible, TControl* Client) { if (!MakeVisible && (APanel->VisibleDockClientCount > 1)) return; /* if (APanel == LeftDockPanel) VSplitter->Visible = MakeVisible; else HSplitter->Visible = MakeVisible; if (MakeVisible) { if (APanel == LeftDockPanel) { APanel->Width = ClientWidth / 3; VSplitter->Left = APanel->Width + VSplitter->Width; } else { APanel->Height = ClientHeight / 3; HSplitter->Top = ClientHeight - APanel->Height - HSplitter->Width; } } else { if (APanel == LeftDockPanel) APanel->Width = 0; else APanel->Height = 0; } */ if (MakeVisible && (Client != NULL)) Client->Show(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::CreateDockableWindows() // µµÅ· À©µµ¿ì »ý¼º { /* for (int i = 0; i < WindowCount; i++) { PenAndNaviDockWindows[i] = new TPenAndNaviDockForm(Application); //PenAndNaviDockWindows[i]->Parent = this; if (i) { PenAndNaviDockWindows[i]->Caption = L"Full View"; } else { PenAndNaviDockWindows[i]->Caption = L"Pen"; } } */ if ((PenManagerForm = new TPenManagerForm(Application))==NULL) goto fail; //PenManagerForm->Parent = this; PenManagerForm->Visible = true; //PenManagerForm->OnUpdateMenu = UpdateMenuItems; PenManagerForm->OnUpdateMenu = NULL; if ((FullViewForm = new TFullViewForm(Application))==NULL) goto fail; //FullViewForm->Parent = this; FullViewForm->Visible = true; //FullViewForm->OnSuperChange = MainMenuForm->SuperChange; //FullViewForm->OnUpdateMenu = UpdateMenuItems; FullViewForm->OnSuperChange = NULL; FullViewForm->OnUpdateMenu = NULL; fail: return; } //--------------------------------------------------------------------------- void __fastcall TMainForm::VPenDockItemClick(TObject *Sender) { /* TPenAndNaviDockForm* DockWindows; // µµÅ· °¡´ÉÇÑ À©µµ¿ì »ý¼º DockWindows = PenAndNaviDockWindows[dynamic_cast(Sender)->Tag]; if (DockWindows == NULL) throw EInvalidCast(""); if (dynamic_cast(DockWindows->HostDockSite) != NULL) static_cast(DockWindows->HostDockSite->Owner)->Show(); else { if ( (dynamic_cast(DockWindows->HostDockSite) != NULL) && !DockWindows->HostDockSite->Visible) { DockWindows->HostDockSite->Show(); (static_cast(DockWindows->HostDockSite))->UpdateCaption(NULL); DockWindows->Show(); } else { if ((dynamic_cast(DockWindows->HostDockSite) != NULL) && ((DockWindows->HostDockSite->Height == 0) | (DockWindows->HostDockSite->Width == 0))) { MainForm->ShowPenAndNaviDockPanel((static_cast(DockWindows->HostDockSite)), true, DockWindows); } else { DockWindows->Show(); } } } */ } //--------------------------------------------------------------------------- void __fastcall TMainForm::VPenandFullviewItemClick(TObject *Sender) { if (!PenAndNaviTabForm) { VPenandFullviewItem->Checked = true; PenAndNaviTabForm = new TPenAndNaviTabForm(this); PenAndNaviTabForm->Parent = this; // PenAndNaviTabForm->Visible = true; PenManagerForm->BorderStyle = Forms::bsNone; //PenManagerForm->ClientHeight = PenManagerForm->sbBtnUp->Top + PenManagerForm->sbBtnUp->Height; PenManagerForm->InitPenForm(); PenManagerForm->Parent = PenAndNaviTabForm->TabSheet1; PenAndNaviTabForm->TabSheet1->Caption = PenManagerForm->Caption; PenManagerForm->Left = 0; PenManagerForm->Top = 0; PenManagerForm->Visible = true; FullViewForm->BorderStyle = Forms::bsNone; FullViewForm->Parent = PenAndNaviTabForm->TabSheet2; PenAndNaviTabForm->TabSheet2->Caption = FullViewForm->Caption; FullViewForm->Left = 0; FullViewForm->Top = 0; FullViewForm->Visible = true; PenAndNaviTabForm->Visible = true; } else { VPenandFullviewItem->Checked = false; PenAndNaviTabForm->Visible = false; FullViewForm->BorderStyle = Forms::bsToolWindow; FullViewForm->Parent = this; FullViewForm->Visible = true; PenManagerForm->BorderStyle = Forms::bsToolWindow; //PenManagerForm->ClientHeight = PenManagerForm->sbBtnUp->Top + PenManagerForm->sbBtnUp->Height; PenManagerForm->InitPenForm(); PenManagerForm->Parent = this; PenManagerForm->Visible = true; delete PenAndNaviTabForm; PenAndNaviTabForm = NULL; } ToolsRearrange(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::WMDisplayChange(TWMDisplayChange &Msg) { if (MainMenuForm) MainMenuForm->WMDisplayChange(Msg); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VTexWorkClick(TObject *Sender) { BEGIN_LOG("::"); BEGIN_TEX; /* // Textile ÀÛ¾÷Áö½Ã¼­´Â ÁÖ¼®Ã³¸® - by monkman (2011.03.21) if(WindowLibForm->Visible)WindowLibForm->ExitClick(this); if(MotiveLibForm->Visible)MotiveLibForm->Button2Click(this); if(TexWork){ if (TexWork->WindowState == wsMinimized){ TexWork->WindowState = wsMaximized; TexWork->Height -= MainForm->StatusBar->Height + 5; } TexWork->Show(); } else { TexWork = new TTexWork(this); TexWork->Parent = MainForm; //TexWork->BorderStyle = Forms::bsNone; TexWork->Left = 0; //TexWork->Top = ClientHeight+20; TexWork->Visible = true; // shTexWork->Pen->Color = clBtnShadow; //lhskys °ËÁ¤»öÀ» »¡°£»öÀ¸·Î } */ #ifdef WORKSHEET WorkSheetForm->InitForm(NULL); WorkSheetForm->Show(); #endif END_TEX; END_LOG; } //--------------------------------------------------------------------------- void __fastcall TMainForm::StatusBarDrawPanel(TStatusBar *StatusBar, TStatusPanel *Panel, const TRect &Rect) { if (Panel == StatusBar->Panels->Items[StatusBarLogo]) { m_LogoRect.left = Rect.left + (Rect.Width() - imgLogo->Width) / 2; m_LogoRect.top = Rect.top + (Rect.Height() - imgLogo->Height) / 2; m_LogoRect.right = m_LogoRect.left + imgLogo->Width; m_LogoRect.bottom = m_LogoRect.top + imgLogo->Height; StatusBar->Canvas->StretchDraw(m_LogoRect, imgLogo->Picture->Graphic); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::StatusBarMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { if (X >= m_LogoRect.left && X < m_LogoRect.right && Y >= m_LogoRect.top && Y < m_LogoRect.bottom) { rzurllblHomePage->Click(); } } //--------------------------------------------------------------------------- /// dstMif MainImageFormÀ» rztabctrlCanvas¿¡ Ãß°¡ void __fastcall TMainForm::AddCanvasTab(TObject *dstMif, String tabCaption) { TRzTabCollectionItem *newTabItem = rztabctrlCanvas->Tabs->Add(); newTabItem->Hint = tabCaption; // Tab CaptionÀÌ TabÀÇ Width¿¡ ºñÇØ ³Ê¹« Ŭ °æ¿ì CaptionÀÇ ÀϺθ¦ »ý·« int textWidth = Canvas->TextWidth(tabCaption); if (textWidth > rztabctrlCanvas->TabWidth - 40) { int textLength = (rztabctrlCanvas->TabWidth - 40) * tabCaption.Length() / textWidth - 3; tabCaption = tabCaption.SubString(1, textLength); tabCaption += "..."; } newTabItem->Caption = tabCaption; newTabItem->Data = dstMif; } //--------------------------------------------------------------------------- /// dstMif MainImageFormÀ» rztabctrlCanvas¿¡¼­ Á¦°Å void __fastcall TMainForm::RemoveCanvasTab(TObject *dstMif) { for (int idx = 0; idx < rztabctrlCanvas->Tabs->Count; idx++) { TRzTabCollectionItem *aTabItem = rztabctrlCanvas->Tabs->Items[idx]; if (aTabItem->Data == dstMif) { rztabctrlCanvas->Tabs->Delete(idx); // TabÀÌ ¾ø´Â °æ¿ì¿¡µµ CloseButtonÀÌ ³²¾Æ ÀÖ¾î TabIndex¸¦ -1·Î ¼³Á¤ÇÏ¿© ÇØ°á if (rztabctrlCanvas->Tabs->Count == 0) rztabctrlCanvas->TabIndex = -1; break; } } } //--------------------------------------------------------------------------- /// dstMif MainImageForm¿¡ ÇØ´çÇÏ´Â TabÀÇ String ¼öÁ¤ void __fastcall TMainForm::UpdateCanvasTab(TObject *dstMif, String tabCaption, bool modified) { for (int idx = 0; idx < rztabctrlCanvas->Tabs->Count; idx++) { TRzTabCollectionItem *aTabItem = rztabctrlCanvas->Tabs->Items[idx]; if (aTabItem->Data == dstMif) { aTabItem->Hint = tabCaption; // Tab CaptionÀÌ TabÀÇ Width¿¡ ºñÇØ ³Ê¹« Ŭ °æ¿ì CaptionÀÇ ÀϺθ¦ »ý·« int textWidth = Canvas->TextWidth(tabCaption); if (textWidth > rztabctrlCanvas->TabWidth - 40) { int textLength = (rztabctrlCanvas->TabWidth - 40) * tabCaption.Length() / textWidth - 3; tabCaption = tabCaption.SubString(1, textLength); tabCaption += "..."; } aTabItem->Caption = tabCaption; if (modified == true) aTabItem->Color = (TColor)0x00FFE2C4; else aTabItem->Color = clBtnFace; break; } } } //--------------------------------------------------------------------------- /// dstMif MainImageForm¿¡ ÇØ´çÇÏ´Â TabÀ» ¼±Åà void __fastcall TMainForm::ChangeCanvasTab(TObject *dstMif) { for (int idx = 0; idx < rztabctrlCanvas->Tabs->Count; idx++) { TRzTabCollectionItem *aTabItem = rztabctrlCanvas->Tabs->Items[idx]; if (aTabItem->Data == dstMif) { rztabctrlCanvas->TabIndex = idx; break; } } } //--------------------------------------------------------------------------- /// CanvasTab Visible ¼³Á¤ void __fastcall TMainForm::VCanvasTabItemClick(TObject *Sender) { if (VCanvasTabItem->Checked == true) { VCanvasTabItem->Checked = false; rztabctrlCanvas->Visible = false; } else { VCanvasTabItem->Checked = true; rztabctrlCanvas->Visible = true; rztabctrlCanvas->Tabs->Clear(); for (int idx = 0; idx < MDIChildCount; idx++) { TMainImageForm *aMif = dynamic_cast(MDIChildren[idx]); AddCanvasTab(dynamic_cast(aMif), aMif->FileName); } if (MDIChildCount > 0) ChangeCanvasTab(dynamic_cast(ActiveMDIChild)); } } //--------------------------------------------------------------------------- /// CanvasTabÀÇ TabIndex º¯°æ void __fastcall TMainForm::rztabctrlCanvasChanging(TObject *Sender, int NewIndex, bool &AllowChange) { TMainImageForm *dstMif = static_cast(rztabctrlCanvas->Tabs->Items[NewIndex]->Data); if (dstMif != NULL) { dstMif->Show(); if (dstMif->WindowState == wsMinimized) dstMif->WindowState = wsNormal; } } //--------------------------------------------------------------------------- /// CanvasTabÀÇ ÇöÀç Tab ´Ý±â void __fastcall TMainForm::rztabctrlCanvasClose(TObject *Sender, bool &AllowClose) { TMainImageForm *dstMif = static_cast(rztabctrlCanvas->Tabs->Items[rztabctrlCanvas->TabIndex]->Data); // Tab¿¡ ÇØ´çÇÏ´Â MainImageForm ´Ý±â if (dstMif != NULL) dstMif->Close(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnitmCloseTabClick(TObject *Sender) { if (rztabctrlCanvas->Tabs->Count > 0) rztabctrlCanvas->CloseActiveTab(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::mnitmPrintTabClick(TObject *Sender) { if (rztabctrlCanvas->Tabs->Count > 0) FPrintingItemClick(NULL); } //--------------------------------------------------------------------------- void __fastcall TMainForm::rztabctrlCanvasContextPopup(TObject *Sender, TPoint &MousePos, bool &Handled) { if (rztabctrlCanvas->Tabs->Count > 0){ mnitmCloseTab->Enabled = true; mnitmPrintTab->Enabled = true; } else { mnitmCloseTab->Enabled = false; mnitmPrintTab->Enabled = false; } } //--------------------------------------------------------------------------- void __fastcall TMainForm::StatusBarMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { if (X >= m_LogoRect.left && X < m_LogoRect.right && Y >= m_LogoRect.top && Y < m_LogoRect.bottom) { Screen->Cursor = crHandPoint; } else { Screen->Cursor = crDefault; } } //--------------------------------------------------------------------------- void __fastcall TMainForm::StatusBarMouseLeave(TObject *Sender) { Screen->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TMainForm::VLibraryItemClick(TObject *Sender) { BEGIN_TEX; if (LibraryForm && LibraryForm->Visible == false){ LibraryForm->InitForm(); LibraryForm->Visible = true; } END_TEX; } //--------------------------------------------------------------------------- void __fastcall TMainForm::MenuVisibleChange() { // top menu CaptureItem->Visible = false; ImageItem->Visible = false; VN3DItem->Visible = false; WorkArea1->Visible = false; Motive1->Visible = false; N7->Visible = false; // ±¸ºÐ¼± VLibraryItem->Visible = false; Screencam1->Visible = false; ProgramUpdate->Visible = false; BuyItem->Visible = false; VPenDockItem->Visible = false; VFullViewDockItem->Visible = false; // MainMenu popup MainMenuForm->repeat1->Visible = false; MainMenuForm->Draw1->Visible = false; MainMenuForm->Fill1->Visible = false; MainMenuForm->SpreadFill1->Visible = false; MainMenuForm->Stipple1->Visible = false; MainMenuForm->Style1->Visible = false; MainMenuForm->PatternRepeat1->Visible = false; MainMenuForm->N3D1->Visible = false; MainMenuForm->Stripe1->Visible = false; MainMenuForm->ColorSeparate1->Visible = false; MainMenuForm->Stitch1->Visible = false; MainMenuForm->Text1->Visible = false; MainMenuForm->ColorCombo1->Visible = false; MainMenuForm->Scratch1->Visible = false; MainMenuForm->Jacquard1->Visible = false; MainMenuForm->Shadow1->Visible = false; MainMenuForm->After1->Visible = false; MainMenuForm->BitmapReflection1->Visible = false; MainMenuForm->Printing1->Visible = false; MainMenuForm->Scanning1->Visible = false; } //--------------------------------------------------------------------------- void __fastcall TMainForm::CheckTimerTimer(TObject *Sender) { #ifdef LOCK_TEX CheckReverseEngineeringTools(); #endif } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- /* SK SMART E - FOCUS SYSTEM */ /* SK Web service¿Í ¿¬µ¿Çϱâ À§ÇØ ÇÊ¿äÇÑ ºÎºÐ */ //--------------------------------------------------------------------------- #ifdef SK_SMART //--------------------------------------------------------------------- void __fastcall TMainForm::WMsgWebDownLoadFileForEfocus(TMessage &Msg) { if (nSmartParamCount != 0 && strSmartParam) { RunWebDownLoadFile(strSmartParam, nSmartParamCount); delete[] strSmartParam; } nSmartParamCount = 0; strSmartParam = NULL; } //07.02.23 for SK // void __fastcall TMainForm::WMessageForEfocus(TMessage &Msg) // { // String message; // switch((unsigned int) Msg.WParam){ // case 0: message = "No message in mailslot."; // break; // case 1: message = "Message Sending Complete."; // break; // case 2: message = "Can't create mailslot."; // break; // case 3: message = "E-Focus Refresh or Disconnected."; // break; // default: return; // } // Application->MessageBox(message.c_str(), L"Network Message", MB_OK); // } //--------------------------------------------------------------------- //For SK - E-Focus (by maxleo21c 07.01.04) bool __fastcall TMainForm::RunWebDownLoadFile(String *param, int paramCount) { bool bMakeFile=false; ParsedURL myURL, targetURL; String FileName, DirName, FileExt; const String tempDirectory = DirectoryItem + "\\SK\\"; DWORD hgetfile = GetFileAttributes(tempDirectory.c_str() ); if (hgetfile==0xFFFFFFFF) {//µð·ºÅ丮°¡ Á¸ÀçÇÏÁö ¾Ê´Ù¸é~ CreateDirectory(tempDirectory.c_str(), NULL); } hgetfile = GetFileAttributes((tempDirectory+"\\JPEG\\").c_str() ); if (hgetfile==0xFFFFFFFF) {//µð·ºÅ丮°¡ Á¸ÀçÇÏÁö ¾Ê´Ù¸é~ CreateDirectory((tempDirectory+"\\JPEG\\").c_str(), NULL); SetFileAttributes((tempDirectory+"\\JPEG\\").c_str(),FILE_ATTRIBUTE_HIDDEN); } //String ServerAddress,SendFileName; String localPath; if(myURL.parseURL(param[0].c_str()) ){ //Á¦´ë·Î ÆÄ½ÌµÇ´Â URLÀ̸é localPath = tempDirectory + myURL.remoteFilename; if (!HTTPDown(NULL,param[0].c_str(),localPath.c_str(), myURL)) { bMakeFile = true; } DirName = ExcludeTrailingBackslash(ExtractFilePath(localPath)); FileName = ExtractFileName(localPath); FileExt = ExtractFileExt(localPath); } else { bMakeFile = true; } if (!targetURL.parseURL(param[1].c_str()) ) { //Á¦´ë·Î ÆÄ½ÌµÇ´Â URLÀ̸é Application->MessageBox(IDS_SK_MSG6.c_str(), L"Warning", MB_OK);//¾÷·Îµå ÁÖ¼Ò°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù. return false; } /* if (paramCount==4) { myURL.ID = param[2]; myURL.PW = param[3]; targetURL.ID = param[2]; targetURL.PW = param[3]; } */ if (!bMakeFile) { if (FileExt.LowerCase() == ".svg") { bFirst = 2; OpenFile_HTTP(DirName, FileName, gffSVG, 24, myURL, targetURL); } else if (FileExt.LowerCase() == ".tfc") { bFirst = 2; OpenFile_HTTP(DirName, FileName, gffTFC, 24, myURL, targetURL); } else {//FileÀÌ LinkµÇ¾î ÀÖÁö ¾Ê¾Æ ¿­¼ö ¾ø½À´Ï´Ù Application->MessageBox(IDS_SK_MSG7.c_str(), L"Warning", MB_OK); return false; } } else { if (!NewCanvasFullForSK(targetURL, param, paramCount)) return false; } if (paramCount>2 && param[2].Length()>0 && MainImageForm) { MainImageForm->mailslot_Number = param[2]; // mailslotÀÇ À̸§À» È®ÀÎÇϱâ À§Çؼ­~ MainImageForm->WebConnected = true; } // ÀÌ°É ÇØÁà¾ß Ä÷¯ ÃʱⰪÀÌ ¼³Á¤µÈ´Ù. (OpenFile_HTTP¿¡¼­ Á¦´ë·Î ó¸®ÇÏÁö ¸øÇÑ´Ù.) PaletteForm->FormActivateCOLOR(); return true; } //--------------------------------------------------------------------- bool __fastcall TMainForm::NewCanvasFullForSK(ParsedURL targetURL, String *param, int paramCount) { TCursor cur; TMainImageForm *Child = NULL; TNewCanvasForm *Form; TPException ec = EC_NONE; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï Æû´Ý±â - by monkman (2005.02.24) if (VectorForm) { if (!VectorForm->ExitReflectionMirror()) return false; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PenManagerForm->spread_sw[4] = 0; PenManagerForm->aspread = false; PenManagerForm->acolor = 0; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else if (ProtectCard->isHacked(hsTexStylist, TexStylistVersion)) { EXCEPTION_MESSAGE_OK(EC_HASPKEYNOTFOUND); Application->Terminate(); } #endif #endif Form = new TNewCanvasForm(NULL); if (paramCount == 6) { Form->SetCanvasForSK(param); } if (Form->ShowModal()==mrOk) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (MainImageForm) { if (MainImageForm->AutoRepeat && (MainImageForm->LayerCNT == MainImageForm->ARLayerCnt)) MainImageForm->ARViewExitForm(); } if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; goto fail; } MainImageForm->AutoRepUpdateMenu(true); //lhskys »õ·Î¿î MainMenu »ý¼º if ((ec = Child->InitForm(Form->CanvasInfor, 24))!=EC_NONE) goto fail; targetURL.Copy(Child->TargetInternetURL); Child->DirName = DirectoryItem + "\\SK";; Screen->Cursor = cur; PaletteForm->FormActivateCOLOR(); } delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { ec = EC_INTERFACE_NONE; SAVE_EXCEPTION(ec); EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } #endif #endif for (int i=0; MDIChildCount-1 >= i; i++) { if (MDIChildren[i] != Child) { static_cast(MDIChildren[i])->SourceInternetURL.Clear(); static_cast(MDIChildren[i])->TargetInternetURL.Clear(); } } return true; fail: if (Child) delete Child; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); return false; } //--------------------------------------------------------------------------- //For SK - E-Focus (by maxleo21c 07.01.04) void __fastcall TMainForm::OpenFile_HTTP(String DirName, String FileName, int Index, WORD bpp, ParsedURL myURL, ParsedURL targetURL) { TCursor cur; TMainImageForm *Child = NULL; TPException ec = EC_NONE; MainMenuForm->ExitForm(1); cur = Screen->Cursor; Screen->Cursor = crHourGlass; if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; goto fail; } if ((ec = Child->InitFormFile(DirName, FileName, (TGraphicFileFormat)Index, bpp, myURL, targetURL))!=EC_NONE) goto fail; for (int i=0; MDIChildCount-1 >= i; i++) { if (MDIChildren[i] != Child) { static_cast(MDIChildren[i])->SourceInternetURL.Clear(); static_cast(MDIChildren[i])->TargetInternetURL.Clear(); } } Screen->Cursor = cur; return; fail: if (Child) delete Child; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); return; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FindFileRecursive(wchar_t *path) { HANDLE hSrch; WIN32_FIND_DATA wfd; wchar_t DirName[MAX_PATH]; bool bResult=true; wchar_t drive[_MAX_DRIVE]; wchar_t dir[MAX_PATH]; wchar_t newpath[MAX_PATH]; String filename; hSrch=FindFirstFile(path, &wfd); while(bResult) { _wsplitpath(path, drive, dir, NULL, NULL); if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if (wfd.cFileName[0]!='.') { swprintf(newpath,L"%s%s%s\\*.*", drive, dir, wfd.cFileName); FindFileRecursive(newpath); } } else { swprintf(DirName, L"%s%s", drive, dir); filename = wfd.cFileName; if (filename.Length() > 0) { String ext = LowerCase(ExtractFileExt(filename)); if (ext == ".svg" || ext ==".jpg") { filename = DirName; filename += wfd.cFileName; DeleteFile(filename); } } } bResult=FindNextFile(hSrch, &wfd); } FindClose(hSrch); } #endif //--------------------------------------------------------------------------- // ÀÓ½ÃÆÄÀÏÀ» Áö¿ì±â À§Çؼ­ void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action) { #ifdef SK_SMART //ÀÌ¿ë´ë Â÷ÀåÀÌ ½º¸¶Æ®¿¡¼­ ÆÄÀÏÀ» Áö¿ìÁö ¾Ê°Ô ÇØ´Þ¶ó°í ¿äûÀ» ÇØ¼­ //¾Æ·¡¿Í °°ÀÌ ÁÖ¼®À¸·Î ó¸® 13.07.19 //String path = DirectoryItem + "\\SK"; //FindFileRecursive(path.c_str()); #endif #ifdef WEB_LOCK if (LogObj) { LogObj->AddLog(rtime); delete LogObj; LogObj = NULL; } #endif } //--------------------------------------------------------------------------- #ifdef WEB_LOCK void __fastcall TMainForm::OffLineSet() { String logMAC; String logPRG; String logRTime; SYSTEMTIME sysLTime; String logLTime, strlogLTime; String strsysLTime; int OffTime; TDateTime dtlogLT, dtsysLT; LogData* tempdata = LogObj->ReadLastLog(); logMAC = tempdata->macaddress; logPRG = tempdata->program; logRTime = tempdata->rtime; logLTime = tempdata->ltime; free(tempdata); if (logMAC != MACaddress.SubString(1, 8) || logPRG != PRG_VSN) { Application->MessageBox(IDS_ERR_OFFLINESET.c_str(), L"ERROR", MB_OK); LogObj->DeleteLog(); delete LogObj; LogObj = NULL; Application->Terminate(); } rtime = logRTime.ToInt(); strlogLTime = "20" + logLTime.SubString(1, 2) + "-"; strlogLTime += logLTime.SubString(3, 2) + "-"; strlogLTime += logLTime.SubString(5, 2) + " "; strlogLTime += logLTime.SubString(7, 2) + ":"; strlogLTime += logLTime.SubString(9, 2) + ":"; strlogLTime += logLTime.SubString(11, 2); GetLocalTime(&sysLTime); strsysLTime.sprintf(L"%d-%02d-%02d %02d:%02d:%02d", sysLTime.wYear, sysLTime.wMonth, sysLTime.wDay, sysLTime.wHour, sysLTime.wMinute, sysLTime.wSecond); dtlogLT = StrToDateTime(strlogLTime); dtsysLT = StrToDateTime(strsysLTime); OffTime = SecondsBetween(dtsysLT, dtlogLT); //¼­¹ö¿¡¼­ unlimitedÀ̸é -1000À» ¸®ÅÏÇϱ⠶§¹®¿¡ ¾Æ·¡¿Í °°ÀÌ ºñ±³ÇÔ. //-1000Àº ¾ç¼ö·Î º¯°æÇÏÁö ¾ÊÀ½. if (rtime != -1000) { rtime -= OffTime; if (rtime < 0) rtime = 0; } } #endif //--------------------------------------------------------------------------- void __fastcall TMainForm::WebLockT1Timer(TObject *Sender) { #ifdef WEB_LOCK if (rtime == -1000) {//unlimited ÀÌ¸é ³²Àº ½Ã°£À» º¯°æÇÏ¸é ¾ÈµÈ´Ù. WebLockT1->Enabled = false; StatusBar->Panels->Items[StatusBarRTime]->Text = "Unlimited"; return; } int rd, rh, rm, rs; if (rtime > 0) rtime--; else rtime = 0; rs = rtime; rm = rs / 60; rs %= 60; rh = rm / 60; rm %= 60; rd = rh / 24; rh %= 24; String temp = ""; if (rd) { temp += IntToStr(rd) + IDS_RTIME_D + " "; } temp += IntToStr(rh) + IDS_RTIME_H + " "; temp += IntToStr(rm) + IDS_RTIME_M; StatusBar->Panels->Items[StatusBarRTime]->Text = temp; #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::WebLockT2Timer(TObject *Sender) { #ifdef WEB_LOCK if (rtime == -1000) { //unlimited WebLockT2->Enabled = false; return; } if (LogObj) LogObj->AddLog(rtime); #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::WebLockT3Timer(TObject *Sender) { #ifdef WEB_LOCK if (rtime == -1000) { //unlimited WebLockT3->Enabled = false; return; } static bool shown5 = false; if (rtime >= 295 && rtime <= 305 && !shown5) { shown5 = true; MessageBoxTimeout(NULL, IDS_RTIME5_ALARM.c_str(), Application->Title.c_str(), MB_OK|MB_ICONWARNING, 0, 200000); } static bool shown1 = false; if (rtime >= 60 && rtime <= 70 && !shown1) { shown1 = true; MessageBoxTimeout(NULL, IDS_RTIME1_ALARM.c_str(), Application->Title.c_str(), MB_OK|MB_TOPMOST|MB_ICONWARNING, 0, 40000); } if (rtime <= 0) { // Expired! if (LogObj) LogObj->AddLog(rtime); WebLockT1->Enabled = false; WebLockT2->Enabled = false; WebLockT3->Enabled = false; Application->MessageBox(IDS_EXPIRED_MSG.c_str(), IDS_EXPIRED_CAPTION.c_str(), MB_OK); //////// Off-line //////// #ifndef EDU_ASP if(!checkInetConnect() || (checkRemainTime(Application) == -100)) { TTempKeyDialogForm *reTempKeyDialogForm; reTempKeyDialogForm = new TTempKeyDialogForm(Application); if ( reTempKeyDialogForm->ShowModal() == mrOk ) { delete reTempKeyDialogForm; OffLineSet(); shown5 = false; shown1 = false; WebLockT1->Enabled = true; WebLockT2->Enabled = true; WebLockT3->Enabled = true; } else { delete reTempKeyDialogForm; if (LogObj) { delete LogObj; LogObj = NULL; } Application->Terminate(); } } //////// On-line //////// else { #endif LogObj->FlushLog(); TActivationDialogForm * reActivationDialogForm; reActivationDialogForm = new TActivationDialogForm(Application); if ( reActivationDialogForm->ShowModal() == mrOk ) { delete reActivationDialogForm; rtime = checkRemainTime(Application); shown5 = false; shown1 = false; WebLockT1->Enabled = true; WebLockT2->Enabled = true; WebLockT3->Enabled = true; } else { delete reActivationDialogForm; if (LogObj) { delete LogObj; LogObj = NULL; } Application->Terminate(); } #ifndef EDU_ASP } #endif } #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::RenewActivationClick(TObject *Sender) { #ifdef WEB_LOCK if(!checkInetConnect() || (checkRemainTime(Application) == -100)) { Application->MessageBox(IDS_RENEW_FAIL.c_str(), L"FAIL", MB_OK); return; } TActivationDialogForm * renewActivationDialogForm; renewActivationDialogForm = new TActivationDialogForm(NULL); if ( renewActivationDialogForm->ShowModal() == mrOk ) { delete renewActivationDialogForm; rtime = checkRemainTime(Application); WebLockT1->Enabled = true; WebLockT2->Enabled = true; WebLockT3->Enabled = true; } else { delete renewActivationDialogForm; } #endif } //---------------------------------------------------------------------------