//--------------------------------------------------------------------------- #include #include #include #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 "W:\TpwTest\CommonTextile\TPrint_F.h" // #include "TPrint_F.h" by jeegeo #include "Undo.h" #include "VecDraw.h" #include "Grid_F.h" #include "Motivelib_F.h" #include "Windowlib_F.h" #include "Window.h" #include "N3DMapping.h" #include "N3DPattern.h" #ifndef ACADEMY #include "CaptureEdit.h" #include "UserColor_F.h" #include "Layer_F.h" #include "TexWork_F.h" #endif //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "ltimg_bc.lib" #pragma link "lttwn_bc.lib" #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] //--------------------------------------------------------------------------- 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) { 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; } //============================================= 2001.5.23 by lhskys windows version ¾Ë¾Æ³»±â... /* AnsiString version; TRegIniFile *RegIniFile; RegIniFile = new TRegIniFile(RegFilename); version = RegIniFile->ReadString("Common", "Windows Version", "" ); if(version == ""){ AnsiString 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"); } }*/ OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osvi); osVERSION = osvi.dwPlatformId; //============================================== #ifdef N_SCREENCAM Screencam1->Visible = false; #endif FILEOPEN = true; //2001.4.11. by lhskys Open Ãß°¡ WReopenMove = false; WaSave = false; MoSave = false; ReadN3D=false; } //--------------------------------------------------------------------------- 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) { 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 ProtectCard->Read(); #endif #endif if ((Form = new TNewCanvasForm(NULL))==NULL) { ec = EC_FORM_NOT_CREATE; 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; goto fail; } 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 { EXCEPTION_MESSAGE_OK(EC_INTERFACE_NONE); Application->Terminate(); } #endif #endif return; fail: if (Form) { if (Child) delete Child; Screen->Cursor = cur; delete Form; } EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FNewCanvasFullItemClick(TObject *Sender) { TCursor cur; TMainImageForm *Child = NULL; TNewCanvasForm *Form; 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 ProtectCard->Read(); #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; 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 { EXCEPTION_MESSAGE_OK(EC_INTERFACE_NONE); Application->Terminate(); } #endif #endif return; fail: if (Child) delete Child; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FManagerItemClick(TObject *Sender) { TFileManagerForm *Form; MainMenuForm->ExitForm(1); #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC if (ProtectCard->CheckPassword()) { #else ProtectCard->Read(); #endif #endif if ((Form = new TFileManagerForm(this)) == NULL) goto fail; if (MainImageForm) { Form->Extension = MainImageForm->iMainImage->Bitmap->BitsPerPixel; } else { Form->Extension = 8; } Form->CompressCheckBox->Checked = (CompressMethod == cmNone) ? false: true; Form->FilterComboBox->Filter = #ifdef ACADEMY "Texpro Textile 256 Colors File (*.tex)|*.tex|" "Microsoft Windows Bitmap (*.bmp)|*.bmp|" "TIFF uncomp (*.tif)|*.tif"; #else "Texpro Textile 256 Colors File (*.tex)|*.tex|" "Texpro Textile Full Colors File (*.tfc)|*.tfc|" #ifndef N_3D "Texpro Textile 3D File (*.t3d)|*.t3d|" #ifdef NOTN3D #else "Texpro Textile New 3D File (*.n3d)|*.n3d|" #endif #endif "Texpro Weave File (*.wea)|*.wea|" "Texpro Weave File - V7.01 (*.wav)|*.wav|" "Texpro Knit File (*.knt)|*.knt|" "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|" "ALL Files (*.*)|*.*"; // "GIF (*.gif)|*.gif"; // by mecbong #endif //================================================================= Form->OnRead = FMOnRead; Form->OnFileName = FMOnFileName; if (MainImageForm) { Form->SpeedButtonSave->Enabled = true; Form->SpeedButtonSaveAs->Enabled = true; Form->OnSave = FMOnSave; Form->OnMerge = FMOnMerge; } else { Form->SpeedButtonSave->Enabled = false; Form->SpeedButtonSaveAs->Enabled = false; } Form->ShowModal(); delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { EXCEPTION_MESSAGE_OK(EC_INTERFACE_NONE); Application->Terminate(); } #endif #endif return; fail: EXCEPTION_MESSAGE_OK(EC_FORM_NOT_CREATE); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FCloseItemClick(TObject *Sender) { if (ActiveMDIChild) ActiveMDIChild->Close(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FResizeCanvasItemClick(TObject *Sender) { 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(!(StrToFloat(Form->edNSWidth->Text) > 0)){ ShowMessage("Floating point division by zero."); goto next; }else if(!(StrToFloat(Form->edNSHeight->Text) > 0)){ ShowMessage("Floating point division by zero."); goto next; } MainImageForm->UndoSave(UK_ALL, Rect(0,0,MainImageForm->iMainImage->Bitmap->Width,MainImageForm->iMainImage->Bitmap->Height)); MainImageForm->ResizeCanvas(Form->NewDPI, Form->NewSize.cx, Form->NewSize.cy); Screen->Cursor = cur; } next: delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { EXCEPTION_MESSAGE_OK(EC_INTERFACE_NONE); Application->Terminate(); } #endif #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::FEnlargeCanvasItemClick(TObject *Sender) { 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; MainImageForm->EnlargeCanvas(Form->NewSize.cx, Form->NewSize.cy); Screen->Cursor = cur; } delete Form; #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC } else { EXCEPTION_MESSAGE_OK(EC_INTERFACE_NONE); Application->Terminate(); } #endif #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::FScannerSetupItemClick(TObject *Sender) { int nRet; nRet = L_TwainSelect(Application->Handle); if (nRetCursor; Screen->Cursor = crDefault; TPItemImage *ti = MainImageForm->iMainImage; memset(&hBitmap, 0, sizeof(BITMAPHANDLE)); if (L_InitBitmap(&hBitmap, 0, 0, 24)Handle, &hBitmap); if (nRet < SUCCESS) goto fail; if (!hBitmap.Flags.Allocated) goto fail; if (ti->Bitmap->BitsPerPixel==8) { if (L_ColorResBitmap(&hBitmap, &hBitmap, 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)); if (ti->LayerMask) ti->LayerMask->FillRect(r, PALETTEINDEX(255)); 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) { ec = EC_RESOURCE_LACK; goto fail; } if ((dcDst = ti->Bitmap->CreateDC())==NULL) { ec = EC_RESOURCE_LACK; goto fail; } BitBlt(dcDst, 0, 0, w, h, dcSrc, 0, 0, SRCCOPY); if (ti->LayerMask) ti->LayerMask->FillRect(Rect(0, 0, w, h), 0); 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()) { ec = EC_MEMORY_LACK; goto fail; } for (y=0; yBitmap->GetScanLine(y); for (x=0; xBitmap->PutScanLine(y); } ti->Bitmap->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); ti->Bitmap->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, 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 (ti->LayerMask) ti->LayerMask->FillRect(r, clWhite); 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) { ec = EC_RESOURCE_LACK; goto fail; } if ((dcDst = ti->Bitmap->CreateDC())==NULL) { ec = EC_RESOURCE_LACK; goto fail; } BitBlt(dcDst, 0, 0, w, h, dcSrc, 0, 0, SRCCOPY); if (ti->LayerMask) ti->LayerMask->FillRect(Rect(0, 0, w, h), 0); ti->Bitmap->DeleteDC(dcDst); L_DeleteLeadDC(dcSrc); r.right = w; r.bottom = h; } MainImageForm->WorkArea->SetRectangle(r); MainImageForm->WorkAreaChange(); L_FreeBitmap(&hBitmap); RepaintColor(); Screen->Cursor = OldCursor; return; fail: ti->Bitmap->StopScanLine(); if (dcSrc) { if (dcDst) ti->Bitmap->DeleteDC(dcDst); L_DeleteLeadDC(dcSrc); } L_FreeBitmap(&hBitmap); Screen->Cursor = OldCursor; EXCEPTION_MESSAGE_OK(ec); /* 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, 0, 0, 24)Handle, &hBitmap)Bitmap->BitsPerPixel==8) { if (L_ColorResBitmap(&hBitmap, &hBitmap, 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, 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::FPrinterSetupItemClick(TObject *Sender) { PrinterSetupDialog->Execute(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FPrintingItemClick(TObject *Sender) { TTPrintForm *PrintForm = NULL; //ComboHeader~~Method¿¡¼­ ½ÇÁ¦ ÀÛ¾÷±¸¿ª(ÆÐÅÏ=BitmapÀ¸·Î µÇ¾îÀÖ´Ù.)°ú TTexpiaBitmap *Pattern = NULL; //ColorChipµîÀ» ºÙ¿©ÁØ´Ù. int mx, my, WW, HH; //DPI //Pattern¿¡ ºÙ¿©ÁØ´Ù. by k3dogs TSize r; bool FitSize; double rx, ry, DPI; int PrintPosition = 0; float WRatio = 0.0, HRatio = 0.0; TColor GridColor; //±×¸®µå ÇÁ¸°Æ®Çϱâ À§ÇØ by k3dogs TGrid Grid; int GridMark; TColor GridMarkColor; if ((PrintForm = new TTPrintForm(this))==NULL) goto fail; PrintForm->InitForm(); if (PrintForm->ShowModal()==mrOk) { if ((Pattern = new TTexpiaBitmap)==NULL) goto fail; DPI = MainImageForm->CanvasInfor.DotsPerInch; FitSize = PrintForm->cbFitSize->Checked; GridColor = FullViewForm->rGridColor; Grid = FullViewForm->rGrid; GridMark = FullViewForm->rGridMark; GridMarkColor = FullViewForm->rGridMarkColor; #if defined(TEXTILE) //====================== 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, StrToInt(PrintForm->EditRepeat->Text), PrintForm->ComboBoxRepeat->ItemIndex)) goto fail; if (PrintForm->GridCheck->Checked == true) // MainImageForm->PrintGrid(Pattern, r, GridColor, Grid, GridMark, GridMarkColor); //by k3dogs ±×¸®µå Ãâ·Â. if (FitSize) { rx = (double)WW / Pattern->Width; ry = (double)HH / Pattern->Height; if (rx < ry) { if (rx < 1.0) DPI = DPI / rx; } else { if (ry < 1.0) DPI = DPI / ry; } } else { DPI = DPI * 100 / StrToInt(PrintForm->EditZoom->Text); } break; case phYes: if (!MainImageForm->ComboHeaderYesMethod(Pattern)) goto fail; if (PrintForm->GridCheck->Checked == true) { // r.cx = 1; r.cy = 1; MainImageForm->PrintGrid(Pattern, r, GridColor, Grid, GridMark, GridMarkColor); //by k3dogs ±×¸®µå Ãâ·Â. } if (FitSize) { rx = (double)WW / Pattern->Width; ry = (double)HH / Pattern->Height; if (rx < ry) { if (rx < 1.0) DPI = DPI / rx; } else { if (ry < 1.0) DPI = DPI / ry; } } else { DPI = DPI * 100 / StrToInt(PrintForm->EditZoom->Text); } break; case phUsedColor: if (!MainImageForm->ComboHeaderUsedColorMethod(Pattern, false)) goto fail; break; case phMosaic: mx = PrintForm->MosaicXEdit->Value; my = PrintForm->MosaicYEdit->Value; if (!MainImageForm->ComboHeaderMosaicMethod(Pattern, mx, my)) goto fail; break; } #if defined(TEXTILE) if (!SendToPrinter(Pattern, DPI, "Textile - "+MainImageForm->FileName, PrintForm->SpinEditPage->Value, PrintForm->cbMethod->ItemIndex, PrintPosition, WRatio, HRatio, MainImageForm->Number)) goto fail; #else if (!SendToPrinter(Pattern, DPI, "Textile - "+MainImageForm->FileName, PrintForm->SpinEditPage->Value, PrintForm->cbMethod->ItemIndex)) goto fail; #endif delete Pattern; } delete PrintForm; return; fail: if (Pattern) delete Pattern; if (PrintForm) delete PrintForm; EXCEPTION_MESSAGE_OK(EC_MEMORY_LACK); } //--------------------------------------------------------------------------- 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(DirectoryItem + "\\Environment.ini"); if (IniFile) { SaveFont(IniFile, SmallFont, "Font"); delete IniFile; } RegIniFile = new TRegIniFile(RegFilename); RegIniFile->RootKey = HKEY_LOCAL_MACHINE; RegIniFile->OpenKey("SOFTWARE\\YoungWoo\\Texpro\\8.0\\",true); if (RegIniFile) { RegIniFile->WriteString("Common", "DefaultFontName", SmallFont->Name); } delete RegIniFile; SetSmallFont(StatusBar->Font); ColorLibraryForm->SetFont(); ColorChartForm->SetFont(); PenManagerForm->SetFont(); FullViewForm->SetFont(); PaletteForm->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) { int unit; MainMenuForm->ExitForm(1); TEnvironmentForm *Form = new TEnvironmentForm(this); Form->ShowModal(); TIniFile *IniFile = new TIniFile(DirectoryItem+"\\Environment.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); } } bAutoSave = IniFile->ReadBool("AutoSave", "Check", false); if (bAutoSave) { AutosaveTimer->Interval = IniFile->ReadInteger("AutoSave", "Min", 5) * 60000; } delete IniFile; } delete Form; if (MainImageForm) MainImageForm->ApplyEnvironment(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FExitItemClick(TObject *Sender) { Close(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::ECutItemClick(TObject *Sender) { MainImageForm->EditCut(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::ECopyItemClick(TObject *Sender) { MainImageForm->EditCopy(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::EPasteItemClick(TObject *Sender) { MainImageForm->EditPaste(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::COverwriteItemClick(TObject *Sender) { #ifndef ACADEMY if (CaptureData->Count) { TCaptureData *cd = (TCaptureData *)CaptureData->First(); CaptureData->Remove(cd); delete cd; } CaptureData->Insert(0, MainImageForm->MakeCapture()); UpdateMenuItems(NULL); #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::CInsertItemClick(TObject *Sender) { #ifndef ACADEMY CaptureData->Insert(0, MainImageForm->MakeCapture()); UpdateMenuItems(NULL); #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::CDeleteAllItemClick(TObject *Sender) { #ifndef ACADEMY TCaptureData *cd; while (CaptureData->Count) { cd = (TCaptureData *)CaptureData->First(); CaptureData->Remove(cd); delete cd; } UpdateMenuItems(NULL); #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::CEditItemClick(TObject *Sender) { #ifndef ACADEMY TCaptureEditForm *Form = new TCaptureEditForm(this); Form->InitForm(); Form->ShowModal(); delete Form; #endif } //--------------------------------------------------------------------------- void __fastcall TMainForm::IIntensityDetectItemClick(TObject *Sender) { L_UINT uLow = 0, uHigh = 255; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetRange DlgGetRange = (TDlgGetRange)GetProcAddress(hLibrary, "L_DlgGetRange"); if (DlgGetRange(Handle, bh, &uLow, &uHigh, DLG_IMG_SHOWPREVIEW, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_IntensityDetectBitmap(bh, uLow, uHigh); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISolarizeItemClick(TObject *Sender) { L_INT nChange = 0; L_UINT32 uProcess = 0; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); if (DlgGetChange(Handle, bh, &nChange, &uProcess, DLG_IMG_SHOWPREVIEW | DLG_IMG_SOLARIZE, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (nChange>=0) { MainImageForm->UndoSave(UK_PATTERN); L_SolarizeBitmap(bh, nChange); MainImageForm->iMainImage->Repaint(); } Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEPosterizeItemClick(TObject *Sender) { L_INT nChange = 2; L_UINT32 uProcess = 0; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); if (DlgGetChange(Handle, bh, &nChange, &uProcess, DLG_IMG_SHOWPREVIEW | DLG_IMG_POSTERIZE, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (nChange) { MainImageForm->UndoSave(UK_PATTERN); L_PosterizeBitmap(bh, nChange); MainImageForm->iMainImage->Repaint(); } Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEMosaicItemClick(TObject *Sender) { L_INT nChange = 2; L_UINT32 uProcess; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); if (DlgGetChange(Handle, bh, &nChange, &uProcess, DLG_IMG_SHOWPREVIEW | DLG_IMG_MOSAIC, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (nChange) { MainImageForm->UndoSave(UK_PATTERN); L_MosaicBitmap(bh, nChange); MainImageForm->iMainImage->Repaint(); } Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEAverageItemClick(TObject *Sender) { L_INT nChange = 3; L_UINT32 uProcess; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); if (DlgGetChange(Handle, bh, &nChange, &uProcess, DLG_IMG_SHOWPREVIEW | DLG_IMG_AVERAGE, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (nChange) { MainImageForm->UndoSave(UK_PATTERN); L_AverageFilterBitmap(bh, nChange); MainImageForm->iMainImage->Repaint(); } Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEMedianItemClick(TObject *Sender) { L_INT nChange = 3; L_UINT32 uProcess; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); if (DlgGetChange(Handle, bh, &nChange, &uProcess, DLG_IMG_SHOWPREVIEW | DLG_IMG_MEDIAN, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (nChange) { MainImageForm->UndoSave(UK_PATTERN); L_MedianFilterBitmap(bh, nChange); MainImageForm->iMainImage->Repaint(); } Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IESharpenItemClick(TObject *Sender) { L_INT nChange = 0; L_UINT32 uProcess; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetChange DlgGetChange = (TDlgGetChange)GetProcAddress(hLibrary, "L_DlgGetChange"); if (DlgGetChange(Handle, bh, &nChange, &uProcess, DLG_IMG_SHOWPREVIEW | DLG_IMG_SHARPEN, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (nChange) { MainImageForm->UndoSave(UK_PATTERN); L_SharpenBitmap(bh, nChange); MainImageForm->iMainImage->Repaint(); } Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEAddNoiseItemClick(TObject *Sender) { L_UINT uRange; L_UINT uChannel; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetNoise DlgGetNoise = (TDlgGetNoise)GetProcAddress(hLibrary, "L_DlgGetNoise"); if (DlgGetNoise(Handle, bh, &uRange, &uChannel, DLG_IMG_SHOWPREVIEW, NULL)==SUCCESS) { MainImageForm->UndoSave(UK_PATTERN); TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; L_AddBitmapNoise(bh, uRange, uChannel); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEEmbossItemClick(TObject *Sender) { L_UINT uDirectory, uDepth = 50; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetEmboss DlgGetEmboss = (TDlgGetEmboss)GetProcAddress(hLibrary, "L_DlgGetEmboss"); if (DlgGetEmboss(Handle, bh, &uDirectory, &uDepth, DLG_IMG_SHOWPREVIEW | DLG_IMG_EMBOSS, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_EmbossBitmap(bh, uDirectory, uDepth); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEEdgeEnhanceItemClick(TObject *Sender) { BITMAPHANDLE WrkBitmap, *bh = MainImageForm->iMainImage->Bitmap->Handle; L_INT nRet; TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; nRet = L_CopyBitmap(&WrkBitmap, bh); 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); MainImageForm->iMainImage->Repaint(); } L_FreeBitmap(&WrkBitmap); } Screen->Cursor = cur; } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISGradientItemClick(TObject *Sender) { LPSPATIALFLT pSpatialFlt; LPBINARYFLT pBinaryFlt; L_BOOL bSpatial; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetFilter DlgGetFilter = (TDlgGetFilter)GetProcAddress(hLibrary, "L_DlgGetFilter"); if (DlgGetFilter(Handle, bh, &pSpatialFlt, &pBinaryFlt, &bSpatial, DLG_IMG_SHOWPREVIEW | DLG_IMG_GRADIENT, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_SpatialFilterBitmap(bh, pSpatialFlt); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISLaplacianItemClick(TObject *Sender) { LPSPATIALFLT pSpatialFlt; LPBINARYFLT pBinaryFlt; L_BOOL bSpatial; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetFilter DlgGetFilter = (TDlgGetFilter)GetProcAddress(hLibrary, "L_DlgGetFilter"); if (DlgGetFilter(Handle, bh, &pSpatialFlt, &pBinaryFlt, &bSpatial, DLG_IMG_SHOWPREVIEW | DLG_IMG_LAPLACIAN, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_SpatialFilterBitmap(bh, pSpatialFlt); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISSobelItemClick(TObject *Sender) { LPSPATIALFLT pSpatialFlt; LPBINARYFLT pBinaryFlt; L_BOOL bSpatial; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetFilter DlgGetFilter = (TDlgGetFilter)GetProcAddress(hLibrary, "L_DlgGetFilter"); if (DlgGetFilter(Handle, bh, &pSpatialFlt, &pBinaryFlt, &bSpatial, DLG_IMG_SHOWPREVIEW | DLG_IMG_SOBEL, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_SpatialFilterBitmap(bh, pSpatialFlt); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISPrewittItemClick(TObject *Sender) { LPSPATIALFLT pSpatialFlt; LPBINARYFLT pBinaryFlt; L_BOOL bSpatial; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetFilter DlgGetFilter = (TDlgGetFilter)GetProcAddress(hLibrary, "L_DlgGetFilter"); if (DlgGetFilter(Handle, bh, &pSpatialFlt, &pBinaryFlt, &bSpatial, DLG_IMG_SHOWPREVIEW | DLG_IMG_PREWITT, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_SpatialFilterBitmap(bh, pSpatialFlt); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISShiftandDifferenceItemClick(TObject *Sender) { LPSPATIALFLT pSpatialFlt; LPBINARYFLT pBinaryFlt; L_BOOL bSpatial; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetFilter DlgGetFilter = (TDlgGetFilter)GetProcAddress(hLibrary, "L_DlgGetFilter"); if (DlgGetFilter(Handle, bh, &pSpatialFlt, &pBinaryFlt, &bSpatial, DLG_IMG_SHOWPREVIEW | DLG_IMG_SHIFTDIFF, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_SpatialFilterBitmap(bh, pSpatialFlt); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::ISLineSegmentItemClick(TObject *Sender) { LPSPATIALFLT pSpatialFlt; LPBINARYFLT pBinaryFlt; L_BOOL bSpatial; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.dll"); if (hLibrary) { TDlgGetFilter DlgGetFilter = (TDlgGetFilter)GetProcAddress(hLibrary, "L_DlgGetFilter"); if (DlgGetFilter(Handle, bh, &pSpatialFlt, &pBinaryFlt, &bSpatial, DLG_IMG_SHOWPREVIEW | DLG_IMG_LINESEG, NULL)==SUCCESS) { TCursor cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainImageForm->UndoSave(UK_PATTERN); L_SpatialFilterBitmap(bh, pSpatialFlt); MainImageForm->iMainImage->Repaint(); Screen->Cursor = cur; } FreeLibrary(hLibrary); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::IEOilifyItemClick(TObject *Sender) { /* L_INT nChange = 3; L_UINT32 uProcess; BITMAPHANDLE *bh = MainImageForm->iMainImage->Bitmap->Handle; HINSTANCE hLibrary = LoadLibrary("ltdlg10n.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::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) { #ifndef ACADEMY if (VLayerItem->Checked) { VLayerItem->Checked = false; LayerForm->Visible = false; } else { MainMenuForm->ExitForm(); VLayerItem->Checked = true; LayerForm->Show(); LayerForm->InitForm(); } UpdateMenuItems(Sender); #endif } //--------------------------------------------------------------------------- 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) { TMainImageForm *Child = NULL; TPCanvasInfor p; TPException ec = EC_NONE; AnsiString FileName, DirName, FileExt; int TextileDPI; if (bFirst==1) { //======================================== if (ParamStr(1) != "") { DirName = ExtractFileDir(ParamStr(1)); FileName = ExtractFileName(ParamStr(1)); FileExt = ExtractFileExt(ParamStr(1)); if (FileExt.LowerCase() == ".tex") { OpenFile(DirName, FileName, gffTEX, 8); //<-- (DirName, DirName + "\\" + FileName, gffTEX, 8) #ifndef ACADEMY #ifndef N_3D } else if (FileExt.LowerCase() == ".t3d") { OpenFile(DirName, FileName, gffT3D, 24); #endif } else if (FileExt.LowerCase() == ".tfc") { OpenFile(DirName, FileName, gffTFC, 24); //<-- (DirName, DirName + "\\" + FileName, gffTEX, 8) #endif } } else { if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; goto fail; } p.Orientation = coPortrait; //================================ //2001.4.10. by lhskys congi¿¡¼­ Á¾ÀÌ size ³Ö±â TIniFile *IniFile = new TIniFile(DirectoryItem+"\\Environment.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 ((ec = Child->InitForm(p, 8))!=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) { if (TexWork){ if (TexWork->Modify ){ AnsiString msg; if(TexWork->OpenDialog1->FileName!= "")msg = TexWork->OpenDialog1->FileName; else msg = "Noname.fst"; int Btn = MessageDlg(IDS_MESSAGE_SAVECHANGE + " " + msg, mtWarning, TMsgDlgButtons()<tbSaveClick(this); } TexWork->Modify = false; } bool val=true; TexWork->FormCloseQuery(this, val); } } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormCreate(TObject *Sender) { int Items, Items_country; TIniFile *IniFile; TPException ec = EC_NONE; Application->OnActivate = ApplicationActivate; Application->OnHint = ShowHint; Screen->OnActiveFormChange = UpdateMenuItems; Screen->Cursors[crPen] = LoadCursor(HInstance, "TEXPIAPEN"); LoadFromMainRegIniFile(); MessageStringTable.Create(DirectoryBin, Language, "Message"); if ((ProtectCard = new TProtectCard)==NULL) { ec = EC_INTERFACE_NONE; goto fail; } //ifdef lock_crypkey ---> protectcard is not needed...... #ifndef LOCK_CRYPKEY #ifdef LOCK_IFC #ifdef ACADEMY if (!ProtectCard->Init()) { ec = EC_INTERFACE_NONE; goto fail; } #else Items = ProtectCard->Init(RegFilename); if (Items==0 || (Items&PCN_TEXTILE_3D)!=PCN_TEXTILE_3D) { ec = EC_INTERFACE_NONE; goto fail; } #endif if (!ProtectCard->CheckPassword()) { ec = EC_INTERFACE_NONE; goto fail; } #else Items = ProtectCard->Init(Password); #ifdef ACADEMY if (((Items>>14)&3)<3 || Items<1 || (Items&PCN_TEXTILE_3D)!=PCN_TEXTILE_3D) { ec = EC_INTERFACE_NONE; goto fail; } #else /* if ((((Items>>14)&3)==3) || Items<1 || (Items&PCN_TEXTILE_3D)!=PCN_TEXTILE_3D) { ec = EC_INTERFACE_NONE; goto fail; */ //========================================== by hjs TEXTILE check if ((((Items>>14)&3)==3) || Items<1 || (Items&PCN_TEXTILE)!=PCN_TEXTILE) { ec = EC_INTERFACE_NONE; goto fail; } ////////////////////////////////////////////// 3D check by playzzang if ((((Items>>14)&3)==3) || Items<1 || (Items&PCN_3D)!=PCN_3D) { T3D_Item = false; } else { T3D_Item = true; } H_item = Items ; // 3D üũ¸¦ À§ÇØ ´Ù¸¥ °÷¿¡¼­ »ç¿ë µÊ #ifdef JAPAN // country nomal(1) , Japan(2) üũ // »õ·Î Ãß°¡µÈ °ª Items_country = ProtectCard->Init_country(Password); if(Items_country<1 || Items_country != 2) { // Japan ec = EC_INTERFACE_NONE; goto fail; } #else Items_country = ProtectCard->Init_country(Password); if(Items_country<1 || Items_country != 1) { // normal ec = EC_INTERFACE_NONE; goto fail; } #endif //========================================== #endif #endif #endif // #ifndef LOCK_CRYPKEY #ifdef LOCK_CRYPKEY T3D_Item = true; #endif #ifdef LOCK_IFC T3D_Item = true; #endif CommonStringTable.Create(DirectoryBin, Language, "Common"); StringTable.Create(DirectoryItem, Language, "Main"); if ((SmallFont = new TFont)==NULL) { ec = EC_MEMORY_LACK; goto fail; } IniFile = new TIniFile(DirectoryItem + "\\Environment.ini"); if (IniFile) { LoadFont(IniFile, SmallFont, "Font"); bAutoSave = IniFile->ReadBool("AutoSave", "Check", false); if (bAutoSave) { AutosaveTimer->Interval = IniFile->ReadInteger("AutoSave", "Min", 5) * 60000; } delete IniFile; } else { SmallFont->Name = DefaultFontName; SmallFont->Size = 10; } if ((Tablet = new TTablet)==NULL) { ec = EC_MEMORY_LACK; goto fail; } Tablet->Init(Handle, RegFilename.c_str()); if ((PrinterColor = new TPrinterColor)==NULL) { ec = EC_MEMORY_LACK; goto fail; } #ifndef ACADEMY if ((StandardColor = new TStandardColor(DirectoryColor+"\\Standard.tpc"))==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((TextileColor = new TTextileColor(DirectoryColor+"\\Textile.tpc"))==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((Pantone1000 = new TPantone1000(DirectoryColor+"\\Thousand.ptc"))==NULL) { //k3dogs Palette¿¡¼­ ec = EC_MEMORY_LACK; goto fail; //Pantone Color Code¸¦ } //ã±â À§Çؼ­ if ((PantoneTextile = new TPantoneTextile(DirectoryColor+"\\Textile.ptc"))==NULL) { //20001211 ec = EC_MEMORY_LACK; goto fail; } #endif if ((MainMenuForm = new TMainMenuForm(this))==NULL) goto fail; MainMenuForm->Parent = this; MainMenuForm->Visible = true; MainMenuForm->OnUpdateMenu = UpdateMenuItems; if ((PenManagerForm = new TPenManagerForm(this))==NULL) goto fail; PenManagerForm->Parent = this; PenManagerForm->Visible = true; PenManagerForm->OnUpdateMenu = UpdateMenuItems; if ((FullViewForm = new TFullViewForm(this))==NULL) goto fail; FullViewForm->Parent = this; FullViewForm->Visible = true; FullViewForm->OnSuperChange = MainMenuForm->SuperChange; FullViewForm->OnUpdateMenu = UpdateMenuItems; 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; 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; #ifndef ACADEMY if ((LayerForm = new TLayerForm(this))==NULL) goto fail; LayerForm->Parent = this; LayerForm->Visible = false; LayerForm->OnUpdateMenu = UpdateMenuItems; #endif 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; #ifndef ACADEMY if ((UserColorLibForm = new TUserColorLibForm(this))==NULL) goto fail; UserColorLibForm->Parent = this; if ((CaptureData = new TList)==NULL) { ec = EC_MEMORY_LACK; goto fail; } #endif ClipboardFormat = RegisterClipboardFormat("Texpro"); if ((StatusProgress = new TStatusProgress(StatusBar, StatusBarHint))==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((FileHistory = new TFileHistory(DirectoryItem + "\\Main.ini", 8, FReopenItem, &OpenFile))==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((Undo = new TUndo)==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((VecDraw = new TVecDraw)==NULL) { ec = EC_MEMORY_LACK; goto fail; } #ifdef ACADEMY Undo->Method = UM_SWAP; #else Undo->Method = UM_STACK; #endif bFirst = 1; CompressMethod = cmZLib; if (L_IsTwainAvailable(Application->Handle)) { FScanningItem->Enabled = true; FScannerSetupItem->Enabled = true; } else { FScanningItem->Enabled = false; FScannerSetupItem->Enabled = false; } srand(clock()); //======================================== SetSmallFont(StatusBar->Font); /* #ifdef ACADEMY Caption = IDS_TDCSA; #else Caption = IDS_TDCSP; #endif */ //=================================== source code befre lock_crypkey defined............. /* #ifdef JAPAN switch (Items >> 14) { case 1: Caption = "Yuka & Alpha - Design (Education)"; break; case 2: Caption = "Yuka & Alpha - Design (Demo)"; break; default: Caption = "Yuka & Alpha - Design (Professional)"; break; } #else #ifdef ACADEMY Caption = "Texpro Design CAD System - Textile (Academy)"; #else #ifdef LOCK_IFC Caption = "Texpro Design CAD System - Textile (Professional)"; #else switch (Items >> 14) { case 1: Caption = "Texpro Design CAD System - Textile (Education)"; break; case 2: Caption = "Texpro Design CAD System - Textile (Demo)"; break; default: Caption = "Texpro Design CAD System - Textile (Professional)"; break; } #endif #endif #endif */ #ifdef LOCK_CRYPKEY // japan, education, demo.... must be definde.... #ifdef JAPAN #ifdef EDUCATION Caption = "Yuka & Alpha - Design (Education)"; #endif #ifdef DEMO Caption = "Yuka & Alpha - Design (Demo)"; #endif #ifdef PROFESSIONAL Caption = "Yuka & Alpha - Design (Professional)"; #endif #else #ifdef ACADEMY Caption = "Texpro Design CAD System - Textile (Academy)"; #else #ifdef EDUCATION Caption = "Texpro Design CAD System - Textile (Education)"; #endif #ifdef DEMO Caption = "Texpro Design CAD System - Textile (Demo)"; #endif #ifdef PROFESSIONAL Caption = "Texpro Design CAD System - Textile (Professional)"; #endif #endif #endif #else // if lock_crypkey is not defined.... #ifdef JAPAN switch (Items >> 14) { case 1: Caption = "Yuka & Alpha - Design (Education)"; break; case 2: Caption = "Yuka & Alpha - Design (Demo)"; break; default: Caption = "Yuka & Alpha - Design (Professional)"; break; } #else #ifdef ACADEMY Caption = "Texpro Design CAD System - Textile (Academy)"; #else #ifdef LOCK_IFC Caption = "Texpro Design CAD System - Textile (Professional)"; #else switch (Items >> 14) { case 1: Caption = "Texpro Design CAD System - Textile (Education)"; break; case 2: Caption = "Texpro Design CAD System - Textile (Demo)"; break; default: Caption = "Texpro Design CAD System - Textile (Professional)"; break; } #endif #endif #endif #endif // end of define lock_crypkey.... //============================================================================== FileItem->Caption = IDS_FILE; FNewCanvas256Item->Caption = IDS_F256COLOR; FNewCanvasFullItem->Caption = IDS_FFULLCOLOR; 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; 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; //======================================== return; fail: ::doDestroy(Undo); ::doDestroy(FileHistory); ::doDestroy(StatusProgress); #ifndef ACADEMY ::doDestroy(CaptureData); ::doDestroy(UserColorLibForm); #endif ::doDestroy(ColorLibraryForm); ::doDestroy(ColorChartForm); #ifndef ACADEMY ::doDestroy(LayerForm); #endif ::doDestroy(MotiveLibForm); ::doDestroy(PaletteForm); ::doDestroy(FullViewForm); ::doDestroy(PenManagerForm); ::doDestroy(MainMenuForm); #ifndef ACADEMY ::doDestroy(PantoneTextile); ::doDestroy(Pantone1000); // k3dogs 20001211 ::doDestroy(TextileColor); ::doDestroy(StandardColor); #endif ::doDestroy(PrinterColor); ::doDestroy(Tablet); ::doDestroy(SmallFont); ::doDestroy(ProtectCard); if (ec == EC_NONE) ec = EC_FORM_NOT_CREATE; EXCEPTION_MESSAGE_OK(ec); Application->Terminate(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormDestroy(TObject *Sender) { ::doDestroy(VecDraw);//by jeegeo ::doDestroy(Undo); ::doDestroy(FileHistory); ::doDestroy(StatusProgress); #ifndef ACADEMY if (CaptureData) { CDeleteAllItemClick(NULL); delete CaptureData; CaptureData = NULL; } //::doDestroy(UserColorLibForm); //::doDestroy(LayerForm); #endif //::doDestroy(ColorLibraryForm); //::doDestroy(ColorChartForm); //::doDestroy(MotiveLibForm); //::doDestroy(N3DMappingForm); //::doDestroy(PaletteForm); //::doDestroy(FullViewForm); //::doDestroy(PenManagerForm); //::doDestroy(MainMenuForm); #ifndef ACADEMY ::doDestroy(PantoneTextile); ::doDestroy(Pantone1000); // k3dogs 20001211 ::doDestroy(TextileColor); ::doDestroy(StandardColor); #endif ::doDestroy(PrinterColor); ::doDestroy(Tablet); ::doDestroy(SmallFont); ::doDestroy(ProtectCard); Screen->OnActiveFormChange = NULL; } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { MainMenuForm->iMainImageKeyDown(MainImageForm, Key); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormKeyPress(TObject *Sender, char &Key) { MainMenuForm->iMainImageKeyPress(MainImageForm, Key); #ifndef ACADEMY bool NotWork = false; //qe TexWork°¡ ¿­·ÁÀÖÁö ¾Ê°Å³ª Minimized µÇ¾úÀ»¶§¸¸ A,S ´ÜÃàŰ ½ÇÇàµÇµµ·Ï if(TexWork){ if(TexWork->WindowState == wsMinimized){ NotWork = true; }else { NotWork = false; } }else { NotWork = true; } if((Key == 97 || Key == 65 || Key == 83 || Key == 115)&& NotWork) MainImageForm->iMainImageKeyDown(Key); //È®´ëÃà¼Ò ´ÜÃàŰ·Î #else if(Key == 97 || Key == 65 || Key == 83 || Key == 115) MainImageForm->iMainImageKeyDown(Key); //È®´ëÃà¼Ò ´ÜÃàŰ·Î #endif //MainImageForm->sbVert->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift) { MainMenuForm->iMainImageKeyUp(MainImageForm, Key); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FormResize(TObject *Sender) { int w = StatusBar->Width-(160+80+100+100+200); 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) { AnsiString filename; filename = "all_textile1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile21Click(TObject *Sender) { AnsiString filename; filename = "all_textile2.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile31Click(TObject *Sender) { AnsiString filename; filename = "all_textile3.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile41Click(TObject *Sender) { AnsiString filename; filename = "all_textile4.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Textile51Click(TObject *Sender) { AnsiString filename; filename = "all_textile5.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N8Click(TObject *Sender) { AnsiString filename; filename = "start1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::sub1Click(TObject *Sender) { AnsiString filename; filename = "pen1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N10Click(TObject *Sender) { AnsiString filename; filename = "pen2.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N11Click(TObject *Sender) { AnsiString filename; filename = "pen3.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N12Click(TObject *Sender) { AnsiString filename; filename = "pen4.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N13Click(TObject *Sender) { AnsiString filename; filename = "pen5.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N14Click(TObject *Sender) { AnsiString filename; filename = "color_selection.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N16Click(TObject *Sender) { AnsiString filename; filename = "view1.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N17Click(TObject *Sender) { AnsiString filename; filename = "view2.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N19Click(TObject *Sender) { AnsiString filename; filename = "palette.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::CMY1Click(TObject *Sender) { AnsiString filename; filename = "cmy.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::HLS1Click(TObject *Sender) { AnsiString filename; filename = "HLS.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N20Click(TObject *Sender) { AnsiString filename; filename = "color_library.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N21Click(TObject *Sender) { AnsiString filename; filename = "color_file.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N22Click(TObject *Sender) { AnsiString filename; filename = "color_chart.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N23Click(TObject *Sender) { AnsiString filename; filename = "protection.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N24Click(TObject *Sender) { AnsiString filename; filename = "color_undo.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N26Click(TObject *Sender) { AnsiString filename; filename = "menu.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N27Click(TObject *Sender) { AnsiString filename; filename = "selection.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N28Click(TObject *Sender) { AnsiString filename; filename = "copy_move.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N29Click(TObject *Sender) { AnsiString filename; filename = "color_change.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N30Click(TObject *Sender) { AnsiString filename; filename = "clear.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N31Click(TObject *Sender) { AnsiString filename; filename = "color_group.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N32Click(TObject *Sender) { AnsiString filename; filename = "repeat.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N33Click(TObject *Sender) { AnsiString filename; filename = "drawing.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N34Click(TObject *Sender) { AnsiString filename; filename = "reproportion.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N35Click(TObject *Sender) { AnsiString filename; filename = "fill.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N36Click(TObject *Sender) { AnsiString filename; filename = "spread_fill.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N37Click(TObject *Sender) { AnsiString filename; filename = "stipple.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N38Click(TObject *Sender) { AnsiString filename; filename = "style.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N39Click(TObject *Sender) { AnsiString filename; filename = "pattern_repeat.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N40Click(TObject *Sender) { AnsiString filename; filename = "stripe.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N41Click(TObject *Sender) { AnsiString filename; filename = "color_separate.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N42Click(TObject *Sender) { AnsiString filename; filename = "stitch.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N43Click(TObject *Sender) { AnsiString filename; filename = "text.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N44Click(TObject *Sender) { AnsiString filename; filename = "color_combo.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N45Click(TObject *Sender) { AnsiString filename; filename = "smooth.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N46Click(TObject *Sender) { AnsiString filename; filename = "scratch.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N47Click(TObject *Sender) { AnsiString filename; filename = "jacquard.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N48Click(TObject *Sender) { AnsiString filename; filename = "file.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N49Click(TObject *Sender) { AnsiString filename; filename = "printer.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N50Click(TObject *Sender) { AnsiString filename; filename = "scanner.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N51Click(TObject *Sender) { AnsiString filename; filename = "undo.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N52Click(TObject *Sender) { AnsiString filename; filename = "shadow.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N53Click(TObject *Sender) { AnsiString filename; filename = "layer.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N84Click(TObject *Sender) { AnsiString filename; filename = "after_make.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Top2Click(TObject *Sender) { AnsiString filename; filename = "TOP.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N77Click(TObject *Sender) { AnsiString filename; filename = "Tfile.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N78Click(TObject *Sender) { AnsiString filename; filename = "Tedit.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N79Click(TObject *Sender) { AnsiString filename; filename = "Tview.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N80Click(TObject *Sender) { AnsiString filename; filename = "Twindow.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N81Click(TObject *Sender) { AnsiString filename; filename = "Thelp.scm"; education(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N82Click(TObject *Sender) { AnsiString filename; filename = "all_weave1.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Weave21Click(TObject *Sender) { AnsiString filename; filename = "all_weave2.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N55Click(TObject *Sender) { AnsiString filename; filename = "yarn_making1.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::II1Click(TObject *Sender) { AnsiString filename; filename = "yarn_making2.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::III1Click(TObject *Sender) { AnsiString filename; filename = "yarn_making3.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N56Click(TObject *Sender) { AnsiString filename; filename = "yarn_scan.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N58Click(TObject *Sender) { AnsiString filename; filename = "setting.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N59Click(TObject *Sender) { AnsiString filename; filename = "sketch.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N60Click(TObject *Sender) { AnsiString filename; filename = "selection(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N61Click(TObject *Sender) { AnsiString filename; filename = "preview(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N62Click(TObject *Sender) { AnsiString filename; filename = "rotate(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N64Click(TObject *Sender) { AnsiString filename; filename = "yarn_table.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N65Click(TObject *Sender) { AnsiString filename; filename = "yarn_dye.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N66Click(TObject *Sender) { AnsiString filename; filename = "yarn_arrange.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N67Click(TObject *Sender) { AnsiString filename; filename = "texture_table.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N68Click(TObject *Sender) { AnsiString filename; filename = "texture_selection.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N69Click(TObject *Sender) { AnsiString filename; filename = "weaving.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N70Click(TObject *Sender) { AnsiString filename; filename = "printer(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N71Click(TObject *Sender) { AnsiString filename; filename = "yarn_brightness.scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N72Click(TObject *Sender) { AnsiString filename; filename = "weaving_window_file(weave).scm"; educationweave(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N83Click(TObject *Sender) { AnsiString filename; filename = "all_knit.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N73Click(TObject *Sender) { AnsiString filename; filename = "window(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N74Click(TObject *Sender) { AnsiString filename; filename = "copymove(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knit2Click(TObject *Sender) { AnsiString filename; filename = "clear(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knit3Click(TObject *Sender) { AnsiString filename; filename = "repeat(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knit4Click(TObject *Sender) { AnsiString filename; filename = "drawing(knit).scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Markchartform1Click(TObject *Sender) { AnsiString filename; filename = "markchartform.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::Mark1Click(TObject *Sender) { AnsiString filename; filename = "mark_fill.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N75Click(TObject *Sender) { AnsiString filename; filename = "resize_canvas.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::knittingform1Click(TObject *Sender) { AnsiString filename; filename = "knitting.scm"; educationknit(filename); } //--------------------------------------------------------------------------- void __fastcall TMainForm::N76Click(TObject *Sender) { AnsiString 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) { 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; EditItem->Enabled = MDIChildCount > 0; CaptureItem->Enabled = false; ImageItem->Enabled = false; COverwriteItem->Enabled = false; CInsertItem->Enabled = false; if (MainImageForm) { if (MainImageForm->iMainImage) { if (MainImageForm->iMainImage->Bitmap->BitsPerPixel==24) { CaptureItem->Enabled = true; ImageItem->Enabled = true; } } if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { COverwriteItem->Enabled = true; CInsertItem->Enabled = true; } } } #ifndef ACADEMY if (CaptureData) { CEditItem->Enabled = CaptureData->Count>0; CDeleteAllItem->Enabled = CaptureData->Count>0; } #else CEditItem->Enabled = false; #endif ViewItem->Enabled = MDIChildCount > 0; VPenItem->Checked = PenManagerForm->Visible; VFullViewItem->Checked = FullViewForm->Visible; VPaletteItem->Checked = PaletteForm->Visible; VMainMenuItem->Checked = MainMenuForm->Visible; #ifndef ACADEMY if(MainImageForm&&MainImageForm->new3d){ LayerForm->Visible = false; VLayerItem->Checked = false; VLayerItem->Enabled = false; } else { VLayerItem->Checked = LayerForm->Visible; VLayerItem->Enabled = MDIChildCount > 0; } VN3DItem->Checked = N3DMappingForm->Visible; #endif if (MotiveLibForm) MotiveLoad->Checked = MotiveLibForm->Visible; MotiveLoad->Enabled = MDIChildCount > 0; if (WindowLibForm) ReOpen1->Checked = WindowLibForm->Visible; ReOpen1->Enabled = MDIChildCount > 0; VStatusBarItem->Checked = StatusBar->Visible; VToolsRearrangeItem->Enabled = MDIChildCount > 0; WCascadeItem->Enabled = MDIChildCount > 0; WTileItem->Enabled = MDIChildCount > 0; WArrangeItem->Enabled = MDIChildCount > 0; WMinimizeItem->Enabled = MDIChildCount > 0; #ifdef ACADEMY FNewCanvasFullItem->Enabled = false; FScannerSetupItem->Enabled = false; FScanningItem->Enabled = false; #else FNewCanvasFullItem->Enabled = true; FScannerSetupItem->Enabled = true; FScanningItem->Enabled = true; #endif 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) MainMenuForm->CloseMainMenuItem(); // MainMenu ´ÝÇôµµ Filemanager´Â »ç¿ë °¡´ÉÇÏ°Ô #ifndef ACADEMY LayerForm->Enabled = MDIChildCount > 0; #endif if (MotiveLibForm) MotiveLibForm->Enabled = MDIChildCount > 0; #ifdef NOTN3D VN3DItem->Visible = false; #endif } //--------------------------------------------------------------------- // Private Function //--------------------------------------------------------------------- void TMainForm::WTPacket(TMessage &msg) { 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 __fastcall TMainForm::ApplicationActivate(TObject *Sender) { TMainImageForm *mif = (TMainImageForm *)ActiveMDIChild; if (Tablet) Tablet->Activate(); if (mif) mif->FormActivate(mif); } //--------------------------------------------------------------------- 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); #ifndef ACADEMY LayerFormPos = Point(ClientWidth-LayerForm->Width-2, MainMenuFormPos.y+MainMenuForm->Height+1); #endif 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; #ifndef ACADEMY LayerForm->Left = LayerFormPos.x; LayerForm->Top = LayerFormPos.y; #endif } //--------------------------------------------------------------------- TPException __fastcall TMainForm::FMOnRead(TFMReadParameter rp) { TCursor cur; TMainImageForm *Child = NULL; TPException ec = EC_NONE; cur = Screen->Cursor; Screen->Cursor = crHourGlass; MainMenuForm->ExitForm(1); if (MainImageForm) MainImageForm->iMainImage->Deactivate(); if ((Child = new TMainImageForm(Application))==NULL) { ec = EC_FORM_NOT_CREATE; goto fail; } if ((ec = Child->InitFormFile(rp.DirName, rp.FileName, rp.ExtIndex, rp.bpp)) != EC_NONE) goto fail; Screen->Cursor = cur; return EC_NONE; fail: if (Child) delete Child; Screen->Cursor = cur; return ec; } //--------------------------------------------------------------------- bool __fastcall TMainForm::FMOnMerge(AnsiString FileName, TGraphicFileFormat ExtIndex) { #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif return MainImageForm->InitMerge(FileName, ExtIndex); } //--------------------------------------------------------------------- AnsiString __fastcall TMainForm::FMOnFileName(AnsiString FileName, TGraphicFileFormat ExtIndex) { char *s; AnsiString fn; //================================================================ int FileNameLength, last1, last2, last3, last4; char FileIndex1, FileIndex2, FileIndex3, FileIndex4; FileNameLength = FileName.Length(); if(FileNameLength > 4){ last1 = FileNameLength-3; last2 = FileNameLength-2; last3 = FileNameLength-1; last4 = FileNameLength; #ifdef ACADEMY switch (ExtIndex) { case gffTEX: FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = 'e'; FileIndex4 = 'x'; break; case gffBMP: FileIndex1 = '.'; FileIndex2 = 'b'; FileIndex3 = 'm'; FileIndex4 = 'p'; break; case gffTIF: FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = 'i'; FileIndex4 = 'f'; break; } #else switch (ExtIndex) { case gffTEX: FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = 'e'; FileIndex4 = 'x'; break; case gffTFC: FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = 'f'; FileIndex4 = 'c'; break; #ifndef N_3D case gffT3D: if(T3D_Item) {FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = '3';FileIndex4 = 'd';} break; #ifdef NOTN3D #else case gffN3D: if(T3D_Item) {FileIndex1 = '.'; FileIndex2 = 'n'; FileIndex3 = '3';FileIndex4 = 'd';} break; #endif #endif case gffWEA: FileIndex1 = '.'; FileIndex2 = 'w'; FileIndex3 = 'e'; FileIndex4 = 'a'; break; case gffWAV: FileIndex1 = '.'; FileIndex2 = 'w'; FileIndex3 = 'a'; FileIndex4 = 'v'; break; case gffKNT: FileIndex1 = '.'; FileIndex2 = 'k'; FileIndex3 = 'n'; FileIndex4 = 't'; break; case gffBMP: FileIndex1 = '.'; FileIndex2 = 'b'; FileIndex3 = 'm'; FileIndex4 = 'p'; break; case gffJPG: FileIndex1 = '.'; FileIndex2 = 'j'; FileIndex3 = 'p'; FileIndex4 = 'g'; break; case gffPCT: FileIndex1 = '.'; FileIndex2 = 'p'; FileIndex3 = 'c'; FileIndex4 = 't'; break; case gffPCX: FileIndex1 = '.'; FileIndex2 = 'p'; FileIndex3 = 'c'; FileIndex4 = 'x'; break; case gffPNG: FileIndex1 = '.'; FileIndex2 = 'p'; FileIndex3 = 'n'; FileIndex4 = 'g'; break; case gffPSD: FileIndex1 = '.'; FileIndex2 = 'p'; FileIndex3 = 's'; FileIndex4 = 'd'; break; case gffRAS: FileIndex1 = '.'; FileIndex2 = 'r'; FileIndex3 = 'a'; FileIndex4 = 's'; break; case gffTGA: FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = 'g'; FileIndex4 = 'a'; break; case gffTIF: FileIndex1 = '.'; FileIndex2 = 't'; FileIndex3 = 'i'; FileIndex4 = 'f'; break; case gffEPS: FileIndex1 = '.'; FileIndex2 = 'e'; FileIndex3 = 'p'; FileIndex4 = 's'; break; // case gffGIF: FileIndex = '.gif'; break; // by mecbong } #endif if((FileIndex1 == FileName[last1])&&(FileIndex2 == FileName[last2]) && (FileIndex3 == FileName[last3])&&(FileIndex4 == FileName[last4])){ s = "PASS"; }else s=NULL; }else s=NULL; //=============================================================== // s = AnsiStrScan(FileName.c_str(), '.'); if (s==NULL) { #ifdef ACADEMY switch (ExtIndex) { case gffTEX: fn = FileName+".tex"; break; case gffBMP: fn = FileName+".bmp"; break; case gffTIF: fn = FileName+".tif"; break; } #else switch (ExtIndex) { case gffTEX: fn = FileName+".tex"; break; case gffTFC: fn = FileName+".tfc"; break; #ifndef N_3D case gffT3D: if(T3D_Item) {fn = FileName+".t3d";} break; #ifdef NOTN3D #else case gffN3D: if(T3D_Item) {fn = FileName+".n3d";} break; #endif #endif case gffWEA: fn = FileName+".wea"; break; case gffWAV: fn = FileName+".wav"; break; case gffKNT: fn = FileName+".knt"; break; case gffBMP: fn = FileName+".bmp"; break; case gffJPG: fn = FileName+".jpg"; break; case gffPCT: fn = FileName+".pct"; break; case gffPCX: fn = FileName+".pcx"; break; case gffPNG: fn = FileName+".png"; break; case gffPSD: fn = FileName+".psd"; break; case gffRAS: fn = FileName+".ras"; break; case gffTGA: fn = FileName+".tga"; break; case gffTIF: fn = FileName+".tif"; break; case gffEPS: fn = FileName+".eps"; break; // case gffGIF: fn = FileName+".gif"; break; // by mecbong } #endif return fn; } else { return FileName; } } //--------------------------------------------------------------------- TPException __fastcall TMainForm::FMOnSave(AnsiString DirName, AnsiString FileName, TGraphicFileFormat ExtIndex, TCompressMethod cm) { #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif return MainImageForm->SaveToFile(DirName, FileName, ExtIndex, cm); } //--------------------------------------------------------------------------- void __fastcall TMainForm::OpenFile(AnsiString DirName, AnsiString FileName, int Index, WORD bpp) { 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))!=EC_NONE) goto fail; Screen->Cursor = cur; return; fail: if (Child) delete Child; Screen->Cursor = cur; EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------- // 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->Bitmap); // PenManagerForm->FormChange(MainImageForm->Palette); } */ } //--------------------------------------------------------------------------- void __fastcall TMainForm::education(AnsiString str) { #ifndef N_SCREENCAM AnsiString 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 = "open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = "scplayer.exe"; cam = screencam + "\\textile\\" + 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(AnsiString str) { #ifndef N_SCREENCAM AnsiString 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 = "open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = "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(AnsiString str) { #ifndef N_SCREENCAM AnsiString 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 = "open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = "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 { WindowLibForm->Save(this); } //--------------------------------------------------------------------------- void __fastcall TMainForm::WorkareaClick(TObject *Sender) //2001.4.6. by lhskys ÀÛ¾÷±¸¿ª save { if(MainMenuForm->Item != T_WIN)MainMenuForm->InitWindowForm(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteAll1Click(TObject *Sender) { WindowLibForm->WDeleteAll(this); } //--------------------------------------------------------------------------- void __fastcall TMainForm::MotiveSaveClick(TObject *Sender) { // By GreenFish ¸ðƼºêµéÀ» ÀúÀåÇÏ´Â ÇÔ¼ö MotiveLibForm->MotiveSave(); } //--------------------------------------------------------------------------- void __fastcall TMainForm::MotiveLoadClick(TObject *Sender) { // By GreenFish if (MotiveLoad->Checked) { Motive1->Checked = false; MotiveLibForm->Visible = false; } else { Motive1->Checked = true; MotiveLibForm->Show(); } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::ReOpen1Click(TObject *Sender) { if (ReOpen1->Checked) { WorkArea1->Checked = false; WindowLibForm->Visible = false; } else { WorkArea1->Checked = true; WindowLibForm->Show(); } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::DeleteAll3Click(TObject *Sender) { MotiveLibForm->MDeleteAll(this); } //--------------------------------------------------------------------------- void __fastcall TMainForm::FRasterizeItemClick(TObject *Sender) { MainMenuForm->ExitForm(1); WindowForm->sbOffClick(this); MainImageForm->UndoSave(UK_PATTERN); VecDraw->ConvertToBitmap(this); } //--------------------------------------------------------------------------- void __fastcall TMainForm::VN3DItemClick(TObject *Sender) { MainMenuForm->ExitForm(1); if (VN3DItem->Checked) { VN3DItem->Checked = false; N3DMappingForm->Visible = false; } else { VN3DItem->Checked = true; N3DMappingForm->Visible = true; } UpdateMenuItems(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainForm::AutoRepPreView() { 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 ProtectCard->Read(); #endif #endif if ((Form = new TNewCanvasForm(NULL))==NULL) { ec = EC_FORM_NOT_CREATE; 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; 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 { EXCEPTION_MESSAGE_OK(EC_INTERFACE_NONE); Application->Terminate(); } #endif #endif return; fail: if (Form) { if (Child) delete Child; Screen->Cursor = cur; delete Form; } EXCEPTION_MESSAGE_OK(ec); } //---------------------------------------------------------------------------