//--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "MainMenu.h" #include "Clear.h" #include "ColorChange_F.h" #include "Combo_F.h" #include "ComboForm.h" #include "Draw_F.h" #include "Fill_F.h" #include "Fullview.h" #include "Grouping_F.h" #include "Main.h" #include "MainImage.h" #include "MoveCopy_F.h" #include "Palette.h" #include "PenManager.h" #include "ProtectCard.h" #include "Repeat_F.h" #include "Repro_F.h" #include "Scratch_F.h" #include "Stitch_F.h" #include "Text_F.h" #include "Undo_F.h" #include "Window.h" #ifndef ACADEMY #include "Layer_F.h" #include "Shadow_F.h" #include "APMenu_F.h" #include "jacquard.h" #ifndef N_3D #include "Menu3D_F.h" #endif #include "PatternRepeat.h" #include "Separate_F.h" #include "Smooth_F.h" #include "SpreadFill.h" #include "Stipple.h" #include "Stripe_F.h" #include "Style_F.h" #include "TexWork_F.h" #endif //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_FCAPTION StringTable[0] #define IDS_MOVECOPY StringTable[1] #define IDS_COLORCHANGE StringTable[2] #define IDS_CLEAR StringTable[3] #define IDS_GROUPING StringTable[4] #define IDS_REPROPORTION StringTable[5] #define IDS_FILL StringTable[6] #define IDS_SPREADFILL StringTable[7] #define IDS_STIPPLE StringTable[8] #define IDS_STYLE StringTable[9] #define IDS_PATTERNREPEAT StringTable[10] #define IDS_3DMAPPING StringTable[11] #define IDS_STRIPE StringTable[12] #define IDS_COLORSEPARATE StringTable[13] #define IDS_STITCH StringTable[14] #define IDS_TEXT StringTable[15] #define IDS_COLORCOMBO StringTable[16] #define IDS_SMOOTH StringTable[17] #define IDS_SCRATCH StringTable[18] #define IDS_JACQUARD StringTable[19] #define IDS_PRINTER StringTable[20] #define IDS_SCANNER StringTable[21] #define IDS_SHADOW StringTable[22] #define IDS_TREATMENT StringTable[23] //============================================ ¼­ºê¸Þ´º¿¡¼­ Ãß°¡ÇÑ ºÎºÐ #define IDS_SHAPE StringTable[24] #define IDS_IRREGULAR StringTable[25] #define IDS_SURFACEMULTI StringTable[26] #define IDS_SURFACESINGLE StringTable[27] #define IDS_BORDER StringTable[28] #define IDS_FULL StringTable[29] #define IDS_OFF StringTable[30] #define IDS_ROTATEMIRROR StringTable[31] #define IDS_ROTATE StringTable[32] #define IDS_BEND StringTable[33] #define IDS_BYWINDOW StringTable[34] #define IDS_SWAP StringTable[35] #define IDS_SINGLETOSINGLE StringTable[36] #define IDS_MULTITOSINGLE StringTable[37] #define IDS_BYPEN StringTable[38] #define IDS_WINDOWIN StringTable[39] #define IDS_WINDOWOUT StringTable[40] #define IDS_TYPE StringTable[41] #define IDS_USERCHOOSE StringTable[42] #define IDS_FILLTER StringTable[43] #define IDS_REARRANGE StringTable[44] #define IDS_MANUALREPEAT StringTable[45] #define IDS_MATCHNORMAL StringTable[46] #define IDS_MATCHVER StringTable[47] #define IDS_MATCHHOR StringTable[48] #define IDS_AUTOREPEAT StringTable[49] #define IDS_PULL StringTable[50] #define IDS_PERSPFIXX StringTable[51] #define IDS_PERSPFIXY StringTable[52] #define IDS_PATTERN StringTable[53] #define IDS_REGULAR StringTable[54] #define IDS_IMAGESPRAY StringTable[55] #define IDS_CLOSECOLOR StringTable[56] #define IDS_CLOSEAREA StringTable[57] #define IDS_WHOLE StringTable[58] #define IDS_SQUARE StringTable[59] #define IDS_SINGLETOPATTERN StringTable[60] #define IDS_SINGLETOROTATE StringTable[61] #define IDS_CIRCLE StringTable[62] #define IDS_MULTITOMULTI StringTable[63] #define IDS_MULTITOPATTERN StringTable[64] #define IDS_MULTITOROTATE StringTable[65] #define IDS_OBLIQUE StringTable[66] #define IDS_HV StringTable[67] #define IDS_MAKINGGRID StringTable[68] #define IDS_COPY StringTable[69] #define IDS_FABRIC StringTable[70] //======================================================= //--------------------------------------------------------------------------- TMainMenuForm *MainMenuForm; //--------------------------------------------------------------------------- __fastcall TMainMenuForm::TMainMenuForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::FormClose(TObject *Sender, TCloseAction &Action) { ExitForm(1); Visible = false; if (FOnUpdateMenu) FOnUpdateMenu(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::FormCreate(TObject *Sender) { ClientWidth = 248; ClientHeight = sbExit->Top; PosY = Height; FWidth = ClientWidth; FHeight = ClientHeight; //================================================= StringTable.Create(DirectoryItem, Language, "MainMenu"); Caption = IDS_FCAPTION; sbWindow->Hint = IDS_COMMON_WINDOW; sbMoveCopy->Hint = IDS_MOVECOPY; sbColorChange->Hint = IDS_COLORCHANGE; sbClear->Hint = IDS_CLEAR; sbGrouping->Hint = IDS_GROUPING; sbRepeat->Hint = IDS_COMMON_REPEAT; sbDraw->Hint = IDS_COMMON_DRAW; sbRepro->Hint = IDS_REPROPORTION; sbFill->Hint = IDS_FILL; sbSpreadFill->Hint = IDS_SPREADFILL; sbStipple->Hint = IDS_STIPPLE; sbStyle->Hint = IDS_STYLE; sbPatternRepeat->Hint = IDS_PATTERNREPEAT; sb3D->Hint = IDS_3DMAPPING; sbStripe->Hint = IDS_STRIPE; sbSeparate->Hint = IDS_COLORSEPARATE; sbStitch->Hint = IDS_STITCH; sbText->Hint = IDS_TEXT; sbCombo->Hint = IDS_COLORCOMBO; sbSmooth->Hint = IDS_SMOOTH; sbScratch->Hint = IDS_SCRATCH; sbJacquard->Hint = IDS_JACQUARD; sbFile->Hint = IDS_COMMON_FILE; sbPrint->Hint = IDS_PRINTER; sbScan->Hint = IDS_SCANNER; sbUndo->Hint = IDS_COMMON_UNDO; sbShadow->Hint = IDS_SHADOW; sbAfter->Hint = IDS_TREATMENT; Window1->Caption = IDS_COMMON_WINDOW; MoveCopy1->Caption = IDS_MOVECOPY; ColorChange1->Caption = IDS_COLORCHANGE; Clear1->Caption = IDS_CLEAR; Grouping1->Caption = IDS_GROUPING; repeat1->Caption = IDS_COMMON_REPEAT; Draw1->Caption = IDS_COMMON_DRAW; Reproportion1->Caption = IDS_REPROPORTION; Fill1->Caption = IDS_FILL; SpreadFill1->Caption = IDS_SPREADFILL; Stipple1->Caption = IDS_STIPPLE; Style1->Caption = IDS_STYLE; PatternRepeat1->Caption = IDS_PATTERNREPEAT; N3D1->Caption = IDS_3DMAPPING; Stripe1->Caption = IDS_STRIPE; ColorSeparate1->Caption = IDS_COLORSEPARATE; Stitch1->Caption = IDS_STITCH; Text1->Caption = IDS_TEXT; ColorCombo1->Caption = IDS_COLORCOMBO; Smooth1->Caption = IDS_SMOOTH; Scratch1->Caption = IDS_SCRATCH; Jacquard1->Caption = IDS_JACQUARD; Shadow1->Caption = IDS_SHADOW; After1->Caption = IDS_TREATMENT; File1->Caption = IDS_COMMON_FILE; Printing1->Caption = IDS_PRINTER; Scanning1->Caption = IDS_SCANNER; Undo1->Caption = IDS_COMMON_UNDO; //================================================= ¼­ºê ¸Þ´º¿¡¼­ Ãß°¡ÇÑ ºÎºÐ subshape1->Caption = IDS_SHAPE; subRectangle2->Caption = IDS_COMMON_RECTANGLE; subEllipse1->Caption = IDS_COMMON_ELLIPSE; subIrre1->Caption = IDS_IRREGULAR; suboutline1->Caption = IDS_COMMON_OUTLINE; subSurfaceM1->Caption = IDS_SURFACEMULTI; subSurfaceS1->Caption = IDS_SURFACESINGLE; subBorder1->Caption = IDS_BORDER; subfull1->Caption = IDS_FULL; subOff1->Caption = IDS_OFF; Copy1->Caption = IDS_COMMON_COPY; sbNormal->Caption = IDS_COMMON_NORMAL; sbUpdown->Caption = IDS_COMMON_UPDOWN; Mirror1->Caption = IDS_COMMON_MIRROR; RotatingMirror2->Caption = IDS_ROTATEMIRROR; UpdownMirror1->Caption = IDS_COMMON_UPDOWNMIRROR; Rotate1->Caption = IDS_ROTATE; Bend1->Caption = IDS_BEND; Move1->Caption = IDS_COMMON_MOVE; Normal2->Caption = IDS_COMMON_NORMAL; UpDown2->Caption = IDS_COMMON_UPDOWN; Mirror2->Caption = IDS_COMMON_MIRROR; RotatingMirror1->Caption = IDS_ROTATEMIRROR; UpDownMirror2->Caption = IDS_COMMON_UPDOWNMIRROR; Rotate2->Caption = IDS_ROTATE; Bend2->Caption = IDS_BEND; ByWindow1->Caption = IDS_BYWINDOW; Swap1->Caption = IDS_SWAP; SToS1->Caption = IDS_SINGLETOSINGLE; MToS1->Caption = IDS_MULTITOSINGLE; ByPen1->Caption = IDS_BYPEN; SToS2->Caption = IDS_SINGLETOSINGLE; MToS2->Caption = IDS_MULTITOSINGLE; wholeclear1->Caption = IDS_COMMON_WHOLE; subwindowin1->Caption = IDS_WINDOWIN; subwindowout1->Caption = IDS_WINDOWOUT; subType1->Caption = IDS_TYPE; subUser1->Caption = IDS_USERCHOOSE; subFilter1->Caption = IDS_FILLTER; subRearrange1->Caption = IDS_REARRANGE; ManualR->Caption = IDS_MANUALREPEAT; Nomal1->Caption = IDS_COMMON_NORMAL; half1->Caption = IDS_COMMON_HDVER; halfHor1->Caption = IDS_COMMON_HDHOR; MatchNormal1->Caption = IDS_MATCHNORMAL; MatchVer1->Caption = IDS_MATCHVER; MatchHor1->Caption = IDS_MATCHHOR; AutoRepeat1->Caption = IDS_AUTOREPEAT; Normal1->Caption = IDS_COMMON_NORMAL; halfDHor1->Caption = IDS_COMMON_HDHOR; halfDVer1->Caption = IDS_COMMON_HDVER; close1->Caption = IDS_COMMON_EXIT; sbLine->Caption = IDS_COMMON_LINE; sbSquare->Caption = IDS_COMMON_SQUARE; Circle1->Caption = IDS_COMMON_CIRCLE; OutLine1->Caption = IDS_COMMON_OUTLINE; Curve1->Caption = IDS_COMMON_CURVE; Rectangle1->Caption = IDS_COMMON_RECTANGLE; Ellipse1->Caption = IDS_COMMON_ELLIPSE; subRectangle1->Caption = IDS_COMMON_RECTANGLE; subpull1->Caption = IDS_PULL; subPerspX1->Caption = IDS_PERSPFIXX; subPerspY1->Caption = IDS_PERSPFIXY; subLine1->Caption = IDS_COMMON_LINE; subCircle1->Caption = IDS_COMMON_CIRCLE; subRect1->Caption = IDS_COMMON_RECTANGLE; subpattern1->Caption = IDS_PATTERN; subRegular1->Caption = IDS_REGULAR; sub1->Caption = IDS_IRREGULAR; subImagespray1->Caption = IDS_IMAGESPRAY; subchoosecolor1->Caption = IDS_CLOSECOLOR; subchoosearea1->Caption = IDS_CLOSEAREA; subwhole1->Caption = IDS_WHOLE; StoS3->Caption = IDS_SINGLETOSINGLE; StoPattern1->Caption = IDS_SINGLETOPATTERN; StoRotate1->Caption = IDS_SINGLETOROTATE; MtoS3->Caption = IDS_MULTITOSINGLE; MtoM1->Caption = IDS_MULTITOMULTI; MtoPattern1->Caption = IDS_MULTITOPATTERN; MtoRotate1->Caption = IDS_MULTITOROTATE; subSquare1->Caption = IDS_SQUARE; subCircle2->Caption = IDS_CIRCLE; Rearrange1->Caption = IDS_REARRANGE; File2->Caption = IDS_COMMON_FILE; FreeLine1->Caption = IDS_COMMON_DRAW; ObliqueLine1->Caption = IDS_OBLIQUE; HVLine1->Caption = IDS_HV; Rectangle2->Caption = IDS_COMMON_RECTANGLE; Ellipse2->Caption = IDS_COMMON_ELLIPSE; Curve2->Caption = IDS_COMMON_CURVE; SubMGrid1->Caption = IDS_MAKINGGRID; SubFile1->Caption = IDS_COMMON_FILE; SubCopy1->Caption = IDS_COPY; SubFabric1->Caption = IDS_FABRIC; //================================================= #ifdef ACADEMY sbStripe->Enabled = false; sbSpreadFill->Enabled = false; sbSeparate->Enabled = false; sbGrouping->Enabled = false; sbSmooth->Enabled = false; sbJacquard->Enabled = false; sb3D->Enabled = false; sbPatternRepeat->Enabled = false; sbScan->Enabled = false; sbStyle->Enabled = false; // can click but nothing happens.... sbTexWork->Enabled = false; #endif #ifdef N_3D if(!MainForm->T3D_Item) sb3D->Enabled = false; #endif bRegion = false; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbWindowClick(TObject *Sender) { InitWindowForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbMoveCopyClick(TObject *Sender) { InitMoveCopyForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbColorChangeClick(TObject *Sender) { InitColorChangeForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbClearClick(TObject *Sender) { InitClearForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbGroupingClick(TObject *Sender) { InitGroupingForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbRepeatClick(TObject *Sender) { InitRepeatForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbDrawClick(TObject *Sender) { InitDrawForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbReproClick(TObject *Sender) { InitReproForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbFillClick(TObject *Sender) { InitFillForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbSpreadFillClick(TObject *Sender) { InitSpreadFillForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbStippleClick(TObject *Sender) { InitStippleForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbStyleClick(TObject *Sender) { InitStyleForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbPatternRepeatClick(TObject *Sender) { InitPatternRepeatForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbStripeClick(TObject *Sender) { InitStripeForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbSeparateClick(TObject *Sender) { InitSeparateForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbStitchClick(TObject *Sender) { InitStitchForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbTextClick(TObject *Sender) { InitTextForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbComboClick(TObject *Sender) { InitComboForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbSmoothClick(TObject *Sender) { InitSmoothForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbScratchClick(TObject *Sender) { InitScratchForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbJacquardClick(TObject *Sender) { InitJacquardForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbFileClick(TObject *Sender) { MainForm->FManagerItemClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbPrintClick(TObject *Sender) { MainForm->FPrintingItemClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbScanClick(TObject *Sender) { MainForm->FScanningItemClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbUndoClick(TObject *Sender) { InitUndoForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sb3DClick(TObject *Sender) { Init3DForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbShadowClick(TObject *Sender) { #ifndef ACADEMY InitShadowForm(); #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbAfterClick(TObject *Sender) { InitAfterProcessForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbExitClick(TObject *Sender) { ExitForm(); showfalse(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::PopupMenu1Popup(TObject *Sender) { TMenuItem *NewItem = NULL; GetCursorPos(&ptScreen); UpdatePopup(); subOff1->Enabled = false; Undo1->Enabled = true; if (MainImageForm->WorkArea->Mask) { subOff1->Enabled = true; NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "-"; PopupMenu1->Items->Insert(0, NewItem); } NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "Transform Region"; NewItem->OnClick = TransformRegion; PopupMenu1->Items->Insert(0, NewItem); } NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "Invert Region"; NewItem->OnClick = InvertRegion; PopupMenu1->Items->Insert(0, NewItem); } bRegion = true; subwindowin1->Enabled = true; subwindowout1->Enabled = true; }else { subwindowin1->Enabled = false; subwindowout1->Enabled = false; } if(MainImageForm->iMainImage->Bitmap->BitsPerPixel == 8) { #ifndef ACADEMY if (Item == T_STYLE) { if (StyleForm->PopupInsert()) { NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "-"; PopupMenu1->Items->Insert(0, NewItem); } NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "StyleImage Delete"; NewItem->OnClick = StyleForm->PopupClick; PopupMenu1->Items->Insert(0, NewItem); } } } if(showAfterprocess == false) Rearrange1->Enabled = true; #endif CMY1->Visible = false; ByWindow1->Visible = true; ByPen1->Visible = true; MtoS3->Enabled = true; MtoM1->Enabled = true; MtoPattern1->Enabled = MainImageForm->WorkArea->Mask!=NULL; MtoRotate1->Enabled = MainImageForm->WorkArea->Mask!=NULL; StoPattern1->Enabled = MainImageForm->WorkArea->Mask!=NULL; StoRotate1->Enabled = MainImageForm->WorkArea->Mask!=NULL; } else { TData3D *dp = MainImageForm->Data3D; if (MainImageForm->WorkArea->Mask){ NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "-"; PopupMenu1->Items->Insert(0, NewItem); } NewItem = new TMenuItem(NULL); if (NewItem) { NewItem->Caption = "Capture Overwrite"; NewItem->OnClick = MainForm->COverwriteItemClick; PopupMenu1->Items->Insert(0, NewItem); } } // SubCopy1->Enabled = MainImageForm->Data3D->CopyCount>0; Rearrange1->Enabled = false; ByWindow1->Visible = false; ByPen1->Visible = false; CMY1->Visible = true; MtoS3->Enabled = false; MtoM1->Enabled = false; StoPattern1->Enabled = MainImageForm->WorkArea->Mask!=NULL; StoRotate1->Enabled = MainImageForm->WorkArea->Mask!=NULL; MtoPattern1->Enabled = false; MtoRotate1->Enabled = false; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InvertRegion(TObject *Sender) { MainImageForm->WorkArea->InvertRegion(); MainImageForm->iMainImage->Invalidate(); UpdateItem(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::TransformRegion(TObject *Sender) { ExitForm(); Item = T_REGION; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::UpdatePopup() { TMenuItem *NewItem = NULL; int i; for (i = 0; i < 2; i++) { NewItem = (TMenuItem *) PopupMenu1->Items->Items[0]; if (NewItem) { if (NewItem->Caption == "Capture Overwrite") { PopupMenu1->Items->Remove(NewItem); delete NewItem; } else if (NewItem->Caption == "StyleImage Delete") { PopupMenu1->Items->Remove(NewItem); delete NewItem; } else if (NewItem->Caption == "-") { PopupMenu1->Items->Remove(NewItem); delete NewItem; } } } if (bRegion) { for (i = 0; i < 3; i++) { NewItem = (TMenuItem *) PopupMenu1->Items->Items[0]; if (NewItem) { if (NewItem->Caption == "Invert Region") { PopupMenu1->Items->Remove(NewItem); delete NewItem; } else if (NewItem->Caption == "Transform Region") { PopupMenu1->Items->Remove(NewItem); delete NewItem; } else if (NewItem->Caption == "-") { PopupMenu1->Items->Remove(NewItem); delete NewItem; } } } bRegion = false; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::ZoomClick(TObject *Sender) { if (Sender==Zoom1161) { MainImageForm->ZoomChange(1, 16, &ptScreen); } else if (Sender==Zoom181) { MainImageForm->ZoomChange(1, 8, &ptScreen); } else if (Sender==Zoom141) { MainImageForm->ZoomChange(1, 4, &ptScreen); } else if (Sender==Zoom121) { MainImageForm->ZoomChange(1, 2, &ptScreen); } else if (Sender==Zoom11) { MainImageForm->ZoomChange(1, 1, &ptScreen); } else if (Sender==Zoom21) { MainImageForm->ZoomChange(2, 1, &ptScreen); } else if (Sender==Zoom41) { MainImageForm->ZoomChange(4, 1, &ptScreen); } else if (Sender==Zoom81) { MainImageForm->ZoomChange(8, 1, &ptScreen); } else if (Sender==Zoom161) { MainImageForm->ZoomChange(16, 1, &ptScreen); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::ViewLight() { switch (Item) { case T_WIN: shWindow->Brush->Color = clRed; shWindow->Pen->Color = clRed; break; case T_MOVECOPY: shMoveCopy->Brush->Color = clRed; shMoveCopy->Pen->Color = clRed; break; case T_COLOR: shColorChange->Brush->Color = clRed; shColorChange->Pen->Color = clRed; break; case T_CLEAR: shClear->Brush->Color = clRed; shClear->Pen->Color = clRed; break; case T_GROUP: shGrouping->Brush->Color = clRed; shGrouping->Pen->Color = clRed; break; case T_REPEAT: shRepeat->Brush->Color = clRed; shRepeat->Pen->Color = clRed; break; case T_DRAW: shDraw->Brush->Color = clRed; shDraw->Pen->Color = clRed; break; case T_REPRO: shRepro->Brush->Color = clRed; shRepro->Pen->Color = clRed; break; case T_FILL: shFill->Brush->Color = clRed; shFill->Pen->Color = clRed; break; case T_SPREAD: shSpreadFill->Brush->Color = clRed; shSpreadFill->Pen->Color = clRed; break; case T_STIPPLE: shStipple->Brush->Color = clRed; shStipple->Pen->Color = clRed; break; case T_STYLE: shStyle->Brush->Color = clRed; shStyle->Pen->Color = clRed; break; case T_PATTERN: shPattern->Brush->Color = clRed; shPattern->Pen->Color = clRed; break; case T_STRIPE: shStripe->Brush->Color = clBlue; shStripe->Pen->Color = clBlue; break; case T_STITCH: shStitch->Brush->Color = clBlue; shStitch->Pen->Color = clBlue; break; case T_TEXT: shText->Brush->Color = clBlue; shText->Pen->Color = clBlue; break; case T_COMBO: shCombo->Brush->Color = clBlue; shCombo->Pen->Color = clBlue; break; case T_SMOOTH: shSmooth->Brush->Color = clBlue; shSmooth->Pen->Color = clBlue; break; case T_SEPARATE: shSeparate->Brush->Color = clBlue; shSeparate->Pen->Color = clBlue; break; case T_SCRATCH: shScratch->Brush->Color = clBlue; shScratch->Pen->Color = clBlue; break; case T_JAQ: shJacquard->Brush->Color = clBlue; shJacquard->Pen->Color = clBlue; break; case T_UNDO: shUndo->Brush->Color = clBlue; shUndo->Pen->Color = clBlue; break; case T_SHADOW: shShadow->Brush->Color = clBlue; shShadow->Pen->Color = clBlue; break; case T_AFTER: shAfter->Brush->Color = clBlue; shAfter->Pen->Color = clBlue; break; case T_3D: sh3D->Brush->Color = clRed; sh3D->Pen->Color = clRed; break; } } //--------------------------------------------------------------------------- /* void TMainMenuForm::WMEXITSIZEMOVE(TMessage &msg) { if ((Left <= MainForm->MainMenuFormPos.x + 100) && (Left >= MainForm->MainMenuFormPos.x - 100)) { if ((Top <= MainForm->MainMenuFormPos.y + 100) && (Top >= MainForm->MainMenuFormPos.y - 100)) { Top = MainForm->MainMenuFormPos.y; Left = MainForm->MainMenuFormPos.x; } } } */ //--------------------------------------------------------------------------- void TMainMenuForm::TPMExitFunction(TMessage &msg) { ExitForm(1); } //-------------------------------------------------------------------------- void __fastcall TMainMenuForm::UpdateItem() { if (MainImageForm==NULL) return; if (MainImageForm->iMainImage==NULL) return; #ifdef ACADEMY sbMoveCopy->Enabled = false; MoveCopy1->Enabled = false; sbColorChange->Enabled = true; ColorChange1->Enabled = true; sbRepeat->Enabled = false; repeat1->Enabled = false; sbRepro->Enabled = false; Reproportion1->Enabled = false; sbFill->Enabled = true; Fill1->Enabled = true; sbSpreadFill->Enabled = false; SpreadFill1->Enabled = false; sbStipple->Enabled = false; Stipple1->Enabled = false; // sbStyle->Enabled = true; // Style1->Enabled = true; sbStyle->Enabled = false; Style1->Enabled = false; sbPatternRepeat->Enabled = false; PatternRepeat1->Enabled = false; sbStripe->Enabled = false; Stripe1->Enabled = false; sbCombo->Enabled = true; ColorCombo1->Enabled = true; sbSmooth->Enabled = false; Smooth1->Enabled = false; sbSeparate->Enabled = false; ColorSeparate1->Enabled = false; sbScratch->Enabled = true; Scratch1->Enabled = true; sbJacquard->Enabled = false; Jacquard1->Enabled = false; sb3D->Enabled = false; N3D1->Enabled = false; sbShadow->Enabled = false; Shadow1->Enabled = false; sbAfter->Enabled = false; After1->Enabled = false; sbScan->Enabled = false; Scanning1->Enabled = false; if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { sbMoveCopy->Enabled = true; MoveCopy1->Enabled = true; sbRepeat->Enabled = true; repeat1->Enabled = true; sbRepro->Enabled = true; Reproportion1->Enabled = true; } } #else if (MainImageForm->iMainImage->Bitmap->BitsPerPixel==8) { sbMoveCopy->Enabled = false; MoveCopy1->Enabled = false; sbColorChange->Enabled = true; ColorChange1->Enabled = true; sbRepeat->Enabled = false; repeat1->Enabled = false; sbRepro->Enabled = false; Reproportion1->Enabled = false; sbGrouping->Enabled = true; Grouping1->Enabled = true; sbFill->Enabled = true; Fill1->Enabled = true; sbSpreadFill->Enabled = true; SpreadFill1->Enabled = true; sbStipple->Enabled = true; Stipple1->Enabled = true; sbStyle->Enabled = true; Style1->Enabled = true; sbPatternRepeat->Enabled = false; PatternRepeat1->Enabled = false; sbStripe->Enabled = true; Stripe1->Enabled = true; sbSmooth->Enabled = true; Smooth1->Enabled = true; sbScratch->Enabled = true; Scratch1->Enabled = true; sb3D->Enabled = false; N3D1->Enabled = false; sbShadow->Enabled = false; Shadow1->Enabled = false; // sbJacquard->Enabled = true; // Jacquard1->Enabled = true; // sbCombo->Enabled = true; // ColorCombo1->Enabled = true; // sbSeparate->Enabled = true; // ColorSeparate1->Enabled = true; if (MainImageForm->iMainImage->LayerList->Count > 1) { sbCombo->Enabled = false; ColorCombo1->Enabled = false; sbJacquard->Enabled = false; Jacquard1->Enabled = false; sbSeparate->Enabled = false; ColorSeparate1->Enabled = false; } else { if (MainImageForm->AutoRepeat) { sbCombo->Enabled = false; ColorCombo1->Enabled = false; sbJacquard->Enabled = false; Jacquard1->Enabled = false; } else { sbCombo->Enabled = true; ColorCombo1->Enabled = true; sbJacquard->Enabled = true; Jacquard1->Enabled = true; sbSeparate->Enabled = true; ColorSeparate1->Enabled = true; } } if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { sbMoveCopy->Enabled = true; MoveCopy1->Enabled = true; sbRepeat->Enabled = true; repeat1->Enabled = true; sbRepro->Enabled = true; Reproportion1->Enabled = true; sbPatternRepeat->Enabled = true; PatternRepeat1->Enabled = true; if (MainImageForm->iMainImage->IsBack() == false) { sbShadow->Enabled = true; Shadow1->Enabled = true; } } } sbScan->Enabled = MainForm->FScanningItem->Enabled; Scanning1->Enabled = MainForm->FScanningItem->Enabled; } else if (MainImageForm->iMainImage->Bitmap->BitsPerPixel==24) { sbMoveCopy->Enabled = false; MoveCopy1->Enabled = false; sbColorChange->Enabled = false; ColorChange1->Enabled = false; sbGrouping->Enabled = false; Grouping1->Enabled = false; sbRepeat->Enabled = false; repeat1->Enabled = false; sbRepro->Enabled = false; Reproportion1->Enabled = false; sbFill->Enabled = true; Fill1->Enabled = true; sbSpreadFill->Enabled = true; SpreadFill1->Enabled = true; sbStipple->Enabled = false; Stipple1->Enabled = false; sbStyle->Enabled = false; Style1->Enabled = false; sbPatternRepeat->Enabled = false; PatternRepeat1->Enabled = false; sbStripe->Enabled = true; Stripe1->Enabled = true; sbCombo->Enabled = false; ColorCombo1->Enabled = false; sbSmooth->Enabled = false; Smooth1->Enabled = false; sbSeparate->Enabled = false; ColorSeparate1->Enabled = false; sbScratch->Enabled = true; Scratch1->Enabled = true; sbJacquard->Enabled = false; Jacquard1->Enabled = false; #ifndef N_3D if(MainForm->T3D_Item){ sb3D->Enabled = true; N3D1->Enabled = true; } else { sb3D->Enabled = false; N3D1->Enabled = false; } #else sb3D->Enabled = false; N3D1->Enabled = false; #endif sbScan->Enabled = MainForm->FScanningItem->Enabled; Scanning1->Enabled = MainForm->FScanningItem->Enabled; sbShadow->Enabled = false; Shadow1->Enabled = false; if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { sbMoveCopy->Enabled = true; MoveCopy1->Enabled = true; sbRepeat->Enabled = true; repeat1->Enabled = true; sbRepro->Enabled = true; Reproportion1->Enabled = true; sbPatternRepeat->Enabled = true; PatternRepeat1->Enabled = true; sbColorChange->Enabled = true; ColorChange1->Enabled = true; if (MainImageForm->iMainImage->IsBack() == false) { sbShadow->Enabled = true; Shadow1->Enabled = true; } } } } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitWindowForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_WIN) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_WIN; ViewLight(); WindowForm = new TWindowForm(this); WindowForm->Parent = this; WindowForm->BorderStyle = bsNone; WindowForm->Left = 0; WindowForm->Top = ClientHeight+20; WindowForm->Visible = true; WindowForm->InitForm(); showfalse(); showWindow = true; } else sbWindow->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitMoveCopyForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_MOVECOPY) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_MOVECOPY; ViewLight(); MoveCopyForm = new TMoveCopyForm(this); MoveCopyForm->Parent = this; MoveCopyForm->BorderStyle = bsNone; MoveCopyForm->Left = 0; MoveCopyForm->Top = ClientHeight+20; MoveCopyForm->Visible = true; MoveCopyForm->InitForm(); showfalse(); showMovecopy = true; } else sbMoveCopy->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitColorChangeForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_COLOR) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_COLOR; ViewLight(); ColorChangeForm = new TColorChangeForm(this); ColorChangeForm->Parent = this; ColorChangeForm->BorderStyle = bsNone; ColorChangeForm->Left = 0; ColorChangeForm->Top = ClientHeight+20; ColorChangeForm->Visible = true; ColorChangeForm->InitForm(); showColorChange = true; shifta = 0; //lhskys shift Ŭ¸®¼ö ÃʱâÈ­ } else sbColorChange->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitClearForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_CLEAR) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_CLEAR; ViewLight(); ClearForm = new TClearForm(this); ClearForm->Parent = this; ClearForm->BorderStyle = bsNone; ClearForm->Left = 0; ClearForm->Top = ClientHeight+20; ClearForm->Visible = true; ClearForm->InitForm(); showClear = true; } else sbClear->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitGroupingForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_GROUP) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_GROUP; ViewLight(); GroupingForm = new TGroupingForm(this); GroupingForm->Parent = this; GroupingForm->BorderStyle = bsNone; GroupingForm->Left = 0; GroupingForm->Top = ClientHeight+20; GroupingForm->Visible = true; GroupingForm->InitForm(); showGrouping = true; } else sbGrouping->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitRepeatForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_REPEAT) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_REPEAT; ViewLight(); RepeatForm = new TRepeatForm(this); RepeatForm->Parent = this; RepeatForm->BorderStyle = bsNone; RepeatForm->Left = 0; RepeatForm->Top = ClientHeight+20; RepeatForm->Visible = true; RepeatForm->InitForm(); showRepeat = true; } else sbRepeat->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitDrawForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_DRAW) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_DRAW; ViewLight(); DrawForm = new TDrawForm(this); DrawForm->Parent = this; DrawForm->BorderStyle = bsNone; DrawForm->Left = 0; DrawForm->Top = ClientHeight+20; DrawForm->Visible = true; DrawForm->InitForm(); showDraw = true; } else sbDraw->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitReproForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_REPRO) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_REPRO; ViewLight(); ReproForm = new TReproForm(this); ReproForm->Parent = this; ReproForm->BorderStyle = bsNone; ReproForm->Left = 0; ReproForm->Top = ClientHeight+20; ReproForm->Visible = true; ReproForm->InitForm(); showReproportion = true; } else sbRepro->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitFillForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_FILL) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_FILL; ViewLight(); FillForm = new TFillForm(this); FillForm->Parent = this; FillForm->BorderStyle = bsNone; FillForm->Left = 0; FillForm->Top = ClientHeight+20; FillForm->Visible = true; FillForm->InitForm(); showFill = true; } else sbFill->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitSpreadFillForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_SPREAD) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_SPREAD; ViewLight(); SpreadFillForm = new TSpreadFillForm(this); SpreadFillForm->Parent = this; SpreadFillForm->BorderStyle = bsNone; SpreadFillForm->Left = 0; SpreadFillForm->Top = ClientHeight+20; SpreadFillForm->Visible = true; SpreadFillForm->InitForm(); } else sbSpreadFill->Down = false; } else { ExitForm(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitStippleForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_STIPPLE) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_STIPPLE; ViewLight(); StippleForm = new TStippleForm(this); StippleForm->Parent = this; StippleForm->BorderStyle = bsNone; StippleForm->Left = 0; StippleForm->Top = ClientHeight+20; StippleForm->Visible = true; StippleForm->InitForm(); showStipple = true; } else sbStipple->Down = false; } else { ExitForm(); showfalse(); } #endif } //---------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitStyleForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_STYLE) sw = false; else sw = true; if (sw) { if (ExitForm()) { Item = T_STYLE; StyleForm = new TStyleForm(this); StyleForm->Parent = MainForm; StyleForm->InitForm(); } else sbStyle->Down = false; } else { ExitForm(); } #endif } //---------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitPatternRepeatForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_PATTERN) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_PATTERN; ViewLight(); PatternRepeatForm = new TPatternRepeatForm(this); PatternRepeatForm->Parent = this; PatternRepeatForm->BorderStyle = bsNone; PatternRepeatForm->Left = 0; PatternRepeatForm->Top = ClientHeight+20; PatternRepeatForm->Visible = true; PatternRepeatForm->InitForm(); showPatternRe = true; } else sbPatternRepeat->Down = false; } else { ExitForm(); showfalse(); } #endif } //---------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitStripeForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_STRIPE) sw = false; else sw = true; if (sw) { if (ExitForm()) { Item = T_STRIPE; StripeForm = new TStripeForm(this); StripeForm->Parent = MainForm; StripeForm->InitForm(); } else sbStripe->Down = false; } else { ExitForm(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitSeparateForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_SEPARATE) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_SEPARATE; ViewLight(); SeparateForm = new TSeparateForm(this); SeparateForm->Parent = this; SeparateForm->BorderStyle = bsNone; SeparateForm->Left = 0; SeparateForm->Top = ClientHeight + 20; SeparateForm->Visible = true; SeparateForm->InitForm(); } else sbSeparate->Down = false; } else { ExitForm(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitStitchForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_STITCH) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_STITCH; ViewLight(); StitchForm = new TStitchForm(this); StitchForm->Parent = this; StitchForm->BorderStyle = bsNone; StitchForm->Left = 0; StitchForm->Top = ClientHeight+20; StitchForm->Visible = true; StitchForm->InitForm(); } else sbStitch->Down = false; } else { ExitForm(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitTextForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_TEXT) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_TEXT; ViewLight(); TextForm = new TTextForm(this); TextForm->Parent = this; TextForm->BorderStyle = bsNone; TextForm->Left = 0; TextForm->Top = ClientHeight+20; TextForm->Visible = true; TextForm->InitForm(); showText = true; } else sbText->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitComboForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_COMBO) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_COMBO; ViewLight(); ComboMenu = new TComboMenu(this); ComboMenu->Parent = this; ComboMenu->BorderStyle = bsNone; ComboMenu->Left = 0; ComboMenu->Top = ClientHeight+20; ComboMenu->Visible = true; ComboMenu->InitForm(); } else sbCombo->Down = false; } else { ExitForm(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitSmoothForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_SMOOTH) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_SMOOTH; ViewLight(); SmoothForm = new TSmoothForm(this); SmoothForm->Parent = this; SmoothForm->BorderStyle = bsNone; SmoothForm->Left = 0; SmoothForm->Top = ClientHeight + 20; SmoothForm->Visible = true; SmoothForm->InitForm(); showSmooth = true; } else sbSmooth->Down = false; } else { ExitForm(); showfalse(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitScratchForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_SCRATCH) sw = false; else sw = true; if (sw) { if (ExitForm() && Item!=T_SCRATCH) { Show(); Item = T_SCRATCH; ViewLight(); ScratchForm = new TScratchForm(this); ScratchForm->Parent = this; ScratchForm->BorderStyle = bsNone; ScratchForm->Left = 0; ScratchForm->Top = ClientHeight + 20; ScratchForm->Visible = true; ScratchForm->InitForm(); } else sbScratch->Down = false; } else { ExitForm(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitJacquardForm() { #ifndef ACADEMY bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_JAQ) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_JAQ; ViewLight(); JacquardForm = new TJacquardForm(this); JacquardForm->Parent = this; JacquardForm->BorderStyle = bsNone; JacquardForm->Left = 0; JacquardForm->Top = ClientHeight+20; JacquardForm->Visible = true; JacquardForm->InitForm(); } else sbJacquard->Down = false; } else { ExitForm(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitUndoForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif if (Item==T_UNDO) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_UNDO; ViewLight(); UndoForm = new TUndoForm(this); UndoForm->Parent = this; UndoForm->BorderStyle = bsNone; UndoForm->Left = 0; UndoForm->Top = ClientHeight+20; UndoForm->Visible = true; UndoForm->InitForm(); showUndo = true; } else sbUndo->Down = false; } else { ExitForm(); showfalse(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitShadowForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif #ifndef ACADEMY if (Item==T_SHADOW) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_SHADOW; ViewLight(); ShadowForm = new TShadowForm(this); ShadowForm->Parent = this; ShadowForm->BorderStyle = bsNone; ShadowForm->Left = 0; ShadowForm->Top = ClientHeight+20; ShadowForm->Visible = true; ShadowForm->InitForm(); } else sbShadow->Down = false; } else { ExitForm(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitAfterProcessForm() { bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Check(); #endif #endif #ifndef ACADEMY if (Item==T_AFTER) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_AFTER; ViewLight(); APMenuForm = new TAPMenuForm(this); APMenuForm->Parent = this; APMenuForm->BorderStyle = bsNone; APMenuForm->Left = 0; APMenuForm->Top = ClientHeight+20; APMenuForm->Visible = true; APMenuForm->InitForm(); showAfterprocess = true; } else sbAfter->Down = false; } else { ExitForm(); showfalse(); } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::Init3DForm() { #ifndef ACADEMY #ifndef N_3D bool sw; #ifndef LOCK_CRYPKEY #ifndef LOCK_IFC ProtectCard->Read(); #endif #endif if (Item==T_3D) sw = false; else sw = true; if (sw) { if (ExitForm()) { Show(); Item = T_3D; ViewLight(); Menu3DForm = new TMenu3DForm(this); Menu3DForm->Parent = this; Menu3DForm->BorderStyle = bsNone; Menu3DForm->Left = 0; Menu3DForm->Top = ClientHeight+20; Menu3DForm->Visible = true; Menu3DForm->InitForm(); // PenManagerForm->InitType(PT_NORMAL, true); // Source PenManagerForm->Type = PT_NORMAL; PenManagerForm->InitType(true); // show3D = true; } else sb3D->Down = false; } else { ExitForm(); showfalse(); } #endif #endif } //--------------------------------------------------------------------------- TPException __fastcall TMainMenuForm::LoadFrom3DFile(HANDLE fh, TEXPIAFILEHEADER &tpfh, TTexpiaBitmap *pBitmap) { #ifndef ACADEMY #ifndef N_3D if(MainForm->T3D_Item){ if (Item != T_3D) { sb3D->Enabled = true; Init3DForm(); } else { ClientHeight = FHeight; Menu3DForm->RemoveData(); MainImageForm->Data3D->Remove(); Menu3DForm->InitForm(); } return Menu3DForm->LoadFrom3DFile(fh, tpfh, pBitmap); } #endif #endif } //--------------------------------------------------------------------------- TPException __fastcall TMainMenuForm::SaveTo3DFile(HANDLE fh, TEXPIAFILEHEADER &tpfh, TTexpiaBitmap *tag, TTexpiaBitmap *pBitmap) { #ifndef ACADEMY #ifndef N_3D if(MainForm->T3D_Item) return Menu3DForm->SaveTo3DFile(fh, tpfh, tag, pBitmap); #endif #endif } //--------------------------------------------------------------------------- bool __fastcall TMainMenuForm::ExitForm(int i) { AnsiString msg, fn, ext; char *s; TGraphicFileFormat gff; int Btn; TMainImageForm *mif; bool success = true; showfalse(); if (Item!=T_NONE) { Show(); switch (Item) { case T_WIN: WindowForm->ExitForm(); delete WindowForm; WindowForm = NULL; sbWindow->Down = false; break; case T_MOVECOPY: MoveCopyForm->ExitForm(); delete MoveCopyForm; MoveCopyForm = NULL; sbMoveCopy->Down = false; break; case T_COLOR: ColorChangeForm->ExitForm(); delete ColorChangeForm; ColorChangeForm = NULL; sbColorChange->Down = false; break; case T_CLEAR: delete ClearForm; ClearForm = NULL; sbClear->Down = false; break; case T_GROUP: GroupingForm->ExitForm(); delete GroupingForm; GroupingForm = NULL; sbGrouping->Down = false; break; case T_REPEAT: RepeatForm->ExitForm(); delete RepeatForm; RepeatForm = NULL; sbRepeat->Down = false; break; case T_DRAW: DrawForm->ExitForm(); delete DrawForm; DrawForm = NULL; sbDraw->Down = false; break; case T_REPRO: ReproForm->ExitForm(); delete ReproForm; ReproForm = NULL; sbRepro->Down = false; break; case T_FILL: FillForm->ExitForm(); delete FillForm; FillForm = NULL; sbFill->Down = false; break; #ifndef ACADEMY case T_STYLE: StyleForm->ExitForm(); delete StyleForm; StyleForm = NULL; sbStyle->Down = false; break; #endif case T_STITCH: StitchForm->ExitForm(); delete StitchForm; StitchForm = NULL; sbStitch->Down = false; break; case T_TEXT: TextForm->ExitForm(); delete TextForm; TextForm = NULL; sbText->Down = false; break; case T_COMBO: ComboMenu->ExitForm(); delete ComboMenu; ComboMenu = NULL; sbCombo->Down = false; break; case T_SCRATCH: ScratchForm->ExitForm(); delete ScratchForm; ScratchForm = NULL; sbScratch->Down = false; break; case T_UNDO: delete UndoForm; UndoForm = NULL; sbUndo->Down = false; break; #ifndef ACADEMY case T_STIPPLE: StippleForm->ExitForm(); delete StippleForm; StippleForm = NULL; sbStipple->Down = false; break; case T_SPREAD: SpreadFillForm->ExitForm(); delete SpreadFillForm; SpreadFillForm = NULL; sbSpreadFill->Down = false; break; case T_PATTERN: PatternRepeatForm->ExitForm(); delete PatternRepeatForm; PatternRepeatForm = NULL; sbPatternRepeat->Down = false; break; case T_STRIPE: StripeForm->ExitForm(); delete StripeForm; StripeForm = NULL; sbStripe->Down = false; break; case T_SEPARATE: SeparateForm->ExitForm(); delete SeparateForm; SeparateForm = NULL; sbSeparate->Down = false; break; case T_SMOOTH: delete SmoothForm; SmoothForm = NULL; sbSmooth->Down = false; break; case T_JAQ: JacquardForm->ExitForm(); delete JacquardForm; JacquardForm = NULL; sbJacquard->Down = false; break; case T_SHADOW: ShadowForm->ExitForm(); delete ShadowForm; ShadowForm = NULL; sbShadow->Down = false; break; case T_AFTER: APMenuForm->ExitForm(); delete APMenuForm; APMenuForm = NULL; sbAfter->Down = false; break; #ifndef N_3D case T_3D: /* mif = MainImageForm; if (mif->Modify) { msg = Format( "%s", OPENARRAY (TVarRec,(mif->FileName))); if (i == 0) Btn = MessageDlg(IDS_MESSAGE_EXITWORK + msg, mtWarning, TMsgDlgButtons()<FileName == Format("Noname%d%s", OPENARRAY(TVarRec, (MainImageForm->Number+1, ext)))) { if (MainForm->SaveDialog->Execute()) { s = AnsiStrScan(MainForm->SaveDialog->FileName.c_str(), '.'); if (s==NULL) fn = MainForm->SaveDialog->FileName+ext; else fn = MainForm->SaveDialog->FileName; mif->DirName = ExtractFileDir(fn); mif->FileName = ExtractFileName(fn); mif->SaveToFile(mif->DirName, mif->FileName, gff, MainForm->CompressMethod); mif->Modify = false; } } else { mif->SaveToFile(mif->DirName, mif->FileName, gff, MainForm->CompressMethod); mif->Modify = false; } Menu3DForm->ExitForm(mif); delete Menu3DForm; Menu3DForm = NULL; sb3D->Down = false; } else if (Btn == mrNo) { Menu3DForm->ExitForm(mif); delete Menu3DForm; Menu3DForm = NULL; sb3D->Down = false; mif->Modify = false; } else return false; /// mrCancel click....Ignore ExitForm(); } else { Menu3DForm->ExitForm(mif); delete Menu3DForm; Menu3DForm = NULL; sb3D->Down = false; } */ if(MainForm->T3D_Item){ Menu3DForm->ExitForm(MainImageForm); delete Menu3DForm; Menu3DForm = NULL; sb3D->Down = false; } break; #endif #endif case T_MERGE: MainImageForm->ExitMerge(); break; } shWindow->Brush->Color = clBlack; shWindow->Pen->Color = clBlack; shMoveCopy->Brush->Color = clBlack; shMoveCopy->Pen->Color = clBlack; shColorChange->Brush->Color = clBlack; shColorChange->Pen->Color = clBlack; shClear->Brush->Color = clBlack; shClear->Pen->Color = clBlack; shGrouping->Brush->Color = clBlack; shGrouping->Pen->Color = clBlack; shRepeat->Brush->Color = clBlack; shRepeat->Pen->Color = clBlack; shDraw->Brush->Color = clBlack; shDraw->Pen->Color = clBlack; shRepro->Brush->Color = clBlack; shRepro->Pen->Color = clBlack; shFill->Brush->Color = clBlack; shFill->Pen->Color = clBlack; shSpreadFill->Brush->Color = clBlack; shSpreadFill->Pen->Color = clBlack; shStipple->Brush->Color = clBlack; shStipple->Pen->Color = clBlack; shStyle->Brush->Color = clBlack; shStyle->Pen->Color = clBlack; shPattern->Brush->Color = clBlack; shPattern->Pen->Color = clBlack; shStripe->Brush->Color = clBlack; shStripe->Pen->Color = clBlack; shStitch->Brush->Color = clBlack; shStitch->Pen->Color = clBlack; shText->Brush->Color = clBlack; shText->Pen->Color = clBlack; shCombo->Brush->Color = clBlack; shCombo->Pen->Color = clBlack; shSmooth->Brush->Color = clBlack; shSmooth->Pen->Color = clBlack; shSeparate->Brush->Color = clBlack; shSeparate->Pen->Color = clBlack; shScratch->Brush->Color = clBlack; shScratch->Pen->Color = clBlack; shJacquard->Brush->Color = clBlack; shJacquard->Pen->Color = clBlack; shUndo->Brush->Color = clBlack; shUndo->Pen->Color = clBlack; shShadow->Brush->Color = clBlack; shShadow->Pen->Color = clBlack; shAfter->Brush->Color = clBlack; shAfter->Pen->Color = clBlack; sh3D->Brush->Color = clBlack; sh3D->Pen->Color = clBlack; ClientWidth = FWidth; ClientHeight = FHeight; Item = T_NONE; MainImageForm->PenChange(); } if (MainImageForm) { FullViewForm->InitForm(MainImageForm->iMainImage); #ifndef ACADEMY LayerForm->InitForm(); #endif } if (MainImageForm) { if (MainImageForm->AutoRepeat) AutoRepUpdateItem(); else UpdateItem(); } else UpdateItem(); return success; } //--------------------------------------------------------------------------- bool __fastcall TMainMenuForm::iMainImageMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { RECT r, art; TCursor cursor; int ZoomIn, ZoomOut; int PenSize, ww, hh; TMainImageForm *mif = (TMainImageForm *)Sender; if (Button==mbMiddle || (Shift.Contains(ssShift) && Button==mbLeft)) { COLORREF color = mif->iMainImage->Bitmap->GetPixelColor(X, Y); if (mif->iMainImage->Bitmap->BitsPerPixel == 8) { switch (Item) { case T_COLOR: break; case T_JAQ: //lhskys MainImage ¿¡¼­ Ä®¶ó¸¦ ¼±ÅÃÇÒ¼ö ÀÖ°Ô... break; default: if (color<252) PaletteForm->DIB256Palette->ChoiceIndex = color; break; } } else { PaletteForm->DIB256Palette->SetNormal(PaletteForm->DIB256Palette->ChoiceIndex, GetRValue(color), GetGValue(color), GetBValue(color)); PaletteForm->DIB256Palette->Repaint(); } } ZoomIn = mif->iMainImage->ZoomIn; ZoomOut = mif->iMainImage->ZoomOut; PenSize = PenManagerForm->Pen->Thick; switch (Item) { case T_NONE: return true; case T_MERGE: cursor = Screen->Cursor; Screen->Cursor = crHourGlass; if (MainImageForm->WorkArea) MainImageForm->WorkArea->PushUndo(); mif->SubBitmapPosition(X, Y, false); if (mif->OpenItem(X, Y)) { //if AutoRepeat = true --> drawing in iMainImage ==> OpenImage PaletteForm->DIB256Palette->ChoiceIndex = 2; ExitForm(1); } else { ExitForm(1); Undo->Read(); } ::RepaintColor(); Screen->Cursor = cursor; break; case T_CLEAR: if (ClearForm->sbByPen->Down) { r.left = mif->iMainImage->PositionX-PenSize; if (r.left<0) r.left = 0; r.top = mif->iMainImage->PositionY-PenSize; if (r.top<0) r.top = 0; r.right = r.left+mif->iMainImage->Width*ZoomOut/ZoomIn+PenSize; if (r.right>mif->iMainImage->Bitmap->Width) r.right = mif->iMainImage->Bitmap->Width; r.bottom = r.top+mif->iMainImage->Height*ZoomOut/ZoomIn+PenSize; if (r.bottom>mif->iMainImage->Bitmap->Height) r.bottom = mif->iMainImage->Bitmap->Height; art = r; if (MainImageForm->AutoRepeat) art = MainImageForm->AutoRep_UndoRect(r); mif->UndoSave(UK_PATTERN, art, false); Lsx = X; Lsy = Y; Lex = Lsx; Ley = Lsy; mif->line_pen(Lsx, Lsy, Lex, Ley, PaletteForm->DIB256Palette->ChoiceIndex, &r); mif->iMainImage->RectPaint(r); mif->BtnClick = true; } break; case T_WIN: if (Button == mbLeft || Button == mbMiddle) { WindowForm->iMainImageMouseDown(Button, Shift, X, Y); } if (MainImageForm->AutoRepeat) AutoRepUpdateItem(); else UpdateItem(); break; case T_MOVECOPY: if (Button == mbLeft) { MoveCopyForm->MoveCopyMouseDown(X, Y); } break; case T_COLOR: ColorChangeForm->ColorChangeMouseDown(Button, Shift, X, Y); if (ColorChangeForm->IsPen()) { r.left = mif->iMainImage->PositionX-PenSize; if (r.left<0) r.left = 0; r.top = mif->iMainImage->PositionY-PenSize; if (r.top<0) r.top = 0; r.right = r.left+mif->iMainImage->Width*ZoomOut/ZoomIn+PenSize; if (r.right>mif->iMainImage->Bitmap->Width) r.right = mif->iMainImage->Bitmap->Width; r.bottom = r.top+mif->iMainImage->Height*ZoomOut/ZoomIn+PenSize; if (r.bottom>mif->iMainImage->Bitmap->Height) r.bottom = mif->iMainImage->Bitmap->Height; art = r; if (MainImageForm->AutoRepeat) art = MainImageForm->AutoRep_UndoRect(r); mif->UndoSave(UK_PATTERN, art); Lsx = X; Lsy = Y; Lex = Lsx; Ley = Lsy; mif->line_pen(Lsx, Lsy, Lex, Ley, PaletteForm->DIB256Palette->ChoiceIndex, &r); mif->iMainImage->RectPaint(r); mif->BtnClick = true; } break; case T_GROUP: GroupingForm->iMainImageMouseDown(Button, Shift, X, Y); break; case T_REPEAT: if (Button == mbLeft) { RepeatForm->RepeatMouseDown(X, Y); if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crPen; } break; case T_DRAW: if (Button == mbLeft) DrawForm->DrawMouseDown(Button, Shift, X, Y); break; case T_STITCH: StitchForm->StitchMouseDown(Button, Shift, X, Y); break; case T_REPRO: if (Button == mbLeft) { ReproForm->ReproMouseDown(X, Y); } break; case T_FILL: FillForm->FillMouseDown(Button, Shift, X, Y); break; case T_TEXT: TextForm->iMainImageMouseDown(Button, Shift, X, Y); break; case T_UNDO: if (UndoForm->UndoPen->Checked) { mif->BtnClick = true; Lsx = X; Lsy = Y; Lex = Lsx; Ley = Lsy; mif->line_pen(Lsx, Lsy, Lex, Ley, PaletteForm->DIB256Palette->ChoiceIndex, &r); mif->iMainImage->RectPaint(r); } break; #ifndef ACADEMY case T_STYLE: StyleForm->iMainImageMouseDown(Button, X, Y); break; #endif case T_REGION: mif->RegionMouseDown(X, Y); break; #ifndef ACADEMY case T_STIPPLE: StippleForm->iMainImageMouseDown(mif->iMainImage, Button, Shift, X, Y); break; case T_SPREAD: SpreadFillForm->iMainImageMouseDown(mif->iMainImage, Button, Shift, X, Y); break; case T_SEPARATE: SeparateForm->iMainImageMouseDown(mif->iMainImage, Button, Shift, X, Y); break; case T_SMOOTH: if (Button==mbLeft) { SmoothForm->SmoothMouseDown(X, Y); } break; case T_STRIPE: StripeForm->iMainImageMouseDown(X, Y); break; case T_JAQ: JacquardForm->iMainImageMouseDown(Button, Shift, X, Y); break; case T_PATTERN: if (Button==mbLeft) { if (PatternRepeatForm->Item != T_IMGSPRAY) { if (PatternRepeatForm->Item == T_REGULAR) { if (PatternRepeatForm->SetStartPoint(X, Y)) { return false; } } if (mif->bDrawPen) { if (FullViewForm->iMainImageMouseDown(mif->iMainImage, X, Y)) { r.left = mif->iMainImage->PositionX-PenSize; if (r.left<0) r.left = 0; r.top = mif->iMainImage->PositionY-PenSize; if (r.top<0) r.top = 0; r.right = r.left+mif->iMainImage->Width*ZoomOut/ZoomIn+PenSize; if (r.right>mif->iMainImage->Bitmap->Width) r.right = mif->iMainImage->Bitmap->Width; r.bottom = r.top+mif->iMainImage->Height*ZoomOut/ZoomIn+PenSize; if (r.bottom>mif->iMainImage->Bitmap->Height) r.bottom = mif->iMainImage->Bitmap->Height; PenManagerForm->SpecialMouseDown(Button, Shift, X, Y); mif->BtnClick = true; } } } else { PatternRepeatForm->ImageSprayMouseDown(X, Y); //mif->BtnClick = true; if(PatternRepeatForm->mousedown >= 1)mif->BtnClick = true; //lhskys Ŭ¸¯À¸·Î ÆÐÅÏÀ» else mif->BtnClick = false; //lhskys ¸¸µé¼ö ÀÖ°Ô. } } break; #ifndef N_3D case T_3D: if(MainForm->T3D_Item){ if (PenManagerForm->sbMask->Down) return true; else Menu3DForm->iMainImageMouseDown(Button, Shift, X, Y); } break; #endif #endif } return false; } //--------------------------------------------------------------------------- bool __fastcall TMainMenuForm::iMainImageMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { RECT r; TMainImageForm *mif = (TMainImageForm *)Sender; switch (Item) { case T_NONE: return true; case T_WIN: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; WindowForm->iMainImageMouseMove(Shift, X, Y); break; case T_MOVECOPY: mif->iMainImage->Cursor = crHandPoint; MoveCopyForm->MoveCopyMouseMove(X, Y); break; case T_CLEAR: if (ClearForm->sbByPen->Down) { if (mif->BtnClick) { Lex = X; Ley = Y; mif->line_pen(Lsx, Lsy, Lex, Ley, PaletteForm->DIB256Palette->ChoiceIndex, &r); mif->iMainImage->RectPaint(r); Lsx = Lex; Lsy = Ley; } if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crPen; } else { if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; } break; case T_COLOR: ColorChangeForm->ColorChangeMouseMove(Shift, X, Y); if (ColorChangeForm->IsPen()) { if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crPen; if (mif->BtnClick) { Lex = X; Ley = Y; mif->line_pen(Lsx, Lsy, Lex, Ley, PaletteForm->DIB256Palette->ChoiceIndex, &r); mif->iMainImage->RectPaint(r); Lsx = Lex; Lsy = Ley; } } else { if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; } break; case T_GROUP: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; GroupingForm->iMainImageMouseMove(Shift, X, Y); break; case T_TEXT: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; TextForm->iMainImageMouseMove(Shift, X, Y); break; case T_REPEAT: mif->iMainImage->Cursor = crHandPoint; RepeatForm->RepeatMouseMove(X, Y); break; case T_DRAW: DrawForm->DrawMouseMove(Shift, X, Y); break; case T_STITCH: mif->iMainImage->Cursor = crHandPoint; StitchForm->StitchMouseMove(X, Y); break; case T_REPRO: mif->iMainImage->Cursor = crHandPoint; ReproForm->ReproMouseMove(X, Y); break; case T_FILL: mif->iMainImage->Cursor = crHandPoint; FillForm->FillMouseMove(X, Y); break; case T_UNDO: if (UndoForm->UndoPen->Checked) { if (mif->BtnClick) { Lex = X; Ley = Y; mif->line_pen(Lsx, Lsy, Lex, Ley, PaletteForm->DIB256Palette->ChoiceIndex, &r); mif->iMainImage->RectPaint(r); Lsx = Lex; Lsy = Ley; } if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crPen; } else { if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; } break; case T_MERGE: mif->iMainImage->Cursor = crHandPoint; mif->SubBitmapPosition(X, Y, true); break; #ifndef ACADEMY case T_STYLE: mif->iMainImage->Cursor = crHandPoint; StyleForm->iMainImageMouseMove(X, Y); break; #endif case T_REGION: mif->RegionMouseMove(X, Y); break; #ifndef ACADEMY case T_STIPPLE: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; StippleForm->iMainImageMouseMove(mif->iMainImage, Shift, X, Y); break; case T_SPREAD: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; SpreadFillForm->iMainImageMouseMove(mif->iMainImage, Shift, X, Y); break; case T_STRIPE: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; StripeForm->iMainImageMouseMove(X, Y); break; case T_SEPARATE: SeparateForm->iMainImageMouseMove(mif->iMainImage, Shift, X, Y); break; case T_SMOOTH: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; break; case T_JAQ: if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; JacquardForm->iMainImageMouseMove(X, Y); break; case T_PATTERN: if (PatternRepeatForm->Item != T_IMGSPRAY) { if (mif->bDrawPen) { if (FullViewForm->iMainImageMouseMove(mif->iMainImage, X, Y)) { if (PenManagerForm->acolor == 1) { PenManagerForm->SpecialMouseMove(Shift, X, Y); if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; } else { if (mif->BtnClick) PenManagerForm->SpecialMouseMove(Shift, X, Y); if (PatternRepeatForm->sbSelectPos->Down) {if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross;} else if(PatternRepeatForm->sbRegular->Down) mif->iMainImage->Cursor = crPen; else {if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crPen;} } } else if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; } } else { PatternRepeatForm->ImageSprayMouseMove(X, Y, mif->BtnClick); if(!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; } break; #ifndef N_3D case T_3D: if(MainForm->T3D_Item){ if (PenManagerForm->sbMask->Down) return true; else { if (!MainImageForm->iMainImage->Cross)mif->iMainImage->Cursor = crCross; Menu3DForm->iMainImageMouseMove(Shift, X, Y); } } break; #endif #endif } return false; } //--------------------------------------------------------------------------- bool __fastcall TMainMenuForm::iMainImageMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TMainImageForm *mif = (TMainImageForm *)Sender; switch (Item) { case T_NONE: return true; case T_DRAW: if (Button == mbLeft) { DrawForm->DrawMouseUp(X, Y); } break; case T_CLEAR: if (ClearForm->sbByPen->Down) { mif->BtnClick = false; if (MainImageForm->AutoRepeat) MainImageForm->RedrawingRepeat(PenManagerForm->sbMask->Down, true); } break; case T_COLOR: if (MainImageForm->AutoRepeat && ColorChangeForm->cbDraw->Checked) MainImageForm->RedrawingRepeat(false, true); if (ColorChangeForm->IsPen()) mif->BtnClick = false; break; case T_UNDO: if (UndoForm->UndoPen->Checked) { if (MainImageForm->AutoRepeat) MainImageForm->RedrawingRepeat(false, true); mif->BtnClick = false; } break; case T_REGION: mif->RegionMouseUp(X, Y); break; #ifndef ACADEMY case T_PATTERN: PenManagerForm->SpecialMouseUp(Button, Shift, X, Y); PatternRepeatForm->ImageSprayFreeLineMouseUp(X, Y); //lhskys freeline¿¡¼­´Â µå·¡±×·Î ±×¸®°Ô.. // mif->BtnClick = false; lhskys break; #ifndef N_3D case T_3D: if(MainForm->T3D_Item) if (PenManagerForm->sbMask->Down) return true; break; #endif #endif case T_TEXT: if (Button == mbLeft) (TextForm->iMainImageMouseUp(Button, X, Y)); break; } return false; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::iMainImageMouseLeave(TObject *Sender) { switch (Item) { case T_NONE: ((TMainImageForm *) Sender)->BtnClick = false; break; #ifndef ACADEMY // case T_PATTERN: PatternRepeatForm->ImageSprayMouseLeave(); break; lhskys leave¸¦ ÇÏÁö ¸øÇÏ°Ô ¸·À½ case T_CLEAR: if (ClearForm->sbByPen->Down) { if (MainImageForm->AutoRepeat) MainImageForm->RedrawingRepeat(PenManagerForm->sbMask->Down, true); } break; #endif case T_MOVECOPY : MoveCopyForm->MouseStop->Enabled = false; break; //by k3dogs(20001104)MoveCopy-Rotate,Bend ¿¡¼­ mouseStop Timer -> false } } //--------------------------------------------------------------------------- bool __fastcall TMainMenuForm::iMainImagePaint(TObject *Sender) { switch (Item) { case T_NONE: return true; case T_WIN: WindowForm->iMainImagePaint(); break; case T_COLOR: ColorChangeForm->ColorChangePaint(); break; case T_GROUP: GroupingForm->iMainImagePaint(); break; case T_FILL: FillForm->FillPaint(); break; case T_TEXT: TextForm->iMainImagePaint(); break; #ifndef ACADEMY #ifndef N_3D case T_3D:if(MainForm->T3D_Item) Menu3DForm->iMainImagePaint(); break; #endif case T_STIPPLE: StippleForm->iMainImagePaint(); break; case T_SPREAD: SpreadFillForm->iMainImagePaint(); break; case T_SEPARATE: SeparateForm->iMainImagePaint(); break; #endif } return false; } //--------------------------------------------------------------------------- bool __fastcall TMainMenuForm::iMainImageChange(TObject *Sender) { TMainImageForm *mif = (TMainImageForm *)Sender; switch (Item) { case T_NONE: return true; case T_WIN: WindowForm->iMainImageChange(); break; case T_MOVECOPY: MoveCopyForm->iMainImageChange(); break; case T_FILL: FillForm->iMainImageChange(); break; case T_REPEAT: RepeatForm->iMainImageChange(); break; case T_REPRO: ReproForm->iMainImageChange(); break; case T_DRAW: DrawForm->iMainImageChange(); break; case T_STITCH: StitchForm->iMainImageChange(); break; #ifndef ACADEMY #ifndef N_3D case T_3D: if(MainForm->T3D_Item) Menu3DForm->iMainImageChange(); break; #endif #endif } return false; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::iMainImageKeyPress(TObject *Sender, int Key) { switch (Item) { case T_DRAW: DrawForm->iMainImageKeyDown(Key); break; case T_WIN: WindowForm->iMainImageKeyDown(Key); break; //lhskys x,yȰ¿ë ºÒ±ÔÄ¢¿¡¼­ case T_STITCH: StitchForm->iMainImageKeyDown(Key); break; case T_GROUP: GroupingForm->iMainImageKeyDown(Key); break; //lhskys »öÁ¤¸®·Î case T_COLOR: ColorChangeForm->iMainImageKeyDown(Key); break; //lhskys »ö¹Ù²Ù case T_SCRATCH: ScratchForm->iMainImageKeyDown(Key); break; //lhskys ±Ü±â·Î case T_COMBO: ComboMenu->iMainImageKeyDown(Key); break; //lhskys »ö»çÀü°³·Î case T_UNDO: UndoForm->iMainImageKeyDown(Key); break; //lhskys ȯ¿øÀ¸·Î case T_REPRO: ReproForm->iMainImageKeyDown(Key); break; //lhskys È®´ëÃà¼Ò·Î case T_TEXT: TextForm->iMainImageKeyPress(Key); break; //lhskys ¹®ÀÚ¿¡¼­ #ifndef ACADEMY case T_SEPARATE: SeparateForm->iMainImageKeyDown(Key); break; //lhskys »öºÐÇØ·Î case T_AFTER: APMenuForm->iMainImageKeyDown(Key); break; //lhskys Èİ¡°ø¿¡¼­ case T_PATTERN: PatternRepeatForm->iMainImageKeyDown(Key); break; //lhskys ÆÐÅϹݺ¹À¸·Î #endif } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::iMainImageKeyDown(TObject *Sender, int Key) { TMainImageForm *mif = (TMainImageForm *) Sender; if (mif) { switch (Item) { case T_REPRO: ReproForm->iMainImageKeyDown(Key); break; case T_REGION: if (Key == VK_RETURN) { Item = T_NONE; mif->iMainImage->Cursor = crDefault; mif->RegionChange(); } } } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::iMainImageKeyUp(TObject *Sender, int Key) { TMainImageForm *mif = (TMainImageForm *) Sender; if (mif) { switch (Item) { case T_DRAW: MainForm->SetFocus(); DrawForm->iMainImageKeyUp(Key); break; case T_WIN: WindowForm->SetFocus(); WindowForm->iMainImageKeyUp(Key); break; //lhskys window¿¡¼­ key up ½Ã È£Ãâ case T_STITCH: MainForm->SetFocus(); StitchForm->iMainImageKeyUp(Key); break; case T_REPRO: ReproForm->iMainImageKeyUp(); break; } } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SuperChange(TObject *Sender) { switch (Item) { case T_MOVECOPY: MoveCopyForm->SetMoveCopyImage(true); break; // case T_REPRO: ReproForm->SetReproImage(); break; case T_REPEAT: if (!MainImageForm->AutoRepeat) RepeatForm->SetRepeatImage(); break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::ChoiceColor(int Index) { switch (MainMenuForm->Item) { case T_NONE: PenManagerForm->SelectColor(Index); break; case T_COLOR: ColorChangeForm->FGChange(Index); break; case T_FILL: FillForm->SelectColor(Index); break; case T_DRAW: DrawForm->FGChange(Index); PenManagerForm->SelectColor(Index); break; //dogs case T_COMBO: ComboMenu->FGChange(Index); break; #ifndef ACADEMY case T_SHADOW: ShadowForm->FGChange(Index); break; case T_STIPPLE: StippleForm->FGChange(Index); break; case T_SEPARATE: SeparateForm->SepSelectorColor(Index); break; case T_SPREAD: SpreadFillForm->FGChange(Index); break; case T_JAQ: JacquardForm->FGChange(Index); break; case T_STRIPE: StripeForm->FGChange(Index); break; #endif } PenManagerForm->PenShapeChange(Index); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::ColorChange(TObject *Sender) { if (MainMenuForm->Item==T_COMBO) if (ComboMenu->SubForm) ComboMenu->SubForm->ComboColorChange(this); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::CursorIndexChange(TObject *Sender) { if (MainMenuForm->Item==T_COLOR) ColorChangeForm->CCChange(PaletteForm->DIB256Palette->CursorIndex); if (MainImageForm->AutoRepeat) MainImageForm->RedrawingRepeat(false, false, false); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::UnitChange() { #ifndef ACADEMY if (Item==T_STRIPE) StripeForm->ChangeUnit(MainImageForm->CurrentUnit); else if (Item == T_PATTERN) PatternRepeatForm->ChangeUnit(MainImageForm->CurrentUnit); else if (Item == T_REPRO) ReproForm->ChangeUnit(MainImageForm->CurrentUnit); #else if (Item == T_REPRO) ReproForm->ChangeUnit(MainImageForm->CurrentUnit); #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::Timer200ms() { switch (MainMenuForm->Item) { case T_TEXT: TextForm->DrawCursor(); break; } } //--------------------------------------------------------------------------- //=========================================================================== // For Auto Repeat by kjs //=========================================================================== //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::AutoRepUpdateItem() { sbWindow->Enabled = true; sbDraw->Enabled = true; sbMoveCopy->Enabled = false; MoveCopy1->Enabled = false; sbRepeat->Enabled = true; repeat1->Enabled = true; sbAfter->Enabled = false; After1->Enabled = false; if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { sbMoveCopy->Enabled = true; MoveCopy1->Enabled = true; } } if (MainImageForm->iMainImage->Bitmap->BitsPerPixel==8) { sbGrouping->Enabled = true; Grouping1->Enabled = true; sbColorChange->Enabled = true; ColorChange1->Enabled = true; } else { sbGrouping->Enabled = false; Grouping1->Enabled = false; sbColorChange->Enabled = false; ColorChange1->Enabled = false; if (MainImageForm->WorkArea) { if (MainImageForm->WorkArea->Mask) { sbColorChange->Enabled = true; ColorChange1->Enabled = true; } } } sbRepro->Enabled = false; Reproportion1->Enabled = false; sbStipple->Enabled = false; Stipple1->Enabled = false; sbStyle->Enabled = false; Style1->Enabled = false; sbPatternRepeat->Enabled = false; PatternRepeat1->Enabled = false; sbStripe->Enabled = false; Stripe1->Enabled = false; sbCombo->Enabled = false; ColorCombo1->Enabled = false; sbSmooth->Enabled = false; Smooth1->Enabled = false; sbSeparate->Enabled = false; ColorSeparate1->Enabled = false; sbScratch->Enabled = false; Scratch1->Enabled = false; sbJacquard->Enabled = false; Jacquard1->Enabled = false; sb3D->Enabled = false; N3D1->Enabled = false; sbStitch->Enabled = false; Stitch1->Enabled = false; sbText->Enabled = false; Text1->Enabled = false; sbPrint->Enabled = false; Printing1->Enabled = false; sbScan->Enabled = false; Scanning1->Enabled = false; MainForm->FScanningItem->Enabled = false; MainForm->FScanningItem->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::ARExitForm() { sbStitch->Enabled = true; Stitch1->Enabled = true; sbText->Enabled = true; Text1->Enabled = true; sbPrint->Enabled = true; Printing1->Enabled = true; sbScan->Enabled = true; Scanning1->Enabled = true; sbAfter->Enabled = true; After1->Enabled = true; MainForm->FScanningItem->Enabled = true; MainForm->FScanningItem->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::Show_FabricSize() { //=============================// v7.1À» ÄÄÆÄÀÏÇϱâ À§ÇØ Àá½Ã ¸·¾Æ³ð. #ifndef ACADEMY if (Menu3DForm) { // to fit size and point by kjs if (Menu3DForm->sbMFabric->Down) Menu3DForm->Show_FabricSize(); } #endif //============================= } //--------------------------------------------------------------------------- /* void __fastcall TMainMenuForm::ARExitForm(bool bExitForm) { if (bExitForm) ExitForm(); else UpdateItem(); sbStitch->Enabled = true; Stitch1->Enabled = true; sbText->Enabled = true; Text1->Enabled = true; sbFile->Enabled = true; File1->Enabled = true; sbPrint->Enabled = true; Printing1->Enabled = true; sbScan->Enabled = true; Scanning1->Enabled = true; */ //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbHelpMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { AnsiString screencam, cam, camdir; TRegistry *Registry; SHELLEXECUTEINFO screeninfo; if (Button == mbRight && Shift.Contains(ssShift)) { Registry = new TRegistry; if (!Registry) return; Registry->RootKey = HKEY_CURRENT_USER; Registry->OpenKey("SOFTWARE\\Youngwoo\\TexPro\\7.2\\Directory",TRUE); screencam = Registry->ReadString("screencam"); delete Registry; if(screeninfo.lpFile == "scplayer.exe") { return; } else { memset(&screeninfo,0,sizeof(screeninfo)); screeninfo.cbSize = sizeof(screeninfo); screeninfo.lpVerb = "open"; screeninfo.lpDirectory = screencam.c_str(); screeninfo.lpFile = "scplayer.exe"; } switch(dynamic_cast(Sender)->Tag) { case 0 : cam = screencam + "\\textile\\selection.scm"; break; case 1 : cam = screencam + "\\textile\\copy_move.scm"; break; case 2 : cam = screencam + "\\textile\\color_change.scm"; break; case 3 : cam = screencam + "\\textile\\clear.scm"; break; case 4 : cam = screencam + "\\textile\\color_group.scm"; break; case 5 : cam = screencam + "\\textile\\repeat.scm"; break; case 6 : cam = screencam + "\\textile\\drawing.scm"; break; case 7 : cam = screencam + "\\textile\\reproportion.scm"; break; case 8 : cam = screencam + "\\textile\\fill.scm"; break; case 9 : cam = screencam + "\\textile\\spread_fill.scm"; break; case 10 : cam = screencam + "\\textile\\stipple.scm"; break; case 11 : cam = screencam + "\\textile\\style.scm"; break; case 12 : cam = screencam + "\\textile\\pattern_repeat.scm"; break; case 14 : cam = screencam + "\\textile\\shadow.scm"; break; case 15 : cam = screencam + "\\textile\\after_make.scm"; break; case 16 : cam = screencam + "\\textile\\stripe.scm"; break; case 17 : cam = screencam + "\\textile\\color_separate.scm"; break; case 18 : cam = screencam + "\\textile\\stitch.scm"; break; case 19 : cam = screencam + "\\textile\\text.scm"; break; case 20 : cam = screencam + "\\textile\\color_combo.scm"; break; case 21 : cam = screencam + "\\textile\\smooth.scm"; break; case 22 : cam = screencam + "\\textile\\scratch.scm"; break; case 23 : cam = screencam + "\\textile\\jacquard.scm"; break; case 24 : cam = screencam + "\\textile\\file.scm"; break; case 25 : cam = screencam + "\\textile\\printer.scm"; break; case 26 : cam = screencam + "\\textile\\scanner.scm"; break; case 27 : //cam = screencam + "\\textile\\texwork.scm"; break; case 28 : cam = screencam + "\\textile\\undo.scm"; break; } 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; } } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subIrre1Click(TObject *Sender) { if (showWindow == false) InitWindowForm(); WindowForm->ExitItem(); WindowForm->InitItem(WI_IRREGULAR); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subfull1Click(TObject *Sender) { if (showWindow == false) InitWindowForm(); WindowForm->Full(); showWindow = false; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::showfalse() { showWindow = false; showMovecopy = false; showColorChange = false; showClear = false; showGrouping = false; showRepeat = false; showDraw = false; showReproportion = false; showStipple = false; showPatternRe = false; showSmooth = false; showFill = false; showUndo = false; show3D = false; showText = false; showAfterprocess = false; /* showSpreadFill = false; showStyle = false; */ } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubClearClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showClear == false) InitClearForm(); switch(sp->Tag){ case 1 : ClearForm->WholeClear(); break; case 2 : ClearForm->WindowIn(); break; case 3 : ClearForm->WindowOut(); break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubGroupingClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showGrouping == false) InitGroupingForm(); switch(sp->Tag){ case 1 : GroupingForm->InitItem(0); break; case 2 : GroupingForm->InitItem(1); break; case 3 : GroupingForm->InitItem(2); break; case 4 : GroupingForm->Rearrange(); break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubDrawClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if (showDraw == false) InitDrawForm(); switch(sp->Tag){ case 1 : DrawForm->FunctionClick(DrawForm->sbLine); break; case 2 : DrawForm->FunctionClick(DrawForm->sbSquare); break; case 3 : DrawForm->FunctionClick(DrawForm->sbCircle); break; case 4 : DrawForm->FunctionClick(DrawForm->sbOut); break; case 5 : DrawForm->FunctionClick(DrawForm->sbCurve); break; case 6 : DrawForm->FunctionClick(DrawForm->sbRect); break; case 7 : DrawForm->FunctionClick(DrawForm->sbEllip); break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubReproportionClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if (showReproportion == false) InitReproForm(); switch(sp->Tag){ case 1 : ReproForm->FunctionClick(ReproForm->sbRect); break; case 2 : ReproForm->FunctionClick(ReproForm->sbPull); ReproForm->btnPull->SetFocus(); //lhskys ¿£ÅÍ·Î ½ÇÇàÇϱâ break; case 3 : ReproForm->FunctionClick(ReproForm->sbX); break; case 4 : ReproForm->FunctionClick(ReproForm->sbY); break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::close1Click(TObject *Sender) { if(showRepeat == false) InitRepeatForm(); RepeatForm->sbARExitClick(Sender); close1->Enabled = false; ManualR->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubCopyClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showMovecopy == false) InitMoveCopyForm(); MoveCopyForm->FunctionClick(MoveCopyForm->sbCopy); switch(sp->Tag){ case 1 : MoveCopyForm->TypeClick(MoveCopyForm->sbNormal); MoveCopyForm->sbNormal->Down = true; break; case 2 : MoveCopyForm->TypeClick(MoveCopyForm->sbTBMirror); MoveCopyForm->sbTBMirror->Down = true; break; case 3 : MoveCopyForm->TypeClick(MoveCopyForm->sbLRMirror); MoveCopyForm->sbLRMirror->Down = true; break; case 4 : MoveCopyForm->TypeClick(MoveCopyForm->sbRotatingMirror); MoveCopyForm->sbRotatingMirror->Down = true; break; case 5 : MoveCopyForm->TypeClick(MoveCopyForm->sbTBLRMirror); MoveCopyForm->sbTBLRMirror->Down = true; break; case 6 : MoveCopyForm->TypeClick(MoveCopyForm->sbRotate); MoveCopyForm->sbRotate->Down = true; break; case 7 : MoveCopyForm->TypeClick(MoveCopyForm->sbBend); MoveCopyForm->sbBend->Down = true; break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubMoveClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showMovecopy == false) InitMoveCopyForm(); MoveCopyForm->FunctionClick(MoveCopyForm->sbMove); switch(sp->Tag){ case 1 : MoveCopyForm->TypeClick(MoveCopyForm->sbNormal); MoveCopyForm->sbNormal->Down = true; break; case 2 : MoveCopyForm->TypeClick(MoveCopyForm->sbTBMirror); MoveCopyForm->sbTBMirror->Down = true; break; case 3 : MoveCopyForm->TypeClick(MoveCopyForm->sbLRMirror); MoveCopyForm->sbLRMirror->Down = true; break; case 4 : MoveCopyForm->TypeClick(MoveCopyForm->sbRotatingMirror); MoveCopyForm->sbRotatingMirror->Down = true; break; case 5 : MoveCopyForm->TypeClick(MoveCopyForm->sbTBLRMirror); MoveCopyForm->sbTBLRMirror->Down = true; break; case 6 : MoveCopyForm->TypeClick(MoveCopyForm->sbRotate); MoveCopyForm->sbRotate->Down = true; break; case 7 : MoveCopyForm->TypeClick(MoveCopyForm->sbBend); MoveCopyForm->sbBend->Down = true; break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubByWindowClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showColorChange == false) InitColorChangeForm(); ColorChangeForm->Items = 0; ColorChangeForm->ActivePage(1); ColorChangeForm->PageControlChange(Sender); switch(sp->Tag){ case 1 : ColorChangeForm->sbWSwap->Down = true; break; case 2 : ColorChangeForm->sbWSingle->Down = true; break; case 3 : ColorChangeForm->sbWMulti->Down = true; break; } ColorChangeForm->SpeedButtonByWindowClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubByPenClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showColorChange == false) InitColorChangeForm(); ColorChangeForm->Items = 1; ColorChangeForm->ActivePage(2); ColorChangeForm->PageControlChange(Sender); switch(sp->Tag){ case 1 : ColorChangeForm->sbPSingle->Down = true; break; case 2 : ColorChangeForm->sbPMulti->Down = true; break; } ColorChangeForm->SpeedButtonByPenClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::HLS1Click(TObject *Sender) { if(showColorChange == false) InitColorChangeForm(); if(MainImageForm->iMainImage->Bitmap->BitsPerPixel == 8) { ColorChangeForm->Items = 2; ColorChangeForm->ActivePage(3); ColorChangeForm->PageControlChange(Sender); } else { ColorChangeForm->ActivePage24(1); ColorChangeForm->SetHLS(); } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubManualRepeatClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if(showRepeat == false) InitRepeatForm(); RepeatForm->sbRepClick(Sender); if (sp == Nomal1 ) { RepeatForm->FunctionClick(RepeatForm->sbNormal); RepeatForm->sbNormal->Down = true; } else if (sp == half1) { RepeatForm->FunctionClick(RepeatForm->sbHDVer); RepeatForm->sbHDVer->Down = true; } else if (sp == halfHor1) { RepeatForm->FunctionClick(RepeatForm->sbHDHor); RepeatForm->sbHDHor->Down = true; } else if (sp == MatchNormal1) { RepeatForm->FunctionMatchClick(RepeatForm->sbMatchNormal); RepeatForm->sbMatchNormal->Down = true; } else if (sp == MatchVer1) { RepeatForm->FunctionMatchClick(RepeatForm->sbMatchVer); RepeatForm->sbMatchVer->Down = true; } else if (sp == MatchHor1) { RepeatForm->FunctionMatchClick(RepeatForm->sbMatchHor); RepeatForm->sbMatchHor->Down = true; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubAutoRepeatClick(TObject *Sender) { if(showRepeat == false) { InitRepeatForm(); close1->Enabled = true; ManualR->Enabled = false; } RepeatForm->sbRepClick(Sender); RepeatForm->sbAMethodClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subStippleClick(TObject *Sender) { #ifndef ACADEMY TSpeedButton *sp = (TSpeedButton *)Sender; if(showStipple == false) InitStippleForm(); switch (sp->Tag){ case 0 : StippleForm->TypeComboBox->ItemIndex = 0; break; case 1 : StippleForm->TypeComboBox->ItemIndex = 1; break; case 2 : StippleForm->TypeComboBox->ItemIndex = 2; break; case 3 : StippleForm->TypeComboBox->ItemIndex = 3; break; } StippleForm->TypeComboBoxChange(Sender); #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subPatternRepeatClick(TObject *Sender) { /* TSpeedButton *sp = (TSpeedButton *)Sender; if(showPatternRe == false) InitPatternRepeatForm(); switch (sp->Tag){ case 0 : PatternRepeatForm->sbRegular->Down = true; break; case 1 : PatternRepeatForm->sbIrregular->Down = true; break; case 2 : subImagespray1Click(this); break; //lhskys ¼­ºê¸Þ´º Ãß°¡ // case 2 : PatternRepeatForm->sbImgSpray->Down = true; break; } PatternRepeatForm->FunctionClick(Sender); */ } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subSmoothClick(TObject *Sender) { #ifndef ACADEMY TSpeedButton *sp = (TSpeedButton *)Sender; if(showSmooth == false) InitSmoothForm(); switch (sp->Tag) { case 0 : SmoothForm->cbType->ItemIndex = 0; break; case 1 : SmoothForm->cbType->ItemIndex = 1; break; case 2 : SmoothForm->cbType->ItemIndex = 2; break; } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::CMY1Click(TObject *Sender) { if(showColorChange == false) InitColorChangeForm(); ColorChangeForm->ActivePage24(2); ColorChangeForm->SetCMY(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::FillFunctionClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; // by playzzang if(showFill == false) InitFillForm(); switch (sp->Tag) { case 0 : FillForm->sbTMulti->Enabled = false; FillForm->sbFSingle->Down = true; FillForm->FunctionClick2(1); FillForm->sbTSingle->Down = true; FillForm->FunctionClick2(3); break; /* case 1 : FillForm->sbTMulti->Enabled = false; FillForm->sbFSingle->Down = true; FillForm->FunctionClick2(1); FillForm->sbTMulti->Down = true; FillForm->FunctionClick2(4); break;*/ case 2 : FillForm->sbTMulti->Enabled = false; FillForm->sbFSingle->Down = true; FillForm->FunctionClick2(1); FillForm->sbTNPattern->Down = true; FillForm->FunctionClick2(5); break; case 3 : FillForm->sbTMulti->Enabled = false; FillForm->sbFSingle->Down = true; FillForm->FunctionClick2(1); FillForm->sbTRPattern->Down = true; FillForm->FunctionClick2(6); break; case 4 : case 5 : case 6 : case 7 : //lhskys 4-7Àº FillForm->sbTMulti->Enabled = true; //»öÀ»¸ÕÀú ¼±ÅÃÇØ¾ß ÇϹǷΠFillForm->sbFMulti->Down = true; //¸ðµÎ ¶È°°ÀÌ ÇÑ´Ù FillForm->FunctionClick2(2); break; /* case 4 : FillForm->sbTMulti->Enabled = true; FillForm->sbFMulti->Down = true; FillForm->sbTSingle->Down = true; FillForm->FunctionClick2(2); FillForm->FunctionClick2(3); break; case 5 : FillForm->sbTMulti->Enabled = true; FillForm->sbFMulti->Down = true; FillForm->sbTMulti->Down = true; FillForm->FunctionClick2(2); FillForm->FunctionClick2(4); break; case 6 : FillForm->sbTMulti->Enabled = true; FillForm->sbFMulti->Down = true; FillForm->sbTNPattern->Down = true; FillForm->FunctionClick2(2); FillForm->FunctionClick2(5); break; case 7 : FillForm->sbTMulti->Enabled = true; FillForm->sbFMulti->Down = true; FillForm->sbTRPattern->Down = true; FillForm->FunctionClick2(2); FillForm->FunctionClick2(6); break; */ } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subOff1Click(TObject *Sender) { if (showWindow == false) InitWindowForm(); WindowForm->sbOffClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subShapeClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if (showWindow == false) InitWindowForm(); WindowForm->ExitItem(); WindowForm->InitItem(WI_SHAPE); switch (sp->Tag) { case 1 : WindowForm->SubItem = WSI_RECTANGLE; WindowForm->sbShapeRectangle->Down = true; break; case 2 : WindowForm->SubItem = WSI_SQUARE; WindowForm->sbShapeSquare->Down = true; break; case 3 : WindowForm->SubItem = WSI_CIRCLE; WindowForm->sbShapeCircle->Down = true; break; case 4 : WindowForm->SubItem = WSI_ELLIPSE; WindowForm->sbShapeEllipse->Down = true; break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::subOutLineClick(TObject *Sender) { TSpeedButton *sp = (TSpeedButton *)Sender; if (showWindow == false) InitWindowForm(); WindowForm->ExitItem(); WindowForm->InitItem(WI_OUTLINE); switch (sp->Tag) { case 1 : WindowForm->sbOutlineSurfaceMultiClick(Sender); WindowForm->sbOutlineSurfaceMulti->Down = true; break; case 2 : WindowForm->sbOutlineSurfaceSingleClick(Sender); WindowForm->sbOutlineSurfaceSingle->Down = true; break; case 3 : WindowForm->sbOutlineBorderClick(Sender); WindowForm->sbOutlineBorder->Down = true; break; } } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbRegular1Click(TObject *Sender) //lhskys { #ifndef ACADEMY if(showPatternRe == false)InitPatternRepeatForm(); PatternRepeatForm->sbRegular->Down = true; PatternRepeatForm->FunctionClick(Sender); #endif } //---------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbIrregular1Click(TObject *Sender) //lhskys { #ifndef ACADEMY if(showPatternRe == false)InitPatternRepeatForm(); PatternRepeatForm->sbIrregular->Down = true; PatternRepeatForm->FunctionClick(Sender); #endif } //----------------------------------------------------------------------------- void __fastcall TMainMenuForm::subImagespray1Click(TObject *Sender) //lhskys ¼­ºêÃß°¡ { #ifndef ACADEMY TSpeedButton *sp = (TSpeedButton *)Sender; if(showPatternRe == false) InitPatternRepeatForm(); switch (sp->Tag){ case 0 : PatternRepeatForm->sbImgSpray->Down = true; PatternRepeatForm->ShapeComboBox->ItemIndex = 0; break; case 1 : PatternRepeatForm->sbImgSpray->Down = true; PatternRepeatForm->ShapeComboBox->ItemIndex = 1; break; case 2 : PatternRepeatForm->sbImgSpray->Down = true; PatternRepeatForm->ShapeComboBox->ItemIndex = 2; break; case 3 : PatternRepeatForm->sbImgSpray->Down = true; PatternRepeatForm->ShapeComboBox->ItemIndex = 3; break; case 4 : PatternRepeatForm->sbImgSpray->Down = true; PatternRepeatForm->ShapeComboBox->ItemIndex = 4; break; case 5 : PatternRepeatForm->sbImgSpray->Down = true; PatternRepeatForm->ShapeComboBox->ItemIndex = 5; break; } PatternRepeatForm->FunctionClick(Sender); PatternRepeatForm->ShapeComboBoxChange(Sender); #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::Undo1Click(TObject *Sender) { if(showUndo == false) InitUndoForm(); if (UndoForm->UndoAll->Checked && UndoForm->BitBtn1->Enabled) UndoForm->BitBtn1Click(Sender); Undo1->Enabled = UndoForm->UndoAll->Checked && UndoForm->UndoCount; } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::Shadow1Click(TObject *Sender) { #ifndef ACADEMY InitShadowForm(); #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::After1Click(TObject *Sender) { InitAfterProcessForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::Sub3DClick(TObject *Sender) { #ifndef ACADEMY #ifndef N_3D if(MainForm->T3D_Item){ TSpeedButton *sp = (TSpeedButton *)Sender; if(show3D == false) Init3DForm(); switch(sp->Tag){ case 1 : Menu3DForm->sbMainClick(Menu3DForm->sbMGrid); Menu3DForm->sbMGrid->Down = true; break; case 2 : Menu3DForm->sbMainClick(Menu3DForm->sbMFile); Menu3DForm->sbMFile->Down = true; break; case 3 : Menu3DForm->sbMainClick(Menu3DForm->sbMCopy); Menu3DForm->sbMCopy->Down = true; break; case 4 : Menu3DForm->sbMainClick(Menu3DForm->sbMFabric); Menu3DForm->sbMFabric->Down = true; break; } } #endif #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubTextClick(TObject *Sender) { if(showText == false) InitTextForm(); TextForm->ButtonFontClick(Sender); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::SubAfterprocessClick(TObject *Sender) { #ifndef ACADEMY TSpeedButton *sp = (TSpeedButton *)Sender; if(showAfterprocess == false) InitAfterProcessForm(); switch(sp->Tag){ case 1 : APMenuForm->sbRearrangeClick(Sender); break; case 2 : APMenuForm->sbViewClick(Sender); break; } #endif } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::sbTexWorkClick(TObject *Sender) { InitTexWorkForm(); } //--------------------------------------------------------------------------- void __fastcall TMainMenuForm::InitTexWorkForm() { #ifndef ACADEMY if(TexWork){ if(TexWork->WindowState == wsMinimized){ TexWork->WindowState = wsMaximized; TexWork->Height -= MainForm->StatusBar->Height + 5; }else{ TexWork->WindowState = wsMinimized; } } else { TexWork = new TTexWork(this); TexWork->Parent = MainForm; //TexWork->BorderStyle = bsNone; TexWork->Left = 0; //TexWork->Top = ClientHeight+20; TexWork->Visible = true; shTexWork->Brush->Color = clRed; //lhskys ÆûÀÌ ³ªÅ¸³ª¸é shTexWork->Pen->Color = clRed; //lhskys °ËÁ¤»öÀ» »¡°£»öÀ¸·Î } #endif } //---------------------------------------------------------------------------