// --------------------------------------------------------------------------- #include #pragma hdrstop #include "Vector_F.h" #include "VStyleForm.h" #include "MainImage.h" #include "MainMenu.h" #include "Main.h" #include "FullView.h" #include "Combination.h" #include "CombiResult.h" #include "DataTrans.h" #include "CombiDetail.h" #include "VIllustForm.h" #include "Math.h" #include "PenManager.h" // for Text Color by maxleo21c (04.10.19) #include "Palette.h" // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ZigZag Line °ü·Ã - by monkman (2005.04.07) #include "VecMotiveList_F.h" //090226 #include "ZigZagDialog_F.h" #include "Window.h" // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #ifdef WORKSHEET #include "WorkSheet_F.h" #endif // --------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "RzCmboBx" #pragma link "RzButton" #pragma link "RzRadChk" #pragma link "RzPanel" #pragma link "PColorGrid" #pragma link "RzSpnEdt" #pragma link "TPStretchImage" #pragma link "RzTrkBar" #pragma link "RzRadGrp" #pragma link "TNumEdit" #pragma link "RzEdit" #pragma link "RzBckgnd" #pragma link "RzLabel" #pragma resource "*.dfm" #pragma resource "Cursor.res" // --------------------------------------------------------------------------- #define IDS_DRAWINGTOOL StringTable[0] #define IDS_TEXTEDIT StringTable[1] #define IDS_OBJECTEDIT StringTable[2] #define IDS_POINTEDIT StringTable[3] #define IDS_CHANGECOLOR StringTable[4] #define IDS_COLORFILL StringTable[5] #define IDS_BRINGTOFRONT StringTable[6] #define IDS_SENDTOBACK StringTable[7] #define IDS_PATTERNFILL StringTable[8] #define IDS_OBJECTCOPY StringTable[9] #define IDS_OBJECTDELETE StringTable[10] #define IDS_FONT StringTable[11] #define IDS_LINE StringTable[12] #define IDS_CURVE StringTable[13] #define IDS_SQUARE StringTable[14] #define IDS_RECTANGLE StringTable[15] #define IDS_CIRCLE StringTable[16] #define IDS_ELLIPSE StringTable[17] #define IDS_CONTINUOUSLINE StringTable[18] #define IDS_SEPARATELINE StringTable[19] #define IDS_CONTINUOUSTAN StringTable[20] #define IDS_PROPORTION StringTable[21] #define IDS_RUN StringTable[22] #define IDS_RESET StringTable[23] #define IDS_UNDO StringTable[24] #define IDS_REDO StringTable[25] #define IDS_DIRECTSELECT StringTable[26] #define IDS_CONVERT StringTable[27] #define IDS_POINTADD StringTable[28] #define IDS_POINTDELETE StringTable[29] #define IDS_DELETEPOINT StringTable[30] #define IDS_PATHCOLOR StringTable[31] #define IDS_PENTHICK StringTable[32] #define IDS_OBJECTCUT StringTable[33] #define IDS_OBJECTPASTE StringTable[34] #define IDS_MAKEGROUP StringTable[35] #define IDS_SELECTGROUP StringTable[36] #define IDS_OBJECTCOPY2 StringTable[37] #define IDS_KNIFE StringTable[38] #define IDS_ROTATION StringTable[39] #define IDS_ARRANGE StringTable[40] #define IDS_BRINGFORWARD StringTable[41] #define IDS_SENDBACKWARD StringTable[42] #define IDS_GROUP StringTable[43] #define IDS_UNGROUP StringTable[44] #define IDS_LOCK StringTable[45] #define IDS_UNLOCK StringTable[46] #define IDS_OBJECTJOIN StringTable[47] #define IDS_REVERSECOPY StringTable[48] #define IDS_AVERAGE StringTable[49] #define IDS_HORIZONTAL StringTable[50] #define IDS_VERTICAL StringTable[51] #define IDS_BOTH StringTable[52] #define IDS_ATTACH StringTable[53] #define IDS_REPLACE StringTable[54] #define IDS_PATTERNSIZE StringTable[55] #define IDS_PATTERNANGLE StringTable[56] #define IDS_PASTANGLE StringTable[57] #define IDS_PASTSIZE StringTable[58] #define IDS_HFONTNAMEBOX StringTable[59] #define IDS_HFONTSTYLEBOX StringTable[60] #define IDS_HFONTSIZEBOX StringTable[61] #define IDS_HFONTWIDTHGAP StringTable[62] #define IDS_HFONTHEIGHTGAP StringTable[63] #define IDS_HFONTDEFAULTBTN StringTable[64] #define IDS_CFONTDEFAULTBTN StringTable[65] #define IDS_HFONTNOMAL StringTable[66] #define IDS_HFONTITALIC StringTable[67] #define IDS_HFONTWEIGHT StringTable[68] #define IDS_HFONTWEIGHTITALIC StringTable[69] #define IDS_OBJECTNOTSELECTED StringTable[70] #define IDS_CANNOTBRINGTEXT StringTable[71] // #define IDS_ StringTable[0] // #define IDS_ StringTable[0] // ================ 20050519 by lhskys TDW #define IDS_NLINE StringTable[72] #define IDS_NCURVE StringTable[73] #define IDS_NSQUARE StringTable[74] #define IDS_NRECTANGLE StringTable[75] #define IDS_NCIRCLE StringTable[76] #define IDS_NELLIPSE StringTable[77] #define IDS_NTEXTEDIT StringTable[78] #define IDS_NCHANGINGPATHCOLOR StringTable[79] #define IDS_NOBJECTEDIT StringTable[80] #define IDS_NMOVECOPY StringTable[81] #define IDS_NCHANGINGCOLOR StringTable[82] #define IDS_NPROPORTION StringTable[83] #define IDS_NFILLINGOBJECT StringTable[84] #define IDS_NROTATION StringTable[85] #define IDS_NARRANGE StringTable[86] #define IDS_NDIRECTSELECT StringTable[87] #define IDS_NCONVERTDIRECTION StringTable[88] #define IDS_NPOINTADD StringTable[89] #define IDS_NPOINTDELETE StringTable[90] #define IDS_NKNIFE StringTable[91] #define IDS_NVECTORPOINTIRREGULAR StringTable[92] #define IDS_NUNDOREDO StringTable[93] #define IDS_NANTIALIAS StringTable[94] #define IDS_NCOLORFILL StringTable[95] #define IDS_NCURVETEXTDRAW StringTable[96] #define IDS_NLENGTH StringTable[97] #define IDS_NANGLE StringTable[98] #define IDS_NTHICK StringTable[99] #define IDS_NFIRSTPOINT StringTable[100] #define IDS_NTYPE StringTable[101] #define IDS_NDELETPOINT StringTable[102] #define IDS_NDASH StringTable[103] #define IDS_NGAP StringTable[104] #define IDS_NCURVETEXTEDIT StringTable[105] #define IDS_NCHANGEPENSHAPE StringTable[106] #define IDS_NCOPY StringTable[107] #define IDS_NMOVE StringTable[108] #define IDS_NREVERSECOPY StringTable[109] #define IDS_NRATIO StringTable[110] #define IDS_NRESET StringTable[111] #define IDS_NRUN StringTable[112] #define IDS_NNCOLORFILL StringTable[113] #define IDS_NPATTERNFILL StringTable[114] #define IDS_NPATTERNSIZE StringTable[115] #define IDS_NPASTSIZE StringTable[116] #define IDS_NPATTERNANGLE StringTable[117] #define IDS_NPASTANGLE StringTable[118] #define IDS_NBRINGTOFRONT StringTable[119] #define IDS_NSENDTOBACK StringTable[120] #define IDS_NBRINGFOWARD StringTable[121] #define IDS_NSENDBACKWORD StringTable[122] #define IDS_NUNDO StringTable[123] #define IDS_NREDO StringTable[124] #define IDS_NWIDTH StringTable[125] #define IDS_NHEIGHT StringTable[126] #define IDS_NRADIUS StringTable[127] #define IDS_NNONE StringTable[128] #define IDS_MESSAGE001 StringTable[129] #define IDS_MESSAGE002 StringTable[130] #define IDS_NIMAGESPRAY StringTable[131] #define IDS_NCUTTING StringTable[132] #define IDS_NCUTTING_MERGE StringTable[133] #define IDS_NCUTTING_BOTTOM StringTable[134] #define IDS_NCUTTING_FRONT StringTable[135] #define IDS_NCUTTING_INTERSECTION StringTable[136] #define IDS_NSPRAY_OUTLINE StringTable[137] #define IDS_NSPRAY_IMAGE StringTable[138] #define IDS_NCOUNT StringTable[139] #define IDS_NMETHOD StringTable[140] #define IDS_NPOSITION StringTable[141] #define IDS_NUSECOUNT StringTable[142] #define IDS_NGRADIENTFILL StringTable[143] #define IDS_MESSAGE003 StringTable[144] #define IDS_NSPRAYMOTIVE StringTable[145] #define IDS_NMOTIVECOUNT StringTable[146] #define IDS_NMOTIVEGAP StringTable[147] #define IDS_NMOTIVEMAXCOUNT StringTable[148] #define IDS_FREEDRAWING StringTable[149] #define IDS_MESSAGE004 StringTable[150] #define IDS_VECTOR_REPEAT StringTable[151] #define IDS_REPEAT_NORMAL StringTable[152] #define IDS_REPEAT_HDHOR StringTable[153] #define IDS_REPEAT_HDVER StringTable[154] #define IDS_USE_COUNT StringTable[155] #define IDS_CUT_OBJECT StringTable[156] #define IDS_OBJECT_GAP StringTable[157] #define IDS_HD_MAXLENGTH StringTable[158] #define IDS_MOTIVELIB_OPEN StringTable[159] #define IDS_FILLCOLORFROMOUTLINECOLOR StringTable[160] #define IDS_OUTLINECOLORFROMFILLCOLOR StringTable[161] #define IDS_Free StringTable[162] #define IDS_Oblique StringTable[163] #define IDS_H_V_Line StringTable[164] #define IDS_Rectangle StringTable[165] #define IDS_Circle StringTable[166] #define IDS_Ellipse StringTable[167] #define IDS_Curve StringTable[168] #define IDS_Center StringTable[169] #define IDS_Left StringTable[170] #define IDS_Right StringTable[171] #define IDS_Both StringTable[172] #define IDS_FLAT StringTable[173] #define IDS_ROUND StringTable[174] #define IDS_Line_Width_Zero StringTable[175] // ================ 20050519 by lhskys TDW END // --------------------------------------------------------------------------- #include //Á¶¸³ÁßÀÎ ¹®ÀÚ¿­À» ó¸®Çϱâ À§ÇÑ lib load #pragma link "imm32.lib" // --------------------------------------------------------------------------- TVectorForm *VectorForm; // --------------------------------------------------------------------------- __fastcall TVectorForm::TVectorForm(TComponent* Owner) : TForm(Owner) { StringTable.Create(DirectoryItem, Language, "Vector"); SetSmallFont(Font); hWnd = ((TWinControl*)Owner)->Handle; rzbtnLType->Hint = IDS_CONTINUOUSLINE; btRedo->Caption = IDS_REDO; StringPenThick = IDS_PENTHICK; PopupCut->Caption = IDS_OBJECTCUT; PopupPaste->Caption = IDS_OBJECTPASTE; MakeGroup->Caption = IDS_MAKEGROUP; SelectGroup->Caption = IDS_SELECTGROUP; PopupCopy->Caption = IDS_OBJECTCOPY2; PopupAverage->Caption = IDS_AVERAGE; PopupToFront->Caption = IDS_BRINGTOFRONT; PopupForward->Caption = IDS_BRINGFORWARD; PopupBackward->Caption = IDS_SENDBACKWARD; PopupToBack->Caption = IDS_SENDTOBACK; ReverseCopy->Caption = IDS_REVERSECOPY; PopupJoin->Caption = IDS_OBJECTJOIN; PopupArrange->Caption = IDS_ARRANGE; AverageHorz->Caption = IDS_HORIZONTAL; AverageVert->Caption = IDS_VERTICAL; AverageBoth->Caption = IDS_BOTH; PopupLock->Caption = IDS_LOCK; PopupGroup->Caption = IDS_GROUP; DynamicMenu[0] = IDS_GROUP; DynamicMenu[1] = IDS_UNGROUP; DynamicMenu[2] = IDS_LOCK; DynamicMenu[3] = IDS_UNLOCK; DynamicMenu[4] = IDS_ATTACH; DynamicMenu[5] = IDS_REPLACE; FontNameBox->Hint = IDS_HFONTNAMEBOX; FontStyleBox->Hint = IDS_HFONTSTYLEBOX; FontSizeComboBox->Hint = IDS_HFONTSIZEBOX; HeightGapComboBox->Hint = IDS_HFONTHEIGHTGAP; WidthGapComboBox->Hint = IDS_HFONTWIDTHGAP; // ->Caption = IDS_; // ================ 20050519 by lhskys TDW sbLine->Hint = IDS_NLINE; sbCurve->Hint = IDS_NCURVE; sbFreeDraw->Hint = IDS_FREEDRAWING; sbRect->Hint = IDS_NRECTANGLE; mnitmRectangle->Caption = IDS_NRECTANGLE; mnitmSquare->Caption = IDS_NSQUARE; sbEllipse->Hint = IDS_NELLIPSE; mnitmEllipse->Caption = IDS_NELLIPSE; mnitmCircle->Caption = IDS_NCIRCLE; sbNewTextEdit->Hint = IDS_NTEXTEDIT; sbPathColor->Hint = IDS_NCHANGINGPATHCOLOR; sbObjectEdit->Hint = IDS_NOBJECTEDIT; sbMoveCopy->Hint = IDS_NMOVECOPY; sbColor->Hint = IDS_NCHANGINGCOLOR; sbProportion->Hint = IDS_NPROPORTION; sbFill->Hint = IDS_NFILLINGOBJECT; sbRotation->Hint = IDS_NROTATION; sbArrange->Hint = IDS_NARRANGE; sbDirectSelect->Hint = IDS_NDIRECTSELECT; sbConvertDirection->Hint = IDS_NCONVERTDIRECTION; sbPointAdd->Hint = IDS_NPOINTADD; sbPointDelete->Hint = IDS_NPOINTDELETE; sbKnife->Hint = IDS_NKNIFE; sbVectorPointIrregular->Hint = IDS_NVECTORPOINTIRREGULAR; sbUndoRedo->Hint = IDS_NUNDOREDO; sbSpray->Hint = IDS_NIMAGESPRAY; sbCutting->Hint = IDS_NCUTTING; sbMerge->Hint = IDS_NCUTTING_MERGE; sbCutBottom->Hint = IDS_NCUTTING_BOTTOM; sbCutFront->Hint = IDS_NCUTTING_FRONT; sbMakeIntersection->Hint = IDS_NCUTTING_INTERSECTION; cbObjAntialiasing->Hint = IDS_NANTIALIAS; imgObjAntialiasing->Hint = IDS_NANTIALIAS; cbFill->Hint = IDS_NNCOLORFILL; imgFill->Hint = IDS_NNCOLORFILL; sbCurveTextDraw->Hint = IDS_NCURVETEXTDRAW; lbDrawThick->Caption = IDS_NTHICK; btFirstPoint->Hint = IDS_NFIRSTPOINT; btDeletePoint->Hint = IDS_NDELETPOINT; stLinetype->Caption = IDS_NTYPE; lbData1->Caption = IDS_NLENGTH; lbData2->Caption = IDS_NANGLE; stSet1_d->Caption = IDS_NDASH; stSet1_g->Caption = IDS_NGAP; stSet2_d->Caption = IDS_NDASH; stSet2_g->Caption = IDS_NGAP; stSet3_d->Caption = IDS_NDASH; stSet3_g->Caption = IDS_NGAP; cbTextAntialiasing->Hint = IDS_NANTIALIAS; imgTextAntialiasing->Hint = IDS_NANTIALIAS; cbObjAntialiasing2->Hint = IDS_NANTIALIAS; imgObjAntialiasing2->Hint = IDS_NANTIALIAS; sbCurveTextEdit->Hint = IDS_NCURVETEXTEDIT; rzbtnPenShape->Hint = IDS_NCHANGEPENSHAPE; lblPenThick->Caption = IDS_NTHICK; lbPenType->Caption = IDS_NTYPE; stSet1d->Caption = IDS_NDASH; stSet1g->Caption = IDS_NGAP; stSet2d->Caption = IDS_NDASH; stSet2g->Caption = IDS_NGAP; stSet3d->Caption = IDS_NDASH; stSet3g->Caption = IDS_NGAP; btCopy->Caption = IDS_NCOPY; btCut->Caption = IDS_NMOVE; btReverseCopy->Caption = IDS_NREVERSECOPY; sbRatio->Caption = IDS_NRATIO; btProportionReset->Caption = IDS_NRESET; btProportionRun->Caption = IDS_NRUN; btRotationRun->Caption = IDS_NRUN; btColorChange->Caption = IDS_NRUN; sbColorFill->Caption = IDS_NNCOLORFILL; sbPatternFill->Caption = IDS_NPATTERNFILL; cbPatternSize->Caption = IDS_NPATTERNSIZE; sbPastSize->Hint = IDS_NPASTSIZE; cbPatternAngle->Caption = IDS_NPATTERNANGLE; sbPastAngle->Hint = IDS_NPASTANGLE; Label4->Caption = IDS_NANGLE; btFront->Caption = IDS_NBRINGTOFRONT; btBack->Caption = IDS_NSENDTOBACK; btFoward->Caption = IDS_NBRINGFOWARD; btBackword->Caption = IDS_NSENDBACKWORD; btUndo->Caption = IDS_NUNDO; btRedo->Caption = IDS_NREDO; sbSprayOutline->Caption = IDS_NSPRAY_OUTLINE; sbSprayImage->Caption = IDS_NSPRAY_IMAGE; btOutlineRun->Caption = IDS_NRUN; lbCount->Caption = IDS_NCOUNT; lbMethod->Caption = IDS_NMETHOD; lbPosition->Caption = IDS_NPOSITION; CountLabel->Caption = IDS_NCOUNT; rzcbUseCount->Caption = IDS_NUSECOUNT; sbGradientFill->Caption = IDS_NGRADIENTFILL; sbGradientRun->Caption = IDS_NRUN; spdbtnFillColorFromOutlineColor->Hint = IDS_FILLCOLORFROMOUTLINECOLOR; spdbtnOutlineColorFromFillColor->Hint = IDS_OUTLINECOLORFROMFILLCOLOR; // ================ 20050519 by lhskys TDW END // by embakum ShapeComboBox->Items->Clear(); ShapeComboBox->Items->Add(IDS_Free);//"Free"); ShapeComboBox->Items->Add(IDS_Oblique);//"Oblique"); ShapeComboBox->Items->Add(IDS_H_V_Line);//"H/V Line"); ShapeComboBox->Items->Add(IDS_Rectangle);//"Rectangle"); ShapeComboBox->Items->Add(IDS_Circle);//"Circle"); ShapeComboBox->Items->Add(IDS_Ellipse);//"Ellipse"); ShapeComboBox->Items->Add(IDS_Curve);//"Curve"); PositionComboBox->Items->Clear(); PositionComboBox->Items->Add(IDS_Center);//"Center"); PositionComboBox->Items->Add(IDS_Left);//"Left"); PositionComboBox->Items->Add(IDS_Right);//"Right"); PositionComboBox->Items->Add(IDS_Both);//"Both"); MotiveModeComboBox->Items->Clear(); MotiveModeComboBox->Items->Add(IDS_Free);//"Free"); MotiveModeComboBox->Items->Add(IDS_Oblique);//"Oblique"); MotiveModeComboBox->Items->Add(IDS_H_V_Line);//"H/V Line"); MotiveModeComboBox->Items->Add(IDS_Rectangle);//"Rectangle"); MotiveModeComboBox->Items->Add(IDS_Circle);//"Circle"); MotiveModeComboBox->Items->Add(IDS_Ellipse);//"Ellipse"); MotiveModeComboBox->Items->Add(IDS_Curve);//"Curve"); mnitemRound->Caption = IDS_ROUND; mnitemFlat->Caption = IDS_FLAT; PenComboBox->Items->Clear(); PenComboBox->Items->Add("Other"); PenComboBox->Items->Add("--------"); PenComboBox->Items->Add(IDS_Line_Width_Zero); PenComboBox->Items->Add("0.25"); PenComboBox->Items->Add("0.5"); PenComboBox->Items->Add("0.75"); PenComboBox->Items->Add("1.0"); PenComboBox->Items->Add("1.5"); //2017.09.14 Ãß°¡ for (int i = 2; i <= 10; i++) PenComboBox->Items->Add(IntToStr(i)); PenComboBox->Items->Add("20"); PenComboBox->Items->Add("30"); PenComboBox->Items->Add("40"); PenComboBox->Items->Add("50"); EditPenComboBox->Items->Clear(); EditPenComboBox->Items->Add("Other"); EditPenComboBox->Items->Add("--------"); EditPenComboBox->Items->Add(IDS_Line_Width_Zero); EditPenComboBox->Items->Add("0.25"); EditPenComboBox->Items->Add("0.5"); EditPenComboBox->Items->Add("0.75"); EditPenComboBox->Items->Add("1.0"); EditPenComboBox->Items->Add("1.5"); //2017.09.14 Ãß°¡ for (int i = 2; i <= 10; i++) EditPenComboBox->Items->Add(IntToStr(i)); ///// EditPenComboBox->Items->Add("20"); EditPenComboBox->Items->Add("30"); EditPenComboBox->Items->Add("40"); EditPenComboBox->Items->Add("50"); PenStyleComboBox->ItemIndex = 0; sbSprayMotive->Caption = IDS_NSPRAYMOTIVE; rbMotiveCount->Caption = IDS_NMOTIVECOUNT; rbMotiveGap->Caption = IDS_NMOTIVEGAP; rbMotiveProportion->Caption = IDS_NRATIO; rbMotiveMax->Caption = IDS_NMOTIVEMAXCOUNT; cbMotiveCurveConti->Caption = IDS_CONTINUOUSLINE; checkboxContinue->Caption = IDS_CONTINUOUSLINE; mnitmSeparate->Caption = IDS_SEPARATELINE; mnitmContinuous->Caption = IDS_CONTINUOUSLINE; mnitmTangent->Caption = IDS_CONTINUOUSTAN; // Vector Repeat rzbtnVectorRepeat->Hint = IDS_VECTOR_REPEAT; rzcbobxRepeatMode->Items->Strings[0] = IDS_REPEAT_NORMAL; rzcbobxRepeatMode->Items->Strings[1] = IDS_REPEAT_HDHOR; rzcbobxRepeatMode->Items->Strings[2] = IDS_REPEAT_HDVER; rzchbxUseCnt->Caption = IDS_USE_COUNT; rzchbxCutObj->Caption = IDS_CUT_OBJECT; rzgrpbxGap->Caption = IDS_OBJECT_GAP; rzlblMax->Caption = IDS_HD_MAXLENGTH; sbMotiveList->Hint = IDS_MOTIVELIB_OPEN; sbMotiveList2->Hint = IDS_MOTIVELIB_OPEN; sbDelete->Hint = IDS_COMMON_DELETECOLOR; // For Text Processing in Vector by maxleo21c (2004.10.19) blinkCatet = 0; // by maxleo21c (ij·ÔÀ» ±ô¹ÚÀÌ°Ô Çϱâ À§Çؼ­) UseComboBoxForText = false; // ComboBox¸¦ »ç¿ëÇÏ´Â µ¿¾È KeyDownÀ» ¸·±â À§Çؼ­ KindOfPenShape = 0; MakeMenuHintByShortcut(); // added shortcuts hint by maxleo21c (05.05.19) EnterException = 0; this->ClientWidth = 204; this->Height = 245; bComp = 0; // ±ÛÀÚ Á¶¸³ »óÅ ȮÀÎ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FormCreate(TObject *Sender) { // bTextState = false; // bDownState = false; // bDragState = false; bSeparate = false; VecDraw->bZKey = false; VecDraw->bJKeyState = false; VecDraw->bJoinState = false; VecDraw->bShiftState = false; VecDraw->bAltState = false; VecDraw->bPointModeState = false; // bMultiSelect = false; V_MainItem = 1; V_Item = M_D_LINE; // step = &(VecDraw->step); // *step = 0; LineType = 1; // ChangeLTypeImg(); ProportionPanel->Visible = false; RotationPanel->Visible = false; PatternPanel->Visible = false; bAntialiasing = true; // 20050211 shin bUserChange = true; CapStyle[0] = 0; CapStyle[1] = 0; ReadIni_Arrow(); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ĵ¹ö½º¿¡ µ¶¸³ÀûÀ̾î¾ß ÇÏ´Â VectorFormÀÇ º¯¼ö¸¦ MainImageFormÀ¸·Î À̵¿ - by monkman (2005.03.08) // º¯¼ö¸¦ ÃʱâÈ­ ÇÑ´Ù MappingVariable(MainImageForm->NVector); InitVariable(MainImageForm->NVector); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- bPenComboBoxCloseup = false; bArrowBoth_measure = false; //@jhs DrawingThick = 2; // ÇöÀç º¹»ç ÁßÀÎ »óÅÂÀÎÁö À̵¿ ÁßÀÎ »óÅÂÀÎÁö¸¦ ¾Ë·ÁÁÖ´Â º¯¼ö - by monkman (2005.08.03) nMoveCopy = 0; // shin gradientfill for (int i = 0; i < 10; i++) { ColorValues[i] = clWhite; } // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï¿¡¼­ ¹ÝÀü ±âÁؼ±¿¡¼­ 'J'Ű ´­·¶À» ¶§ º¯°æ½Ãų Ä¿¼­ ¼³Á¤ - by monkman (2009.11.27) HCURSOR hLoadCursor = NULL; hLoadCursor = (HCURSOR)LoadCursor(HInstance, L"VECTORJOIN"); crJoin = 5; Screen->Cursors[crJoin] = hLoadCursor; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- cbObjAntialiasing->Checked = MainForm->bVectorAntiAlias; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FormClose(TObject *Sender, TCloseAction &Action) { BEGIN_LOG(""); HWND hWnd = ((TWinControl*)Owner)->Handle; PostMessage(hWnd, TPM_EXITFUNCTION, 0, 0); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::MappingVariable(TNVector *SrcVector) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ĵ¹ö½º¿¡ µ¶¸³ÀûÀ̾î¾ß ÇÏ´Â VectorFormÀÇ º¯¼ö¸¦ MainImageFormÀ¸·Î À̵¿ - by monkman (2005.03.08) // MainImageForm¿¡ ÀÖ´Â Vector º¯¼öµé°ú ¿¬°á ½ÃÄÑÁØ´Ù NVector = SrcVector; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitVariable(TNVector *SrcVector) { NVector->Init(); } // --------------------------------------------------------------------------- /* void __fastcall TVectorForm::MappingMainImageVariable(TMainImageForm *mif) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ĵ¹ö½º¿¡ µ¶¸³ÀûÀ̾î¾ß ÇÏ´Â VectorFormÀÇ º¯¼ö¸¦ MainImageFormÀ¸·Î À̵¿ - by monkman (2005.03.08) // MainImageForm¿¡ ÀÖ´Â Vector º¯¼öµé°ú ¿¬°á ½ÃÄÑÁØ´Ù if (mif) { bDownState = &(mif->bDownState); bDragState = &(mif->bDragState); bTextState = &(mif->bTextState); bMultiSelect = &(mif->bMultiSelect); Tanx = &(mif->Tanx); Tany = &(mif->Tany); paintrect = &(mif->VectorPaintrect); step = &(mif->step); Lex = &(mif->Lex); Ley = &(mif->Ley); Lsx = &(mif->Lsx); Lsy = &(mif->Lsy); Csx = &(mif->Csx); Csy = &(mif->Csy); Cux = &(mif->Cux); Cuy = &(mif->Cuy); Cux2 = &(mif->Cux2); Cuy2 = &(mif->Cuy2); bUserInput = &(mif->bUserInput); bUserLength1 = &(mif->bUserLength1); bUserLength2 = &(mif->bUserLength2); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } //--------------------------------------------------------------------------- void __fastcall TVectorForm::InitMainImageVariable(TMainImageForm *mif) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ĵ¹ö½º¿¡ µ¶¸³ÀûÀ̾î¾ß ÇÏ´Â VectorFormÀÇ º¯¼ö¸¦ MainImageFormÀ¸·Î À̵¿ - by monkman (2005.03.08) // º¯¼ö¸¦ ÃʱâÈ­ ÇÑ´Ù if (mif) { *bDownState = false; *bDragState = false; *bTextState = false; *bMultiSelect = false; *step = 0; *bUserInput = false; *bUserLength1 = false; *bUserLength2 = false; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } */ // --------------------------------------------------------------------------- void __fastcall TVectorForm::ButtonTagMapping() { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // º¤ÅÍ ¸Þ´º À籸¼º - by monkman (2005.05.17) // ¹öư¿¡ ÇØ´çÇϴ ű׸¦ ¼ÂÆÃÇÑ´Ù sbLine->Tag = M_D_LINE; sbCurve->Tag = M_D_CURVE; sbFreeDraw->Tag = M_D_FREEDRAW; sbRect->Tag = M_D_RECT; sbEllipse->Tag = M_D_ELLIPSE; sbNewTextEdit->Tag = M_D_NEWTEXT; sbPathColor->Tag = M_E_PATHCOLOR; sbObjectEdit->Tag = M_O_EDIT; sbMoveCopy->Tag = M_O_MOVECOPY; sbColor->Tag = M_O_COLOR; sbProportion->Tag = M_O_PROPORTION; sbFill->Tag = M_O_FILL; sbRotation->Tag = M_O_ROTATION; sbArrange->Tag = M_O_ARRANGE; sbDirectSelect->Tag = M_P_EDIT; sbConvertDirection->Tag = M_P_CONVERTDIRECTION; sbPointAdd->Tag = M_P_ADD; sbPointDelete->Tag = M_P_DELETE; sbKnife->Tag = M_P_KNIFE; sbVectorPointIrregular->Tag = M_P_IRREGULAR; sbUndoRedo->Tag = M_E_UNDOREDO; // OutLine Speed Button Ãß°¡ (2008. 01. 02 Annualring) // sbOutline->Tag = M_O_OUTLINE; // Spray Speed Button Ãß°¡ by embakum sbSpray->Tag = M_O_OUTLINE; // object cutting speed button Ãß°¡ by shin sbCutting->Tag = M_O_CUTTING; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::VectorMenuButtonOff() { /* // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // º¤ÅÍ ¸Þ´º À籸¼º - by monkman (2005.05.17) // ¹öưÀ» ¸ðµÎ ºñȰ¼ºÈ­ÇØ ÁÜ - by monkman (2005.05.16) shLine->Brush->Color = clBlack; shLine->Pen->Color = clBlack; shCurve->Brush->Color = clBlack; shCurve->Pen->Color = clBlack; shFreeDraw->Brush->Color = clBlack; shFreeDraw->Pen->Color = clBlack; shRect->Brush->Color = clBlack; shRect->Pen->Color = clBlack; shEllipse->Brush->Color = clBlack; shEllipse->Pen->Color = clBlack; shNewTextEdit->Brush->Color = clBlack; shNewTextEdit->Pen->Color = clBlack; shPathColor->Brush->Color = clBlack; shPathColor->Pen->Color = clBlack; shObjectEdit->Brush->Color = clBlack; shObjectEdit->Pen->Color = clBlack; shMoveCopy->Brush->Color = clBlack; shMoveCopy->Pen->Color = clBlack; shColor->Brush->Color = clBlack; shColor->Pen->Color = clBlack; shProportion->Brush->Color = clBlack; shProportion->Pen->Color = clBlack; shFill->Brush->Color = clBlack; shFill->Pen->Color = clBlack; shRotation->Brush->Color = clBlack; shRotation->Pen->Color = clBlack; shArrange->Brush->Color = clBlack; shArrange->Pen->Color = clBlack; shDirectSelect->Brush->Color = clBlack; shDirectSelect->Pen->Color = clBlack; shConvertDirection->Brush->Color = clBlack; shConvertDirection->Pen->Color = clBlack; shPointAdd->Brush->Color = clBlack; shPointAdd->Pen->Color = clBlack; shPointDelete->Brush->Color = clBlack; shPointDelete->Pen->Color = clBlack; shKnife->Brush->Color = clBlack; shKnife->Pen->Color = clBlack; shVectorPointIrregular->Brush->Color = clBlack; shVectorPointIrregular->Pen->Color = clBlack; shUndoRedo->Brush->Color = clBlack; shUndoRedo->Pen->Color = clBlack; // object cutting button Ãß°¡ by shin shCutting->Brush->Color = clBlack; shCutting->Pen->Color = clBlack; // Spray Button Ãß°¡ by embakum shSpray->Brush->Color = clBlack; shSpray->Pen->Color = clBlack; shIrregularMode->Brush->Color = clBlack; shIrregularMode->Pen->Color = clBlack; shRegularMode->Brush->Color = clBlack; shRegularMode->Pen->Color = clBlack; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::VectorMenuCurrentPanel() { VectorMenuButtonOff(); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // º¤ÅÍ ¸Þ´º À籸¼º - by monkman (2005.05.17) // ÇöÀç ¼±ÅÃµÈ ¸Þ´ºÀÇ PanelÀ» º¸¿©ÁÜ - by monkman (2005.05.16) ArrangePanel->Visible = false; DrawPanel->Visible = false; EditPanel->Visible = false; MoveCopyPanel->Visible = false; ColorChangePanel->Visible = false; NewTextPanel->Visible = false; PatternPanel->Visible = false; ProportionPanel->Visible = false; RotationPanel->Visible = false; UndoRedoPanel->Visible = false; // ÀÏ´Ü ¸ðµç ÆÐ³ÎÀ» °¨Ãá ´ÙÀ½¿¡ - by diekun // Outline Panel Ãß°¡ (2008. 01. 02 Annualring) // OutlinePanel->Visible = false; // Spray Panel Ãß°¡ by embakum SprayPanel->Visible = false; // Cutting Panel Ãß°¡ by shin CuttingPanel->Visible = false; // ÇöÀç º¹»ç ÁßÀÎ »óÅÂÀÎÁö À̵¿ ÁßÀÎ »óÅÂÀÎÁö¸¦ ¾Ë·ÁÁÖ´Â º¯¼ö - by monkman (2005.08.03) if (V_Item != M_O_MOVECOPY) nMoveCopy = 0; // VecMotiveFormÀÌ ÀÖ´Ù¸é ´Ýµµ·Ï ÇÑ´Ù - by monkman (2009.04.09) /* if (V_Item != M_O_OUTLINE && VecMotiveForm) { VecMotiveForm->ExitForm(); delete VecMotiveForm; VecMotiveForm = NULL; } */ // spray ÃʱâÈ­ by embakum 080326 POINT First = Point(0, 0); VecDraw->DrawShape(0, 0, 0, 0); VecDraw->DrawCurve(First, First, First); VecDraw->mousedown = 0; MainImageForm->iMainImage->Repaint(); ExitVectorRepeat(); switch(V_Item) { case M_D_LINE: lbData2->Enabled = true; // ¼öÁ¤ - by monkman (2009.04.10) eData2->Enabled = true; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Left = 0; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_D_FREEDRAW: lbData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) btTemp->SetFocus(); eData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_D_CURVE: lbData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) btTemp->SetFocus(); eData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Left = 0; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_D_SQUARE: lbData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) btTemp->SetFocus(); eData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Left = 0; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_D_RECT: lbData2->Enabled = true; // ¼öÁ¤ - by monkman (2009.04.10) eData2->Enabled = true; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Left = 0; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_D_CIRCLE: lbData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) btTemp->SetFocus(); eData2->Enabled = false; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Left = 0; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; lbData1->Caption = IDS_NRADIUS; lbData2->Caption = IDS_NRADIUS; break; case M_D_ELLIPSE: lbData2->Enabled = true; // ¼öÁ¤ - by monkman (2009.04.10) eData2->Enabled = true; // ¼öÁ¤ - by monkman (2009.04.10) DrawPanel->Visible = true; DrawPanel->Left = 0; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; lbData1->Caption = IDS_NWIDTH; lbData2->Caption = IDS_NHEIGHT; break; case M_D_NEWTEXT: NewTextPanel->Visible = true; NewTextPanel->Left = 0; NewTextPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + NewTextPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_EDIT: EditPanel->Visible = true; EditPanel->Left = 0; EditPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + EditPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_MOVECOPY: MoveCopyPanel->Visible = true; MoveCopyPanel->Left = 0; MoveCopyPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + MoveCopyPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_COLOR: ColorChangePanel->Visible = true; ColorChangePanel->Left = 0; ColorChangePanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + ColorChangePanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_PROPORTION: ProportionPanel->Visible = true; ProportionPanel->Left = 0; ProportionPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + ProportionPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_FILL: PatternPanel->Left = 0; PatternPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + PatternPanel->Height; // shin gradientfill sbColorFill->Down = true; pnColorFill->BringToFront(); PatternPanel->Visible = true; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_ROTATION: RotationPanel->Visible = true; RotationPanel->Left = 0; RotationPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + RotationPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_ARRANGE: ArrangePanel->Visible = true; ArrangePanel->Left = 0; ArrangePanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + ArrangePanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; /* // Outline Case Ãß°¡ (2008. 01. 02 Annualring) case M_O_OUTLINE: shOutline->Brush->Color = clLime; shOutline->Pen->Color = clGreen; OutlinePanel->Visible = true; OutlinePanel->Left = 0; OutlinePanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + OutlinePanel->Height; Parent->Height = ParentHeight + ClientHeight; break; */ // Spray Ãß°¡ by embakum case M_O_OUTLINE: pnOutline->BringToFront(); sbSprayOutline->Down = true; sbSprayImage->Down = false; SprayPanel->Visible = true; SprayPanel->Left = 0; SprayPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + SprayPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_O_VECTORREPEAT: InitVectorRepeat(); break; // object cutting Ãß°¡ by shin case M_O_CUTTING: CuttingPanel->Visible = true; CuttingPanel->Left = 0; CuttingPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + CuttingPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_P_EDIT: ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_P_CONVERTDIRECTION: ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_P_ADD: ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_P_DELETE: ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_P_KNIFE: ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_P_IRREGULAR: ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; break; case M_E_UNDOREDO: UndoRedoPanel->Visible = true; UndoRedoPanel->Left = 0; UndoRedoPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + UndoRedoPanel->Height; // Parent->Height = ParentHeight + ClientHeight; break; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitForm(bool bLoadVector) { // ParentHeight = Parent->Height+20; ButtonTagMapping(); // btTemp->SetFocus() ÇØÁà¾ßÁö¸¸ Pen»öÀÌ ÇöÀç PaletteÀÇ Ä÷¯·Î ¹Ù²ï´Ù - by monkman (2005.07.22) btTemp->SetFocus(); UpdateForm(); PenStyle = 0; ViewVectorPen(true); DrawPenShapeButton(0); InitSizeComboBox(); // for TextEdit by maxleo21c (04.10.19) // VectorDraw->OnMouseSelectDrag() ¿¡¼­ ¼±Åà »ç°¢ÇüÀÌ ±×·ÁÁö°Ô Çϱâ À§Çؼ­.. // ¸¶¿ì½º°¡ ĵ¹ö½º ¾È¿¡ ÀÖ°í ´ÜÃàŰ·Î ÇßÀ» °æ¿ì, bOnImage°¡ false À̹ǷΠ»ç°¢ÇüÀÌ ±×·ÁÁöÁö ¾Ê´Â´Ù.. // - by celberus with shin and monkman (2005.06.13) bOnImage = true; if (bLoadVector) { sbObjectEdit->Click(); } // if¹® ¹ÛÀ¸·Î »©³¿ - by monkman (2005.05.09) // MainImageForm Á¦°Å½Ã¿¡ ¸Þ¸ð¸® Á¢±Ù ¿À·ù¹ß»ýÇØ¼­ Ãß°¡ if (MainImageForm != NULL) MainImageForm->iMainImage->Cursor = crDefault; VecDraw->bZKey = false; VecDraw->bJKeyState = false; VecDraw->bJoinState = false; VecDraw->bShiftState = false; VecDraw->bAltState = false; VecDraw->bPointModeState = false; // todo : ¡Ù¡Ù ¼Óµµ °³¼± - by monkman (2005.07.20) VecDraw->FullViewBitmapDraw(-1, -1, -1, -1); // ÇÁ·Î±×·¥ÀÌ Ã³À½ ½ÇÇàµÇ¾úÀ» ¶§´Â Ç×»ó Ini ÆÄÀϵéÀ» ÃʱâÈ­ ½ÃÄÑÁØ´Ù by tmddn85 /* if ( VectorOpenCount == 0 ){ VectorOpenCount++; edCount->Text = "0"; edMargin->Text = "0"; ShapeCombo->ItemIndex = 0; PositionCombo->ItemIndex = 0; rzcbUseCount->Checked = 1; CountEdit->Text = "5"; MotiveModeComboBox->ItemIndex = 0; eMotiveCount->Text = "0"; eMotiveGap->Text = "0"; eMotiveProportion->Text = "0"; cbMotiveCurveConti->Checked = 0; FontNameBox->ItemIndex = 19; FontSizeComboBox->ItemIndex = 7; FontStyleBox->ItemIndex = 0; WidthGapComboBox->ItemIndex = 6; HeightGapComboBox->ItemIndex = 6; cbTextAntialiasing->Checked = 0; WriteIni_Spray(); WriteIni_Text(); TIniFile *VecIni = new TIniFile(AppDataItem + "\\VectorText.ini"); VecIni->Free(); // VecIni->EraseSection(AppDataItem + "\\VectorText.ini"); } */ m_IsChangedItemByShift = false; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::UpdateForm() { int count; EVecKind kind; ElementSet element; TList *DataList = NULL; TVecData *data = NULL; DataList = NVector->DataList; if (!VecDraw->NVector) return; // ¼±Åà ¾÷µ¥ÀÌÆ® Á¤º¸ °»½Å // ÆíÁý Áß¿¡µµ Undo³ª Redo·Î ¼±ÅÃµÈ ¿ÀºêÁ§Æ®ÀÇ ¼ö°¡ º¯ÇÏ´Â °æ¿ìµµ Àֱ⠶§¹®¿¡ ´Ù½Ã °Ë»çÇÑ´Ù NVector->bSelected = false; for (int i = 0; i < DataList->Count; i++) { data = (TVecData*)DataList->Items[i]; if (true == data->bSelected) { // Çϳª¶óµµ ¼±ÅÃµÈ °ÍÀÌ ÀÖ´Â °æ¿ì NVector->bSelected = true; break; } } element.Clear(); element = VecDraw->ElementsInList(NVector->DataList, true); // ÀÏ´Ü PopUp ¸Þ´º »ç¿ëÀÌ °¡´ÉÇϵµ·Ï ÇÑ´Ù - by monkman (2005.05.31) PopupCopy->Enabled = true; PopupCut->Enabled = true; PopupPaste->Enabled = true; ReverseCopy->Enabled = true; ProportionPanel->Visible = false; RotationPanel->Visible = false; PatternPanel->Visible = false; VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï»óÅ¿¡¼­´Â TEXT ÀÔ·ÂÀÌ ºÒ°¡ - by monkman (2005.02.16) if (MainImageForm->NVector->bVectorReflectionMode) { sbNewTextEdit->Enabled = false; sbPatternFill->Enabled = false; sbCurveTextDraw->Enabled = false; sbCurveTextEdit->Enabled = false; } else { if (element.Contains(E_TEXTBOX) || element.Contains(E_PFILL) || element.Contains(E_PTEXTBOX)) { MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; } sbNewTextEdit->Enabled = true; sbCurveTextDraw->Enabled = true; sbCurveTextEdit->Enabled = true; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- VecDraw->NVector->bPatternMode = false; VecDraw->NVector->PatternStep = 0; // VecDraw->bExtend = false; if (VecDraw->NVector->bSelected) { sbColor->Enabled = true; sbArrange->Enabled = true; sbRotation->Enabled = true; sbProportion->Enabled = true; sbMoveCopy->Enabled = true; sbFill->Enabled = true; sbConvertDirection->Enabled = true; sbPointAdd->Enabled = true; sbPointDelete->Enabled = true; sbKnife->Enabled = true; // OutLine Speed Button Ãß°¡ (2008. 01. 11 Annualring) // sbOutline->Enabled = true; // Spray Speed Button Ãß°¡ by embakum // sbSpray->Enabled = true; // object cutting button Ãß°¡ shin sbCutting->Enabled = true; rzbtnVectorRepeat->Enabled = true; cbObjAntialiasing2->Enabled = true; eSet_0->Enabled = true; eSet_1->Enabled = true; eSet_2->Enabled = true; eSet_3->Enabled = true; eSet_4->Enabled = true; eSet_5->Enabled = true; lblPenThick->Enabled = true; EditPenStyleBox->Enabled = true; lbPenType->Enabled = true; stSet1d->Enabled = true; stSet1g->Enabled = true; stSet2d->Enabled = true; stSet2g->Enabled = true; stSet3d->Enabled = true; stSet3g->Enabled = true; pnArrowEdit->Enabled = true; cbArrowFillEdit->Enabled = true; Label12->Enabled = false; rzspCapLineEdit->Enabled = false; EditPenThickSpinButton->Enabled = true; EditPenComboBox->Enabled = true; PopupGroup->Enabled = true; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï»óÅ¿¡¼­´Â PatternFill ºÒ°¡ (ÀÛ¾÷Çß´ø °ÍÀÌ SubBitmap¿¡ ¹é¾÷ º¸°üµÇ¾î ÀÖÀ¸¹Ç·Î) - by monkman (2005.02.16) if (MainImageForm->WorkArea->Mask && !MainImageForm->NVector->bVectorReflectionMode) { sbPatternFill->Enabled = true; } else { sbPatternFill->Enabled = false; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } else { g_FocusControl->SetFocus(); // this->SetFocus(); sbColor->Enabled = false; sbArrange->Enabled = false; sbRotation->Enabled = false; sbProportion->Enabled = false; sbMoveCopy->Enabled = false; sbFill->Enabled = false; sbConvertDirection->Enabled = false; sbPointAdd->Enabled = false; sbPointDelete->Enabled = false; sbKnife->Enabled = false; // OutLine Speed Button Ãß°¡ (2008. 01. 11 Annualring) // sbOutline->Enabled = false; // Spray Speed Button Ãß°¡ by embakum // sbSpray->Enabled = false; // object cutting button Ãß°¡ shin sbCutting->Enabled = false; rzbtnVectorRepeat->Enabled = false; cbObjAntialiasing2->Enabled = false; eSet_0->Enabled = false; eSet_1->Enabled = false; eSet_2->Enabled = false; eSet_3->Enabled = false; eSet_4->Enabled = false; eSet_5->Enabled = false; lblPenThick->Enabled = false; EditPenStyleBox->Enabled = false; lbPenType->Enabled = false; stSet1d->Enabled = false; stSet1g->Enabled = false; stSet2d->Enabled = false; stSet2g->Enabled = false; stSet3d->Enabled = false; stSet3g->Enabled = false; pnArrowEdit->Enabled = false; EditPenComboBox->Enabled = false; EditPenThickSpinButton->Enabled = false; PopupGroup->Enabled = false; } if (VecDraw->GroupUpdate()) { // Group ±â´ÉÀÌ GroupÀ¸·Î ÀÛ¿ëÇÒÁö UnGroupÀ¸·Î ÀÛ¿ëÇÒÁö.. PopupGroup->Caption = DynamicMenu[1]; PopupGroup->Tag = 1; } else { PopupGroup->Caption = DynamicMenu[0]; PopupGroup->Tag = 0; } if (VecDraw->NVector->bSelected) { PopupLock->Enabled = true; PopupLock->Caption = DynamicMenu[2]; PopupLock->Tag = 0; PopupAttach->Caption = IDS_REPLACE; PopupAttach->Tag = 1; // ¸¶¿ì½º ¿À¸¥ÂÊ ¹öưÀ» ´­·¯ ¶ß´Â ÆË¾÷ ¸Þ´º¿¡¼­ Replace½Ã Sleeve¿Í Collar´Â º¸¿©¾ß ÇÑ´Ù. - by monkman (2004.07.30) SubSleeve->Visible = true; SubCollar->Visible = true; } else if (VecDraw->NVector->bLocked) { PopupLock->Enabled = true; PopupLock->Caption = DynamicMenu[3]; PopupLock->Tag = 1; PopupAttach->Caption = IDS_ATTACH; PopupAttach->Tag = 0; // ¸¶¿ì½º ¿À¸¥ÂÊ ¹öưÀ» ´­·¯ ¶ß´Â ÆË¾÷ ¸Þ´º¿¡¼­ Attach½Ã Sleeve¿Í Collar´Â º¸ÀÌÁö ¾Ê¾Æ¾ß ÇÑ´Ù. - by monkman (2004.07.30) SubSleeve->Visible = false; SubCollar->Visible = false; } else { PopupLock->Enabled = false; PopupAttach->Caption = IDS_ATTACH; PopupAttach->Tag = 0; // ¸¶¿ì½º ¿À¸¥ÂÊ ¹öưÀ» ´­·¯ ¶ß´Â ÆË¾÷ ¸Þ´º¿¡¼­ Attach½Ã Sleeve¿Í Collar´Â º¸ÀÌÁö ¾Ê¾Æ¾ß ÇÑ´Ù. - by monkman (2004.07.30) SubSleeve->Visible = false; SubCollar->Visible = false; } if (V_MainItem == 1) { if (!sbSpray->Down) { // for motive by david 090418 MoveRect = Rect(0, 0, 0, 0); if (V_Item == M_D_NEWTEXT) { NVector->bUserInput = false; EditPanel->Visible = false; DrawPanel->Visible = false; NewTextPanel->Visible = true; // by maxleo21c (2004.10.19) UndoRedoPanel->Visible = false; ArrangePanel->Visible = false; MoveCopyPanel->Visible = false; ColorChangePanel->Visible = false; PatternPanel->Visible = false; ProportionPanel->Visible = false; RotationPanel->Visible = false; // Outline Panel Ãß°¡ (2008. 01. 02 Annualring) // OutlinePanel->Visible = false; // Spray Panel Ãß°¡ by embakum SprayPanel->Visible = false; // Cutting Panel Ãß°¡ by shin CuttingPanel->Visible = false; PopupCopy->Enabled = false; PopupCut->Enabled = false; PopupPaste->Enabled = false; ReverseCopy->Enabled = false; if (sbPatternFill->Enabled) sbPatternFill->Enabled = false; MainMenuForm->UseEditFunction = true; NewTextPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + NewTextPanel->Height; // Parent->Height = ParentHeight + ClientHeight; MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; // //btTemp->SetFocus(); // Focus󸮸¦ À§Çؼ­ ÇÊ¿äÇÑ °Í °°´Ù. ÇÏÁö¸¸ // // À̰ÍÀ» »ç¿ëÇϸé MainImage¿¡ Focus°¡ °¡Áö ¾Ê´Â´Ù. // // ÇöÀç ¾î¶»°Ô ó¸®ÇØ¾ß ÇÒÁö ¸ð¸£°Ú´Ù. // // 󸮵ÇÁö ¾Ê´Â ¹®Á¦¸¦ ÇØ°áÇϱâ À§Çؼ­ »ç¿ë // SetFocusedControl(MainImageForm); // MainImageForm->tempRadioButton->SetFocus(); } else { DrawPanel->Visible = true; EditPanel->Visible = false; NewTextPanel->Visible = false; // by maxleo21c (2004.10.15) ArrangePanel->Visible = false; MoveCopyPanel->Visible = false; ColorChangePanel->Visible = false; PatternPanel->Visible = false; ProportionPanel->Visible = false; RotationPanel->Visible = false; UndoRedoPanel->Visible = false; // Outline Panel Ãß°¡ (2008. 01. 02 Annualring) // OutlinePanel->Visible = false; // Spray Panel Ãß°¡ by embakum SprayPanel->Visible = false; // Cutting Panel Ãß°¡ by shin CuttingPanel->Visible = false; DrawPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + DrawPanel->Height; // Parent->Height = ParentHeight + ClientHeight; // btTemp->SetFocus(); } } } else if (V_MainItem == 2) { NVector->bUserInput = false; EditPanel->Visible = true; DrawPanel->Visible = false; NewTextPanel->Visible = false; // by maxleo21c (2004.10.15) ArrangePanel->Visible = false; MoveCopyPanel->Visible = false; ColorChangePanel->Visible = false; PatternPanel->Visible = false; ProportionPanel->Visible = false; RotationPanel->Visible = false; UndoRedoPanel->Visible = false; // Outline Panel Ãß°¡ (2008. 01. 02 Annualring) // OutlinePanel->Visible = false; // Spray Panel Ãß°¡ by embakum SprayPanel->Visible = false; // Cutting Panel Ãß°¡ by shin CuttingPanel->Visible = false; ExitVectorRepeat(); VecDraw->bRatio = true; sbRatio->Caption = IDS_NRATIO; // by lhskys (2005.05.19) // btTemp->SetFocus(); count = VecDraw->SelectedObjectCount(); if (count == 1) { int num = 0; bool PenShape = true; // VecDraw->GetSingleObjectData(PenThick, PenStyle, num, PenShape, kind, TextItem); /////////////////////////// TVecData *selectedData = VecDraw->GetSelectedData(); kind = selectedData->Kind; if (kind != V_TEXT) { PenThick = selectedData->PenThick; PenStyle = selectedData->PenStyle; PenShape = selectedData->bRound; VecDraw->GetDashPattern(selectedData); // 2005 Vector Upgrade Shin 0315 : num Ãß°¡ if (PenStyle == P_USERSTYLE) { num = selectedData->DashValues[0]; } CapStyle[0] = selectedData->CapStyle[0]; CapStyle[1] = selectedData->CapStyle[1]; } else { // TextÀÇ °æ¿ì¿¡´Â Penthick´ë½Å¿¡ °¢µµ¸¦ ¹ÝȯÇÑ´Ù PenThick = selectedData->Font.lfEscapement / 10; TextItem = selectedData->TextString; } if (selectedData->ParentTextBox) kind = V_TEXTBOX; // Curved TextÀÇ °æ¿ì¿¡µµ ¹®ÀڷΠó¸® - by monkman (2009.05.01) ////////////////////// if (PenShape) { DrawPenShapeButton(0); // Round } else { DrawPenShapeButton(1); // Flat } VectorMenuButtonOff(); sbObjectEdit->Down = true; V_Item = M_O_EDIT; VecDraw->NVector->bFstLine = true; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) NVector->bMultiSelect = false; EditPenComboBox->Items->Strings[0] = FloatToStr(PenThick); EditPenComboBox->ItemIndex = 0; if (PenThick == 0) { EditPenComboBox->Text = IDS_Line_Width_Zero; } else { EditPenComboBox->Text = FloatToStr(PenThick); } VecDraw->bRatio = true; if (kind == V_TEXTBOX) { EditPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + EditPanel->Height; // Parent->Height = ParentHeight + ClientHeight; sbFill->Enabled = false; btReverseCopy->Enabled = false; ReverseCopy->Enabled = false; sbRatio->Enabled = false; VecDraw->bRatio = true; EditPenComboBox->Enabled = false; EditPenThickSpinButton->Enabled = false; EditPenStyleBox->Enabled = false; // -->by linuxjun for CurvedVectorText // if (element.Contains(E_PTEXTBOX)) { PopupCopy->Enabled = false; PopupCut->Enabled = false; ReverseCopy->Enabled = false; } // <--by linuxjun for CurvedVectorText MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { if (element.Contains(E_PFILL) || element.Contains(E_PTEXTBOX)) { // -->by linuxjun for CurvedVectorText // if (element.Contains(E_PTEXTBOX)) { PopupCopy->Enabled = false; PopupCut->Enabled = false; ReverseCopy->Enabled = false; } // <--by linuxjun for CurvedVectorText MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; } btReverseCopy->Enabled = true; sbRatio->Enabled = true; EditPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + EditPanel->Height; // Parent->Height = ParentHeight + ClientHeight; // lblPenThick->Caption = StringPenThick + " " + IntToStr(PenThick); if (PenStyle == P_USERSTYLE) { if (num == 2) { EditPenStyleBox->ItemIndex = 1; } else if (num == 4) { EditPenStyleBox->ItemIndex = 3; } else if (num == 6) { EditPenStyleBox->ItemIndex = 4; } } else { if (CapStyle[0] > 0) { if(CapStyle[0] == 2) { EditPenStyleBox->ItemIndex = 7; pnDashDotEdit->Visible = false; pnArrowEdit->Visible = true; cbArrowFillEdit->Enabled = false; Label12->Enabled = true; rzspCapLineEdit->Enabled = true; bUserChange = false; cbArrowFillEdit->Checked = selectedData->ArrowCap->bFillLineCap; cbArrowBothEdit->Checked = selectedData->ArrowCap->bShowArrowBoth; rzspCapWidthScaleEdit->Value = selectedData->ArrowCap->LineCapWidthScale; rzspCapWidthEdit->Value = selectedData->ArrowCap->LineCapWidth; rzspCapHeightEdit->Value = selectedData->ArrowCap->LineCapHeight; rzspCapLineEdit->Value = selectedData->ArrowCap->LineCapLine; bUserChange = true; } else { EditPenStyleBox->ItemIndex = 5; pnArrowEdit->Visible = true; cbArrowFillEdit->Enabled = true; Label12->Enabled = false; rzspCapLineEdit->Enabled = false; bUserChange = false; cbArrowFillEdit->Checked = selectedData->ArrowCap->bFillLineCap; cbArrowBothEdit->Checked = selectedData->ArrowCap->bShowArrowBoth; rzspCapWidthScaleEdit->Value = selectedData->ArrowCap->LineCapWidthScale; rzspCapWidthEdit->Value = selectedData->ArrowCap->LineCapWidth; rzspCapHeightEdit->Value = selectedData->ArrowCap->LineCapHeight; rzspCapLineEdit->Value = selectedData->ArrowCap->LineCapLine; bUserChange = true; } } else { if( !(PenStyle == P_SOLID )){ pnDashDotEdit->Visible = true; } EditPenStyleBox->ItemIndex = PenStyle; pnArrowEdit->Visible = false; } } String strTemp; switch(EditPenStyleBox->ItemIndex) { case 0: eSet_0->Visible = false; eSet_1->Visible = false; eSet_2->Visible = false; eSet_3->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet1d->Visible = false; stSet1g->Visible = false; stSet2d->Visible = false; stSet2g->Visible = false; stSet3d->Visible = false; stSet3g->Visible = false; break; case 1: eSet_0->Visible = true; eSet_1->Visible = true; eSet_2->Visible = false; eSet_3->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet1d->Visible = true; stSet1g->Visible = true; stSet2d->Visible = false; stSet2g->Visible = false; stSet3d->Visible = false; stSet3g->Visible = false; strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; break; case 2: eSet_0->Visible = true; eSet_1->Visible = true; eSet_2->Visible = false; eSet_3->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet1d->Visible = true; stSet1g->Visible = true; stSet2d->Visible = false; stSet2g->Visible = false; stSet3d->Visible = false; stSet3g->Visible = false; strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; break; case 3: eSet_0->Visible = true; eSet_1->Visible = true; eSet_2->Visible = true; eSet_3->Visible = true; eSet_4->Visible = false; eSet_5->Visible = false; stSet1d->Visible = true; stSet1g->Visible = true; stSet2d->Visible = true; stSet2g->Visible = true; stSet3d->Visible = false; stSet3g->Visible = false; strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[2]); eSet_2->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[3]); eSet_3->Text = strTemp + " pt"; break; case 4: eSet_0->Visible = true; eSet_1->Visible = true; eSet_2->Visible = true; eSet_3->Visible = true; eSet_4->Visible = true; eSet_5->Visible = true; stSet1d->Visible = true; stSet1g->Visible = true; stSet2d->Visible = true; stSet2g->Visible = true; stSet3d->Visible = true; stSet3g->Visible = true; strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[2]); eSet_2->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[3]); eSet_3->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[4]); eSet_4->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[5]); eSet_5->Text = strTemp + " pt"; break; } } NVector->bTextState = false; } else if (count == 0) { // DrawPenShapeButton(0); // None NVector->bMultiSelect = false; VectorMenuButtonOff(); sbObjectEdit->Down = true; V_Item = M_O_EDIT; VecDraw->NVector->bFstLine = true; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) EditPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + EditPanel->Height; // Parent->Height = ParentHeight + ClientHeight; MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; } else if (count > 1) { VectorMenuButtonOff(); sbObjectEdit->Down = true; V_Item = M_O_EDIT; VecDraw->NVector->bFstLine = true; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) EditPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + EditPanel->Height; // Parent->Height = ParentHeight + ClientHeight; if (element.Contains(E_TEXTBOX) || element.Contains(E_PTEXTBOX)) { // E_PTEXTBOX Ãß°¡ - by monkman (2009.05.01) EditPenStyleBox->Enabled = false; EditPenThickSpinButton->Enabled = false; EditPenComboBox->Enabled = false; sbFill->Enabled = false; btReverseCopy->Enabled = false; ReverseCopy->Enabled = false; sbRatio->Enabled = false; VecDraw->bRatio = true; // -->by linuxjun for CurvedVectorText // if (element.Contains(E_PTEXTBOX)) { PopupCopy->Enabled = false; PopupCut->Enabled = false; ReverseCopy->Enabled = false; } // <--by linuxjun for CurvedVectorText MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { if (element.Contains(E_PFILL) || element.Contains(E_PTEXTBOX)) { // -->by linuxjun for CurvedVectorText // if (element.Contains(E_PTEXTBOX)) { PopupCopy->Enabled = false; PopupCut->Enabled = false; ReverseCopy->Enabled = false; } // <--by linuxjun for CurvedVectorText MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; } // DrawPenShapeButton(3); // Multi NVector->bMultiSelect = true; btReverseCopy->Enabled = true; sbRatio->Enabled = true; // lblPenThick->Caption = StringPenThick + " - "; // UDPen->Position = 100; eSet_0->Visible = false; eSet_1->Visible = false; eSet_2->Visible = false; eSet_3->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet1d->Visible = false; stSet1g->Visible = false; stSet2d->Visible = false; stSet2g->Visible = false; stSet3d->Visible = false; stSet3g->Visible = false; // EditPenStyleBox->ItemIndex = -1; EditPenComboBox->ItemIndex = 1; // ItemIndex 1 : --------------- EditPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + EditPanel->Height; // Parent->Height = ParentHeight + ClientHeight; } // btTemp->SetFocus(); } } else if (V_MainItem == 3) { if (V_Item == M_E_UNDOREDO) { NVector->bUserInput = false; // 2005 Vector upgrade shin0228 // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); UndoRedoPanel->Visible = true; EditPanel->Visible = false; DrawPanel->Visible = false; NewTextPanel->Visible = false; ArrangePanel->Visible = false; MoveCopyPanel->Visible = false; ColorChangePanel->Visible = false; PatternPanel->Visible = false; ProportionPanel->Visible = false; RotationPanel->Visible = false; // Outline Panel Ãß°¡ (2008. 01. 02 Annualring) // OutlinePanel->Visible = false; // Spray Panel Ãß°¡ by embakum SprayPanel->Visible = false; // Cutting Panel Ãß°¡ by shin CuttingPanel->Visible = false; UndoRedoPanel->Top = RzSeparator->Top + RzSeparator->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + UndoRedoPanel->Height; // Parent->Height = ParentHeight + ClientHeight; } else { NVector->bUserInput = false; EditPanel->Visible = false; DrawPanel->Visible = false; // sbProportion->Enabled = false; NewTextPanel->Visible = false; // by maxleo21c (2004.10.19) UndoRedoPanel->Visible = false; ArrangePanel->Visible = false; MoveCopyPanel->Visible = false; ColorChangePanel->Visible = false; PatternPanel->Visible = false; ProportionPanel->Visible = false; RotationPanel->Visible = false; // Outline Panel Ãß°¡ (2008. 01. 02 Annualring) // OutlinePanel->Visible = false; // Spray Panel Ãß°¡ by embakum SprayPanel->Visible = false; // Cutting Panel Ãß°¡ by shin CuttingPanel->Visible = false; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height; // Parent->Height = ParentHeight + ClientHeight; // btTemp->SetFocus(); if (element.Contains(E_PFILL) || element.Contains(E_TEXTBOX) || element.Contains(E_PTEXTBOX)) { if (element.Contains(E_TEXTBOX)) { ReverseCopy->Enabled = false; } // -->by linuxjun for CurvedVectorText // if (element.Contains(E_PTEXTBOX)) { PopupCopy->Enabled = false; PopupCut->Enabled = false; ReverseCopy->Enabled = false; } // <--by linuxjun for CurvedVectorText MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; } } } if (V_Item != M_D_NEWTEXT) { MainMenuForm->UseEditFunction = false; // by maxleo21c (2004.08.06) NVector->bTextState = false; VecDraw->BeReadyEdit = false; } // btUndo->Enabled = MainImageForm->VU_DATA->Count; // btRedo->Enabled = MainImageForm->VR_DATA->Count; btUndo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canundo(); btRedo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canredo(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ExitForm(void) { // MainImageForm Á¦°Å½Ã¿¡ ¸Þ¸ð¸® Á¢±Ù ¿À·ù¹ß»ýÇØ¼­ Ãß°¡ if (MainImageForm == NULL) return; BEGIN_LOG(""); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï Æû´Ý±â - by monkman (2005.02.24) if (!ExitReflectionMirror(true)) { END_LOG; return; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); ViewVectorPen(false); // Combo ¸Þ´º¸¦ ¼±ÅÃÇßÀ» ¶§´Â º¤ÅÍ ¿ÀºêÁ§Æ®°¡ ¼±ÅÃµÈ °ÍÀ» ÇØÁ¦ÇÏÁö ¾ÊÀ½ (Item == T_COMBO¿Í ´Ù¸§) - by monkman (2004.10.26) if (MainMenuForm->bCombo) VecDraw->NVector->bSelected = true; else VecDraw->NVector->bSelected = false; VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; VecDraw->NVector->bPatternMode = false; VecDraw->NVector->PatternStep = 0; VecDraw->SpreadStep = 0; VecDraw->nSelPos = 0; VecDraw->NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) VecDraw->bZKey = false; VecDraw->bJKeyState = false; VecDraw->bJoinState = false; VecDraw->bShiftState = false; VecDraw->bAltState = false; VecDraw->bPointModeState = false; if (MainImageForm) { MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); } VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; MainImageForm->iMainImage->bVectorModify = false; /* if (VecDraw->bStyle && StyleLibForm) { StyleLibForm->ExitForm(); delete StyleLibForm; StyleLibForm = NULL; } */ if (CombiForm->Visible) CombiForm->Visible = false; if (ResultForm) ResultForm->Visible = false; // STY, STI ÀÛ¾÷ÇÏ´ø ºÎºÐÀÌ ³²¾ÆÀÖµµ·Ï ¼öÁ¤ - by monkman (2010.09.09) /* if (DataTransForm) { DataTransForm->ExitForm(); delete DataTransForm; DataTransForm = NULL; } */ if (DataTransForm) DataTransForm->Visible = false; if (DetailForm) { DetailForm->ExitForm(); delete DetailForm; DetailForm = NULL; } if (StyleIllustForm) { StyleIllustForm->ExitForm(); delete StyleIllustForm; StyleIllustForm = NULL; } // TextBox¿¡ ´ëÇÑ ÃʱâÈ­ VecDraw->BeReadyEdit = false; MainMenuForm->UseEditFunction = false; if (MainImageForm) { // MainImageForm->fontIndex = FontNameBox->ItemIndex; //ColseUp¿¡¼­ ó¸® by david 20080522 MainImageForm->styleIndex = FontStyleBox->ItemIndex; MainImageForm->sizeIndex = FontSizeComboBox->ItemIndex; MainImageForm->wGapIndex = WidthGapComboBox->ItemIndex; MainImageForm->hGapIndex = HeightGapComboBox->ItemIndex; } // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ±â´É - by monkman (2005.01.31) ExitIrregular(); // ¿Ã°¡¹Ì ³¡³»±â // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // todo : ¡Ù¡Ù ¼Óµµ °³¼± - by monkman (2005.07.20) VecDraw->FullViewBitmapDraw(-1, -1, -1, -1); // spray ÃʱâÈ­ by embakum 080326 POINT First = Point(0, 0); VecDraw->DrawShape(0, 0, 0, 0); VecDraw->DrawCurve(First, First, First); VecDraw->mousedown = 0; ExitVectorRepeat(); if (VecMotiveForm) { VecMotiveForm->ExitForm(); delete VecMotiveForm; // 090227 VecMotiveForm = NULL; } // by david ¸ðƼºê ¹Ýº¹ 090506 if (VecDraw->tempChildList) { TVecData *data = NULL; for (int i = 0; i < VecDraw->tempChildList->Count; i++) { data = (TVecData*)VecDraw->tempChildList->Items[i]; if (data) delete data; data = NULL; } VecDraw->tempChildList->Clear(); } MainImageForm->iMainImage->Repaint(); WriteIni_Arrow(); if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); SprayOnceEnabled = false; TextOnceEnabled = false; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageMouseDown(TMouseButton Button, TShiftState Shift, int X, int Y) { if (Button != mbLeft) return; int lsx, lsy, lex, ley; bOnImage = true; // if (Shift.Contains(ssShift)) bShiftState = true; // else bShiftState = false; // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´©¸£°í ¼± ±×¸®±â½Ã ¹ÝÀü ±âÁؼ± ³» 5px ¹üÀ§¿¡ µé¾î¿À¸é ´Þ¶óºÙµµ·Ï ÇÑ´Ù - by monkman (2009.11.27) // ¼öÁ÷ ±âÁؼ± if (VecDraw->bJKeyState && NVector->bVectorReflectionMode && NVector->ReflectionVH == 1 && X - 5 <= NVector->ReflectionVIndex && NVector->ReflectionVIndex <= X + 5) { NVector->Lex = NVector->ReflectionVIndex; NVector->Ley = Y; VecDraw->bJoinState = true; } // ¼öÆò ±âÁؼ± else if (VecDraw->bJKeyState && NVector->bVectorReflectionMode && NVector->ReflectionVH == 2 && Y - 5 <= NVector->ReflectionHIndex && NVector->ReflectionHIndex <= Y + 5) { NVector->Lex = X; NVector->Ley = NVector->ReflectionHIndex; VecDraw->bJoinState = true; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- else { NVector->Lex = X; NVector->Ley = Y; } // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü ¸ðµå Áß ±âÁؼ± ±×¸®±â ¸ðµå À϶§´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê´Â´Ù - by monkman (2005.02.21) if (MainImageForm->NVector->bVectorReflectionMode && (MainImageForm->NVector->ReflectionVH == 3 || MainImageForm->NVector->ReflectionVH == 4)) { MainImageForm->NVector->bFirstMove = false; MainImageForm->bDownState = false; MainImageForm->bDragState = false; MainImageForm->NVector->step = 0; return; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (V_Item == M_D_NEWTEXT) { MainImageForm->bDrawCaret = true; // shin vectorform // ¸¶¿ì½º ´Ù¿îÀ» ÇÏ¸é Æ÷ÀÎÆ®°¡ ÀÌ¹Ì TestBox°¡ ÀÖ´ÂÁö ¾ø´ÂÁö È®ÀÎÇϰí // ÀÖ´Ù¸é ¼±ÅÃÇÑ Box¿¡ Caret¸¦ ±×¸®°í Űº¸µå ÀÔ·ÂÀ» ±â´Ù¸°´Ù. // ¾ø´Ù¸é »õ·Î¿î Box¸¦ ¸¸µé°í Űº¸µå ÀÔ·ÂÀ» ±â´Ù¸°´Ù. NVector->bTextState = true; // MouseDown½ÃÁ¡¿¡¼­ Text Object¸¦ Ãß°¡ VecDraw->AddTextBox(X, Y); NVector->bDownState = true; VecDraw->NVector->bFirstMove = true; btUndo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canundo(); // by linuxjun btRedo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canredo(); // by linuxjun return; } else { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï»óÅ¿¡¼­´Â TEXT ÀÔ·ÂÀÌ ºÒ°¡ - by monkman (2005.07.28) ElementSet element; element.Clear(); element = VecDraw->ElementsInList(NVector->DataList, true); if (!MainImageForm->NVector->bVectorReflectionMode) { if (element.Contains(E_TEXTBOX) || element.Contains(E_PFILL) || element.Contains(E_PTEXTBOX)) { MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; MainImageForm->sbLock->Enabled = false; } else { MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; } } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } if (VecDraw->NVector->bMergeMode) { // Merge»óÅÂÀÎ °æ¿ì MergePosition(X, Y, false); return; } if (VecDraw->SpreadStep) { // Spread»óÅÂÀÎ °æ¿ì SpreadPosition(X, Y, false); NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; MainImageForm->iMainImage->Repaint(); return; } if (VecDraw->NVector->bPatternMode) { switch(VecDraw->NVector->PatternStep) { case 1: VecDraw->InitPatternFill(ePatternX->IntValue, ePatternY->IntValue, ePatternAngle->IntValue); VecDraw->NVector->PatternStep = cbPatternAngle->Checked ? 2 : 4; break; case 2: VecDraw->NVector->PatternStep = 3; break; case 3: VecDraw->InitPatternFill(ePatternX->IntValue, ePatternY->IntValue, ePatternAngle->IntValue); VecDraw->NVector->PatternStep = 4; break; case 4: VecDraw->ObjectPatternFill(X, Y, ePatternAngle->IntValue, ePatternX->IntValue, ePatternY->IntValue); VecDraw->NVector->PatternStep = 0; VecDraw->NVector->bPatternMode = false; cbPatternSize->Checked = false; cbPatternAngle->Checked = false; break; } return; } if (V_MainItem == 1) { gdp::Rect rect; // 2005 Vector Upgrade Shin 0315 if (NVector->bUserInput) CalculateObject(rect, 0, 0, false); switch(V_Item) { case M_D_LINE: // Line if (NVector->step == 0) { if (LineType == 2) VecDraw->NVector->bFstLine = true; NVector->step = 1; NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; if (Shift.Contains(ssShift)) { VecDraw->NVector->bExtend = VecDraw->OnMouseDrawMove(X, Y); } else VecDraw->NVector->bExtend = false; } else if (NVector->step == 1) { if (NVector->bUserInput) UserDataInput(X, Y); // 2005 Vector upgrade Shin 0315 if (VecDraw->bZKey) { // ¼öÁ÷/¼öÆò ±×¸®±â if (abs((NVector->Lex) - (NVector->Lsx)) > abs ((NVector->Ley) - (NVector->Lsy))) NVector->Ley = NVector->Lsy; else NVector->Lex = NVector->Lsx; } if (VecDraw->NVector->bExtend) VecDraw->ExtendObject(V_LINE, Point(NVector->Lsx, NVector->Lsy), Point(NVector->Lex, NVector->Ley), Point(0, 0)); else VecDraw->LineAdd(V_LINE, Point(NVector->Lsx, NVector->Lsy), Point(NVector->Lex, NVector->Ley)); // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ ¹ÝÀüÀ» ±âÁØÀ¸·Î ¼± ±×¸®±â°¡ ¸¶¹«¸®µÇ¸é º¤ÅÍ ¿ÀºêÁ§Æ®¸¦ ¿Ï¼º½ÃŲ´Ù - by monkman (2009.11.27) if (VecDraw->bJKeyState && VecDraw->NVector->bExtend == false && ((VecDraw->NVector->ReflectionVH == 1 && NVector->Lex == VecDraw->NVector->ReflectionVIndex) || (VecDraw->NVector->ReflectionVH == 2 && NVector->Ley == VecDraw->NVector->ReflectionHIndex))) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- else { if (LineType == 1) { NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; } else if (LineType == 2) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) bSeparate = true; } } if( bArrowBoth_measure ) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bJoinState = false; VecDraw->NVector->bVectorMove = false; //line, curve µî ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇϰí shift + z(ÇÑÁ¡µÚ·Î)¸¦ ÀÌ¿ëÇØ¼­ ¸¶Áö¸·±îÁö //°£ÈÄ¿¡ x¸¦ ´­·¯ ¿ÀºêÁ§Æ®¸¦ ¾ø¾Ö¸é undosave¸¦ Çß´ø °ÍÀ» »èÁ¦ÇؾßÇÑ´Ù. //¿ÀºêÁ§Æ®°¡ »ý¼ºµÇ±â Àü¿¡ x¸¦ ´©¸£¸é ÇÒ Çʿ䰡 ¾ø´Ù. if (MainImageForm->V_DATA->Count > 0) { TVecData *tdata = (TVecData *)MainImageForm->V_DATA->Last(); if (tdata->nCount == 0) { TPVectorUndo * Undo = (TPVectorUndo *)MainImageForm->VecUndo; Undo->RemoveLast(); MainImageForm->V_DATA->Remove(tdata); delete tdata; tdata = NULL; } } MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); } if (VecDraw->NVector->bClosedState) { NVector->step = 0; VecDraw->NVector->bClosedState = false; } } break; case M_D_CURVE: // Curve if (VecDraw->bAltState) { VecDraw->bJoinState = false; VecDraw->bJKeyState = false; } if (NVector->step == 0) { NVector->step = 1; NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; if (Shift.Contains(ssShift)) { VecDraw->NVector->bExtend = VecDraw->OnMouseDrawMove(X, Y); } else VecDraw->NVector->bExtend = false; } else if (NVector->step == 1) { NVector->step = 2; if (NVector->bUserInput) UserDataInput(X, Y); // 2005 Vector upgrade Shin 0315 if (VecDraw->bZKey) { // ¼öÁ÷/¼öÆò ±×¸®±â if (abs((NVector->Lex) - (NVector->Lsx)) > abs ((NVector->Ley) - (NVector->Lsy))) NVector->Ley = NVector->Lsy; else NVector->Lex = NVector->Lsx; } NVector->Csx = NVector->Lex; NVector->Csy = NVector->Ley; if (VecDraw->bAltState) { if (!(NVector->bFstLine)) { TVecData* data = (TVecData*)NVector->DataList->Items [NVector->DataList->Count - 1]; data->bFirstJoin = false; data->bLastJoin = false; } } } else if (NVector->step == 2) { NVector->Tanx = X; NVector->Tany = Y; if (VecDraw->NVector->bExtend) VecDraw->ExtendObject(V_CURVE, Point(NVector->Lsx, NVector->Lsy), Point(NVector->Csx, NVector->Csy), Point(NVector->Lex, NVector->Ley)); else VecDraw->CurveAdd(Point(NVector->Lsx, NVector->Lsy), Point(NVector->Csx, NVector->Csy), Point(NVector->Lex, NVector->Ley)); // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ ¹ÝÀüÀ» ±âÁØÀ¸·Î ¼± ±×¸®±â°¡ ¸¶¹«¸®µÇ¸é º¤ÅÍ ¿ÀºêÁ§Æ®¸¦ ¿Ï¼º½ÃŲ´Ù - by monkman (2009.11.27) if (VecDraw->bJKeyState && VecDraw->NVector->bExtend == false && ((VecDraw->NVector->ReflectionVH == 1 && NVector->Csx == VecDraw->NVector->ReflectionVIndex) || (VecDraw->NVector->ReflectionVH == 2 && NVector->Csy == VecDraw->NVector->ReflectionHIndex))) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- else { if (LineType == 1) { NVector->Lsx = NVector->Csx; NVector->Lsy = NVector->Csy; NVector->step = 1; } else if (LineType == 2) { NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) bSeparate = true; } else if (LineType == 3) { NVector->Lsx = NVector->Csx; NVector->Lsy = NVector->Csy; NVector->step = 1; } } if (VecDraw->NVector->bClosedState) { NVector->step = 0; VecDraw->NVector->bClosedState = false; } RECT rc; int k1x = (NVector->Csx) * 2 - (NVector->Cux), k1y = (NVector->Csy) * 2 - (NVector->Cuy); int k2x = (NVector->Csx) * 2 - (NVector->Cux2), k2y = (NVector->Csy) * 2 - (NVector->Cuy2); rc.top = min(min(min(NVector->Lsy, k1y), min(k2y, NVector->Csy)), min(int(min(NVector->Cuy, NVector->Cuy2)), NVector->Tany)); rc.bottom = max(max(max(NVector->Lsy, k1y), max(k2y, NVector->Csy)), max(int(max(NVector->Cuy, NVector->Cuy2)), NVector->Tany)); rc.left = min(min(min(NVector->Lsx, k1x), min(k2x, NVector->Csx)), min(int(min(NVector->Cux, NVector->Cux2)), NVector->Tanx)); rc.right = max(max(max(NVector->Lsx, k1x), max(k2x, NVector->Csx)), max(int(max(NVector->Cux, NVector->Cux2)), NVector->Tanx)); VecDraw->GetPointListRect(&rc); MainImageForm->iMainImage->RectPaint(rc); } break; case M_D_SQUARE: // Square if (NVector->bUserInput) { // 2005 Vector upgrade Shin 0315 lsx = rect.X; lsy = rect.Y; lex = rect.X + rect.Width; ley = rect.Y + rect.Height; VecDraw->DiagramAdd(V_RECT, Point(lsx, lsy), Point(lex, ley)); } else { if (NVector->step == 0) { NVector->step = 1; NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; } else if (NVector->step == 1) { int vmin = min(abs((NVector->Lex) - (NVector->Lsx)), abs((NVector->Ley) - (NVector->Lsy))); if (NVector->Lsx < NVector->Lex) lsx = NVector->Lsx; else lsx = (NVector->Lsx) - vmin; if (NVector->Lsy < NVector->Ley) lsy = NVector->Lsy; else lsy = (NVector->Lsy) - vmin; lex = lsx + vmin; ley = lsy + vmin; VecDraw->DiagramAdd(V_RECT, Point(lsx, lsy), Point(lex, ley)); NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } } break; case M_D_RECT: // Rectangle if (NVector->bUserInput) { // 2005 Vector upgrade Shin 0315 lsx = rect.X; lsy = rect.Y; lex = rect.X + rect.Width; ley = rect.Y + rect.Height; VecDraw->DiagramAdd(V_RECT, Point(lsx, lsy), Point(lex, ley)); } else { if (NVector->step == 0) { NVector->step = 1; NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; } else if (NVector->step == 1) { lsx = min(NVector->Lsx, NVector->Lex); lsy = min(NVector->Lsy, NVector->Ley); lex = max(NVector->Lsx, NVector->Lex); ley = max(NVector->Lsy, NVector->Ley); VecDraw->DiagramAdd(V_RECT, Point(lsx, lsy), Point(lex, ley)); NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } } break; case M_D_CIRCLE: // Circle if (NVector->bUserInput) { // 2005 Vector upgrade Shin 0315 lsx = rect.X; lsy = rect.Y; lex = rect.X + rect.Width; ley = rect.Y + rect.Height; VecDraw->DiagramAdd(V_ELLIPSE, Point(lsx, lsy), Point(lex, ley)); } else { if (NVector->step == 0) { NVector->step = 1; NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; } else if (NVector->step == 1) { int ra = sqrt(((NVector->Lsx) - (NVector->Lex)) * ((NVector->Lsx) - (NVector->Lex)) + ((NVector->Lsy) - (NVector->Ley)) * ((NVector->Lsy) - (NVector->Ley))); lsx = (NVector->Lsx) - ra; lsy = (NVector->Lsy) - ra; lex = (NVector->Lsx) + ra; ley = (NVector->Lsy) + ra; VecDraw->DiagramAdd(V_ELLIPSE, Point(lsx, lsy), Point(lex, ley)); NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } } break; case M_D_ELLIPSE: // Ellipse if (NVector->bUserInput) { lsx = rect.X; // 2005 Vector upgrade Shin 0315 lsy = rect.Y; lex = rect.X + rect.Width; ley = rect.Y + rect.Height; VecDraw->DiagramAdd(V_ELLIPSE, Point(lsx, lsy), Point(lex, ley)); } else { if (NVector->step == 0) { NVector->step = 1; NVector->Lsx = NVector->Lex; NVector->Lsy = NVector->Ley; } else if (NVector->step == 1) { lsx = (NVector->Lsx) - abs((NVector->Lsx) - (NVector->Lex)); lsy = (NVector->Lsy) - abs((NVector->Lsy) - (NVector->Ley)); lex = (NVector->Lsx) + abs((NVector->Lsx) - (NVector->Lex)); ley = (NVector->Lsy) + abs((NVector->Lsy) - (NVector->Ley)); VecDraw->DiagramAdd(V_ELLIPSE, Point(lsx, lsy), Point(lex, ley)); NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } } break; case M_D_FREEDRAW: if (Shift.Contains(ssShift)) VecDraw->NVector->bExtend = VecDraw->OnMouseDrawMove(X, Y); else VecDraw->NVector->bExtend = false; VecDraw->bezierCurveApproximator.AddPoint(DPOINT(X, Y)); // for I.V by tmddn85 break; } } else if (V_MainItem == 2) { if (V_Item == M_O_PROPORTION) { // È®´ëÃà¼Ò ¿Ï·á if (VecDraw->NVector->bProportion) VecDraw->ObjectProportion(eXSize->Value, eYSize->Value); goto next2; } if (V_Item == M_O_ROTATION) { // Rotation ¿Ï·á if (VecDraw->NVector->bRotation) VecDraw->ObjectRotation(); MainImageForm->iMainImage->bVectorModify = false; goto next2; } // Spray by embakum if (V_Item == M_O_SPRAY) { VecDraw->SprayPositionMouseDown(X, Y); return; } // by embakum 2009.02.10 ¸ðƼºê¹Ýº¹ if (V_Item == M_O_MOTIVEREPEAT) { return; } if (V_Item == M_O_FILL) { if (sbGradientFill->Down && gItem == G_CENTER) { VecDraw->GradientFillMouseDown(X, Y); return; } } if (V_Item == M_O_VECTORREPEAT) { if (mVectorRepeat != NULL) { mVectorRepeat->OnMouseDown(X, Y); ExitVectorRepeat(); UpdateForm(); return; } } // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì·Î ¿ÀºêÁ§Æ® ¼±Åà ±â´É(¿Ã°¡¹Ì ½ÃÀÛ) - MouseDown Event - by monkman (2005.03.02) // if (sbVectorObjectIrregular->Down && VecDraw->nSelPos == 0) { // IrregularMouseDown(Button, Shift, MainImageForm->iMainImage->RealPosX, MainImageForm->iMainImage->RealPosY); // return; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // } // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ´ÜÃàŰ·Î º¤ÅÍ ¿ÀºêÁ§Æ® º¹»çÇϱâ - by monkman (2005.02.14) if (Shift.Contains(ssShift) && Shift.Contains(ssAlt)) { // ÇöÀç´Â Shift + Alt۸¦ ´©¸¥ »óÅ·Π¼±Åà ÈÄ À̵¿ if (VecDraw->CopyVectorObjectFromHotKey(X, Y, Shift)) goto next; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } else if (VecDraw->nSelPos == 0 || Shift.Contains(ssShift) || Shift.Contains (ssAlt)) { // shift¸¦ ´©¸£¸é ¼±Åà Á¦°Å°¡ µÉ ¼ö ÀÖÀ¸¹Ç·Î Æ÷ÇÔÇÑ´Ù VecDraw->ObjectSelect(Shift, X, Y); VecDraw->NVector->bUndosw = true; /* if (*bMultiSelect){ // 2005 Vector Upgrade Shin 0315 VectorPenComboBox->ItemIndex = 1; } else { VectorPenComboBox->Items->Strings[0] = FloatToStr(PenThick); VectorPenComboBox->ItemIndex = 0; VectorPenComboBox->Text = FloatToStr(PenThick); } */ } } else if (V_MainItem == 3) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì·Î ¿ÀºêÁ§Æ® ¼±Åà ±â´É(¿Ã°¡¹Ì ½ÃÀÛ) - MouseDown Event - by monkman (2005.02.01) if (V_Item == M_P_IRREGULAR) { if (VecDraw->nSelPos == 0) { IrregularMouseDown(Button, Shift, MainImageForm->iMainImage->RealPosX, MainImageForm->iMainImage->RealPosY); } else { VecDraw->OnMouseDirectDown(Shift, X, Y); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } else if (VecDraw->nSelPos == 0) { VecDraw->ObjectSelect(Shift, X, Y, true); // ¿ì¼± Object¸¦ ¼±ÅÃÇϰí goto next; } else if (VecDraw->nSelPos == 10) { // Á¡¼±ÅÃÀÌ µÈ°æ¿ìÀÇ MouseDown } MainImageForm->iMainImage->bVectorModify = true; switch(V_Item) { case M_P_EDIT: // Point Move(Select) VecDraw->OnMouseDirectDown(Shift, X, Y); break; case M_P_CONVERTDIRECTION: // Convert Direction Point if (VecDraw->nSelPos == 10) VecDraw->OnMouseConvertDown(NVector->Lex, NVector->Ley, X, Y); // ´©¸£ÀÚ ¸¶ÀÚ Á÷¼±(Á¶ÀýÁ¡ÀÌ ¾ø¾îÁü) break; case M_P_ADD: // Point Add if (VecDraw->nSelPos != 10) VecDraw->AddPoint(X, Y); // Á¡ À§¿¡ ÀÖÁö ¾ÊÀ»¶§¸¸ ADD!~ break; case M_P_DELETE: // Point Delete if (VecDraw->nSelPos == 10) { // cursor°¡ Á¡ À§¿¡ ÀÖÀ»¶§¸¸ Áö¿î´Ù!~ VecDraw->DeletePoint(X, Y); } break; case M_P_KNIFE: if (VecDraw->nSelPos == 10) { // cursor°¡ Á¡ À§¿¡ ÀÖÀ»¶§¸¸!~ VecDraw->Knife(X, Y); goto next2; } break; } } if (V_Item != M_D_NEWTEXT) VecDraw->BeReadyEdit = false; if (NVector->bUserInput) { // 2005 Vector Upgrade Shin 0315 NVector->bUserInput = false; NVector->bUserLength1 = false; NVector->bUserLength2 = false; eData1->Value = 0; eData2->Value = 0; } next: NVector->bDownState = true; next2: VecDraw->NVector->bFirstMove = true; UpdateForm(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageMouseMove(TShiftState Shift, int X, int Y) { // ¼Óµµ °³¼± - ĵ¹ö½º ½ºÅ©·Ñ Áß¿¡´Â º¤ÅÍ ÀÛ¾÷À» ÇÏÁö ¾Ê´Â´Ù - by monkman (2005.07.13) if (NVector->step > 0) { VecDraw->NVector->bVectorMove = true; } RECT rc = Rect(0, 0, 0, 0); RECT rc2 = Rect(0, 0, 0, 0); int Thick = DrawingThick + 5; if (PenStyleComboBox->ItemIndex == 5) { Thick = DrawingThick * LineCapWidthScale * LineCapWidth; } NVector->Cux2 = NVector->Cux; NVector->Cuy2 = NVector->Cuy; NVector->Cux = X; NVector->Cuy = Y; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü ¸ðµå Áß ±âÁؼ± ±×¸®±â ¸ðµå À϶§´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê´Â´Ù - by monkman (2005.02.21) if (MainImageForm->NVector->bVectorReflectionMode && (MainImageForm->NVector->ReflectionVH == 3 || MainImageForm->NVector->ReflectionVH == 4)) { MainImageForm->NVector->bFirstMove = false; MainImageForm->bDownState = false; MainImageForm->bDragState = false; MainImageForm->NVector->step = 0; return; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (VecDraw->NVector->bMergeMode) { // Merge»óÅÂÀÎ °æ¿ì MergePosition(X, Y); return; } if (VecDraw->SpreadStep) { if (VecDraw->SpreadStep == 2 && VecDraw->bZKey) { // ¼öÁ÷/¼öÆò ±×¸®±â if (abs((NVector->Cux) - (NVector->Lex)) > abs ((NVector->Cuy) - (NVector->Ley))) NVector->Cuy = NVector->Ley; else NVector->Cux = NVector->Lex; } SpreadPosition(X, Y); return; } if (VecDraw->NVector->bPatternMode) { PatternPosition(X, Y); return; } if (V_MainItem == 1) { if (!(NVector->bUserInput)) { switch(V_Item) { case M_D_LINE: // Line // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ Ä¿¼­¸¦ º¯°æÇÑ´Ù - by monkman (2009.11.27) if (VecDraw->bJKeyState && NVector->bVectorReflectionMode && (NVector->ReflectionVH == 1 && (X - 5 <= NVector->ReflectionVIndex && NVector->ReflectionVIndex <= X + 5) || (NVector->ReflectionVH == 2 && (Y - 5 <= NVector->ReflectionHIndex && NVector->ReflectionHIndex <= Y + 5)))) { MainImageForm->iMainImage->Cursor = crJoin; } else { if (MainImageForm->iMainImage->Cursor == crJoin) MainImageForm->iMainImage->Cursor = crDefault; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (NVector->step == 0) { if (Shift.Contains(ssShift)) VecDraw->OnMouseDrawMove(X, Y); } else if (NVector->step == 1) { rc.top = min(int(min(NVector->Lsy, NVector->Cuy)), NVector->Cuy2) - Thick; rc.bottom = max(int(max(NVector->Lsy, NVector->Cuy)), NVector->Cuy2) + Thick; rc.left = min(int(min(NVector->Lsx, NVector->Cux)), NVector->Cux2) - Thick; rc.right = max(int(max(NVector->Lsx, NVector->Cux)), NVector->Cux2) + Thick; UserDataInput(NVector->Cux, NVector->Cuy); // 2005 Vector Upgrade Shin 0315 } break; case M_D_CURVE: // Curve // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ Ä¿¼­¸¦ º¯°æÇÑ´Ù - by monkman (2009.11.27) if (VecDraw->bJKeyState && VecDraw->NVector->bVectorReflectionMode && (VecDraw->NVector->ReflectionVH == 1 && (X - 5 <= VecDraw->NVector->ReflectionVIndex && VecDraw->NVector->ReflectionVIndex <= X + 5) || (VecDraw->NVector->ReflectionVH == 2 && (Y - 5 <= VecDraw->NVector->ReflectionHIndex && VecDraw->NVector->ReflectionHIndex <= Y + 5)))) { MainImageForm->iMainImage->Cursor = crJoin; } else { if (MainImageForm->iMainImage->Cursor == crJoin) MainImageForm->iMainImage->Cursor = crDefault; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (NVector->step == 0) { if (Shift.Contains(ssShift)) VecDraw->OnMouseDrawMove(X, Y); } else if (NVector->step == 1) { rc.top = min(int(min(NVector->Lsy, NVector->Cuy)), NVector->Cuy2) - Thick; rc.bottom = max(int(max(NVector->Lsy, NVector->Cuy)), NVector->Cuy2) + Thick; rc.left = min(int(min(NVector->Lsx, NVector->Cux)), NVector->Cux2) - Thick; rc.right = max(int(max(NVector->Lsx, NVector->Cux)), NVector->Cux2) + Thick; UserDataInput(NVector->Cux, NVector->Cuy); // 2005 Vector Upgrade Shin 0315 } else if (NVector->step == 2) { int k1x = (NVector->Csx) * 2 - (NVector->Cux), k1y = (NVector->Csy) * 2 - (NVector->Cuy); int k2x = (NVector->Csx) * 2 - (NVector->Cux2), k2y = (NVector->Csy) * 2 - (NVector->Cuy2); rc.top = min(min(min(NVector->Lsy, k1y), min(k2y, NVector->Csy)), min(int(min(NVector->Cuy, NVector->Cuy2)), NVector->Tany)) - Thick; rc.bottom = max(max(max(NVector->Lsy, k1y), max(k2y, NVector->Csy)), max(int(max(NVector->Cuy, NVector->Cuy2)), NVector->Tany)) + Thick; rc.left = min(min(min(NVector->Lsx, k1x), min(k2x, NVector->Csx)), min(int(min(NVector->Cux, NVector->Cux2)), NVector->Tanx)) - Thick; rc.right = max(max(max(NVector->Lsx, k1x), max(k2x, NVector->Csx)), max(int(max(NVector->Cux, NVector->Cux2)), NVector->Tanx)) + Thick; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // CurveÀÇ °æ¿ì ÇöÀç ±×·ÁÁö´Â ¶óÀÎÀÌ ¸¹ÀÌ ²©ÀÏ °æ¿ì Á¤È®ÇÑ Object¸¦ ÀâÁö ¸øÇÏ´Â °æ¿ì°¡ ÀÖ´Ù ±×·² °æ¿ì »ç¿ëÇÑ´Ù - by monkman (2005.06.14) VecDraw->GetPointListRect(&rc); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } break; case M_D_SQUARE: // Square if (NVector->step == 1) { rc.top = min(int(min(NVector->Ley, NVector->Cuy)), NVector->Cuy2) - Thick; rc.bottom = max(int(max(NVector->Ley, NVector->Cuy)), NVector->Cuy2) + Thick; rc.left = min(int(min(NVector->Lex, NVector->Cux)), NVector->Cux2) - Thick; rc.right = max(int(max(NVector->Lex, NVector->Cux)), NVector->Cux2) + Thick; UserDataInput(NVector->Cux, NVector->Cuy); // 2005 Vector Upgrade Shin 0315 } break; case M_D_RECT: // Rectangle if (NVector->step == 1) { rc.top = min(int(min(NVector->Ley, NVector->Cuy)), NVector->Cuy2) - Thick; rc.bottom = max(int(max(NVector->Ley, NVector->Cuy)), NVector->Cuy2) + Thick; rc.left = min(int(min(NVector->Lex, NVector->Cux)), NVector->Cux2) - Thick; rc.right = max(int(max(NVector->Lex, NVector->Cux)), NVector->Cux2) + Thick; UserDataInput(NVector->Cux, NVector->Cuy); // 2005 Vector Upgrade Shin 0315 } break; case M_D_CIRCLE: // Circle if (NVector->step == 1) { int ra = max (sqrt(((NVector->Cux) - (NVector->Lex)) * ((NVector->Cux) - (NVector->Lex)) + ((NVector->Cuy) - (NVector->Ley)) * ((NVector->Cuy) - (NVector->Ley))), sqrt(((NVector->Cux2) - (NVector->Lex)) * ((NVector->Cux2) - (NVector->Lex)) + ((NVector->Cuy2) - (NVector->Ley)) * ((NVector->Cuy2) - (NVector->Ley)))); rc.top = (NVector->Ley) - ra - Thick; rc.bottom = (NVector->Ley) + ra + Thick; rc.left = (NVector->Lex) - ra - Thick; rc.right = (NVector->Lex) + ra + Thick; UserDataInput(NVector->Cux, NVector->Cuy); // 2005 Vector Upgrade Shin 0315 } break; case M_D_ELLIPSE: // Ellipse if (NVector->step == 1) { int rx = max(abs((NVector->Lex) - (NVector->Cux)), abs((NVector->Lex) - (NVector->Cux2))); int ry = max(abs((NVector->Ley) - (NVector->Cuy)), abs((NVector->Ley) - (NVector->Cuy2))); rc.top = (NVector->Ley) - ry - Thick; rc.bottom = (NVector->Ley) + ry + Thick; rc.left = (NVector->Lex) - rx - Thick; rc.right = (NVector->Lex) + rx + Thick; UserDataInput(NVector->Cux, NVector->Cuy); // 2005 Vector Upgrade Shin 0315 } break; case M_D_NEWTEXT: // New Text if (NVector->bDownState) VecDraw->TextBoxMouseMove(X, Y); else VecDraw->TextBoxOnMouseMove(X, Y); goto next; case M_D_FREEDRAW: // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´©¸£°í ¼± ±×¸®±â½Ã ¹ÝÀü ±âÁؼ± ³» 5px ¹üÀ§¿¡ µé¾î¿À¸é ´Þ¶óºÙµµ·Ï ÇÑ´Ù - by monkman (2009.11.27) // ¼öÁ÷ ±âÁؼ± if (VecDraw->bAltState == false && VecDraw->bJKeyState && NVector->bVectorReflectionMode && NVector->ReflectionVH == 1 && X - 5 <= NVector->ReflectionVIndex && NVector->ReflectionVIndex <= X + 5) { MainImageForm->iMainImage->Cursor = crJoin; X = NVector->ReflectionVIndex; } // ¼öÆò ±âÁؼ± else if (VecDraw->bJKeyState && NVector->bVectorReflectionMode && NVector->ReflectionVH == 2 && Y - 5 <= NVector->ReflectionHIndex && NVector->ReflectionHIndex <= Y + 5) { MainImageForm->iMainImage->Cursor = crJoin; Y = NVector->ReflectionHIndex; } else { if (MainImageForm->iMainImage->Cursor == crJoin) MainImageForm->iMainImage->Cursor = crDefault; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (NVector->bDownState) // && (VecDraw->frequency++ % 3 == 0)) { if (VecDraw->bAltState && VecDraw->IsFreeDrawingClosingState(X, Y)) ::SetCursor(LoadCursor(NULL, IDC_HAND)); else ::SetCursor(LoadCursor(NULL, IDC_ARROW)); VecDraw->bezierCurveApproximator.AddPoint(DPOINT(X, Y)); // for I.V by tmddn85 VecDraw->DrawTracesOfFreeDrawing (MainImageForm->iMainImage->Canvas->Handle); } else { if (Shift.Contains(ssShift)) VecDraw->OnMouseDrawMove(X, Y); else if (MainImageForm->iMainImage->Cursor != crJoin) MainImageForm->iMainImage->Cursor = crDefault; } break; } RECT paintRect; UnionRect(&paintRect, &rc, &MoveRect); MoveRect = rc; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É °ü·Ã - ¹ÝÀü °Å¿ïÀÇ º¤ÅÍ ¿µ¿ªÀ» °°ÀÌ ±¸ÇÑ´Ù - by monkman(2005.03.16) if (NVector->bVectorReflectionMode) { VecDraw->GetRealAndReflectionRect(&paintRect); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- MainImageForm->iMainImage->RectPaint(paintRect); } else { if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { UserDataInput(X, Y); } gdp::Rect rect; CalculateObject(rect, 0, 0, false); rc.top = rect.Y - Thick * 3; rc.bottom = rect.Y + rect.Height + Thick * 3; rc.left = rect.X - Thick * 3; rc.right = rect.X + rect.Width + Thick * 3; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É °ü·Ã - ¹ÝÀü °Å¿ïÀÇ º¤ÅÍ ¿µ¿ªÀ» °°ÀÌ ±¸ÇÑ´Ù - by monkman(2005.03.16) if (NVector->bVectorReflectionMode) { VecDraw->GetRealAndReflectionRect(&rc); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- RECT paintRect; UnionRect(&paintRect, &rc, &MoveRect); if (MoveRect.top == 0 && MoveRect.bottom == 0 && MoveRect.left == 0 && MoveRect.right == 0) { MoveRect.top = rc.top - Thick * 3; MoveRect.bottom = rc.bottom + Thick * 3; MoveRect.left = rc.left - Thick * 3; MoveRect.right = rc.right + Thick * 3; MainImageForm->iMainImage->Repaint(); } else { MainImageForm->iMainImage->RectPaint(paintRect); MoveRect = rc; } } } else if (V_MainItem == 2) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì·Î ¿ÀºêÁ§Æ® ¼±Åà ±â´É(¿Ã°¡¹Ì ½ÃÀÛ) - MouseMove Event - by monkman (2005.03.02) // if (sbVectorObjectIrregular->Down && bIrregularDraw) { // // ¿Ã°¡¹Ì·Î ¿ÀºêÁ§Æ® ¼±Åà // IrregularMouseMove(Shift, MainImageForm->iMainImage->RealPosX, MainImageForm->iMainImage->RealPosY); // } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (V_Item == M_O_PROPORTION) { // È®´ëÃà¼Ò ÇÏ´Â °æ¿ì // VecDraw->ProportionMouseMove(X, Y); // ÁÂÇ¥¸¦ º¸³»¼­ ºñÀ²À» ¹Þ´Â´Ù (X,Y ¿¡) // eXSize->Text = X; eYSize->Text = Y; double dx = X, dy = Y; VecDraw->ProportionMouseMove(dx, dy); // ÁÂÇ¥¸¦ º¸³»¼­ ºñÀ²À» ¹Þ´Â´Ù (X,Y ¿¡) eXSize->Value = dx; // Format("%.2f", OPENARRAY(TVarRec,(dx))); eYSize->Value = dy; // Format("%.2f", OPENARRAY(TVarRec,(dy))); goto next; } if (V_Item == M_O_ROTATION) { eAngle->Value = VecDraw->RotationMouseMove(X, Y); // ÁÂÇ¥¸¦ º¸³»¼­ °¢µµ¸¦ ¹Þ´Â´Ù goto next; } /* // Outline Mode Ãß°¡ (2008. 01. 10 Annualring) if (V_Item == M_O_OUTLINE) { // È®´ëÃà¼Ò ÇÏ´Â °æ¿ì //VecDraw->ProportionMouseMove(X, Y); // ÁÂÇ¥¸¦ º¸³»¼­ ºñÀ²À» ¹Þ´Â´Ù (X,Y ¿¡) //eXSize->Text = X; eYSize->Text = Y; double dx = X, dy = Y; VecDraw->OutlineMouseMove(dx, dy); // ÁÂÇ¥¸¦ º¸³»¼­ ºñÀ²À» ¹Þ´Â´Ù (X,Y ¿¡) eXSize->Text = Format("%.2f", OPENARRAY(TVarRec,(dx))); eYSize->Text = Format("%.2f", OPENARRAY(TVarRec,(dy))); goto next; } */ if (NVector->bDownState) { if (VecDraw->nSelPos == 0) { // ¼±Åà ±¸¿ªÀ» Àâ´Â °æ¿ì if (bOnImage) VecDraw->OnMouseSelectDrag(NVector->Lex, NVector->Ley, X, Y); } else { // ÁöÁ¤ ¸ð¼­¸®¸¦ µå·¡±×·Î ¿Å±â´Â °æ¿ì if (VecDraw->nSelPos == 5) { VecDraw->OnMouseDrag(NVector->Lex, NVector->Ley, X, Y); // ¿ÀºêÁ§Æ® Àüü À̵¿ } else { VecDraw->OnMouseRepro(NVector->Lex, NVector->Ley, X, Y); // ¿ÀºêÁ§Æ® È®´ë Ãà¼Ò } } } else { if (VecDraw->NVector->bSelected) // ±×³É ¸¶¿ì½º ¿òÁ÷ÀÌ´Â °æ¿ì VecDraw->OnMouseMove(X, Y); } // by embakum if (V_Item == M_O_SPRAY) { VecDraw->SprayPositionMouseMove(X, Y); return; } // by embakum 2009.02.10 ¸ðƼºê¹Ýº¹ if (V_Item == M_O_MOTIVEREPEAT) { return; } /* if (V_Item == M_O_FILL){ if (sbGradientFill->Down){ VecDraw->GradientFillMouseMove(X, Y); return; } } */ if (V_Item == M_O_VECTORREPEAT) { if (mVectorRepeat != NULL) mVectorRepeat->OnMouseMove(X, Y); } } else if (V_MainItem == 3) { if (NVector->bDownState) { // DragState if (VecDraw->nSelPos == 0 && V_Item == M_P_EDIT) { // ¼±Åà ±¸¿ªÀ» Àâ´Â °æ¿ì if (bOnImage) VecDraw->OnMouseSelectDrag(NVector->Lex, NVector->Ley, X, Y); } else { switch(V_Item) { case M_P_EDIT: // Point Move // VecDraw->nSelPos == 5 ÀÏ °æ¿ìµµ Ãß°¡ - by monkman (2005.07.11) if (VecDraw->nSelPos == 5 || VecDraw->nSelPos == 10) { // ÁöÁ¤ Á¡¸¸ µå·¡±×·Î ¿Å±è // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ Ä¿¼­¸¦ º¯°æÇÑ´Ù - by monkman (2009.11.27) if (VecDraw->bJKeyState && NVector->bVectorReflectionMode && (NVector->ReflectionVH == 1 && (X - 5 <= NVector->ReflectionVIndex && NVector->ReflectionVIndex <= X + 5) || (NVector->ReflectionVH == 2 && (Y - 5 <= NVector->ReflectionHIndex && NVector->ReflectionHIndex <= Y + 5)))) { MainImageForm->iMainImage->Cursor = crJoin; } else { if (MainImageForm->iMainImage->Cursor == crJoin) MainImageForm->iMainImage->Cursor = crDefault; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿©·¯ ¿ÀºêÁ§Æ®ÀÇ ¿©·¯ Æ÷ÀÎÆ® À̵¿ ±â´É - by monkman (2005.03.29) VecDraw->OnMousePointDrag(NVector->Lex, NVector->Ley, X, Y, Shift); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } break; case M_P_CONVERTDIRECTION: // Convert Direction Point if (VecDraw->nSelPos == 10) VecDraw->OnMouseConvert(NVector->Lex, NVector->Ley, X, Y); break; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì·Î ¿ÀºêÁ§Æ® ¼±Åà ±â´É(¿Ã°¡¹Ì ½ÃÀÛ) - MouseMove Event - by monkman (2005.02.01) case M_P_IRREGULAR: // ¿Ã°¡¹Ì·Î ¿ÀºêÁ§Æ® ¼±Åà if (bIrregularDraw) { IrregularMouseMove(Shift, MainImageForm->iMainImage->RealPosX, MainImageForm->iMainImage->RealPosY); } else { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿©·¯ ¿ÀºêÁ§Æ®ÀÇ ¿©·¯ Æ÷ÀÎÆ® À̵¿ ±â´É - by monkman (2005.03.29) VecDraw->OnMousePointDrag(NVector->Lex, NVector->Ley, X, Y, Shift); // ÁöÁ¤ Á¡¸¸ µå·¡±×·Î ¿Å±è // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } break; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } } } else { if (VecDraw->NVector->bSelected) // ±×³É ¸¶¿ì½º ¿òÁ÷ÀÌ´Â °æ¿ì VecDraw->OnMousePointMove(X, Y); } } next: if (NVector->bDownState) NVector->bDragState = true; VecDraw->NVector->bFirstMove = false; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageMouseUp(TMouseButton Button, TShiftState Shift, int X, int Y) { // GDI+·Î ±×¸®µµ·Ï µ¹·Á³õ´Â´Ù -> MainImageForm->iMainImageMouseUp() - by monkman (2005.07.11) bool bRepaint = false; RECT Area = Rect(min(X, NVector->Lex), min(Y, NVector->Ley), max(X, NVector->Lex), max(Y, NVector->Ley)); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü ¸ðµå Áß ±âÁؼ± ±×¸®±â ¸ðµå À϶§´Â ¾Æ¹«°Íµµ ÇÏÁö ¾Ê´Â´Ù - by monkman (2005.02.21) if (NVector->bVectorReflectionMode && (NVector->ReflectionVH == 3 || NVector->ReflectionVH == 4)) { NVector->bFirstMove = false; MainImageForm->bDownState = false; MainImageForm->bDragState = false; NVector->step = 0; return; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (VecDraw->NVector->bPatternMode) { return; } if (V_Item == M_D_FREEDRAW) { VecDraw->FreeDrawing(); } if (V_Item == M_D_NEWTEXT) { VecDraw->TextBoxMouseUp(X, Y); VecDraw->NVector->bFirstMove = false; VecDraw->NVector->bUndosw = true; NVector->bDownState = false; NVector->bDragState = false; btUndo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canundo(); // by linuxjun btRedo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canredo(); // by linuxjun edText->SetFocus(); return; } if (V_MainItem == 2) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ³¡³»±â - MouseMove Event - by monkman (2005.03.02) // if (sbVectorObjectIrregular->Down && bIrregularDraw) { // IrregularMouseUp(Shift, MainImageForm->iMainImage->RealPosX, MainImageForm->iMainImage->RealPosY, false); // } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // by embakum if (V_Item == M_O_SPRAY) { VecDraw->SprayPositionMouseUp(X, Y); return; } // by embakum 2009.02.10 ¸ðƼºê¹Ýº¹ if (V_Item == M_O_MOTIVEREPEAT) { return; } /* if (V_Item == M_O_FILL){ if (sbGradientFill->Down){ VecDraw->GradientFillMouseUp(X, Y); return; } } */ if (VecDraw->nSelPos == 0 && NVector->bDragState) { // ¼±Åà ±¸¿ªÀ» Àâ´Â °æ¿ì MainImageForm->iMainImage->bVectorSelect = true; if (!VecDraw->MouseDragUp(Shift, Area)) // ¿µ¿ª¾ÈÀÇ ¿ÀºêÁ§Æ® ¼±Åà VecDraw->ObjectSelect(Shift, X, Y); } else if (VecDraw->nSelPos == 0 || (VecDraw->nSelPos == 5 && NVector->bDragState)) { MainImageForm->iMainImage->bVectorModify = false; } bRepaint = true; } else if (V_MainItem == 3) { if (VecDraw->nSelPos == 0 && NVector->bDragState && V_Item == M_P_EDIT) { MainImageForm->iMainImage->bVectorSelect = true; if (!VecDraw->MouseDragUp(Shift, Area, true)) // ¿µ¿ª¾ÈÀÇ ¿ÀºêÁ§Æ® ¼±Åà VecDraw->ObjectSelect(Shift, X, Y, true); VecDraw->UpdateModifiedObject(); } else if (V_Item == M_P_IRREGULAR && bIrregularDraw) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ³¡³»±â - MouseMove Event - by monkman (2005.02.01) IrregularMouseUp(Shift, MainImageForm->iMainImage->RealPosX, MainImageForm->iMainImage->RealPosY, true); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } else { VecDraw->UpdateModifiedObject(); MainImageForm->iMainImage->bVectorModify = false; } bRepaint = true; } VecDraw->NVector->bFirstMove = false; VecDraw->NVector->bUndosw = true; NVector->bDownState = false; NVector->bDragState = false; if (V_Item == M_O_MOVECOPY) return; UpdateForm(); // shin ¿©±â¼­ repaint if (bRepaint || V_MainItem == 1) MainImageForm->iMainImage->Repaint(); MainImageForm->iMainImage->bVectorSelect = false; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageMouseLeave(TObject *Sender) { // if (MainImageForm->bOnImage) VecDraw->bFirstMove = true; bOnImage = false; VecDraw->pBak.x = NVector->Lex; VecDraw->pBak.y = NVector->Ley; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageMouseEnter(TObject *Sender) { // VecDraw->bFirstMove = true; bOnImage = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageKeyDown(WORD Key, TShiftState Shift) { if (Key == VK_SHIFT || Shift.Contains(ssShift)) { if (V_Item == M_D_RECT) { m_IsChangedItemByShift = true; mnitmSquareClick(mnitmSquare); } else if (V_Item == M_D_ELLIPSE) { m_IsChangedItemByShift = true; mnitmSquareClick(mnitmCircle); } VecDraw->bShiftState = true; } if (Key == VK_MENU || Shift.Contains(ssAlt)) VecDraw->bAltState = true; if (Key >= VK_F1 && Key <= VK_F6); else if (MainMenuForm->UseEditFunction && !UseComboBoxForText) { // For TextBox by maxleo21c (04.10.15) MainImageForm->bDrawCaret = true; // shin vectorform VecDraw->KeyDownInTextBox(Key); if (Key == VK_DELETE) FullViewForm->InitForm(MainImageForm->iMainImage); return; } if (V_MainItem == 1 && Key == 'X' && Shift.Contains(ssShift) && btFirstPoint->Enabled) { btFirstPoint->Click(); return; } else if (V_MainItem == 1 && Key == 'Z' && Shift.Contains(ssShift) && btDeletePoint->Enabled) { btDeletePoint->Click(); return; } else if (V_MainItem == 1 && Key == VK_SHIFT && Shift.Contains(ssCtrl)) { // lblTypeClick(lblType); // ´ÜÃàŰ ´Ù½Ã ¼³Á¤ÇؾßÇÔ. return; } else if (V_MainItem == 1 && Key == VK_MENU && Shift.Contains(ssCtrl)) { if (cbFill->Checked) cbFill->Checked = false; else cbFill->Checked = true; return; } #ifdef WORKSHEET // ¹æÇâŰ·Î ºÎÀÚÀç ¹Ì¼¼ À̵¿ - by monkman (2011.02.22) else if (ResultForm && ResultForm->Visible == true && ResultForm->edForMaterialFocus->Focused() && (Key == VK_LEFT || Key == VK_UP || Key == VK_RIGHT || Key == VK_DOWN)) { ResultForm->MaterialMove(Key); return; } #endif switch(Key) { // Menu ºü¸¥ ¼±Åà Key case 'Q': // case 113: // PointEdit Toggle ModeÀÎÁö if (!VecDraw->bPointModeState) { VecDraw->bPointModeState = true; sbDirectSelect->Click(); } break; case 'J': // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ ÀÚµ¿À¸·Î ¹ÝÀü ±âÁؼ±¿¡ ÀÌ¾î ±×¸®±â°¡ °¡´ÉÇϵµ·Ï ¼³Á¤ÇÑ´Ù - by monkman (2009.11.27) if (NVector->bVectorReflectionMode && (NVector->ReflectionVH == 1 && (MainImageForm->iMainImage->RealPosX - 5 <= NVector->ReflectionVIndex && NVector->ReflectionVIndex <= MainImageForm->iMainImage->RealPosX + 5) || (NVector->ReflectionVH == 2 && (MainImageForm->iMainImage->RealPosY - 5 <= NVector->ReflectionHIndex && NVector->ReflectionHIndex <= MainImageForm->iMainImage->RealPosY + 5)))) { VecDraw->bJKeyState = true; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- break; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹æÇâŰ·Î ¹Ì¼¼À̵¿ - by monkman(2005.03.02) case VK_LEFT: // ¹æÇâŰ ¡ç VecDraw->NVector->bVectorMove = true; if (MainImageForm && Shift.Contains(ssCtrl) == false) { MainImageForm->tmVectorMoveDraw->Enabled = true; } if (Shift.Contains(ssShift)) { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(-5, 0); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(-5, 0, true); // Æ÷ÀÎÆ® À̵¿ } else { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(-1, 0); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(-1, 0, true); // Æ÷ÀÎÆ® À̵¿ } break; case VK_UP: // ¹æÇâŰ ¡è VecDraw->NVector->bVectorMove = true; if (MainImageForm && Shift.Contains(ssCtrl) == false) { MainImageForm->tmVectorMoveDraw->Enabled = true; } if (Shift.Contains(ssShift)) { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(0, -5); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(0, -5, true); // Æ÷ÀÎÆ® À̵¿ } else { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(0, -1); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(0, -1, true); // Æ÷ÀÎÆ® À̵¿ } break; case VK_RIGHT: // ¹æÇâŰ ¡æ VecDraw->NVector->bVectorMove = true; if (MainImageForm && Shift.Contains(ssCtrl) == false) { MainImageForm->tmVectorMoveDraw->Enabled = true; } if (Shift.Contains(ssShift)) { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(5, 0); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(5, 0, true); // Æ÷ÀÎÆ® À̵¿ } else { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(1, 0); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(1, 0, true); // Æ÷ÀÎÆ® À̵¿ } break; case VK_DOWN: // ¹æÇâŰ ¡é VecDraw->NVector->bVectorMove = true; if (MainImageForm && Shift.Contains(ssCtrl) == false) { MainImageForm->tmVectorMoveDraw->Enabled = true; } if (Shift.Contains(ssShift)) { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(0, 5); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(0, 5, true); // Æ÷ÀÎÆ® À̵¿ } else { if (VecDraw->NVector->bSelected && V_MainItem == 2) VecDraw->OnArrowKeyObjectMove(0, 1); // ¿ÀºêÁ§Æ® À̵¿ if (VecDraw->NVector->bSelected && V_MainItem == 3) VecDraw->OnArrowKeyPointMove(0, 1, true); // Æ÷ÀÎÆ® À̵¿ } break; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- case '1': // 1 switch(V_MainItem) { case 1: // Draw if (V_Item != M_D_LINE) sbLine->Click(); break; case 2: // Edit if (V_Item != M_O_EDIT) sbObjectEdit->Click(); break; case 3: // Point Edit if (V_Item != M_P_EDIT) sbDirectSelect->Click(); break; } break; case '2': switch(V_MainItem) { case 1: // Draw if (V_Item != M_D_CURVE) sbCurve->Click(); break; case 2: // Edit if (V_Item != M_O_MOVECOPY && sbMoveCopy->Enabled) sbMoveCopy->Click(); break; case 3: // Point Edit if (V_Item != M_P_CONVERTDIRECTION) sbConvertDirection->Click(); break; } break; case '3': switch(V_MainItem) { case 1: // Draw if (V_Item != M_D_FREEDRAW) sbFreeDraw->Click(); break; case 2: // Edit if (sbColor->Enabled) sbColor->Click(); break; case 3: // Point Edit if (V_Item != M_P_ADD) sbPointAdd->Click(); break; } break; case '4': switch(V_MainItem) { case 1: // Draw if (V_Item != M_D_RECT) sbRect->Click(); break; case 2: // Edit if (V_Item != M_O_PROPORTION && sbProportion->Enabled) sbProportion->Click(); break; case 3: // Point Edit if (V_Item != M_P_DELETE) sbPointDelete->Click(); break; } break; case '5': switch(V_MainItem) { case 1: // Draw if (V_Item != M_D_ELLIPSE) sbEllipse->Click(); break; case 2: // Edit if (V_Item != M_O_FILL && sbFill->Enabled) sbFill->Click(); break; case 3: // Point Edit if (V_Item != M_P_KNIFE) sbKnife->Click(); break; } break; case '6': // 6 switch(V_MainItem) { case 1: // Draw if (V_Item != M_D_NEWTEXT && sbNewTextEdit->Enabled) sbNewTextEdit->Click(); break; case 2: // Edit if (V_Item != M_O_ROTATION && sbRotation->Enabled) sbRotation->Click(); break; case 3: // Point Edit if (V_Item != M_P_IRREGULAR) sbVectorPointIrregular->Click(); break; } break; case '7': switch(V_MainItem) { case 1: // Draw if (sbPathColor->Enabled) sbPathColor->Click(); break; case 2: // Edit if (V_Item != M_O_ARRANGE && sbArrange->Enabled) sbArrange->Click(); break; case 3: // Point Edit if (V_Item != M_E_UNDOREDO) sbUndoRedo->Click(); break; } break; case '8': switch(V_MainItem) { case 1: // Draw break; case 2: // Edit break; case 3: // Point Edit break; } break; case '9': switch(V_MainItem) { case 1: // Draw break; case 2: // Edit break; case 3: // Point Edit break; } break; case '0': switch(V_MainItem) { case 1: // Draw break; case 2: // Edit break; case 3: // Point Edit break; } break; case 'Z': // Z Key if (!Shift.Contains(ssShift) && !Shift.Contains(ssCtrl) && !Shift.Contains (ssAlt)) VecDraw->bZKey = true; break; } if (V_MainItem == 1) { switch(Key) { case 'X': // X Key if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) VecDraw->NVector->bVectorMove = false; //line, curve µî ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇϰí shift + z(ÇÑÁ¡µÚ·Î)¸¦ ÀÌ¿ëÇØ¼­ ¸¶Áö¸·±îÁö //°£ÈÄ¿¡ x¸¦ ´­·¯ ¿ÀºêÁ§Æ®¸¦ ¾ø¾Ö¸é undosave¸¦ Çß´ø °ÍÀ» »èÁ¦ÇؾßÇÑ´Ù. //¿ÀºêÁ§Æ®°¡ »ý¼ºµÇ±â Àü¿¡ x¸¦ ´©¸£¸é ÇÒ Çʿ䰡 ¾ø´Ù. if (MainImageForm->V_DATA->Count > 0) { TVecData *tdata = (TVecData *)MainImageForm->V_DATA->Last(); if (tdata->nCount == 0) { TPVectorUndo * Undo = (TPVectorUndo *)MainImageForm->VecUndo; Undo->RemoveLast(); MainImageForm->V_DATA->Remove(tdata); delete tdata; tdata = NULL; } } //VecDraw->DeleteEmptyObject(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); } break; case VK_BACK: // Back Space Key btDeletePoint->Click(); break; } } else if (V_MainItem == 2) { switch(Key) { case VK_DELETE: // Delete Key if (V_Item != M_O_PROPORTION && V_Item != M_O_ROTATION) ObjectDelete(); break; case VK_LEFT: case VK_UP: case VK_RIGHT: case VK_DOWN: // if (!TextBox->Focused() && !ProportionPanel->Visible && !RotationPanel->Visible) // VecDraw->ArrowObjectMove(Key, false); break; case VK_RETURN: // by embakum º¤ÅͽºÇÁ·¹ÀÌ curve¸ðµå¿¡¼­ continuousÀÏ ¶§ enter۷εµ ½ÇÇà °¡´ÉÄÉ ¹ø°æ 080402 if (sbRun->Visible && sbRun->Enabled && sbSprayImage->Down) sbRunClick(this); break; case 187: // (Shift) + if (Shift.Contains(ssShift) && VecDraw->SpreadStep == 2) { VecDraw->SpreadGap++; MainImageForm->iMainImage->Repaint(); } break; case 107: // (KeyPad) + if (VecDraw->SpreadStep == 2) { VecDraw->SpreadGap++; MainImageForm->iMainImage->Repaint(); } break; case 189: // (Shift) - if (Shift.Contains(ssShift) && VecDraw->SpreadStep == 2) { VecDraw->SpreadGap--; MainImageForm->iMainImage->Repaint(); } break; case 109: // (KeyPad) - if (VecDraw->SpreadStep == 2) { VecDraw->SpreadGap--; MainImageForm->iMainImage->Repaint(); } break; } } else if (V_MainItem == 3) { switch(Key) { case VK_DELETE: // Delete Key ObjectDelete(); break; case VK_LEFT: case VK_UP: case VK_RIGHT: case VK_DOWN: // VecDraw->ArrowObjectMove(Key, true); break; } } /* if (Key == 'A' && Shift.Contains(ssCtrl)) { // Ctrl + A // Merge ModeÀÏ °æ¿ì Crtl + A °¡ µÇÁö ¾Êµµ·Ï ÇÑ´Ù - by monkman (2004.12.15) if (VecDraw->NVector->bProportion) { MainImageForm->iMainImage->Repaint(); return; } else if (VecDraw->NVector->bRotation) { MainImageForm->iMainImage->Repaint(); return; } else if (!VecDraw->NVector->bMergeMode && V_MainItem == 2) // } else if (!VecDraw->NVector->bMergeMode) VecDraw->SelectAll(); MainImageForm->iMainImage->Repaint(); UpdateForm(); } else */ // if (Key == 'Z' && Shift.Contains(ssCtrl)) { // Ctrl + Z // btUndo->Click(); // } else if (Key == 'Y' && Shift.Contains(ssCtrl)) { // Ctrl + Y // btRedo->Click(); // } /* if (Key == 'c' && Shift.Contains(ssCtrl)) { VecDraw->InitCopy(false); } else if (Key == 'x' && Shift.Contains(ssCtrl)) { VecDraw->InitCopy(true); } else if (Key == 'v' && Shift.Contains(ssCtrl)) { VecDraw->InitPaste(); } */ // } else if (Key == '[' && Shift.Contains(ssCtrl)) { // Ctrl + [ // PopupBackward->Click(); // } else if (Key == ']' && Shift.Contains(ssCtrl)) { // Ctrl + ] // PopupForward->Click(); } // --------------------------------------------------------------------------- // bShift°¡ private¿¡ ¼±¾ðµÇ¾î À־ ¸¸µé¾ú´Ù. by maxleo21c (04.11.27) bool __fastcall TVectorForm::isShiftKeyDownState() { return VecDraw->bShiftState; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageKeyUp(WORD Key, TShiftState Shift) { if (Key == VK_SHIFT) { if (V_Item == M_D_SQUARE) { if (m_IsChangedItemByShift == true) mnitmSquareClick(mnitmRectangle); } else if (V_Item == M_D_CIRCLE) { if (m_IsChangedItemByShift == true) mnitmSquareClick(mnitmEllipse); } m_IsChangedItemByShift = false; VecDraw->bShiftState = false; } if (Shift.Contains(ssAlt) == false) { VecDraw->bAltState = false; } switch(Key) { case 'Q': // case 113: // PointEdit Toggle ModeÀÎÁö if (VecDraw->bPointModeState) { VecDraw->bPointModeState = false; sbObjectEdit->Click(); } break; case 'Z': if (!Shift.Contains(ssShift) && !Shift.Contains(ssCtrl) && !Shift.Contains (ssAlt)) VecDraw->bZKey = false; break; case 'J': // 2009 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - 'J'۸¦ ´­·¶À» ¶§ Ä¿¼­¸¦ º¯°æÇÑ´Ù - by monkman (2009.11.27) if (VecDraw->bJKeyState == true) MainImageForm->iMainImage->Cursor = crDefault; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- VecDraw->bJKeyState = false; break; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitIrregular() { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ÃʱâÈ­ if (IrregularPointList) { // ±âÁ¸ÀÇ ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ®°¡ ÀÖ´Ù¸é ExitIrregular(); // ¿Ã°¡¹Ì¸¦ ÇØÁ¦Çϸ鼭 ºñ¿ì°í } IrregularPointList = new TList; // »õ·Î¿î ¿Ã°¡¹Ì Æ÷ÀÎÆ®¸®½ºÆ®¸¦ ¸¸µç´Ù // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ExitIrregular() { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì Á¾·á ResetPointList(); // Æ÷ÀÎÆ® ¸®½ºÆ®¸¦ ºñ¿ì°í bIrregularDraw = false; // ±×¸®´Â ´Ü°è°¡ ¾Æ´Ô if (IrregularPointList) delete IrregularPointList; // Æ÷ÀÎÆ® ¸®½ºÆ® Áö¿î´Ù IrregularPointList = NULL; // Æ÷ÀÎÆ® ¸®½ºÆ®ÀÇ ÁÖ¼Ò°ªÀº NULL·Î.. // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::IrregularMouseDown(TMouseButton Button, TShiftState Shift, double X, double Y) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ùÁ¡ if (Button == mbLeft) { IrregularPoint.x = X; IrregularPoint.y = Y; InitIrregular(); PushPointList(false, IrregularPoint); // ùÁ¡À» ³Ö´Â´Ù bIrregularDraw = true; // ÀÌÁ¦ºÎÅÍ ±×¸®´Â »óÅ } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::IrregularMouseMove(TShiftState Shift, double X, double Y) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ® ÀÔ·Â ¹× ¿Ã°¡¹Ì ±×¸®±â if (bIrregularDraw) { // ±×¸®´Â ÁßÀÎÁö È®ÀÎÇϰí if (Shift.Contains(ssLeft)) { // ¿ÞÂÊ ¸¶¿ì½º ¹öưÀ϶§¸¸ ±×¸°´Ù IrregularPoint.x = X; IrregularPoint.y = Y; PushPointList(false, IrregularPoint); PaintIrregular(); } } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::IrregularMouseUp(TShiftState Shift, double X, double Y, bool bPoint) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì¸¦ Âü°íÇÏ¿© º¤ÅÍ ¿ÀºêÁ§Æ® ¼±ÅÃÇÏ±â ¹× ¿Ã°¡¹Ì ÇØÁ¦ // IrregularState (0:¿Ã°¡¹Ì¸¸ ¼±Åà 1:±âÁ¸ ¿µ¿ª¿¡ ¿Ã°¡¹Ì ¿µ¿ªÀ» Ãß°¡ 2:±âÁ¸ ¿µ¿ª¿¡¼­ ¿Ã°¡¹Ì ¿µ¿ªÀ» Á¦°Å) // bPoint (true:Object¸¦ Point´ÜÀ§·Î ¼±Åà false:Object ´ÜÀ§·Î ¼±ÅÃ) if (Shift.Contains(ssShift)) { // ±âÁ¸ ¼±Åà ¿µ¿ª¿¡ ¿Ã°¡¹Ì°¡ ¼±ÅÃÇÑ ¿µ¿ªÀ» Ãß°¡ÇÒ ¶§ IrregularClose(1, bPoint); } else if (Shift.Contains(ssAlt)) { // ±âÁ¸ ¼±Åà ¿µ¿ª¿¡¼­ ¿Ã°¡¹Ì°¡ ¼±ÅÃÇÑ ¿µ¿ªÀ» Á¦°ÅÇÒ ¶§ IrregularClose(2, bPoint); } else { // ¿Ã°¡¹Ì ¿µ¿ª¸¸ ¼±ÅÃÇÒ ¶§ IrregularClose(0, bPoint); } ExitIrregular(); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::IrregularClose(short IrregularState, bool bPoint) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ´Ý±â // IrregularState (0:¿Ã°¡¹Ì¸¸ ¼±Åà 1:±âÁ¸ ¿µ¿ª¿¡ ¿Ã°¡¹Ì ¿µ¿ªÀ» Ãß°¡ 2:±âÁ¸ ¿µ¿ª¿¡¼­ ¿Ã°¡¹Ì ¿µ¿ªÀ» Á¦°Å) // bPoint (true:Object¸¦ Point´ÜÀ§·Î ¼±Åà false:Object ´ÜÀ§·Î ¼±ÅÃ) if (bIrregularDraw && IrregularPointList) { SetRegionToObjectSelect(IrregularState, bPoint); // ¿©±â¼­ ¿µ¿ªÀÌ ¼±Åõȴ٠if (MainImageForm) MainImageForm->iMainImage->Repaint(); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ResetPointList() { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ® ºñ¿ì±â DPOINT *dp = NULL; if (IrregularPointList) { while (IrregularPointList->Count > 0) { dp = (DPOINT*)IrregularPointList->Last(); IrregularPointList->Remove(dp); delete dp; dp = NULL; } } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- bool __fastcall TVectorForm::PushPointList(bool curve, DPOINT pos) { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ®¿¡ Æ÷ÀÎÆ® Çϳª ÀÔ·Â DPOINT *dp = NULL; if ((dp = new DPOINT) == NULL) return false; dp->x = pos.x; dp->y = pos.y; IrregularPointList->Add(dp); return true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopPointList() { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ®¿¡ Æ÷ÀÎÆ® Çϳª Á¦°Å DPOINT *dp = NULL; dp = (DPOINT*)IrregularPointList->Last(); IrregularPointList->Remove(dp); delete dp; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::SetRegionToObjectSelect(short IrregularState, bool bPoint) { BEGIN_LOG(""); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ®¸¦ ÂüÁ¶ÇÏ¿© º¤ÅÍ ¿ÀºêÁ§Æ® ¼±ÅÃÇϱâ // Bitmap Region pBITMAPHANDLE bh; RGNXFORM XForm; HRGN rgnSrc; HDC dc; DPOINT *dp; TPoint pt[3]; XForm.uViewPerspective = TOP_LEFT; XForm.nXScalarNum = 1; XForm.nXScalarDen = 1; XForm.nYScalarNum = 1; XForm.nYScalarDen = 1; XForm.nXOffset = 0; XForm.nYOffset = 0; dc = GetDC(hWnd); // 0); //shin 070327 Vista¿¡¼± GetDC(NULL)ÇÏ¸é ¾ÈµÊ. (¾Æ¹« DC³ª ¸¸µé¾îÁÖ¸é ´Ù µÊ) if (dc) { BeginPath(dc); dp = (DPOINT*)IrregularPointList->First(); pt[2].x = (int)(dp->x + 0.5); pt[2].y = (int)(dp->y + 0.5); MoveToEx(dc, pt[2].x, pt[2].y, NULL); if (IrregularPointList->Count > 1) { for (int i = 1; i <= IrregularPointList->Count - 1; i++) { dp = (DPOINT*)IrregularPointList->Items[i]; pt[2].x = (int)(dp->x + 0.5); pt[2].y = (int)(dp->y + 0.5); LineTo(dc, pt[2].x, pt[2].y); } } CloseFigure(dc); EndPath(dc); rgnSrc = PathToRegion(dc); // ¿Ã°¡¹Ì ÁÂÇ¥ Æ÷ÀÎÆ®¸®½ºÆ®¸¦ ÂüÁ¶ÇÏ¿© º¤ÅÍ ¿ÀºêÁ§Æ® ¼±ÅÃÇϱâ - by monkman (2005.02.04) // IrregularState (0:¿Ã°¡¹Ì¸¸ ¼±Åà 1:±âÁ¸ ¿µ¿ª¿¡ ¿Ã°¡¹Ì ¿µ¿ªÀ» Ãß°¡ 2:±âÁ¸ ¿µ¿ª¿¡¼­ ¿Ã°¡¹Ì ¿µ¿ªÀ» Á¦°Å) // bPoint (true:Object¸¦ Point´ÜÀ§·Î ¼±Åà false:Object ´ÜÀ§·Î ¼±ÅÃ) VecDraw->RegionToObjectSelect(&rgnSrc, IrregularState, bPoint); ReleaseDC(0, dc); DeleteObject(rgnSrc); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PaintIrregular() { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¿Ã°¡¹Ì ±×·ÁÁÖ´Â ÇÔ¼ö (RePaint ¿ªÇÒ) HPEN hOldPen = NULL, hPen = NULL; HBRUSH hOldBrush = NULL; int nDrawMode; HDC dcDst = MainImageForm->iMainImage->Canvas->Handle; int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; int PositionX = MainImageForm->sbHorz->Position; int PositionY = MainImageForm->sbVert->Position; TPoint pt[3]; DPOINT *dp; if (bIrregularDraw) { // ±×¸®´Â ÁßÀÎÁö È®ÀÎÇϰí hPen = CreatePen(PS_DOT, 1, clBlack); hOldPen = (HPEN)SelectObject(dcDst, hPen); nDrawMode = GetROP2(dcDst); SetROP2(dcDst, R2_COPYPEN); hOldBrush = (HBRUSH)SelectObject(dcDst, GetStockObject(NULL_BRUSH)); dp = (DPOINT*)IrregularPointList->First(); pt[2].x = ((int)(dp->x + 0.5) - PositionX) * ZoomIn / ZoomOut; pt[2].y = ((int)(dp->y + 0.5) - PositionY) * ZoomIn / ZoomOut; MoveToEx(dcDst, pt[2].x, pt[2].y, NULL); if (IrregularPointList->Count > 1) { for (int i = 1; i <= IrregularPointList->Count - 1; i++) { dp = (DPOINT*)IrregularPointList->Items[i]; pt[2].x = ((int)(dp->x + 0.5) - PositionX) * ZoomIn / ZoomOut; pt[2].y = ((int)(dp->y + 0.5) - PositionY) * ZoomIn / ZoomOut; LineTo(dcDst, pt[2].x, pt[2].y); } } SetROP2(dcDst, nDrawMode); SelectObject(dcDst, hOldPen); SelectObject(dcDst, hOldBrush); DeleteObject(hPen); hPen = NULL; } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbColorFillClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } pnColorFill->BringToFront(); // VecDraw->ChangeObjectColor(true); if (VecDraw->NVector->bPatternMode) { VecDraw->NVector->bPatternMode = false; MainImageForm->iMainImage->Repaint(); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btFrontClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->ChangeObjectOrder(true, false); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btBackClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->ChangeObjectOrder(false, false); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btCopyClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (!(VecDraw->NVector->bMergeMode)) { if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->MoveCopyVectorObject(false, 0); // ÇöÀç º¹»ç ÁßÀÎ »óÅÂÀÎÁö À̵¿ ÁßÀÎ »óÅÂÀÎÁö¸¦ ¾Ë·ÁÁÖ´Â º¯¼ö - by monkman (2005.08.03) nMoveCopy = 2; } // // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) // if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // if (!(VecDraw->NVector->bSelected)) return; // // VecDraw->MoveCopyVectorObject(false, 0); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ObjectDelete() { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!VecDraw->NVector->bSelected) { END_LOG; return; } VecDraw->DeleteVectorObject(); UpdateForm(); NVector->bTextState = false; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btColorChangeClick(TObject *Sender) { // »ö ¹Ù²Ù±â Ãß°¡ - by monkman (2005.05.31) VecDraw->ChangeObjectColor(false); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbPathColorClick(TObject *Sender) { TRzMenuToolbarButton *s = (TRzMenuToolbarButton*)Sender; V_MainItem = 1; V_Item = s->Tag; // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // bOutline Ãß°¡ (2008. 01. 11 Annualring) /* if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation || VecDraw->NVector->bOutline) { VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; } */ if (ColorDialog1->Execute()) VecDraw->PathColor = ColorDialog1->Color; MainImageForm->iMainImage->Repaint(); if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::UDPenClick(TObject *Sender, TUDBtnType Button) { /* if (*bMultiSelect) { if (Button == Comctrls::btNext) VecDraw->ChangeObjectThick(1, true); else if (Button == Comctrls::btPrev) VecDraw->ChangeObjectThick(-1, true); }else { PenThick = UDPen->Position; VecDraw->ChangeObjectThick(PenThick, false); lblPenThick->Caption = StringPenThick+ " " + IntToStr(PenThick); } */ } // --------------------------------------------------------------------------- /* void __fastcall TVectorForm::FunctionClick(TObject *Sender) { TSpeedButton *speedbutton = (TSpeedButton *)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down //shDrawingTool->Pen->Color = clBlack; shObjectEdit->Brush->Color = clBlack; shObjectEdit->Pen->Color = clBlack; //shPointEdit->Pen->Color = clBlack; shNewTextEdit->Brush->Color = clBlack; shNewTextEdit->Pen->Color = clBlack; shUndoRedo->Brush->Color = clBlack; shUndoRedo->Pen->Color = clBlack; switch (speedbutton->Tag) { case 1: // Drawing VecDraw->NVector->bSelected = false; // 2005 Vector Upgrade shin 0315 PenStyleComboBox->ItemIndex = 0; PenStyle = P_SOLID; CapStyle[0] = 0; CapStyle[1] = 0; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; eData1->Text = "0"; eData2->Text = "0"; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- break; // case 4: // Text Mode // VecDraw->NVector->bSelected = false; // *bTextState = false; // // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) // // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // break; case 2: // Object Edit if (V_MainItem == 2){ shObjectEdit->Brush->Color = clLime; shObjectEdit->Pen->Color = clGreen; } else { shObjectEdit->Brush->Color = clBlack; shObjectEdit->Pen->Color = clBlack; } // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- break; case 3: // Point Edit // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- break; case 4: // New Text Edit by maxleo21c (2004.10.19) if (sbNewTextEdit->Down){ shNewTextEdit->Brush->Color = clLime; shNewTextEdit->Pen->Color = clGreen; } else { shNewTextEdit->Brush->Color = clBlack; shNewTextEdit->Pen->Color = clBlack; } VecDraw->NVector->bSelected = false; VecDraw->ExistSelected = false; *bTextState = false; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- break; case 6: if (V_Item == M_E_UNDOREDO){ shUndoRedo->Brush->Color = clLime; shUndoRedo->Pen->Color = clGreen; } else { shUndoRedo->Brush->Color = clBlack; shUndoRedo->Pen->Color = clBlack; } VecDraw->NVector->bSelected = false; // 2005 Vector Upgrade shin 0315 // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- break; } if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); V_MainItem = speedbutton->Tag; *step = 0; UpdateForm(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); VecDraw->NVector->bFstLine = true; } */ // --------------------------------------------------------------------------- void __fastcall TVectorForm::EditPenStyleBoxChange(TObject *Sender) // 2005 Vector Upgrade 0315 Shin { // } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbPatternFillClick(TObject *Sender) { // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) return; if (!MainImageForm->WorkArea->Mask) return; EditPanel->Visible = false; PatternPanel->Visible = true; pnPatternFill->BringToFront(); // shin 080401 pnPatternFill->Visible = true; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + PatternPanel->Height; // Parent->Height = ParentHeight+ClientHeight; ePatternX->Value = 100; ePatternY->Value = 100; ePatternAngle->Value = 0; cbPatternSize->Checked = false; cbPatternAngle->Checked = false; VecDraw->InitPatternFill(ePatternX->IntValue, ePatternY->IntValue, ePatternAngle->IntValue); VecDraw->NVector->bPatternMode = true; VecDraw->NVector->PatternStep = 4; // 4 : Ŭ¸¯Çϸé ä¿öÁö´Â »óÅ 3: ȸÀü»óÅ 1: Å©±âÁ¶Á¤»óÅ // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::DrawClick(TObject *Sender) { VecDraw->NVector->bSelected = false; NVector->bUserInput = false; // 2005 Vector upgrade shin 0315 NVector->bUserLength1 = false; NVector->bUserLength2 = false; TRzMenuToolbarButton *s = NULL; s = (TRzMenuToolbarButton*)Sender; s->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down if (V_Item == s->Tag) { // °°Àº°ÍÀ» Click½Ã¿¡´Â ¼±²÷¾îÁÖ±â if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } } else if ((V_Item == M_D_LINE && s->Tag == M_D_CURVE) || (V_Item == M_D_CURVE && s->Tag == M_D_LINE)) { // Á÷¼±->°î¼±, °î¼±->Á÷¼± (Object¸¦ ²÷Áö ¾Ê´Â´Ù) if (NVector->step == 2) NVector->step = 1; // °î¼±¿¡¼­ Á÷¼±À¸·Î ¿Å°Ü°¡´Â °æ¿ì if (s->Tag == M_D_LINE && LineType == 3) { // Á÷¼±¿¡´Â Continous Tangent°¡ ÀÖÀ»¼ö ¾øÀ¸¹Ç·Î LineType = 1; } if (s->Tag == M_D_LINE && LineType == 2) { cbFill->Enabled = false; // 2005 Vector upgrade 0315 shin } else { cbFill->Enabled = true; } } else { // º¤ÅÍ ³»ÀÇ ´Ù¸¥ ¸Þ´º¿¡ °¬´Ù¿Íµµ ¶óÀΠŸÀÔÀ» ÃʱâÈ­½ÃŰÁö ¸»¾Æ´Þ¶ó´Â µðÀÚÀÎ½Ç ¿ä±¸»çÇ× - by monkman (2005.08.03) // LineType = 1; // lblType->Caption = IDS_CONTINUOUSLINE; if (s->Tag == M_D_LINE) { if (LineType == 3) { // Á÷¼±Àº coutinous curve°¡ ¾ø´Ù - by monkman (2007.03.21) LineType = 1; } if (LineType == 1) { cbFill->Enabled = true; } else { cbFill->Enabled = false; } } else if (s->Tag == M_D_CURVE) { if (LineType == 1 || LineType == 3) { cbFill->Enabled = true; } else if (LineType == 2) { cbFill->Enabled = true; } else { cbFill->Enabled = false; } } else { cbFill->Enabled = true; } NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } // @jhs - Edit Pen -> Draw Pen 2016.12.15 if( V_Item == M_O_EDIT) { if (PenStyleComboBox->ItemIndex == 5) { CapStyle[0] = 1; CapStyle[1] = 0; PenStyle = 0; eSetD_0->Text = ""; eSetD_1->Text = ""; eSetD_2->Text = ""; eSetD_3->Text = ""; eSetD_4->Text = ""; eSetD_5->Text = ""; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; pnArrow->Visible = true; cbArrowFill->Enabled = true; Label11->Enabled = false; rzspCapLine->Enabled = false; bFillLineCap = cbArrowFill->Checked; bShowArrowBoth = cbArrowBoth->Checked; LineCapWidthScale = rzspCapWidthScale->Value; LineCapWidth = rzspCapWidth->Value; LineCapHeight = rzspCapHeight->Value; LineCapLine = rzspCapLine->Value; } else if (PenStyleComboBox->ItemIndex == 6) { //²÷¾îÁø ¼± LineType = 2; cbFill->Enabled = false; rzbtnLType->Hint = IDS_SEPARATELINE; ChangeLTypeImg(); //¾ç¹æÇâ È­»ìÇ¥ bArrowBoth_measure = true; CapStyle[0] = 2; CapStyle[1] = 2; PenStyle = 0; eSetD_0->Text = ""; eSetD_1->Text = ""; eSetD_2->Text = ""; eSetD_3->Text = ""; eSetD_4->Text = ""; eSetD_5->Text = ""; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; pnArrow->Visible = true; cbArrowFill->Enabled = false; Label11->Enabled = true; rzspCapLine->Enabled = true; bFillLineCap = cbArrowFill->Checked; bShowArrowBoth = cbArrowBoth->Checked; LineCapWidthScale = rzspCapWidthScale->Value; LineCapWidth = rzspCapWidth->Value; LineCapHeight = rzspCapHeight->Value; LineCapLine = rzspCapLine->Value; } else { CapStyle[0] = 0; CapStyle[1] = 0; PenStyle = PenStyleComboBox->ItemIndex; DrawSetDashPattern(VectorForm->DrawingThick); } } eData1->Value = 0; // 2005 Vector upgrade 0315 shin eData2->Value = 0; V_MainItem = 1; V_Item = s->Tag; // PenStyleComboBox->ItemIndex = 0; // PenStyle = P_SOLID; // CapStyle[0] = 0; // CapStyle[1] = 0; // eSetD_0->Visible = false; // eSetD_1->Visible = false; // eSetD_2->Visible = false; // eSetD_3->Visible = false; // eSetD_4->Visible = false; // eSetD_5->Visible = false; // stSet1_d->Visible = false; // stSet1_g->Visible = false; // stSet2_d->Visible = false; // stSet2_g->Visible = false; // stSet3_d->Visible = false; // stSet3_g->Visible = false; VectorMenuCurrentPanel(); VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; switch(V_Item) { case M_D_LINE: // Line rzbtnLType->Visible = true; lbData1->Caption = IDS_NLENGTH; // 2005 Vector upgrade shin 0315 tdw //by lhskys (2005.05.19) lbData2->Caption = IDS_NANGLE; // by lhskys (2005.05.19) lbData2->Enabled = true; eData2->Enabled = true; mnitmTangent->Visible = false; ChangeLTypeImg(); break; case M_D_CURVE: // Curve rzbtnLType->Visible = true; lbData1->Caption = IDS_NLENGTH; // 2005 Vector upgrade shin 0315 tdw lbData2->Caption = IDS_NANGLE; // by lhskys (2005.05.19) lbData2->Enabled = false; btTemp->SetFocus(); eData2->Enabled = false; mnitmTangent->Visible = true; ChangeLTypeImg(); break; case M_D_SQUARE: // Square case M_D_RECT: // Rectangle rzbtnLType->Visible = false; VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; lbData1->Caption = IDS_NWIDTH; // 2005 Vector upgrade shin 0315 tdw lbData2->Caption = IDS_NHEIGHT; // by lhskys (2005.05.19) lbData2->Enabled = true; eData2->Enabled = true; break; case M_D_CIRCLE: // Circle case M_D_ELLIPSE: // Ellipse rzbtnLType->Visible = false; VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; lbData1->Caption = IDS_NWIDTH; // 2005 Vector upgrade shin 0315 tdw lbData2->Caption = IDS_NHEIGHT; // by lhskys (2005.05.19) lbData2->Enabled = true; eData2->Enabled = true; break; case M_D_FREEDRAW: rzbtnLType->Visible = false; break; } MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // HotKey Ȱ¼ºÈ­ - by monkman (2010.07.06) MainMenuForm->UseEditFunction = false; // by maxleo21c (2004.08.06) NVector->bTextState = false; VecDraw->BeReadyEdit = false; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbNewTextEditClick(TObject *Sender) { TRzMenuToolbarButton *s = (TRzMenuToolbarButton*)Sender; s->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 1; V_Item = s->Tag; VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; // New Text Edit by maxleo21c (2004.10.19) VecDraw->NVector->bSelected = false; VecDraw->ExistSelected = false; NVector->bTextState = false; if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) VectorMenuCurrentPanel(); UpdateForm(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); VecDraw->NVector->bFstLine = true; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; if (SprayOnceEnabled) WriteIni_Spray(); ReadIni_Text(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 TextOnceEnabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PointMenuClick(TObject *Sender) { TRzMenuToolbarButton *s = NULL; s = (TRzMenuToolbarButton*)Sender; s->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 3; V_Item = s->Tag; // VectorForm->V_Item VectorMenuCurrentPanel(); // bOutline Ãß°¡ (2008. 01. 11 Annualring) if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation /* || VecDraw->NVector->bOutline */ ) { VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; MainImageForm->iMainImage->Repaint(); } if (NVector->step != 0) { MainImageForm->iMainImage->Repaint(); NVector->step = 0; VecDraw->NVector->bFstLine = true; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbUndoRedoClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 3; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); VecDraw->NVector->bSelected = false; // 2005 Vector Upgrade shin 0315 // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); NVector->step = 0; UpdateForm(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); VecDraw->NVector->bFstLine = true; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbProportionClick(TObject *Sender) { TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (VecDraw->NVector->bRotation) { VecDraw->NVector->bRotation = false; MainImageForm->iMainImage->Repaint(); } if (!(VecDraw->NVector->bSelected)) return; eXSize->Value = 100; eYSize->Value = 100; MainImageForm->iMainImage->bVectorModify = true; VecDraw->InitProportion(); VecDraw->NVector->bProportion = true; if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btProportionRunClick(TObject *Sender) { BEGIN_LOG(""); // Proportion Run // VecDraw->ObjectProportion(eXSize->Text.ToInt(), eYSize->Text.ToInt()); VecDraw->ObjectProportion(eXSize->Value, eYSize->Value); // 2005 Vector upgrade Shin 0315 int ->double MainImageForm->iMainImage->bVectorModify = false; MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eXSizeClick(TObject *Sender) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eXSizeKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) eYSize->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eYSizeKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) btProportionRun->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btProportionResetClick(TObject *Sender) { BEGIN_LOG(""); eXSize->Value = 100; eYSize->Value = 100; VecDraw->ratiox = 1.0; VecDraw->ratioy = 1.0; MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eAngleKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) btRotationRun->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btRotationRunClick(TObject *Sender) { // Rotation Run BEGIN_LOG(""); VecDraw->ObjectRotation(true, eAngle->Value); MainImageForm->iMainImage->bVectorModify = false; MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::mGroup1Click(TObject *Sender) { BEGIN_LOG(""); if (!VecDraw->NVector->bSelected) { ShowMessage(IDS_OBJECTNOTSELECTED); // ShowMessage(String("Object(s) not selected")); // ShowMessage(String("¿ÀºêÁ§Æ®°¡ ¼±ÅõÇÁö ¾Ê¾Ò½À´Ï´Ù.")); END_LOG; return; } TMenuItem *s = (TMenuItem*)Sender; VecDraw->MakeGroup(s->Tag); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sGroup1Click(TObject *Sender) { BEGIN_LOG(""); TMenuItem *s = (TMenuItem*)Sender; VecDraw->SelectGroup(s->Tag); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btUndoClick(TObject *Sender) { BEGIN_LOG(""); if (VecDraw->NVector->bMergeMode) { END_LOG; return; } NVector->step = 0; VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; VecDraw->NVector->bFstLine = true; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) VecDraw->UndoRead(); FullViewForm->InitForm(MainImageForm->iMainImage); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btRedoClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; if (VecDraw->NVector->bMergeMode) { END_LOG; return; } VecDraw->RedoRead(); FullViewForm->InitForm(MainImageForm->iMainImage); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btDeletePointClick(TObject *Sender) { BEGIN_LOG(""); if (NVector->step == 0) { END_LOG; return; } VecDraw->PointBack(NVector->Lsx, NVector->Lsy); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbRotationClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (VecDraw->NVector->bProportion) { VecDraw->NVector->bProportion = false; MainImageForm->iMainImage->Repaint(); } // bOutline Ãß°¡ (2008. 01. 11 Annualring) /* if (VecDraw->NVector->bOutline) { VecDraw->NVector->bOutline= false; MainImageForm->iMainImage->Repaint(); } */ if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } MainImageForm->iMainImage->bVectorModify = true; eAngle->Value = 0; VecDraw->InitProportion(); VecDraw->NVector->bRotation = true; if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupCopyClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->InitCopy(false); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupCutClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->InitCopy(true); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupPasteClick(TObject *Sender) { BEGIN_LOG(""); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // Clip Board PasteÀ϶§ ¿ÀºêÁ§Æ® ÆíÁý ¸Þ´º·Î - by monkman (2005.05.26) VectorMenuButtonOff(); sbObjectEdit->Down = true; V_MainItem = 2; V_Item = M_O_EDIT; VecDraw->NVector->bFstLine = true; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) VectorMenuCurrentPanel(); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- VecDraw->InitPaste(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ReverseCopyClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->InitReverse(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupJoinClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->InitJoin(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::MergePosition(int X, int Y, bool paint, bool isspray) { BEGIN_LOG(""); TList *DataList = NVector->DataList; TVecData *data; RECT range = VecDraw->PasteRange, rc; int width = range.right - range.left, height = range.bottom - range.top; int pt = VecDraw->MaxThick; double childwidth = 0, childheight = 0; VecDraw->SetMergePosition(X, Y, range, paint, isspray); // Vector¿¡¼­µµ Merge int cx = X, cy = Y; TRect rect; // Motive°¡ ÀÖ´Â °æ¿ì rect size¸¦ °è»êÇØ¾ß ÇÑ´Ù. for (int i = 0; i < DataList->Count; i++) { data = (TVecData*)DataList->Items[i]; if (!data->bSelected) continue; VecDraw->GetRectForMouseMove(data, rect); } // if (width < rect.Width()) width = rect.Width(); // if (height < rect.Height()) width = rect.Height(); // if (VecDraw->bZKey && V_MainItem == 2 && V_Item == M_O_MOVECOPY) { //MoveCopy Mode // if (abs(VecDraw->MergeX) > abs(VecDraw->MergeY)) { //XÃà À̵¿ // VecDraw->MergeY = 0; // } // else {//YÃà À̵¿ // VecDraw->MergeX = 0; // } // } if (X < (width / 2)) cx = width / 2; if (Y < (height / 2)) cy = height / 2; if (X > (MainImageForm->iMainImage->uBitmap->Width - width / 2)) cx = MainImageForm->iMainImage->uBitmap->Width - width / 2; if (Y > (MainImageForm->iMainImage->uBitmap->Height - height / 2)) cy = MainImageForm->iMainImage->uBitmap->Height - height / 2; /* rc.left = (paintrect->left < cx - width/2) ? (paintrect->left -pt*2) : (cx - width/2 -pt*2); rc.top = (paintrect->top < cy - height/2) ? (paintrect->top -pt*2) : (cy - height/2 -pt*2); rc.right = (paintrect->right > cx + width/2) ? (paintrect->right +pt*2) : (cx + width/2 +pt*2); rc.bottom = (paintrect->bottom > cy + height/2) ? (paintrect->bottom +pt*2) : (cy + height/2 +pt*2); */ rc.left = (NVector->paintrect.left < cx - width / 2) ? (NVector->paintrect.left - pt * 2 - rect.Width()) : (cx - width / 2 - pt * 2 - rect.Width()); rc.top = (NVector->paintrect.top < cy - height / 2) ? (NVector->paintrect.top - pt * 2 - rect.Height()) : (cy - height / 2 - pt * 2 - rect.Height()); rc.right = (NVector->paintrect.right > cx + width / 2) ? (NVector->paintrect.right + pt * 2 + rect.Width()) : (cx + width / 2 + pt * 2 + rect.Width()); rc.bottom = (NVector->paintrect.bottom > cy + height / 2) ? (NVector->paintrect.bottom + pt * 2 + rect.Height()) : (cy + height / 2 + pt * 2 + rect.Height()); if (MainImageForm->iMainImage->uBitmap->Height < height * 2 || MainImageForm->iMainImage->uBitmap->Width < width * 2) MainImageForm->iMainImage->Repaint(); else { // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É °ü·Ã - ¹ÝÀü °Å¿ïÀÇ º¤ÅÍ ¿µ¿ªÀ» °°ÀÌ ±¸ÇÑ´Ù - by monkman(2005.03.16) if (NVector->bVectorReflectionMode) { VecDraw->GetRealAndReflectionRect(&rc); } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // 0º¸´Ù ÀÛÀº °æ¿ì 0À¸·Î ó¸® - by monkman (2009.04.27) if (rc.left < 0) rc.left = 0; if (rc.top < 0) rc.top = 0; if (rc.right < 0) rc.right = 0; if (rc.bottom < 0) rc.bottom = 0; MainImageForm->iMainImage->RectPaint(rc); NVector->paintrect = Rect(cx - width / 2, cy - height / 2, cx + width / 2, cy + height / 2); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::SpreadPosition(int X, int Y, bool paint) { RECT range = VecDraw->PasteRange, rc; int cx = X, cy = Y; int width = range.right - range.left, height = range.bottom - range.top; int pt = VecDraw->MaxThick; if (X < width / 2) cx = width / 2; if (Y < height / 2) cy = height / 2; if (X > MainImageForm->iMainImage->uBitmap->Width - width / 2) cx = MainImageForm->iMainImage->uBitmap->Width - width / 2; if (Y > MainImageForm->iMainImage->uBitmap->Height - height / 2) cy = MainImageForm->iMainImage->uBitmap->Height - height / 2; if (VecDraw->SpreadStep == 1 && !paint) VecDraw->SpreadStep++; else if (VecDraw->SpreadStep == 2 && !paint) { VecDraw->AddSpreadObject(); VecDraw->SpreadStep = 0; MainImageForm->iMainImage->Repaint(); return; } switch(VecDraw->SpreadStep) { case 1: rc.left = NVector->paintrect.left < cx - width / 2 ? NVector->paintrect.left - pt * 2 : cx - width / 2 - pt * 2; rc.top = NVector->paintrect.top < cy - height / 2 ? NVector->paintrect.top - pt * 2 : cy - height / 2 - pt * 2; rc.right = NVector->paintrect.right > cx + width / 2 ? NVector->paintrect.right + pt * 2 : cx + width / 2 + pt * 2; rc.bottom = NVector->paintrect.bottom > cy + height / 2 ? NVector->paintrect.bottom + pt * 2 : cy + height / 2 + pt * 2; break; case 2: RECT temp = Rect((NVector->Lex) - width / 2, (NVector->Ley) - height / 2, (NVector->Lex) + width / 2, (NVector->Ley) + height / 2); UnionRect(&(NVector->paintrect), &(NVector->paintrect), &temp); rc.left = NVector->paintrect.left < cx - width / 2 ? NVector->paintrect.left - pt * 5 : cx - width / 2 - pt * 5; rc.top = NVector->paintrect.top < cy - height / 2 ? NVector->paintrect.top - pt * 5 : cy - height / 2 - pt * 5; rc.right = NVector->paintrect.right > cx + width / 2 ? NVector->paintrect.right + pt * 5 : cx + width / 2 + pt * 5; rc.bottom = NVector->paintrect.bottom > cy + height / 2 ? NVector->paintrect.bottom + pt * 5 : cy + height / 2 + pt * 5; break; } MainImageForm->iMainImage->RectPaint(rc); NVector->paintrect = Rect(cx - width / 2, cy - height / 2, cx + width / 2, cy + height / 2); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PatternPosition(int X, int Y) { RECT rc, src = MainImageForm->WorkArea->Range; double angle; int r; switch(VecDraw->NVector->PatternStep) { case 1: rc.left = src.left - 10; rc.top = src.top - 10; rc.right = src.left + max(abs(src.left - (NVector->Cux)), abs(src.left - (NVector->Cux2))) + 10; rc.bottom = src.top + max(abs(src.top - (NVector->Cuy)), abs(src.top - (NVector->Cuy2))) + 10; ePatternX->Value = 100 * abs(src.left - (NVector->Cux)) / (src.right - src.left); ePatternY->Value = 100 * abs(src.top - (NVector->Cuy)) / (src.bottom - src.top); break; case 2: rc.left = min(NVector->Cux, NVector->Cux2) - VecDraw->SubBitmap->Width / 2 - 10; rc.top = min(NVector->Cuy, NVector->Cuy2) - VecDraw->SubBitmap->Height / 2 - 10; rc.right = max(NVector->Cux, NVector->Cux2) + VecDraw->SubBitmap->Width / 2 + 10; rc.bottom = max(NVector->Cuy, NVector->Cuy2) + VecDraw->SubBitmap->Height / 2 + 10; break; case 3: angle = ArcTan2(double((NVector->Cux) - (NVector->Lex)), double((NVector->Ley) - (NVector->Cuy))); ePatternAngle->Value = angle > 0 ? int(angle * 180 / M_PI) : int (angle * 180 / M_PI + 360); r = sqrt(VecDraw->SubBitmap->Width * VecDraw->SubBitmap->Width + VecDraw->SubBitmap->Height * VecDraw->SubBitmap->Height); rc.left = (NVector->Lex) - r - 10; rc.top = (NVector->Ley) - r - 10; rc.right = (NVector->Lex) + r + 10; rc.bottom = (NVector->Ley) + r + 10; break; case 4: rc.left = min(NVector->Cux, NVector->Cux2) - VecDraw->SubBitmap->Width / 2 - 10; rc.top = min(NVector->Cuy, NVector->Cuy2) - VecDraw->SubBitmap->Height / 2 - 10; rc.right = max(NVector->Cux, NVector->Cux2) + VecDraw->SubBitmap->Width / 2 + 10; rc.bottom = max(NVector->Cuy, NVector->Cuy2) + VecDraw->SubBitmap->Height / 2 + 10; break; } MainImageForm->iMainImage->RectPaint(rc); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupToFrontClick(TObject *Sender) { VecDraw->ChangeObjectOrder(true, false); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupForwardClick(TObject *Sender) { VecDraw->ChangeObjectOrder(true, true); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupBackwardClick(TObject *Sender) { VecDraw->ChangeObjectOrder(false, true); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupToBackClick(TObject *Sender) { VecDraw->ChangeObjectOrder(false, false); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::AverageSubClick(TObject *Sender) { TMenuItem *menuitem = (TMenuItem*)Sender; switch(menuitem->Tag) { case 1: VecDraw->InitAverage(true, false); break; case 2: VecDraw->InitAverage(false, true); break; case 3: VecDraw->InitAverage(true, true); break; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupGroupClick(TObject *Sender) { BEGIN_LOG(""); if (PopupGroup->Tag == 0) VecDraw->MakeGroup(); else if (PopupGroup->Tag == 1) VecDraw->UnGroup(); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PopupLockClick(TObject *Sender) { BEGIN_LOG(""); if (PopupLock->Tag == 0) VecDraw->ObjectLock(); else if (PopupLock->Tag == 1) VecDraw->ObjectLock(true); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitCombiForm() { // ÇØ»óµµ¿¡ µû¸¥ Æû Å©±â ÃʱâÈ­ - by monkman (2004.05.02) if (Screen->Width >= 1280 && Screen->Height >= 1024) CombiForm->BorderStyle = bsSingle; else CombiForm->BorderStyle = bsSizeable; CombiForm->Left = (Screen->Width - CombiForm->Width); CombiForm->Top = 0; CombiForm->Visible = true; ResultForm->Visible = false; // CombiForm->InitForm(); // ÃʱâÈ­´Â Æû ¸¸µé¶§ ÇÏ´Â °ÍÀ¸·Î º¯°æ - by monkman (2011.02.18) CombiForm->Show(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitResultForm() { // ÇØ»óµµ¿¡ µû¸¥ Æû Å©±â ÃʱâÈ­ - by monkman (2004.05.02) if (Screen->Width >= 1280 && Screen->Height >= 1024) ResultForm->BorderStyle = bsSingle; else ResultForm->BorderStyle = bsSizeable; ResultForm->Left = (Screen->Width - ResultForm->Width); ResultForm->Top = 0; CombiForm->Visible = false; ResultForm->Visible = true; ResultForm->InitForm(); ResultForm->Show(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitPictureForm() { if (StyleIllustForm) { StyleIllustForm->InitData(); } else { StyleIllustForm = new TStyleIllustForm(this); StyleIllustForm->Parent = MainForm; StyleIllustForm->InitForm(); } // ÇØ»óµµ¿¡ µû¸¥ Æû Å©±â ÃʱâÈ­ - by monkman (2004.05.02) if (Screen->Width >= 1280 && Screen->Height >= 1024) StyleIllustForm->BorderStyle = bsSingle; else StyleIllustForm->BorderStyle = bsSizeable; StyleIllustForm->Left = (Screen->Width - StyleIllustForm->Width); StyleIllustForm->Top = 0; StyleIllustForm->Visible = true; StyleIllustForm->Show(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitDataTransForm() { // STY, STI ÀÛ¾÷ÇÏ´ø ºÎºÐÀÌ ³²¾ÆÀÖµµ·Ï ¼öÁ¤ - by monkman (2010.09.09) /* if (DataTransForm) { DataTransForm->Visible = true; DataTransForm->Show(); } else { DataTransForm = new TDataTransForm(this); DataTransForm->Parent = MainForm; DataTransForm->InitForm(); } */ // ÇØ»óµµ¿¡ µû¸¥ Æû Å©±â ÃʱâÈ­ - by monkman (2004.05.02) if (Screen->Width >= 1280 && Screen->Height >= 1024) DataTransForm->BorderStyle = bsSingle; else DataTransForm->BorderStyle = bsSizeable; DataTransForm->Left = (Screen->Width - DataTransForm->Width); DataTransForm->Top = 0; DataTransForm->BringToFront(); DataTransForm->Visible = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::iMainImageMouseWheel(TShiftState Shift, int WheelDelta) { if (VecDraw->SpreadStep == 2) { if (WheelDelta > 0) VecDraw->SpreadGap++; else if (VecDraw->SpreadGap > 10) VecDraw->SpreadGap--; } MainImageForm->iMainImage->Repaint(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::VectorPopupMenuPopup(TObject *Sender) { BEGIN_LOG(""); // Text¸¦ ÀÔ·ÂÇÒ ¶§ ¿ÀºêÁ§Æ® º¹»ç/ºÙÀ̱âÇÏ¸é ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö Àֱ⠶§¹®¿¡ if (V_Item == M_D_NEWTEXT) { PopupPaste->Enabled = false; END_LOG; return; } if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation) { PopupPaste->Enabled = false; return; } if (IsClipboardFormatAvailable(CF_SYLK)) PopupPaste->Enabled = true; else PopupPaste->Enabled = false; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ImgPatternClick(TObject *Sender) { /* String ext; int length; TTexpiaBitmap *TexBitmap = NULL; TPalette *pPalette = NULL; HDC dcSrc=NULL; DWORD dwRead; HANDLE fh = INVALID_HANDLE_VALUE; TPException ec = EC_NONE; if (FileDialog->Execute()) { if (FileExists(FileDialog->FileName)) { length = FileDialog->FileName.Length(); ext = FileDialog->FileName; ext.Delete(1, length-3); ext.LowerCase(); if (ext == "bmp") { if ((TexBitmap = new TTexpiaBitmap) == NULL) goto next; if (!TexBitmap->LoadFromFile(FileDialog->FileName)) {ec = EC_FILE_NOT_READ; SAVE_EXCEPTION(ec); goto fail;} }else if (ext == "tex" || ext == "tfc" || ext == "wea" || ext == "knt") { TEXPIAFILEHEADER tpfh; if ((TexBitmap = new TTexpiaBitmap)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((pPalette = new TPalette)==NULL) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((fh = CreateFile(FileDialog->FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) { ec = EC_MEMORY_LACK; SAVE_EXCEPTION(ec); goto fail; } if ((ec = LoadFromTexpiaFile(fh, pPalette, tpfh, TexBitmap))!= EC_NONE) goto fail; CloseHandle(fh); }else { if ((TexBitmap = new TTexpiaBitmap) == NULL) goto next; if (!TexBitmap->LoadFromFile(FileDialog->FileName)) {ec = EC_FILE_NOT_READ; SAVE_EXCEPTION(ec); goto fail;} } if ((dcSrc = TexBitmap->CreateDC())==NULL) goto next; StretchBlt(ImgPattern->Canvas->Handle, 0,0, 80, 100, dcSrc, 0,0, TexBitmap->Width, TexBitmap->Height, SRCCOPY); ImgPattern->Invalidate(); next: TexBitmap->DeleteDC(dcSrc); dcSrc = NULL; delete TexBitmap; TexBitmap = NULL; delete pPalette; pPalette = NULL; } } return; fail: if (fh != INVALID_HANDLE_VALUE) CloseHandle(fh); TexBitmap->DeleteDC(dcSrc); dcSrc = NULL; delete TexBitmap; TexBitmap = NULL; EXCEPTION_MESSAGE_OK(ec); */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbPastAngleClick(TObject *Sender) { ePatternAngle->Value = VecDraw->PatternPastAngle; cbPatternAngle->Checked = false; switch(VecDraw->NVector->PatternStep) { case 1: VecDraw->InitPatternFill(100, 100, ePatternAngle->Value); break; case 2: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); VecDraw->NVector->PatternStep = 4; break; case 3: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); VecDraw->NVector->PatternStep = 4; break; case 4: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); break; } MainImageForm->iMainImage->Repaint(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbPastSizeClick(TObject *Sender) { ePatternX->Value = VecDraw->PatternPastWidth; ePatternY->Value = VecDraw->PatternPastHeight; cbPatternSize->Checked = false; switch(VecDraw->NVector->PatternStep) { case 1: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); VecDraw->NVector->PatternStep = cbPatternAngle->Checked ? 2 : 4; break; case 2: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); VecDraw->NVector->PatternStep = 4; break; case 3: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, 0); break; case 4: VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); break; } MainImageForm->iMainImage->Repaint(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ePatternXKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) ePatternY->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ePatternYKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { cbPatternSize->Checked = false; if (cbPatternAngle->Checked) VecDraw->NVector->PatternStep = 2; else VecDraw->NVector->PatternStep = 4; VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); MainImageForm->iMainImage->Repaint(); // //btTemp->SetFocus(); // SetFocusedControl(MainImageForm); // MainImageForm->tempRadioButton->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ePatternAngleKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { cbPatternAngle->Checked = false; VecDraw->NVector->PatternStep = 4; VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); MainImageForm->iMainImage->Repaint(); // btTemp->SetFocus(); // SetFocusedControl(MainImageForm); // MainImageForm->tempRadioButton->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbPatternSizeMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { if (cbPatternSize->Checked) { VecDraw->NVector->PatternStep = cbPatternAngle->Checked && VecDraw->NVector->PatternStep != 3 ? 2 : 4; ePatternX->Value = 100; ePatternY->Value = 100; VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, 0); } else { VecDraw->NVector->PatternStep = 1; // Å©±â Á¶Àý »óÅ ePatternAngle->Value = 0; } MainImageForm->iMainImage->Repaint(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbPatternAngleMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { if (cbPatternAngle->Checked) { if (cbPatternSize->Checked) VecDraw->NVector->PatternStep = 1; else VecDraw->NVector->PatternStep = 4; ePatternAngle->Value = 0; VecDraw->InitPatternFill(ePatternX->Value, ePatternY->Value, ePatternAngle->Value); } else { if (cbPatternSize->Checked && VecDraw->NVector->PatternStep != 3) VecDraw->NVector->PatternStep = 1; // Å©±â Á¶Àý »óÅ else VecDraw->NVector->PatternStep = 2; } MainImageForm->iMainImage->Repaint(); } // --------------------------------------------------------------------------- // For Text Processing in Vector by maxleo21c (2004.10.19) // ±ÛÀÚ ÀÔ·ÂÀ» ó¸®Çϱâ À§ÇÑ Proc void __fastcall TVectorForm::EditProcessing(TMessage &msg, TCHAR *cWord, int len) { if (V_Item != M_D_NEWTEXT) return; if (!VecDraw->BeReadyEdit) return; if (VecDraw->CurrentTextBox < 0) return; int i; TList *DataList = NVector->DataList; // MainImageForm->V_DATA; TWordList *WordDataList; TVecData *tData; TSWordData *tsWordData = NULL, *tempWordData; // by maxleo21c (2004.08.07) String temp; int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; int PositionY = MainImageForm->sbVert->Position; // tData = (TVecData *)DataList->Items[VecDraw->CurrentTextBox]; if (VecDraw->CurrentTextBox < DataList->Count) { tData = (TVecData*)DataList->Items[VecDraw->CurrentTextBox]; } else { tData = VecDraw->CurrentTextBoxData; } if (tData->Kind != V_TEXTBOX) return; WordDataList = (TWordList*)tData->ListOfAllLine; int FirstY = (tData->StartPoint.y - PositionY) * ZoomIn / ZoomOut; int sline, tline, rectBottom, IndexInLine, j, Height = 0; RECT rect; msg.Result = 0; VecDraw->DeleteCaret(tData); switch(msg.Msg) { case WM_CHAR: for (i = 0; i < (int)LOWORD(msg.LParam); i++) { switch(msg.WParam) { case VK_BACK: // backspace if (tData->nCount > 0) { if (VecDraw->ExistSelected) { VecDraw->KeyDownInTextBox(VK_DELETE); FullViewForm->InitForm(MainImageForm->iMainImage); return; } if (VecDraw->IndexOfWord == 0) return; VecDraw->IndexOfWord--; VecDraw->SetCaretPoz(-1, 0, tData); // for caret VecDraw->KeyDownInTextBox(VK_DELETE); VecDraw->GetRectForMouseMove(tData, rect); rectBottom = rect.bottom; // ¾Æ·¡°ÍÀ» ¸·¾Ò´Ù´Ù ¿¡·¯°¡ ¾ø´Â °Í °°¾Æ¼­ CaretHeightChange()ÇÔ¼ö¸¦ ´Ù½Ã // ¸·´Â´Ù. ÀÌÀ¯´Â tesStylist¿¡ ½áÀÖ´Ù. // CaretHeightChange(tData, VecDraw->IndexOfLine, false); IndexInLine = WordDataList->GetIndexInLine(VecDraw->IndexOfWord); for (j = 0; j < (tData->ListOfAllLine->GetLineTextBox(VecDraw->IndexOfLine)) ->LineDataList->Count; j++) { tsWordData = (TSWordData*)(tData->ListOfAllLine->GetLineTextBox (VecDraw->IndexOfLine))->LineDataList->Items[j]; // ¸¶Áö¸· enterÀÇ Å©±â¸¦ Ç×»ó Line Heightº¸´Ù À۰ųª °°°Ô ¸¸µé¾î ÁØ´Ù. // ¶óÀο¡ enter¹Û¿¡ ¾ø´Ù¸é ±×³É Áö³ª°£´Ù. if (tsWordData->Word[0] == '\r' && j != 0) tsWordData->PPoint.y = Height; if (tsWordData->PPoint.y > Height) Height = tsWordData->PPoint.y; } (tData->ListOfAllLine->GetLineTextBox(VecDraw->IndexOfLine)) ->lineHeight = Height; VecDraw->CaretH = (tData->ListOfAllLine->GetLineTextBox (VecDraw->IndexOfLine))->lineHeight; VecDraw->SetCaretPozByIndex(VecDraw->IndexOfWord); VecDraw->GetTextBoxRect(tData); VecDraw->MakeTextBoxPointList(tData); VecDraw->GetRectForMouseMove(tData, rect); rect.bottom = rect.bottom > rectBottom ? rect.bottom : rectBottom; MainImageForm->iMainImage->RectPaint(rect); } return; case VK_TAB: // tab return; case 0x0A: // linefeed break; case VK_RETURN: // carriage return if (VecDraw->ExistSelected) { VecDraw->KeyDownInTextBox(VK_DELETE); FullViewForm->InitForm(MainImageForm->iMainImage); } if (!tData->ListOfAllLine->CurveData) { // by linuxjun for CurvedVectorText tsWordData = new TSWordData; AddFontData(tsWordData); tsWordData->Word[0] = (Char)msg.WParam; tsWordData->Word[1] = '\0'; tsWordData->UsedByte = 1; AddTextData(tData, tsWordData, WordDataList); VecDraw->GetTextBoxRect(tData); VecDraw->MakeTextBoxPointList(tData); VecDraw->GetRectForMouseMove(tData, rect); MainImageForm->iMainImage->Repaint(); } break; case VK_ESCAPE: // escape delete tsWordData; return; default: // character codes VecDraw->GetRectForMouseMove(tData, rect); rectBottom = rect.bottom; if (VecDraw->ExistSelected) { VecDraw->KeyDownInTextBox(VK_DELETE); FullViewForm->InitForm(MainImageForm->iMainImage); } tsWordData = new TSWordData; AddFontData(tsWordData); tsWordData->Word[0] = (Char)msg.WParam; tsWordData->Word[1] = '\0'; tsWordData->UsedByte = 1; AddTextData(tData, tsWordData, WordDataList); VecDraw->GetTextBoxRect(tData); VecDraw->MakeTextBoxPointList(tData); VecDraw->GetRectForMouseMove(tData, rect); // rect.bottom = rect.bottom > rectBottom ? rect.bottom : rectBottom; // 05.07.28 Ãß°¡ by malxoe21c // ÀÌÀ¯: LineÀ» µû¶ó Text¸¦ ÀÔ·ÂÇÒ¶§ FullViewUpdateÀÌ µÇÁö ¾Ê´Â ¹®Á¦ // top, left°¡ À½¼ö°¡ ³ª¿Í¼­ rectpaintÇÒ¶§ FullViewUpdate°¡ µÇÁö ¾Ê¾Ò´Ù. rect.top = rect.top < 0 ? 0 : rect.top; rect.left = rect.left < 0 ? 0 : rect.left; rect.right = rect.right < 0 ? 0 : rect.right; rect.bottom = rect.bottom > rectBottom ? rect.bottom : rectBottom; MainImageForm->iMainImage->RectPaint(rect); break; } } break; case WM_IME_CHAR: if (VecDraw->ExistSelected) { VecDraw->KeyDownInTextBox(VK_DELETE); FullViewForm->InitForm(MainImageForm->iMainImage); } tsWordData = new TSWordData; tsWordData->Word[0] = (Char)msg.WParam; tsWordData->Word[1] = '\0'; AddFontData(tsWordData); VecDraw->GetRectForMouseMove(tData, rect); rectBottom = rect.bottom; tsWordData->UsedByte = 1; AddTextData(tData, tsWordData, WordDataList); VecDraw->GetTextBoxRect(tData); VecDraw->MakeTextBoxPointList(tData); VecDraw->GetRectForMouseMove(tData, rect); MainImageForm->iMainImage->RectPaint(rect); break; case WM_IME_COMPOSITION: if (VecDraw->ExistSelected) { VecDraw->KeyDownInTextBox(VK_DELETE); FullViewForm->InitForm(MainImageForm->iMainImage); } int count = (int)LOWORD(msg.LParam); if (msg.LParam & GCS_COMPSTR) { if (bComp == 0) { return; } else if (bComp == 1) { tsWordData = new TSWordData; memcpy(tsWordData->Word, cWord, sizeof(TCHAR) * len); AddFontData(tsWordData); VecDraw->GetRectForMouseMove(tData, rect); rectBottom = rect.bottom; tsWordData->UsedByte = 1; AddTextData(tData, tsWordData, WordDataList); } else { tsWordData = WordDataList->Items(VecDraw->IndexOfWord - 1); memcpy(tsWordData->Word, cWord, sizeof(TCHAR) * len); VecDraw->GetRectForMouseMove(tData, rect); rectBottom = rect.bottom; } } else if (msg.LParam & GCS_RESULTSTR) { tsWordData = WordDataList->Items(VecDraw->IndexOfWord - 1); memcpy(tsWordData->Word, cWord, sizeof(TCHAR) * len); VecDraw->GetRectForMouseMove(tData, rect); rectBottom = rect.bottom; } VecDraw->GetTextBoxRect(tData); VecDraw->MakeTextBoxPointList(tData); VecDraw->GetRectForMouseMove(tData, rect); MainImageForm->iMainImage->RectPaint(rect); break; } } // --------------------------------------------------------------------------- // ÀÔ·ÂµÈ Font°ü·Ã Dataó¸® void __fastcall TVectorForm::AddFontData(TSWordData *tsWordData) { TFont *font = MainImageForm->iMainImage->Canvas->Font; if (FontSizeComboBox->ItemIndex == 0) font->Size = TFontSize[0]; else font->Size = TFontSize[FontSizeComboBox->ItemIndex - 1]; // 2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ font->Name = FontNameBox->SelectedFont->Name; // Text; _tcscpy(tsWordData->LFont.lfFaceName, FontNameBox->SelectedFont->Name.c_str()); tsWordData->LFont.lfHeight = font->Size; tsWordData->LFont.lfWidth = 0; tsWordData->LFont.lfEscapement = VecDraw->TextAngle * 10; tsWordData->LFont.lfItalic = font->Style.Contains(fsItalic); tsWordData->LFont.lfUnderline = font->Style.Contains(fsUnderline); if (font->Style.Contains(fsBold)) tsWordData->LFont.lfWeight = FW_BOLD; else tsWordData->LFont.lfWeight = FW_NORMAL; tsWordData->LFont.lfStrikeOut = font->Style.Contains(fsStrikeOut); tsWordData->LFont.lfCharSet = font->Charset; tsWordData->LFont.lfOrientation = 0; tsWordData->LFont.lfPitchAndFamily = font->Pitch | FF_DONTCARE; tsWordData->LFont.lfOutPrecision = OUT_DEFAULT_PRECIS; tsWordData->LFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; tsWordData->LFont.lfQuality = DEFAULT_QUALITY; } // --------------------------------------------------------------------------- // ÀÔ·ÂµÈ ±ÛÀÚ Dataó¸® void __fastcall TVectorForm::AddTextData(TVecData *tData, TSWordData *tsWordData, TWordList *WordDataList) { SIZE size; HDC hdc = MainImageForm->iMainImage->Canvas->Handle; TSWordData *tempWordData; int IndexInLine, lineCount, count; VecDraw->DeleteCaret(tData); /* if (tsWordData->UsedByte == 1) GetTextExtentPoint32(hdc, tsWordData->Word, 1, &size); else GetTextExtentPoint32(hdc, tsWordData->Word, 2, &size); */ /////////////////////// Vista Font¿¡ ´ëÇØ SizeÁ¦´ë·Î ¸ø°¡Á®¿Í¼­ »ý±â´Â ¹®Á¦ ó¸® (2007. 06. 27 Annualring) size = VecDraw->GetVectorTextExtent(MainImageForm->iMainImage->Canvas, MainImageForm->iMainImage->Canvas->Font, tsWordData); tsWordData->Color = PenManagerForm->PenShape->Pen->Color; tsWordData->Selected = false; tsWordData->bNameChanged = false; // 2005 Vector Upgrade Shin 0316 tsWordData->PPoint.x = size.cx; tsWordData->PPoint.y = size.cy; tsWordData->Interval = size.cx * 4 / 5; if (WidthGapComboBox->ItemIndex == 0) tsWordData->WidthGap = (float)TTextWidthGap[WidthGapComboBox->ItemIndex] / 100; else tsWordData->WidthGap = (float) TTextWidthGap[WidthGapComboBox->ItemIndex - 1] / 100; if (HeightGapComboBox->ItemIndex == 0) tsWordData->HeightGap = (float)TTextHeightGap[HeightGapComboBox->ItemIndex] / 100; else tsWordData->HeightGap = (float) TTextHeightGap[HeightGapComboBox->ItemIndex - 1] / 100; IndexInLine = WordDataList->GetIndexInLine(VecDraw->IndexOfWord); lineCount = (WordDataList->GetLineTextBox(VecDraw->IndexOfLine)) ->LineDataList->Count; if (lineCount > IndexInLine) (WordDataList->GetLineTextBox(VecDraw->IndexOfLine))->LineDataList->Insert (IndexInLine, tsWordData); else (WordDataList->GetLineTextBox(VecDraw->IndexOfLine))->LineDataList->Add (tsWordData); tData->nCount++; VecDraw->IndexOfWord++; if (tsWordData->Word[0] == '\r') { TLineTextBox *tempTLineTextBox = new TLineTextBox; tempTLineTextBox->lineHeight = size.cy; if (tData->ListOfAllLine->LineCount - 1 == VecDraw->IndexOfLine) tData->ListOfAllLine->Add(tempTLineTextBox); else tData->ListOfAllLine->Insert(VecDraw->IndexOfLine + 1, tempTLineTextBox); if (lineCount > IndexInLine) { count = lineCount - IndexInLine; while (count > 0) { tempWordData = (TSWordData*)(WordDataList->GetLineTextBox (VecDraw->IndexOfLine))->LineDataList->Items[IndexInLine + 1]; tempTLineTextBox->LineDataList->Add(tempWordData); (WordDataList->GetLineTextBox(VecDraw->IndexOfLine)) ->LineDataList->Remove(tempWordData); count--; } CaretHeightChange(tData, VecDraw->IndexOfLine); VecDraw->IndexOfLine++; CaretHeightChange(tData, VecDraw->IndexOfLine, false); } else { VecDraw->IndexOfLine++; VecDraw->CaretH = size.cy; } } else { CaretHeightChange(tData, VecDraw->IndexOfLine); } VecDraw->SetCaretPozByIndex(VecDraw->IndexOfWord); } // --------------------------------------------------------------------------- // Caret¸¦ ±×·ÁÁÖ´Â Timer void __fastcall TVectorForm::DrawCaretTimer(TObject *Sender) { // MainImageForm Á¦°Å½Ã¿¡ ¸Þ¸ð¸® Á¢±Ù ¿À·ù¹ß»ýÇØ¼­ Ãß°¡ if (MainImageForm == NULL) return; // shin vectorform if (V_Item != M_D_NEWTEXT) { MainImageForm->bDrawCaret = false; return; } // Text¸¦ ÀÔ·ÂÇÏ´Â ¸Þ´º°¡ ¾Æ´Ï¸é return if (!MainMenuForm->UseEditFunction && NVector->bTextState) { MainImageForm->bDrawCaret = false; return; } if (!VecDraw->BeReadyEdit) { MainImageForm->bDrawCaret = false; return; } if (VecDraw->bInSel) { MainImageForm->bDrawCaret = false; return; } if (!MainImageForm->bDrawCaret) return; /* TVecData *tData; TList *DataList = NVector->DataList; if (DataList->Count < 1) return; tData = (TVecData *)DataList->Items[VecDraw->CurrentTextBox]; */ int CaretWidth = 2; int CaretHeight = VecDraw->CaretH; HDC hDC = MainImageForm->iMainImage->Canvas->Handle; int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; int PositionX = MainImageForm->sbHorz->Position; int PositionY = MainImageForm->sbVert->Position; int nOldROP = 0; double angleChangedX1, angleChangedY1, angleChangedX2, angleChangedY2; double angle = (double)VecDraw->TextAngle / 180 * M_PI; int cx, cy; double tx1, ty1, ty2; CaretHeight = CaretHeight * 0.8 * ZoomIn / ZoomOut; LOGBRUSH logbrush = { BS_SOLID, RGB(0, 0, 0), 0 }; if (blinkCatet) { blinkCatet = 0; } else { logbrush.lbColor = RGB(0, 0, 0); // °ËÀº»ö blinkCatet = 1; HPEN hPen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER, CaretWidth, &logbrush, 0, NULL); HGDIOBJ hOld = SelectObject(hDC, hPen); nOldROP = SetROP2(hDC, R2_NOT); // --> by linuxjun for CurvedVectorText TSWordData *NextWordData; // by maxleo21c (2004.08.07) TSWordData *PreWordData; // by maxleo21c (2004.08.07) TWordList *WordDataList; TVecData *tData = NULL; TList *DataList = NVector->DataList; // MainImageForm->V_DATA; bool IsCurvedText = true; if (DataList->Count < 1) IsCurvedText = false; if (VecDraw->CurrentTextBox < 0) { IsCurvedText = false; // 20050217 shin return; } // tData = (TVecData *)DataList->Items[VecDraw->CurrentTextBox]; if (VecDraw->CurrentTextBox < DataList->Count) { tData = (TVecData*)DataList->Items[VecDraw->CurrentTextBox]; } else { tData = VecDraw->CurrentTextBoxData; } if (tData == NULL) return; if (tData->Kind != V_TEXTBOX) IsCurvedText = false; WordDataList = (TWordList*)tData->ListOfAllLine; NextWordData = (TSWordData*)WordDataList->Items(VecDraw->IndexOfWord); PreWordData = (TSWordData*)WordDataList->Items(VecDraw->IndexOfWord - 1); if (!NextWordData && !PreWordData) IsCurvedText = false; if (!WordDataList->CurveData) IsCurvedText = false; if (IsCurvedText) { int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; int PositionX = MainImageForm->sbHorz->Position; int PositionY = MainImageForm->sbVert->Position; int FirstX; int FirstY; if (NextWordData) { FirstX = (NextWordData->px - PositionX - NextWordData->Interval * NextWordData->WidthGap * NextWordData->tx / 2) * ZoomIn / ZoomOut; FirstY = (NextWordData->py - PositionY - NextWordData->Interval * NextWordData->WidthGap * NextWordData->ty / 2) * ZoomIn / ZoomOut; angleChangedX1 = FirstX; angleChangedY1 = FirstY; angleChangedX2 = FirstX - NextWordData->nx * NextWordData->LFont.lfHeight * NextWordData->HeightGap * ZoomIn / ZoomOut; angleChangedY2 = FirstY - NextWordData->ny * NextWordData->LFont.lfHeight * NextWordData->HeightGap * ZoomIn / ZoomOut; MoveToEx(hDC, angleChangedX1, angleChangedY1, NULL); LineTo(hDC, angleChangedX2, angleChangedY2); } else if (PreWordData) { FirstX = (PreWordData->px - PositionX + PreWordData->Interval * PreWordData->WidthGap * PreWordData->tx / 2) * ZoomIn / ZoomOut; FirstY = (PreWordData->py - PositionY + PreWordData->Interval * PreWordData->WidthGap * PreWordData->ty / 2) * ZoomIn / ZoomOut; angleChangedX1 = FirstX; angleChangedY1 = FirstY; angleChangedX2 = FirstX - PreWordData->nx * PreWordData->LFont.lfHeight * PreWordData->HeightGap * ZoomIn / ZoomOut; angleChangedY2 = FirstY - PreWordData->ny * PreWordData->LFont.lfHeight * PreWordData->HeightGap * ZoomIn / ZoomOut; MoveToEx(hDC, angleChangedX1, angleChangedY1, NULL); LineTo(hDC, angleChangedX2, angleChangedY2); // graphics.DrawLine(&pen, (float)angleChangedX1, (float)angleChangedY1, (float)angleChangedX2, (float)angleChangedY2); } // <-- by linuxjun for CurvedVectorText } else if (VecDraw->TextAngle) { ////cx = (tData->CenterPoint.x - PositionX) * ZoomIn / ZoomOut; ////cy = (tData->CenterPoint.y - PositionY) * ZoomIn / ZoomOut; cx = (VecDraw->CenterPoint.x - PositionX) * ZoomIn / ZoomOut; cy = (VecDraw->CenterPoint.y - PositionY) * ZoomIn / ZoomOut; tx1 = VecDraw->xCaretPoz - cx; ty1 = cy - VecDraw->yCaretPoz; ty2 = cy - (VecDraw->yCaretPoz - CaretHeight); angleChangedX1 = tx1 * cos(-angle) + ty1 * sin(-angle) + cx; angleChangedY1 = cy - (-tx1 * sin(-angle) + ty1 * cos(-angle)); angleChangedX2 = tx1 * cos(-angle) + ty2 * sin(-angle) + cx; angleChangedY2 = cy - (-tx1 * sin(-angle) + ty2 * cos(-angle)); MoveToEx(hDC, angleChangedX1, angleChangedY1, NULL); LineTo(hDC, angleChangedX2, angleChangedY2); } else { // --> by linuxjun for CurvedVectorText if (WordDataList->CurveData) { DPOINT firstPoint; angleChangedX1 = MainImageForm->iMainImage->BitmapToCanvasX (WordDataList->CurveData->pList[0].x); // ÁÜÀ̳ª À̵¿ÈÄ ÇöÀç ´«¿¡ º¸ÀÌ´Â °÷ angleChangedY1 = MainImageForm->iMainImage->BitmapToCanvasY (WordDataList->CurveData->pList[0].y); // ¸¶¿ì½º¸¦ Ŭ¸¯ÇÑ °÷ÀÇ À§Ä¡ firstPoint = VecDraw->FindingNormalOnBezier (&WordDataList->CurveData->pList[0], 0, CaretHeight, true); // angleChangedX2 = angleChangedX1 + firstPoint.x; // angleChangedY2 = angleChangedY1 + firstPoint.y; angleChangedX2 = MainImageForm->iMainImage->BitmapToCanvasX (firstPoint.x); // ÁÜÀ̳ª À̵¿ÈÄ ÇöÀç ´«¿¡ º¸ÀÌ´Â °÷ angleChangedY2 = MainImageForm->iMainImage->BitmapToCanvasY (firstPoint.y); // ¸¶¿ì½º¸¦ Ŭ¸¯ÇÑ °÷ÀÇ À§Ä¡ MoveToEx(hDC, angleChangedX1, angleChangedY1, NULL); LineTo(hDC, angleChangedX2, angleChangedY2); } else { // <-- by linuxjun for CurvedVectorText MoveToEx(hDC, VecDraw->xCaretPoz, VecDraw->yCaretPoz, NULL); LineTo(hDC, VecDraw->xCaretPoz, VecDraw->yCaretPoz - CaretHeight); } } if (nOldROP) SetROP2(hDC, nOldROP); SelectObject(hDC, hOld); DeleteObject(hPen); } } // --------------------------------------------------------------------------- // Zoom In/Out¹× ¸¶¿ì½º·Î MainImage¸¦ À̵¿½Ã¿¡ TextBoxÀÇ º¯È­¿¡ µû¸¥ CaretÀÇ // À§Ä¡¸¦ º¯°æÇØ ÁÖ¾î¾ß¸¸ ÇÑ´Ù. void __fastcall TVectorForm::CaretPozChange() { if (!MainMenuForm->UseEditFunction && NVector->bTextState) return; TList *DataList = NVector->DataList; // MainImageForm->V_DATA; TSWordData *tsWordData; // by maxleo21c (2004.08.07) TWordList *WordDataList; TVecData *tData; int count = 0, tline; if (DataList->Count < 1) return; // tData = (TVecData *)DataList->Items[VecDraw->CurrentTextBox]; if (VecDraw->CurrentTextBox < DataList->Count) { tData = (TVecData*)DataList->Items[VecDraw->CurrentTextBox]; } else { tData = VecDraw->CurrentTextBoxData; } if (tData->Kind != V_TEXTBOX) return; WordDataList = (TWordList*)tData->ListOfAllLine; int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; int PositionX = MainImageForm->sbHorz->Position; int PositionY = MainImageForm->sbVert->Position; int FirstX = (tData->StartPoint.x - PositionX) * ZoomIn / ZoomOut; int FirstY = (tData->StartPoint.y - PositionY) * ZoomIn / ZoomOut; VecDraw->xCaretPoz = FirstX; VecDraw->yCaretPoz = FirstY; for (int i = 0; i < VecDraw->IndexOfWord; i++) { tsWordData = (TSWordData*)WordDataList->Items(i); if (tsWordData->UsedByte == 1) { if (tsWordData->Word[0] == '\n' || tsWordData->Word[0] == '\r') { count++; tline = (tData->ListOfAllLine->GetLineTextBox(count))->lineHeight; VecDraw->xCaretPoz = FirstX; VecDraw->yCaretPoz += ((tline) * 0.8 * tsWordData->HeightGap) * ZoomIn / ZoomOut; } else VecDraw->xCaretPoz += tsWordData->Interval * tsWordData->WidthGap * ZoomIn / ZoomOut; } else VecDraw->xCaretPoz += tsWordData->Interval * tsWordData->WidthGap * ZoomIn / ZoomOut; } } // --------------------------------------------------------------------------- // System¿¡¼­ »ç¿ë°¡´ÉÇÑ Vector(& Open) type Font¸¦ ã´Â ÇÔ¼ö void __fastcall TVectorForm::SearchVectorFont() { BEGIN_LOG(""); TFont *font = MainImageForm->iMainImage->Canvas->Font; TGetVectorFontName *getVectorFontName; getVectorFontName = new TGetVectorFontName; for (int i = 0; i < Screen->Fonts->Count; i++) { if (Screen->Fonts->Strings[i].c_str()[0] != '@') getVectorFontName->GetVectorFont(Screen->Fonts->Strings[i].c_str()); } FontNameBox->Items = getVectorFontName->VectorFontName; FontNameBox->ItemIndex = 0; font->Name = FontNameBox->FontName; // Text¸¦ FontNameÀ¸·Î ¿¡·¯ ¼öÁ¤ (2008. 01. 02 Annualring) delete getVectorFontName; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbTextAntialiasingClick(TObject *Sender) { // MainImageForm->tempRadioButton->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontNameBoxDropDown(TObject *Sender) { UseComboBoxForText = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontNameBoxCloseUp(TObject *Sender) { BEGIN_LOG(""); int i = FontNameBox->ItemIndex; String fontname; TFont *font = MainImageForm->iMainImage->Canvas->Font; // ¼¼·ÎÆùÆ®(@)¸¦ ¼±ÅÃÇßÀ» °æ¿ì ÀÚµ¿À¸·Î ±âº» ÆùÆ®·Î º¯°æ by david 090917 fontname = FontNameBox->Items->Strings[i]; if (fontname.c_str()[0] == '@') fontname = fontname.SubString(2, fontname.Length() - 1); i = FontNameBox->Items->IndexOf(fontname); if (i < 0) { TFont *_font = new TFont(); _font->Handle = (HFONT)GetStockObject(DEFAULT_GUI_FONT); // ±¼¸² fontname = _font->Name; delete _font; _font = NULL; i = FontNameBox->Items->IndexOf(fontname); } font->Name = fontname; // --------------------------------------------------------------- if (MainImageForm) { // ExitForm()ÇÔ¼ö¿¡ ÀÖ¾ú´Âµ¥ rzFontComboBox´Â ¼±ÅÃÇÑ Font¸¦ index = 0À¸·Î °¡Á®´Ù // ³õ±â ¶§¹®¿¡ ExitForm()¿¡¼­ ÀúÀåÇϸé index = 0À» ÀúÀåÇÏ°Ô µÇ¼­ Àǹ̰¡ ¾ø°Ô µÈ´Ù. // ±×·¡¼­ ¼±ÅÃÇÒ ¶§ ÀúÀåÇϵµ·Ï º¯°æ by david 20080522 MainImageForm->fontIndex = i; } UseComboBoxForText = false; MainMenuForm->isAnyChanged = true; PostMessage(this->Handle, TPM_TEXTOPERATION, F_Name, 0); // ¼¼·ÎÆùÆ®(@)¸¦ ¼±ÅÃÇßÀ» °æ¿ì ÀÚµ¿À¸·Î ±âº» ÆùÆ®·Î º¯°æ by david 090917 FontNameBox->ItemIndex = i; /* if (VecDraw->ExistSelected) { VecDraw->ChangeFontSeletedWordData(font); // SetFocusedControl(MainImageForm); -05.07.25ÁÖ¼® MainImageForm->tempRadioButton->SetFocus(); } else { CheckNChangeFont(true); //btTemp->SetFocus(); // Focus󸮸¦ À§Çؼ­ ÇÊ¿äÇÑ °Í °°´Ù. ÇÏÁö¸¸ // À̰ÍÀ» »ç¿ëÇϸé MainImage¿¡ Focus°¡ °¡Áö ¾Ê´Â´Ù. // ÇöÀç ¾î¶»°Ô ó¸®ÇØ¾ß ÇÒÁö ¸ð¸£°Ú´Ù. //-05.07.25ÁÖ¼® // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // SetFocusedControl(MainImageForm); MainImageForm->tempRadioButton->SetFocus(); } */ END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontNameChange(TSWordData *tsWordData) { int count = 0; // ¿¡·¯ ¼öÁ¤ (2008. 01. 02 Annualring) TFont *font = MainImageForm->iMainImage->Canvas->Font; if (font == NULL || tsWordData == NULL) return; for (int i = 0; i < FontNameBox->Items->Count; i++) { String SelectedName = ChangeEnglishFontName(FontNameBox->Items->Strings[i]); String FindName = ChangeEnglishFontName(tsWordData->LFont.lfFaceName); if (_tcscmp(FontNameBox->Items->Strings[i].c_str(), FindName.c_str()) == 0 || (_tcscmp(L"Gulim", tsWordData->LFont.lfFaceName) == 0 && FontNameBox->Items->Strings[i] == "±¼¸²")) { FontNameBox->ItemIndex = i; // 2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ font->Name = FontNameBox->SelectedFont->Name; // Text; count++; break; } if (SelectedName != FontNameBox->Items->Strings[i]) { if (_tcscmp(SelectedName.c_str(), FindName.c_str()) == 0) { FontNameBox->ItemIndex = i; // 2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ font->Name = FontNameBox->Items->Strings[i]; // SelectedName; count++; break; } } } if (count == 0) { // default font ÀÎ °æ¿ì String DefaultName = ChangeEnglishFontName(VecDraw->DefaultFontName); for (int i = 0; i < FontNameBox->Items->Count; i++) { String SelectedName = ChangeEnglishFontName (FontNameBox->Items->Strings[i]); if (_tcscmp(FontNameBox->Items->Strings[i].c_str(), DefaultName.c_str()) == 0) { FontNameBox->ItemIndex = i; font->Name = FontNameBox->Items->Strings[i]; // SelectedName; break; } if (SelectedName != FontNameBox->Items->Strings[i]) { if (_tcscmp(SelectedName.c_str(), DefaultName.c_str()) == 0) { FontNameBox->ItemIndex = i; font->Name = FontNameBox->Items->Strings[i]; // SelectedName; count++; break; } } } /* for (int i=0; iItems->Count; i++) { if (_tcscmp(FontNameBox->Items->Strings[i].c_str(), VecDraw->DefaultFontName.c_str()) == 0) { FontNameBox->ItemIndex = i; //2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ font->Name = FontNameBox->SelectedFont->Name;// Text; break; } } */ } if (tsWordData->LFont.lfWeight == FW_NORMAL) { font->Style = TFontStyles(); FontStyleBox->ItemIndex = 0; } else if (tsWordData->LFont.lfWeight == FW_BOLD && tsWordData->LFont.lfItalic) { font->Style = TFontStyles() << fsBold << fsItalic; FontStyleBox->ItemIndex = 3; } else if (tsWordData->LFont.lfWeight == FW_BOLD) { font->Style = TFontStyles() << fsBold; FontStyleBox->ItemIndex = 2; } else if (tsWordData->LFont.lfItalic) { font->Style = TFontStyles() << fsItalic; FontStyleBox->ItemIndex = 1; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CaretHeightChange(TVecData *tData, int indexOfLine, bool Skip) { if (tData->nCount == 0) return; int i, Count = 0, Height = 0; HDC hdc; SIZE size; TSWordData *tsWordData; Count = (tData->ListOfAllLine->GetLineTextBox(indexOfLine)) ->LineDataList->Count; if (Count) { for (i = 0; i < Count; i++) { tsWordData = (TSWordData*)(tData->ListOfAllLine->GetLineTextBox (indexOfLine))->LineDataList->Items[i]; // ¸¶Áö¸· enterÀÇ Å©±â¸¦ Ç×»ó Line Heightº¸´Ù À۰ųª °°°Ô ¸¸µé¾î ÁØ´Ù. // ¶óÀο¡ enter¹Û¿¡ ¾ø´Ù¸é ±×³É Áö³ª°£´Ù. if (tsWordData->Word[0] == '\r' && !Skip) { hdc = MainImageForm->iMainImage->Canvas->Handle; // GetTextExtentPoint32(hdc, tsWordData->Word, 1, &size); /////////////////////// Vista Font¿¡ ´ëÇØ SizeÁ¦´ë·Î ¸ø°¡Á®¿Í¼­ »ý±â´Â ¹®Á¦ ó¸® (2007. 06. 27 Annualring) size = VecDraw->GetVectorTextExtent(MainImageForm->iMainImage->Canvas, MainImageForm->iMainImage->Canvas->Font, tsWordData, 1); if (FontSizeComboBox->ItemIndex == 0) tsWordData->LFont.lfHeight = TFontSize[0]; else tsWordData->LFont.lfHeight = TFontSize [FontSizeComboBox->ItemIndex - 1]; // 2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ _tcscpy(tsWordData->LFont.lfFaceName, FontNameBox->SelectedFont->Name.c_str()); tsWordData->PPoint.x = size.cx; tsWordData->PPoint.y = size.cy; tsWordData->Interval = size.cx * 4 / 5; } if (tsWordData->PPoint.y > Height) Height = tsWordData->PPoint.y; } (tData->ListOfAllLine->GetLineTextBox(indexOfLine))->lineHeight = Height; VecDraw->CaretH = (tData->ListOfAllLine->GetLineTextBox(indexOfLine)) ->lineHeight; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CaretYPozChange(int FirstY, TVecData *tData, TWordList *WordDataList) { int i, lineCount = 0; TSWordData *tsWordData; int templine, yPoz = FirstY; int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; for (i = 1; i <= VecDraw->IndexOfLine; i++) { templine = tData->ListOfAllLine->GetLineTextBox(i)->lineHeight; tsWordData = (TSWordData*)tData->ListOfAllLine->GetLineTextBox(i - 1) ->LineDataList->Last(); yPoz += (templine * 0.8 * tsWordData->HeightGap) * ZoomIn / ZoomOut; } VecDraw->yCaretPoz = yPoz; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontSizeComboBoxCloseUp(TObject *Sender) { TFont *font = MainImageForm->iMainImage->Canvas->Font; int i = FontSizeComboBox->ItemIndex; if (i == 0 && TFontSize[0] == 0) FontSizeComboBox->ItemIndex = 2; else if (i == 1) FontSizeComboBox->ItemIndex = 2; if (FontSizeComboBox->ItemIndex == 0) font->Size = TFontSize[0]; else font->Size = TFontSize[FontSizeComboBox->ItemIndex - 1]; UseComboBoxForText = false; MainMenuForm->isAnyChanged = true; PostMessage(this->Handle, TPM_TEXTOPERATION, F_Size, 0); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontSizeChange(TSWordData *tsWordData) { TFont *font = MainImageForm->iMainImage->Canvas->Font; int fontSize = tsWordData->LFont.lfHeight; int hGap = ((double)tsWordData->HeightGap + 0.001) * 100; int wGap = ((double)tsWordData->WidthGap + 0.001) * 100; for (int i = 1; i < 11; i++) { if (TTextHeightGap[i] == hGap) { HeightGapComboBox->ItemIndex = i + 1; goto fNext; } } TTextHeightGap[0] = hGap; HeightGapComboBox->Text = IntToStr(hGap) + " %"; HeightGapComboBox->Items->Strings[0] = HeightGapComboBox->Text; HeightGapComboBox->ItemIndex = 0; fNext: for (int i = 1; i < 11; i++) { if (TTextWidthGap[i] == wGap) { WidthGapComboBox->ItemIndex = i + 1; goto sNext; } } TTextWidthGap[0] = wGap; WidthGapComboBox->Text = IntToStr(wGap) + " %"; WidthGapComboBox->Items->Strings[0] = WidthGapComboBox->Text; WidthGapComboBox->ItemIndex = 0; sNext: for (int i = 1; i < 15; i++) { if (TFontSize[i] == fontSize) { FontSizeComboBox->ItemIndex = i + 1; font->Size = TFontSize[i]; return; } } TFontSize[0] = fontSize; FontSizeComboBox->Text = IntToStr(TFontSize[0]) + " pt"; FontSizeComboBox->Items->Strings[0] = FontSizeComboBox->Text; FontSizeComboBox->ItemIndex = 0; font->Size = TFontSize[0]; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitSizeComboBox() { TFont *font = MainImageForm->iMainImage->Canvas->Font; // ±âº»ÀûÀ¸·Î ÆùÆ®¸¦ °¡Áö°í ÀÖÀ¸¹Ç·Î Items¸¦ ¹Þ¾Æ¿À´Â °ÍÀº ÁÖ¼®Ã³¸®ÇÏ¿´´Ù. // 2007.08.22.diekun // FontNameBox->Items = MainMenuForm->getVectorFontName->VectorFontName; // default_index¸¦ 0À¸·Î Çϸé Çѱۿ¡¼­´Â ¼¼·Î¹®Á¦°¡ ¼±ÅõDZ⠶§¹®¿¡ // ¾Æ·¡¿Í °°ÀÌ Ã³¸®Çß´Ù. À©µµ¿ì¸¶´Ù ÆùÆ®°³¼ö°¡ ´Ù¸£±â ¶§¹®¿¡ ÁöÁ¤ÇÒ ¼ö ¾ø´Ù. 20080522 by david TFont *tfont = new TFont(); tfont->Handle = (HFONT)GetStockObject(DEFAULT_GUI_FONT); // ±¼¸² String _DefaultFontName = tfont->Name; delete tfont; tfont = NULL; int default_index = FontNameBox->Items->IndexOf(_DefaultFontName); if (default_index < 0) { default_index = FontNameBox->Items->IndexOf(DefaultFontName); if (default_index < 0) default_index = 0; } FontNameBox->ItemIndex = default_index; String fontname; if (FontNameBox->SelectedFont) fontname = FontNameBox->SelectedFont->Name; // Text; else fontname = FontNameBox->FontName; font->Name = fontname; // 2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ FontSizeComboBox->Items->Clear(); FontSizeComboBox->Items->Add("Other"); // index = 0 TFontSize[0] = 0; FontSizeComboBox->Items->Add("----------------"); // index = 1 FontSizeComboBox->Items->Add("6 pt"); // index = 2 TFontSize[1] = 6; FontSizeComboBox->Items->Add("7 pt"); TFontSize[2] = 7; FontSizeComboBox->Items->Add("9 pt"); TFontSize[3] = 9; FontSizeComboBox->Items->Add("10 pt"); TFontSize[4] = 10; FontSizeComboBox->Items->Add("11 pt"); TFontSize[5] = 11; FontSizeComboBox->Items->Add("12 pt"); TFontSize[6] = 12; FontSizeComboBox->Items->Add("14 pt"); TFontSize[7] = 14; FontSizeComboBox->Items->Add("18 pt"); TFontSize[8] = 18; FontSizeComboBox->Items->Add("21 pt"); TFontSize[9] = 21; FontSizeComboBox->Items->Add("24 pt"); TFontSize[10] = 24; FontSizeComboBox->Items->Add("36 pt"); TFontSize[11] = 36; FontSizeComboBox->Items->Add("48 pt"); TFontSize[12] = 48; FontSizeComboBox->Items->Add("60 pt"); TFontSize[13] = 60; FontSizeComboBox->Items->Add("72 pt"); // index = 15 TFontSize[14] = 72; FontSizeComboBox->ItemIndex = 7; font->Size = TFontSize[6]; TTextHeightGap[0] = 0; TTextWidthGap[0] = 0; // index = 0 TTextHeightGap[1] = 25; TTextWidthGap[1] = 25; // index = 2 TTextHeightGap[2] = 50; TTextWidthGap[2] = 50; TTextHeightGap[3] = 75; TTextWidthGap[3] = 75; TTextHeightGap[4] = 80; TTextWidthGap[4] = 80; TTextHeightGap[5] = 100; TTextWidthGap[5] = 100; TTextHeightGap[6] = 110; TTextWidthGap[6] = 110; TTextHeightGap[7] = 125; TTextWidthGap[7] = 125; TTextHeightGap[8] = 150; TTextWidthGap[8] = 150; TTextHeightGap[9] = 175; TTextWidthGap[9] = 175; TTextHeightGap[10] = 200; TTextWidthGap[10] = 200; // index = 11; HeightGapComboBox->ItemIndex = 6; WidthGapComboBox->ItemIndex = 6; FontStyleBox->Items->Add(IDS_HFONTNOMAL.c_str()); // index = 0 FontStyleBox->Items->Add(IDS_HFONTITALIC.c_str()); FontStyleBox->Items->Add(IDS_HFONTWEIGHT.c_str()); FontStyleBox->Items->Add(IDS_HFONTWEIGHTITALIC.c_str()); FontStyleBox->ItemIndex = 0; if (MainImageForm) { if (MainImageForm->fontIndex > -1) FontNameBox->ItemIndex = MainImageForm->fontIndex; if (MainImageForm->styleIndex > -1) FontStyleBox->ItemIndex = MainImageForm->styleIndex; if (MainImageForm->sizeIndex > -1) FontSizeComboBox->ItemIndex = MainImageForm->sizeIndex; if (MainImageForm->wGapIndex > -1) WidthGapComboBox->ItemIndex = MainImageForm->wGapIndex; if (MainImageForm->hGapIndex > -1) HeightGapComboBox->ItemIndex = MainImageForm->hGapIndex; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::SizeRxSpinBtnBottomClick(TObject *Sender) { int tempSize; if (FontSizeComboBox->ItemIndex == 0) tempSize = TFontSize[0]; else tempSize = TFontSize[FontSizeComboBox->ItemIndex - 1]; tempSize--; TFontSize[0] = tempSize; FontSizeComboBox->Text = IntToStr(tempSize) + " pt"; FontSizeComboBox->Items->Strings[0] = FontSizeComboBox->Text; FontSizeComboBox->ItemIndex = 0; MainMenuForm->isAnyChanged = true; if (VecDraw->ExistSelected) { TFont *font = MainImageForm->iMainImage->Canvas->Font; font->Size = tempSize; VecDraw->ChangeSizeSeletedWordData(font); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::SizeRxSpinBtnTopClick(TObject *Sender) { int tempSize; if (FontSizeComboBox->ItemIndex == 0) tempSize = TFontSize[0]; else tempSize = TFontSize[FontSizeComboBox->ItemIndex - 1]; tempSize++; TFontSize[0] = tempSize; FontSizeComboBox->Text = IntToStr(tempSize) + " pt"; FontSizeComboBox->Items->Strings[0] = FontSizeComboBox->Text; FontSizeComboBox->ItemIndex = 0; MainMenuForm->isAnyChanged = true; if (VecDraw->ExistSelected) { TFont *font = MainImageForm->iMainImage->Canvas->Font; font->Size = tempSize; VecDraw->ChangeSizeSeletedWordData(font); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontSizeComboBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { int i, j; TFont *font = MainImageForm->iMainImage->Canvas->Font; EnterException = 0; for (j = 0; j < FontSizeComboBox->Text.Length(); j++) { i = (Char)FontSizeComboBox->Text.c_str()[j]; EnterException++; if (IsCharAlpha(FontSizeComboBox->Text.c_str()[j]) != 0 || (i < 48 || i > 57)) { if (j == 0) { FontSizeComboBox->ItemIndex = TempComboBoxIndex; if (FontSizeComboBox->ItemIndex == 0) font->Size = TFontSize[0]; else font->Size = TFontSize[FontSizeComboBox->ItemIndex - 1]; FontSizeComboBoxCloseUp(this); // if (VecDraw->ExistSelected) FontSizeComboBoxCloseUp(this); return; } else break; } } String temp = FontSizeComboBox->Text; temp.SetLength(j); i = StrToInt(temp.c_str()); FontSizeComboBox->Text = IntToStr(i) + " pt"; TFontSize[0] = i; FontSizeComboBox->Items->Strings[0] = FontSizeComboBox->Text; FontSizeComboBox->ItemIndex = 0; TempComboBoxIndex = 0; font->Size = TFontSize[0]; FontSizeComboBoxCloseUp(this); // if (VecDraw->ExistSelected) FontSizeComboBoxCloseUp(this); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::HeightGapComboBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { int num, j; for (j = 0; j < HeightGapComboBox->Text.Length(); j++) { num = (Char)HeightGapComboBox->Text.c_str()[j]; if (IsCharAlpha(HeightGapComboBox->Text.c_str()[j]) != 0 || (num < 48 || num > 57)) { if (j == 0) { HeightGapComboBox->ItemIndex = TempComboBoxIndex; HeightGapComboBoxCloseUp(this); // if (VecDraw->ExistSelected) HeightGapComboBoxCloseUp(this); return; } else break; } } String temp = HeightGapComboBox->Text; temp.SetLength(j); if (TryStrToInt(temp, num)) { // num = StrToInt(temp.c_str()); HeightGapComboBox->Text = IntToStr(num) + " %"; TTextHeightGap[0] = num; HeightGapComboBox->Items->Strings[0] = HeightGapComboBox->Text; HeightGapComboBox->ItemIndex = 0; TempComboBoxIndex = 0; HeightGapComboBoxCloseUp(this); } // if (VecDraw->ExistSelected) HeightGapComboBoxCloseUp(this); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WidthGapComboBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { int num, j; for (j = 0; j < WidthGapComboBox->Text.Length(); j++) { num = (Char)WidthGapComboBox->Text.c_str()[j]; if (IsCharAlpha(WidthGapComboBox->Text.c_str()[j]) != 0 || (num < 48 || num > 57)) { if (j == 0) { WidthGapComboBox->ItemIndex = TempComboBoxIndex; WidthGapComboBoxCloseUp(this); // if (VecDraw->ExistSelected) WidthGapComboBoxCloseUp(this); return; } else break; } } String temp = WidthGapComboBox->Text; temp.SetLength(j); num = StrToInt(temp.c_str()); WidthGapComboBox->Text = IntToStr(num) + " %"; TTextWidthGap[0] = num; WidthGapComboBox->Items->Strings[0] = WidthGapComboBox->Text; WidthGapComboBox->ItemIndex = 0; TempComboBoxIndex = 0; WidthGapComboBoxCloseUp(this); // if (VecDraw->ExistSelected) WidthGapComboBoxCloseUp(this); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CurrentFontState(TVecData *tData) { if (tData == NULL) return; int cNum = -1; TWordList *WordDataList; TSWordData *tsWordData; WordDataList = (TWordList*)tData->ListOfAllLine; if (WordDataList->Count == 0) { TFont *font = MainImageForm->iMainImage->Canvas->Font; int i = FontSizeComboBox->ItemIndex; font->Name = FontNameBox->FontName; // Text¸¦ FontNameÀ¸·Î ¿¡·¯ ¼öÁ¤ (2008. 01. 02 Annualring) if (i == 0 && TFontSize[0] == 0) { FontSizeComboBox->ItemIndex = 1; return; } if (i == 1) { FontSizeComboBox->ItemIndex = 2; return; } return; } // 0 1 2 3 ... IndexOfWord // A B C D ... Saved Word Data // 0 1 2 3 List Arrary Number if (VecDraw->IndexOfWord == 0) cNum = VecDraw->IndexOfWord; else cNum = VecDraw->IndexOfWord - 1; if (cNum < 0 || cNum > tData->nCount) return; tsWordData = (TSWordData*)WordDataList->Items(cNum); FontNameChange(tsWordData); FontSizeChange(tsWordData); if (tsWordData->Color != PenManagerForm->PenShape->Pen->Color) { // PaletteForm->DIB256Palette->SetNormal(PaletteForm->DIB256Palette->ChoiceIndex, // GetRValue(tsWordData->Color), GetGValue(tsWordData->Color), GetBValue(tsWordData->Color)); // PaletteForm->DIB256Palette->Repaint(); PenManagerForm->PenShape->Pen->Color = tsWordData->Color; PenManagerForm->PenShape->Brush->Color = tsWordData->Color; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CutSelectedWordData() // by maxleo21c (04.09.22) { BEGIN_LOG(""); if (VecDraw->ExistSelected) { VecDraw->CopySelectedWordData(); VecDraw->KeyDownInTextBox(VK_DELETE); FullViewForm->InitForm(MainImageForm->iMainImage); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CopySelectedWordData() { BEGIN_LOG(""); if (VecDraw->ExistSelected) { VecDraw->CopySelectedWordData(); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PasteSelectedWordData(String clipText) { BEGIN_LOG(""); if (VecDraw->CurrentTextBox < 0) return; if (MainImageForm->V_DATA->Count == 0) return; if (!VecDraw->BeReadyEdit) return; if (VecDraw->ListOfSelectedWord->Count > 0 || !clipText.IsEmpty()) { TVecData *tData; tData = (TVecData*)MainImageForm->V_DATA->Items[VecDraw->CurrentTextBox]; if (VecDraw->ExistSelected) { VecDraw->KeyDownInTextBox(VK_DELETE); VecDraw->PasteSelectedWordData(tData,clipText); } else VecDraw->PasteSelectedWordData(tData,clipText); FullViewForm->InitForm(MainImageForm->iMainImage); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontStyleBoxDropDown(TObject *Sender) { // UseComboBoxForText = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontStyleBoxCloseUp(TObject *Sender) { TFont *font = MainImageForm->iMainImage->Canvas->Font; int i = FontStyleBox->ItemIndex; if (i == 0) font->Style = TFontStyles(); else if (i == 1) font->Style = TFontStyles() << fsItalic; else if (i == 2) font->Style = TFontStyles() << fsBold; else font->Style = TFontStyles() << fsItalic << fsBold; UseComboBoxForText = false; MainMenuForm->isAnyChanged = true; PostMessage(this->Handle, TPM_TEXTOPERATION, F_Style, 0); /* if (VecDraw->ExistSelected) { VecDraw->ChangeStyleSeletedWordData(font); // SetFocusedControl(MainImageForm); -05.07.25ÁÖ¼® // MainImageForm->tempRadioButton->SetFocus(); } else { CheckNChangeFont(true); //btTemp->SetFocus(); // Focus󸮸¦ À§Çؼ­ ÇÊ¿äÇÑ °Í °°´Ù. ÇÏÁö¸¸ // À̰ÍÀ» »ç¿ëÇϸé MainImage¿¡ Focus°¡ °¡Áö ¾Ê´Â´Ù. // ÇöÀç ¾î¶»°Ô ó¸®ÇØ¾ß ÇÒÁö ¸ð¸£°Ú´Ù. // -05.07.25ÁÖ¼® // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // SetFocusedControl(MainImageForm); // MainImageForm->tempRadioButton->SetFocus(); } */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::HeightGapComboBoxCloseUp(TObject *Sender) { int i = HeightGapComboBox->ItemIndex; if (i == 0 && TTextHeightGap[0] == 0) HeightGapComboBox->ItemIndex = 6; if (i == 1) HeightGapComboBox->ItemIndex = 6; UseComboBoxForText = false; MainMenuForm->isAnyChanged = true; PostMessage(this->Handle, TPM_TEXTOPERATION, F_HeightGap, 0); /* if (VecDraw->ExistSelected) { if (HeightGapComboBox->ItemIndex == 0) VecDraw->ChangeHGapSeletedWordData(TTextHeightGap[0]); else VecDraw->ChangeHGapSeletedWordData(TTextHeightGap[HeightGapComboBox->ItemIndex-1]); // SetFocusedControl(MainImageForm); -05.07.25ÁÖ¼® // MainImageForm->tempRadioButton->SetFocus(); } else { CheckNChangeFont(false); // ³ôÀ̸¸ ¿µÇ⸦ ÁÙ°Í °°¾Æ¼­ width´Â ¸·À½ //btTemp->SetFocus(); // Focus󸮸¦ À§Çؼ­ ÇÊ¿äÇÑ °Í °°´Ù. ÇÏÁö¸¸ // À̰ÍÀ» »ç¿ëÇϸé MainImage¿¡ Focus°¡ °¡Áö ¾Ê´Â´Ù. // ÇöÀç ¾î¶»°Ô ó¸®ÇØ¾ß ÇÒÁö ¸ð¸£°Ú´Ù. // -05.07.25ÁÖ¼® // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // SetFocusedControl(MainImageForm); // MainImageForm->tempRadioButton->SetFocus(); } */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WidthGapComboBoxCloseUp(TObject *Sender) { int i = WidthGapComboBox->ItemIndex; if (i == 0 && TTextWidthGap[0] == 0) WidthGapComboBox->ItemIndex = 6; if (i == 1) WidthGapComboBox->ItemIndex = 6; UseComboBoxForText = false; MainMenuForm->isAnyChanged = true; PostMessage(this->Handle, TPM_TEXTOPERATION, F_WidthGap, 0); /* if (VecDraw->ExistSelected) { if (WidthGapComboBox->ItemIndex == 0) VecDraw->ChangeWGapSeletedWordData(TTextWidthGap[0]); else VecDraw->ChangeWGapSeletedWordData(TTextWidthGap[WidthGapComboBox->ItemIndex-1]); // SetFocusedControl(MainImageForm); -05.07.25ÁÖ¼® MainImageForm->tempRadioButton->SetFocus(); } else { // CheckNChangeFont(false); //btTemp->SetFocus(); // Focus󸮸¦ À§Çؼ­ ÇÊ¿äÇÑ °Í °°´Ù. ÇÏÁö¸¸ // À̰ÍÀ» »ç¿ëÇϸé MainImage¿¡ Focus°¡ °¡Áö ¾Ê´Â´Ù. // ÇöÀç ¾î¶»°Ô ó¸®ÇØ¾ß ÇÒÁö ¸ð¸£°Ú´Ù. // -05.07.25ÁÖ¼® // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // SetFocusedControl(MainImageForm); -05.07.25ÁÖ¼® MainImageForm->tempRadioButton->SetFocus(); } */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::TextColorChangeInEdit() { if (VecDraw->ExistSelected) { TVecData *tData; TSWordData *tsWordData; TList *DataList = NVector->DataList; // MainImageForm->V_DATA; // tData = (TVecData *)DataList->Items[VecDraw->CurrentTextBox]; if (VecDraw->CurrentTextBox < DataList->Count) { tData = (TVecData*)DataList->Items[VecDraw->CurrentTextBox]; } else { tData = VecDraw->CurrentTextBoxData; } VecDraw->TextModUndoSave(); // for new font for (int k = 0; k < tData->nCount; k++) { tsWordData = (TSWordData*)tData->ListOfAllLine->Items(k); if (tsWordData->Selected) tsWordData->Color = PenManagerForm->PenShape->Pen->Color; } } } // --------------------------------------------------------------------------- bool __fastcall TVectorForm::CheckTextEditState() { return VecDraw->BeReadyEdit; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::HeightGapRxSpinBtnBottomClick(TObject *Sender) { int i = HeightGapComboBox->ItemIndex; int tempHGap = TTextHeightGap[i]; tempHGap--; TTextHeightGap[0] = tempHGap; HeightGapComboBox->Text = IntToStr(tempHGap) + " %"; HeightGapComboBox->Items->Strings[0] = HeightGapComboBox->Text; HeightGapComboBox->ItemIndex = 0; MainMenuForm->isAnyChanged = true; if (VecDraw->ExistSelected) VecDraw->ChangeHGapSeletedWordData(TTextHeightGap[0]); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::HeightGapRxSpinBtnTopClick(TObject *Sender) { int i = HeightGapComboBox->ItemIndex; int tempHGap = TTextHeightGap[i]; tempHGap++; TTextHeightGap[0] = tempHGap; HeightGapComboBox->Text = IntToStr(tempHGap) + " %"; HeightGapComboBox->Items->Strings[0] = HeightGapComboBox->Text; HeightGapComboBox->ItemIndex = 0; MainMenuForm->isAnyChanged = true; if (VecDraw->ExistSelected) VecDraw->ChangeHGapSeletedWordData(TTextHeightGap[0]); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WidthGapRxSpinBtnBottomClick(TObject *Sender) { int i = WidthGapComboBox->ItemIndex; int tempWGap = TTextWidthGap[i]; tempWGap--; TTextWidthGap[0] = tempWGap; WidthGapComboBox->Text = IntToStr(tempWGap) + " %"; WidthGapComboBox->Items->Strings[0] = WidthGapComboBox->Text; WidthGapComboBox->ItemIndex = 0; MainMenuForm->isAnyChanged = true; if (VecDraw->ExistSelected) VecDraw->ChangeWGapSeletedWordData(TTextWidthGap[0]); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WidthGapRxSpinBtnTopClick(TObject *Sender) { int i = WidthGapComboBox->ItemIndex; int tempWGap = TTextWidthGap[i]; tempWGap++; TTextWidthGap[0] = tempWGap; WidthGapComboBox->Text = IntToStr(tempWGap) + " %"; WidthGapComboBox->Items->Strings[0] = WidthGapComboBox->Text; WidthGapComboBox->ItemIndex = 0; MainMenuForm->isAnyChanged = true; if (VecDraw->ExistSelected) VecDraw->ChangeWGapSeletedWordData(TTextWidthGap[0]); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontNameBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { int i = FontNameBox->ItemIndex; if (Key == VK_RETURN && i < 0) { FontNameBox->ItemIndex = TempComboBoxIndex; FontNameBoxCloseUp(this); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontStyleBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { int i = FontStyleBox->ItemIndex; if (Key == VK_RETURN && i < 0) { FontStyleBox->ItemIndex = TempComboBoxIndex; FontStyleBoxCloseUp(this); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontNameBoxDblClick(TObject *Sender) { UseComboBoxForText = true; FontNameBox->SetFocus(); TempComboBoxIndex = FontNameBox->ItemIndex; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontStyleBoxDblClick(TObject *Sender) { UseComboBoxForText = true; FontStyleBox->SetFocus(); TempComboBoxIndex = FontStyleBox->ItemIndex; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontSizeComboBoxDblClick(TObject *Sender) { UseComboBoxForText = true; FontSizeComboBox->SetFocus(); TempComboBoxIndex = FontSizeComboBox->ItemIndex; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::HeightGapComboBoxDblClick(TObject *Sender) { UseComboBoxForText = true; HeightGapComboBox->SetFocus(); TempComboBoxIndex = HeightGapComboBox->ItemIndex; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WidthGapComboBoxDblClick(TObject *Sender) { UseComboBoxForText = true; WidthGapComboBox->SetFocus(); TempComboBoxIndex = WidthGapComboBox->ItemIndex; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CheckNChangeFont(bool GapOrFont, TVecData *sData) { if (!VecDraw->BeReadyEdit) return; TVecData *tData; if (sData == NULL) { TList *DataList = NVector->DataList; if (DataList->Count < 0) return; if (VecDraw->CurrentTextBox < 0) return; // tData = (TVecData *)DataList->Items[VecDraw->CurrentTextBox]; if (VecDraw->CurrentTextBox < DataList->Count) { tData = (TVecData*)DataList->Items[VecDraw->CurrentTextBox]; } else { tData = VecDraw->CurrentTextBoxData; } if (tData == NULL) return; } else tData = sData; SIZE size; HDC hdc; int IndexInLine, lineCount; TWordList *WordDataList = (TWordList*)tData->ListOfAllLine; TSWordData *tsWordData; IndexInLine = WordDataList->GetIndexInLine(VecDraw->IndexOfWord); lineCount = (WordDataList->GetLineTextBox(VecDraw->IndexOfLine)) ->LineDataList->Count; // lineCount-1 == IndexInLine È®ÀÎÇÏ´Â ÀÌÀ¯´Â ¸¶Áö¸·¿¡ Enter°¡ ÀÖÀ» °æ¿ì // lineCount > IndexInLine À̱⠶§¹®ÀÌ´Ù. if (GapOrFont && lineCount - 1 == IndexInLine) { // GapOrFont´Â FontÀÏ °æ¿ì true hdc = MainImageForm->iMainImage->Canvas->Handle; tsWordData = (TSWordData*)tData->ListOfAllLine->GetLineTextBox (VecDraw->IndexOfLine)->LineDataList->Items[IndexInLine]; if (tsWordData->Word[0] != '\r') return; // GetTextExtentPoint32(hdc, tsWordData->Word, 1, &size); /////////////////////// Vista Font¿¡ ´ëÇØ SizeÁ¦´ë·Î ¸ø°¡Á®¿Í¼­ »ý±â´Â ¹®Á¦ ó¸® (2007. 06. 27 Annualring) size = VecDraw->GetVectorTextExtent(MainImageForm->iMainImage->Canvas, MainImageForm->iMainImage->Canvas->Font, tsWordData, 1); if (FontSizeComboBox->ItemIndex == 0) tsWordData->LFont.lfHeight = TFontSize[0]; else tsWordData->LFont.lfHeight = TFontSize[FontSizeComboBox->ItemIndex - 1]; // 2007.08.22.diekun. RzÄÄÆ÷³ÍÆ®¹æ½ÄÀ¸·Î º¯°æ _tcscpy(tsWordData->LFont.lfFaceName, FontNameBox->SelectedFont->Name.c_str()); tsWordData->PPoint.x = size.cx; tsWordData->PPoint.y = size.cy; tsWordData->Interval = size.cx * 4 / 5; } else if (!GapOrFont && lineCount - 1 == IndexInLine) { tsWordData = (TSWordData*)tData->ListOfAllLine->GetLineTextBox (VecDraw->IndexOfLine)->LineDataList->Items[IndexInLine]; if (tsWordData->Word[0] != '\r') return; if (HeightGapComboBox->ItemIndex == 0) tsWordData->HeightGap = (float)TTextHeightGap[0] / 100; else tsWordData->HeightGap = (float) TTextHeightGap[HeightGapComboBox->ItemIndex - 1] / 100; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitReflectionMirror() { // MainImageForm Á¦°Å½Ã¿¡ ¸Þ¸ð¸® Á¢±Ù ¿À·ù¹ß»ýÇØ¼­ Ãß°¡ if (MainImageForm == NULL) return; BEGIN_LOG(""); // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - by monkman (2005.02.15) TPLayerImage *MIImage = NULL; TList *DataList = NULL, *SelectedList = NULL, *BackUpList = NULL, *ReflectionList = NULL; // ConvertToBitmap() À» Çϱâ À§ÇØ.. HDC dcDst; int countX; int countY; MIImage = MainImageForm->iMainImage; DataList = NVector->DataList; SelectedList = NVector->SelectedList; BackUpList = NVector->BackUpList; ReflectionList = NVector->ReflectionList; // ÃʱâÈ­¸¦ À§ÇÑ Ãß°¡ºÎºÐ - by monkman (2005.04.01) if (NVector->bMergeMode) VecDraw->ExitMerge(); NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // MainImageForm->bOutline = false; NVector->bRotation = false; NVector->bPatternMode = false; NVector->PatternStep = 0; VecDraw->nSelPos = 0; NVector->step = 0; NVector->bFstLine = true; NVector->bFirst = true; // Undo¸¦ À§ÇØ.. NVector->bVectorReflectionMode = true; NVector->ReflectionVIndex = -1; NVector->ReflectionHIndex = -1; // ¹ÝÀü °Å¿ï ±âÁؼ±ÀÇ ÁÂÇ¥ // Control ¼³Á¤ sbCurveTextDraw->Enabled = false; sbCurveTextEdit->Enabled = false; // -->by linuxjun for Undo TPVectorUndo * Undo = (TPVectorUndo*)MainImageForm->VecUndo; Undo->SetIndexOfStartReflection(); // <--by linuxjun for Undo // Vector ¸®½ºÆ®¸¦ ºñ¿ì°í, ¹é¾÷ÇÑ´Ù VecDraw->VecDataListDelete(SelectedList); VecDraw->VecDataListDelete(BackUpList); VecDraw->VecDataListDelete(ReflectionList); // ¾Æ·¡ VecDataListCopy()¿Í VecDataListDelete() ´ë½Å¿¡ Assign() À» »ç¿ëÇÑ´Ù - by monkman (2005.06.02) // VecDraw->VecDataListCopy(BackUpList, DataList); // ConvertToBitmap ½Ã¿¡ ºñÆ®¸ÊÀ¸·Î ¸¸µéÁö ¾Ê±â À§Çؼ­.. // VecDraw->VecDataListDelete(DataList, -1, -1, false, false); // VecDraw->VecDataListCopy(SelectedList, DataList, -1, -1, true, false, false); // VecDraw->VecDataListDelete(DataList, -1, -1, true, true); BackUpList->Assign(DataList); VecDraw->VecDataListDelete(DataList, -1, -1, true, false); if (MIImage->SubBitmap) MIImage->SubBitmap->Destroy(); // ±âÁ¸ ³»¿ë »èÁ¦ if (MIImage->SubMask) MIImage->SubMask->Destroy(); // ¹ÝÀü °Å¿ï ºñÆ®¸ÊÀ» ÀÌ¿ëÇÏ¿© ¹é¾÷ÇÏ´Â °ÍÀ¸·Î º¯°æ - by monkman (2011.04.22) if (MainImageForm->VectorReflectionBitmap) delete MainImageForm->VectorReflectionBitmap; MainImageForm->VectorReflectionBitmap = new TUnionBitmap; MainImageForm->VectorReflectionBitmap->Create(MIImage->uBitmap->Width, MIImage->uBitmap->Height, MIImage->uBitmap->BitsPerPixel, MIImage->uBitmap->RGB); MainImageForm->VectorReflectionBitmap->Copy(MIImage->uBitmap, SRCCOPY); if (MainImageForm->VectorReflectionMask) delete MainImageForm->VectorReflectionMask; MainImageForm->VectorReflectionMask = NULL; if (MIImage->LayerMask) { MainImageForm->VectorReflectionMask = new TUnionBitmap; MainImageForm->VectorReflectionMask->Create(MIImage->LayerMask->Width, MIImage->LayerMask->Height, MIImage->LayerMask->BitsPerPixel, MIImage->LayerMask->RGB); MainImageForm->VectorReflectionMask->Copy(MIImage->LayerMask, SRCCOPY); } // ¹è°æ»öÀ¸·Î ä¿î´Ù // if (MIImage->uBitmap) MIImage->uBitmap->FillRect(Rect(0, 0, MIImage->uBitmap->Width, MIImage->uBitmap->Height), // PaletteForm->DIB256Palette->GetBGCOLORREF(MIImage->uBitmap->BitsPerPixel)); NVector->bCancelAntialiasing = true; // WindowForm->sbOffClick(this); // ConvertToBitmap() À» Çϱâ À§ÇØ.. countX = MIImage->uBitmap->CountX; countY = MIImage->uBitmap->CountY; for (int n = 0; n < countX * countY; n++) // { if (MIImage->LayerMask) { dcDst = MIImage->LayerMask->CreateDC(n); // VecDraw->ConvertToBitmapMask(this, dcDst, MIImage->uBitmap->uRect[0][n].left, MIImage->uBitmap->uRect[0][n].top); // MIImage->LayerMask->Table[0][n].blank = false; // º¤ÅͰ¡ ±×·ÁÁöÁö ¾Ê¾Ò´ø ºÎºÐÀ» ÇöÀç·Î¼­´Â ¾Ë ¼ö ¾ø¾î ÀüºÎ ºñÆ®¸ÊÈ­ µÈ°É·Î.. MIImage->LayerMask->DeleteDC(dcDst, n); // convert by celberus dcDst = NULL; } dcDst = MIImage->uBitmap->CreateDC(n); // VecDraw->ConvertToBitmap(this, dcDst,false, MIImage->uBitmap->uRect[0][n].left, MIImage->uBitmap->uRect[0][n].top, n == countX * countY - 1); // MIImage->uBitmap->Table[0][n].blank = false; // º¤ÅͰ¡ ±×·ÁÁöÁö ¾Ê¾Ò´ø ºÎºÐÀ» ÇöÀç·Î¼­´Â ¾Ë ¼ö ¾ø¾î ÀüºÎ ºñÆ®¸ÊÈ­ µÈ°É·Î.. MIImage->uBitmap->DeleteDC(dcDst, n); // convert by celberus dcDst = NULL; } MIImage->uBitmap->SetAllToModified(); // if (MIImage->LayerMask) { MIImage->LayerMask->SetAllToModified(); // } MainImageForm->CorrectPaletteIndex(); // if (MIImage->LayerMask) { // // BitsPerPixel¿¡ ¸¶½ºÅ©ÀÇ ÃʱâÈ­ ¹æ½ÄÀÌ ´Ù¸£´Ù // switch (MIImage->uBitmap->BitsPerPixel) { // case 8 : // MIImage->LayerMask->FillRect(Rect(0, 0, MIImage->LayerMask->Width, MIImage->LayerMask->Height), 0x010000FF); // break; // case 24 : // MIImage->LayerMask->FillRect(Rect(0, 0, MIImage->LayerMask->Width, MIImage->LayerMask->Height), 0x000000FF); // break; // } // } // À§ÀÇ Assign() »ç¿ëÀ¸·Î ¾Æ·¡ VecDataListDelete()¸¦ »ç¿ëÇÑ´Ù // (Remove()¸¸ Çϰí delete´Â ÇÏÁö ¾Ê´Â´Ù) - by monkman (2005.06.02) VecDraw->VecDataListDelete(DataList, -1, -1, false, false); // ¼±ÅõǾîÀÖ´ø ¿ÀºêÁ§Æ®´Â ¹ÝÀü º¹»ç ¸ðµå·Î °¡Á®¿Â´Ù // ½ÃÀÛÀ§Ä¡¿Í °³¼ö¾øÀ½(ÀüüÀÓ), PatternFill, TextBox´Â °¡Á®¿ÀÁö ¾ÊÀ½ VecDraw->VecDataListCopy(DataList, BackUpList, -1, -1, -1, true, false, false); // ¸ÞÀÎ ¸Þ´ºÀÇ ¹öư »óŸ¦ ÀúÀå MainMenuForm->SetMainMenuItem(); // MainMenuÀÇ ´Ù¸¥ ºÎºÐÀº ¸·´Â´Ù // Main Menu MainMenuForm->sbWindow->Enabled = false; MainMenuForm->sbMoveCopy->Enabled = false; MainMenuForm->sbColorChange->Enabled = false; MainMenuForm->sbClear->Enabled = false; MainMenuForm->sbGrouping->Enabled = false; MainMenuForm->sbAutoRepeat->Enabled = false; MainMenuForm->sbManualRepeat->Enabled = false; MainMenuForm->sbDraw->Enabled = false; MainMenuForm->sbRepro->Enabled = false; MainMenuForm->sbFill->Enabled = false; MainMenuForm->sbSpreadFill->Enabled = false; MainMenuForm->sbStipple->Enabled = false; MainMenuForm->sbStyle->Enabled = false; MainMenuForm->sbPatternRepeat->Enabled = false; MainMenuForm->sb3D->Enabled = false; MainMenuForm->sbShadow->Enabled = false; MainMenuForm->sbAfter->Enabled = false; MainMenuForm->sbStripe->Enabled = false; MainMenuForm->sbSeparate->Enabled = false; MainMenuForm->sbStitch->Enabled = false; MainMenuForm->sbText->Enabled = false; MainMenuForm->sbCombo->Enabled = false; MainMenuForm->sbSmooth->Enabled = false; MainMenuForm->sbScratch->Enabled = false; MainMenuForm->sbJacquard->Enabled = false; MainMenuForm->sbFile->Enabled = true; MainMenuForm->sbPrint->Enabled = false; MainMenuForm->sbScan->Enabled = false; // MainMenuForm->sbTexWork->Enabled = false; MainMenuForm->sbVector->Enabled = true; MainMenuForm->sbUndo->Enabled = false; // Pop-up Menu UpdateForm(); if (MIImage) MIImage->Repaint(); // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- MakeGroup->Enabled = false; SelectGroup->Enabled = false; END_LOG; } // --------------------------------------------------------------------------- bool __fastcall TVectorForm::ExitReflectionMirror(bool bForceExit) { BEGIN_LOG(""); TMainImageForm *mif = NULL; TPLayerImage *MIImage = NULL; TList *DataList = NULL, *SelectedList = NULL, *BackUpList = NULL, *ReflectionList = NULL; int Decision; // -->by linuxjun for Undo TVecData *data = NULL; bool sw = true; int numCount = 0; // <--by linuxjun for Undo // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (bForceExit) { for (int i = 0; i < MainForm->MDIChildCount; i++) { // ÀÌÀü ĵ¹ö½º ¼±ÅÃÇØ¼­ Activate - by monkman (2005.01.19) mif = (TMainImageForm*)MainForm->MDIChildren[i]; if (mif && NVector->bVectorReflectionMode) break; else { if (mif != NULL) { mif->sbVertical->Enabled = false; mif->sbHorizontal->Enabled = false; mif->sbLock->Enabled = false; mif = NULL; } } } } else { if (MainForm->ActiveMDIChild) { mif = (TMainImageForm*)MainForm->ActiveMDIChild; if (mif != NULL) { if (!NVector->bVectorReflectionMode) { mif->sbVertical->Enabled = false; mif->sbHorizontal->Enabled = false; mif->sbLock->Enabled = false; mif = NULL; } } } else { if (mif != NULL) { mif->sbVertical->Enabled = false; mif->sbHorizontal->Enabled = false; mif->sbLock->Enabled = false; mif = NULL; } } } // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (mif == NULL) { END_LOG; return true; } MIImage = mif->iMainImage; DataList = NVector->DataList; SelectedList = NVector->SelectedList; BackUpList = NVector->BackUpList; ReflectionList = NVector->ReflectionList; if (bForceExit) { // °­Á¦ Á¾·á½Ã (FormÀÌ DeActivateµÇ¾úÀ» °æ¿ì) Decision = Application->MessageBox(IDS_MESSAGE002.c_str(), L"Question", MB_ICONQUESTION | MB_YESNO); } else { Decision = Application->MessageBox(IDS_MESSAGE002.c_str(), L"Question", MB_ICONQUESTION | MB_YESNOCANCEL); } if (Decision == IDCANCEL) { END_LOG; return false; // Cancel Click } // -->by linuxjun for Undo TPVectorUndo * Undo = (TPVectorUndo*)mif->VecUndo; Undo->RemoveLastUntilNum(); Undo->SetIndexOfStartReflection(-1); // <--by linuxjun for Undo // ¸®½ºÆ®ÀÇ À̸§À» ¹Ù²Ù±â À§ÇÑ ÀÛ¾÷ VecDraw->VecDataListMove(ReflectionList, DataList); // DataList <-> ReflectionList VecDraw->VecDataListDelete(DataList); // ±âÁ¸ DataList¸¦ ºñ¿î´Ù VecDraw->VecDataListMove(DataList, BackUpList); // ¹é¾÷ÇÑ °ÍÀ» DataList¿¡ ¸ÕÀú ¾´´Ù VecDraw->VecDataListMove(DataList, SelectedList); // ¸Þ¸ð¸®¿¡ »õ·Î ¸¸µéÁö ¾Ê°í, ÁÖ¼Ò¸¸ ¿Å±â´Â ÀÛ¾÷À̶ó ÀÌ·¸°Ô µ¹·Á ÀÛ¾÷ÇØµµ ¼Óµµ°¡ ´À¸®Áö¾Ê´Ù switch(Decision) { case IDYES: // Yes Click // ÀÛ¾÷ÇÑ ³»¿ëÀ» ¿Å±ä´Ù // -->by linuxjun for Undo for (int i = DataList->Count - 1; i > -1; i--) { data = (TVecData*)DataList->Items[i]; if (data->bSelected) { VecDraw->UndoSave(VU_DELETE, i, sw); sw = false; } else { numCount++; } } // <--by linuxjun for Undo VecDraw->VecDataListDelete(DataList, -1, -1, true); // ±âÁ¸ ¼±ÅÃÇØ¼­ °¡Á®¿Â °ÍÀº »ç¶óÁü.. // ½ÃÀÛÀ§Ä¡¿Í °³¼ö¾øÀ½(ÀüüÀÓ), PatternFill, TextBox´Â °¡Á®¿ÀÁö ¾ÊÀ½ VecDraw->VecDataListCopy(DataList, ReflectionList, -1, -1, -1, false, false, false); // ¹ÝÀü °Å¿ï¿¡¼­ »ç¿ëÇÏ¸ç ±âÁØÁ¡ ÁÂÇ¥¸¦ ±âÁØÀ¸·Î ÁÂÇ¥µéÀ» º¯È¯Çؼ­ º¹»ç if (NVector->ReflectionVH == 1) { // ¼öÁ÷ ±âÁØÁ¡ VecDraw->VecDataListReflection(DataList, ReflectionList, -1, -1, false, false, NVector->ReflectionVH, NVector->ReflectionVIndex); } else if (NVector->ReflectionVH == 2) { // ¼öÆò ±âÁØÁ¡ VecDraw->VecDataListReflection(DataList, ReflectionList, -1, -1, false, false, NVector->ReflectionVH, NVector->ReflectionHIndex); } // -->by linuxjun for Undo for (int i = numCount; i < DataList->Count; i++) { VecDraw->UndoSave(VU_CREATE, i, sw); } // <--by linuxjun for Undo // ÀÛ¾÷ÇÑ ³»¿ëÀ» Áö¿ö¹ö¸°´Ù VecDraw->VecDataListDelete(ReflectionList); break; case IDNO: // No Click // ÀÛ¾÷ÇÑ ³»¿ëÀ» Áö¿ö¹ö¸°´Ù VecDraw->VecDataListDelete(ReflectionList); break; } // ¹ÝÀü °Å¿ï ºñÆ®¸ÊÀ» ÀÌ¿ëÇÏ¿© ¹é¾÷ÇÏ´Â °ÍÀ¸·Î º¯°æ - by monkman (2011.04.22) if (MainImageForm->VectorReflectionBitmap) { MIImage->uBitmap->ExactCopy(MainImageForm->VectorReflectionBitmap); delete MainImageForm->VectorReflectionBitmap; } MainImageForm->VectorReflectionBitmap = NULL; if (MainImageForm->VectorReflectionMask) { if (MIImage->LayerMask) MIImage->LayerMask->ExactCopy(MainImageForm->VectorReflectionMask); delete MainImageForm->VectorReflectionMask; } MainImageForm->VectorReflectionMask = NULL; // ¹Ý¿µÇϰųª ¹Ý¿µÇÏÁö ¾Ê´Â °æ¿ì NVector->bVectorReflectionMode = false; NVector->ReflectionVH = 0; NVector->ReflectionVIndex = -1; NVector->ReflectionHIndex = -1; NVector->ReflectFirstIndex = true; mif->iMainImage->OnPaintVectorReflectIndexPoint = NULL; // ÃʱâÈ­¸¦ À§ÇÑ Ãß°¡ºÎºÐ - by monkman (2005.04.01) if (NVector->bMergeMode) VecDraw->ExitMerge(); NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // mif->bOutline = false; NVector->bRotation = false; NVector->bPatternMode = false; NVector->PatternStep = 0; VecDraw->nSelPos = 0; NVector->step = 0; NVector->bFstLine = true; NVector->bFirst = true; // Undo¸¦ À§ÇØ.. // ¸ÞÀÎ ¸Þ´ºÀÇ ¹öư »óŸ¦ µÇµ¹¸² MainMenuForm->GetMainMenuItem(); MainMenuForm->UpdateItem(); NVector->bReflectionGuideLineLock = false; // Control ¼³Á¤ mif->sbVertical->Tag = 0; mif->sbVertical->Down = false; mif->sbHorizontal->Tag = 0; mif->sbHorizontal->Down = false; mif->sbLock->Tag = 0; mif->sbLock->Down = false; mif->sbLock->Enabled = false; sbCurveTextDraw->Enabled = true; sbCurveTextEdit->Enabled = true; UpdateForm(); if (MIImage) MIImage->Repaint(); MakeGroup->Enabled = true; SelectGroup->Enabled = true; END_LOG; return true; } // --------------------------------------------------------------------------- // 2005 Vector upgrade 0315 Shin void __fastcall TVectorForm::sbArrangeClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // bOutline Ãß°¡ (2008. 01. 11 Annualring) if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation /* || VecDraw->NVector->bOutline */ ) { VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; MainImageForm->iMainImage->Repaint(); } if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbObjectEditClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *s = (TRzMenuToolbarButton*)Sender; s->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = s->Tag; // MainImageForm->iMainImage->bVectorModify = true; VectorMenuCurrentPanel(); VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = true; MainImageForm->sbHorizontal->Enabled = true; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (NVector->step != 0) { NVector->step = 0; VecDraw->NVector->bFstLine = true; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) } UpdateForm(); FullViewForm->InitForm(MainImageForm->iMainImage); VecDraw->NVector->bFstLine = true; if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector upgrade 0315 Shin void __fastcall TVectorForm::sbMoveCopyClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *s = (TRzMenuToolbarButton*)Sender; s->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = s->Tag; VectorMenuCurrentPanel(); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // bOutline Ãß°¡ (2008. 01. 11 Annualring) if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation /* || VecDraw->NVector->bOutline */ ) { VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; MainImageForm->iMainImage->Repaint(); } if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbColorClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // bOutline Ãß°¡ (2008. 01. 11 Annualring) if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation /* || VecDraw->NVector->bOutline */ ) { VecDraw->NVector->bProportion = false; // bOutline Ãß°¡ (2008. 01. 11 Annualring) // VecDraw->NVector->bOutline = false; VecDraw->NVector->bRotation = false; MainImageForm->iMainImage->Repaint(); } if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); // VecDraw->ChangeObjectColor(false); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector upgrade 0315 Shin void __fastcall TVectorForm::sbFillClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (VecDraw->NVector->bProportion || VecDraw->NVector->bRotation) { VecDraw->NVector->bProportion = false; VecDraw->NVector->bRotation = false; MainImageForm->iMainImage->Repaint(); } if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } if (!NVector->bVectorReflectionMode) { TList *DataList = NVector->DataList; // MainImageForm->V_DATA; int count = 0, index; TVecData *data; for (int i = 0; i < DataList->Count; i++) { data = (TVecData*)DataList->Items[i]; if (!data->Equal(MainImageForm->Number)) continue; if (data->bSelected) { count++; } } if (count < 1) sbGradientFill->Enabled = false; else sbGradientFill->Enabled = true; } else { sbGradientFill->Enabled = false; } if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); // VecDraw->ChangeObjectColor(true); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0401 Shin void __fastcall TVectorForm::DrawPenShapeButton(int num) { TMenuItem *menuItem = NULL; // Round if (num == 0) menuItem = mnitemRound; // Flat else if (num == 1) menuItem = mnitemFlat; if (menuItem != NULL) rzbtnPenShape->Glyph->Assign(menuItem->Bitmap); KindOfPenShape = num; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::cbObjAntialiasing2Click(TObject *Sender) { TRzCheckBox *CheckBox = dynamic_cast(Sender); if (CheckBox && bUserChange) { if (CheckBox->Checked) { bAntialiasing = true; } else bAntialiasing = false; VecDraw->ChangeAntialiasing(); } // MainImageForm->tempRadioButton->SetFocus(); } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::EditPenThickSpinButtonBottomClick(TObject *Sender) { BEGIN_LOG(""); double PenThick = 0.0; if (NVector->bMultiSelect) { EditPenComboBox->ItemIndex = 1; // ItemIndex 1 : ----------- VecDraw->ChangeObjectThick(-1, true); } else { if (!TryStrToFloat(EditPenComboBox->Text, PenThick)) { END_LOG; return; } // PenThick = StrToFloat(VectorPenComboBox->Text); if (PenThick > 2) PenThick--; else { if (PenThick == 2.0) { PenThick = 1.5; } else if (PenThick == 1.5) { PenThick = 1.0; } else if (PenThick == 1) { PenThick = 0.75; } else if (PenThick == 0.75) { PenThick = 0.5; } else if (PenThick == 0.5) { PenThick = 0.25; } else { PenThick = 0.25; } } EditPenComboBox->Text = FloatToStr(PenThick); VectorPenThickChange(); } END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::EditPenThickSpinButtonTopClick(TObject *Sender) { BEGIN_LOG(""); double PenThick = 0.0; if (NVector->bMultiSelect) { VecDraw->ChangeObjectThick(-2, true); // combobox¿¡¼­ 1·Î º¯°æÇϴ°Ͱú ±¸º°Çϵµ·Ï ÇϱâÀ§ÇØ EditPenComboBox->ItemIndex = 1; // ItemIndex 1 : ----------- } else { if (!TryStrToFloat(EditPenComboBox->Text, PenThick)) { END_LOG; return; } // PenThick = StrToFloat(VectorPenComboBox->Text); if (PenThick >= 2) PenThick++; else { if( PenThick == 1.5){ PenThick = 2; } else if (PenThick == 1.0) { PenThick = 1.5; } else if (PenThick == 0.75) { PenThick = 1; } else if (PenThick == 0.5) { PenThick = 0.75; } else if (PenThick == 0.25) { PenThick = 0.5; } else { PenThick = 0.25; } } EditPenComboBox->Text = FloatToStr(PenThick); // VecDraw->ChangeObjectThick(PenThick, false); VectorPenThickChange(); } END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::EditPenComboBoxCloseUp(TObject *Sender) { TRzComboBox *combobox = (TRzComboBox*)Sender; int tempindex = 0; tempindex = combobox->ItemIndex; if (tempindex == 2) { // Åõ¸í¼± combobox->Text = IDS_Line_Width_Zero; } else if (tempindex != 1) { // ³ª´®¼± combobox->ItemIndex = tempindex; combobox->Text = combobox->Items->Strings[tempindex]; } else { tempindex = 3; // Åõ¸í¼± Ãß°¡·Î ±âº»ÀÌ 3À¸·Î º¯°æ combobox->ItemIndex = tempindex; combobox->Text = combobox->Items->Strings[tempindex]; } VectorPenThickChange(); // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::EditPenComboBoxDblClick(TObject *Sender) { TRzComboBox *combobox = (TRzComboBox*)Sender; combobox->SetFocus(); } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::eSetKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { TEdit* edit = (TEdit*)Sender; String strName = edit->Name; double dInput = 0.0; int next = 0, count = 0; for (int i = 0; i < 6; i++) { TEdit* component = dynamic_cast (FindComponent("eSet_" + IntToStr(i))); if (component) { if (component->Visible) { if (component->Name == strName) next = i + 1; if (TryStrToFloat(component->Text, dInput)) { if (dInput > 10000) dInput = 10000; VecDraw->set[i] = dInput; component->Text = FloatToStr(dInput) + " pt"; } else if (TryStrToFloat(component->Text.SubString(0, component->Text.Length() - 3), dInput)) { if (dInput > 10000) dInput = 10000; VecDraw->set[i] = dInput; } else component->Text = "0 pt"; count++; } } } if (count > 0) VecDraw->SetUserDashStyle(count); if (next < 6) { edit = dynamic_cast(FindComponent("eSet_" + IntToStr(next))); if (edit->Visible) edit->SetFocus(); else g_FocusControl->SetFocus(); // MainImageForm->tempRadioButton->SetFocus(); } else { // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } } } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::eSetMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); edit->SelectAll(); } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::eData1KeyUp(TObject *Sender, WORD &Key, TShiftState Shift) { /* double dtemp = 0; if ((eData1->Text != "0") && TryStrToFloat(eData1->Text, dtemp)){ *bUserLength1 = true; *bUserInput = true; } else { *bUserLength1 = false; *bUserInput = false; eData1->Text = "0"; eData1->SelectAll(); } MainImageForm->tempRadioButton->SetFocus(); */ } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::eDataMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); edit->SelectAll(); } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin bool __fastcall TVectorForm::IsFloat(String strNum) { if (strNum.IsEmpty()) return false; int i, j, count = 0; for (i = 0; i < strNum.Length(); i++) { j = (Char)strNum.c_str()[i]; if (IsCharAlpha(strNum.c_str()[i]) == 0 && ((j >= 48 && j <= 57) || j == 46) ) { count++; } } if (count != strNum.Length()) { return false; } return true; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0317 Shin void __fastcall TVectorForm::eData2KeyUp(TObject *Sender, WORD &Key, TShiftState Shift) { /* double dTemp = 0; if (sbLine->Down){ if (TryStrToFloat(eData2->Text, dTemp)){ *bUserLength2 = true; *bUserInput = true; } else { *bUserLength2 = false; *bUserInput = false; eData2->Text = "0"; eData2->SelectAll(); } } else { if ((eData2->Text != "0") && TryStrToFloat(eData2->Text, dTemp)){ *bUserLength2 = true; *bUserInput = true; } else { *bUserLength2 = false; *bUserInput = false; eData2->Text = "0"; eData2->SelectAll(); } } */ // MainImageForm->tempRadioButton->SetFocus(); } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::PenStyleComboBoxChange(TObject *Sender) { /* eSetD_0->Text = ""; eSetD_1->Text = ""; eSetD_2->Text = ""; eSetD_3->Text = ""; eSetD_4->Text = ""; eSetD_5->Text = ""; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; String strtemp; int index = PenStyleComboBox->ItemIndex; PenStyle = index; PenThick = PenManagerForm->VectorPenThick; switch(index){ case 0: break; case 1: eSetD_0->Visible = true; eSetD_1->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; strtemp = FloatToStr(PenThick*3); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; break; case 2: eSetD_0->Visible = true; eSetD_1->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; strtemp = FloatToStr(PenThick); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; break; case 3: eSetD_0->Visible = true; eSetD_1->Visible = true; eSetD_2->Visible = true; eSetD_3->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; stSet2_d->Visible = true; stSet2_g->Visible = true; strtemp = FloatToStr(PenThick*3); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_2->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_3->Text = strtemp + " pt"; break; case 4: eSetD_0->Visible = true; eSetD_1->Visible = true; eSetD_2->Visible = true; eSetD_3->Visible = true; eSetD_4->Visible = true; eSetD_5->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; stSet2_d->Visible = true; stSet2_g->Visible = true; stSet3_d->Visible = true; stSet3_g->Visible = true; strtemp = FloatToStr(PenThick*3); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_2->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_3->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_4->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_5->Text = strtemp + " pt"; break; } //UDPen->SetFocus(); // ´Ù¸¥°÷¿¡ focus¸¦ µ¹¸² cbObjAntialiasing->SetFocus(); */ } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::PenStyleComboBoxDrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State) { Graphics::TBitmap *pBitmap = new Graphics::TBitmap(); if(Index == 6) ImageList->GetBitmap(Index+1, pBitmap); else ImageList->GetBitmap(Index, pBitmap); PenStyleComboBox->Canvas->Draw(Rect.left, Rect.top, pBitmap); delete pBitmap; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::EditPenStyleBoxDrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State) { Graphics::TBitmap *pBitmap = new Graphics::TBitmap(); ImageList->GetBitmap(Index, pBitmap); EditPenStyleBox->Canvas->Draw(Rect.left, Rect.top, pBitmap); delete pBitmap; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::VectorPenThickChange() { double PenThick = 0.0; if (EditPenComboBox->ItemIndex == 2) PenThick = 0; // Åõ¸íó¸® else if (!TryStrToFloat(EditPenComboBox->Text, PenThick)) return; // PenThick = StrToFloat(VectorPenComboBox->Text); if (NVector->bMultiSelect) { VecDraw->ChangeObjectThick(PenThick, true); } else { VecDraw->ChangeObjectThick(PenThick, false); if (EditPenStyleBox->ItemIndex > 0) { String strTemp; switch(EditPenStyleBox->ItemIndex) { case 1: case 2: strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; break; case 3: strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[2]); eSet_2->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[3]); eSet_3->Text = strTemp + " pt"; break; case 4: strTemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[2]); eSet_2->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[3]); eSet_3->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[4]); eSet_4->Text = strTemp + " pt"; strTemp = FloatToStr(VecDraw->set[5]); eSet_5->Text = strTemp + " pt"; break; } } } } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin // mousemove½Ã ±×·ÁÁö´Â µµÇüµéÀÇ Á¤º¸¸¦ º¸¿©ÁÜ (±æÀÌ µî..) // ÀÔ·ÂÇÑ °ªÀÌ ÀÖÀ» ¶§ mousedown½Ã line°ú curveÀÇ ÂïÈú Á¡ÀÇ À§Ä¡¸¦ ±¸ÇØÁÜ void __fastcall TVectorForm::UserDataInput(int x, int y) { int i, j, dx, dy; dx = x - (NVector->Lsx); dy = y - (NVector->Lsy); double UserData1 = 0.0, UserData2 = 0.0; double alpha, length, Line_angle, Line_len, p; double dTemp = 0; if (NVector->bUserLength1) { UserData1 = eData1->Value; } if (NVector->bUserLength2) { UserData2 = eData2->Value; } int lx, ly; lx = abs(dx); ly = abs(dy); switch(MainImageForm->CurrentUnit) { case uDot: break; case uInch: UserData1 = UserData1 * MainImageForm->CanvasInfor.DotsPerInch; if (V_Item != M_D_LINE && V_Item != M_D_CURVE) UserData2 = UserData2 * MainImageForm->CanvasInfor.DotsPerInch; break; case uCm: UserData1 = UserData1 * MainImageForm->CanvasInfor.DotsPerInch / 2.54; if (V_Item != M_D_LINE && V_Item != M_D_CURVE) UserData2 = UserData2 * MainImageForm->CanvasInfor.DotsPerInch / 2.54; break; } if (NVector->bUserLength2) { if (V_Item == M_D_LINE) { Line_angle = UserData2; if (x > NVector->Lsx) { if (y > NVector->Lsy) { // I alpha = Line_angle * (M_PI / 180.0); } else { // IV alpha = (Line_angle + 270.0) * (M_PI / 180.0); } } else { if (y > NVector->Lsy) { // II alpha = (Line_angle + 90) * (M_PI / 180.0); } else { // III alpha = (Line_angle + 180.0) * (M_PI / 180.0); } } } } else { if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { if ((dy == 0) && (dx == 0)) alpha = M_PI_2; else alpha = atan2(dy, dx); if (dy < 0) { p = (atan2((double)dy, (double)dx) + 2 * M_PI) * 180.0 / M_PI; } else { if ((dx == 0) && (dy == 0)) p = 0; else p = atan2((double)dy, (double)dx) * 180.0 / M_PI; } eData2->Value = p; // Format("%3.1f", OPENARRAY(TVarRec, (p))); } else if (V_Item == M_D_CIRCLE) { p = sqrt(lx * lx + ly * ly); } else if (V_Item == M_D_SQUARE) { if (lx < ly) p = lx; else p = ly; } else { p = abs(dy); } switch(MainImageForm->CurrentUnit) { case uDot: eData2->Value = p; break; case uInch: eData2->Value = p / MainImageForm->CanvasInfor.DotsPerInch; break; // Format("%.2f", OPENARRAY(TVarRec, (p / MainImageForm->CanvasInfor.DotsPerInch))); break; case uCm: eData2->Value = p / MainImageForm->CanvasInfor.DotsPerInch * 2.54; break; // Format("%.2f", OPENARRAY(TVarRec, (p / MainImageForm->CanvasInfor.DotsPerInch * 2.54))); } } if (NVector->bUserLength1) { Line_len = UserData1; NVector->Lex = (NVector->Lsx) + Line_len * cos(alpha) + 0.5; NVector->Ley = (NVector->Lsy) + Line_len * sin(alpha) + 0.5; } else { if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { length = sqrt(dx * dx + dy * dy); NVector->Lex = (NVector->Lsx) + length * cos(alpha) + 0.5; NVector->Ley = (NVector->Lsy) + length * sin(alpha) + 0.5; p = sqrt(lx * lx + ly * ly); } else if (V_Item == M_D_SQUARE) { if (lx < ly) p = lx; else p = ly; } else if (V_Item == M_D_CIRCLE) { p = sqrt(lx * lx + ly * ly); } else { p = lx; } switch(MainImageForm->CurrentUnit) { case uDot: eData1->Value = p; break; case uInch: eData1->Value = p / MainImageForm->CanvasInfor.DotsPerInch; break; // Format("%.2f", OPENARRAY(TVarRec, (p / MainImageForm->CanvasInfor.DotsPerInch))); break; case uCm: eData1->Value = p / MainImageForm->CanvasInfor.DotsPerInch * 2.54; // Format("%.2f", OPENARRAY(TVarRec, (p / MainImageForm->CanvasInfor.DotsPerInch * 2.54))); } } } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::ViewVectorPen(bool view) { if (PenManagerForm->subMenuDown == true) PenManagerForm->sbBtnUpClick(PenManagerForm->sbBtnUp); PenManagerForm->sbBtnUp->Enabled = !view; PenManagerForm->sbNormal->Enabled = !view; PenManagerForm->sbAirBrush->Enabled = !view; PenManagerForm->sbCrayon->Enabled = !view; PenManagerForm->sbWater->Enabled = !view; PenManagerForm->sbScratch->Enabled = !view; PenManagerForm->sbMask->Enabled = !view; PenManagerForm->rzsePenSize->Enabled = !view; PenManagerForm->tbDiameter->Enabled = !view; PenManagerForm->rzcbPressure->Enabled = !view; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade 0315 Shin void __fastcall TVectorForm::eDrawSetKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { bool bChanged = false; if (Key == VK_RETURN) { TEdit* edit = (TEdit*)Sender; String strName = edit->Name; double dInput = 0.0; int next = 0, count = 0; for (int i = 0; i < 6; i++) { TEdit* component = dynamic_cast (FindComponent("eSetD_" + IntToStr(i))); if (component) { if (component->Visible) { if (component->Name == strName) next = i + 1; if (TryStrToFloat(component->Text, dInput)) { if (dInput > 10000) dInput = 10000; if (VecDraw->dset[i] != dInput) bChanged = true; VecDraw->dset[i] = dInput; component->Text = FloatToStr(dInput) + " pt"; } else if (TryStrToFloat(component->Text.SubString(0, component->Text.Length() - 3), dInput)) { if (dInput > 10000) dInput = 10000; VecDraw->dset[i] = dInput; } else component->Text = "0 pt"; count++; } } } if (count > 0) { PenStyle = 5; VecDraw->dashcount = count; } if (bChanged) { VecDraw->NVector->bFstLine = true; } if (next < 6) { edit = dynamic_cast(FindComponent("eSetD_" + IntToStr(next))); if (edit->Visible) edit->SetFocus(); else g_FocusControl->SetFocus(); // MainImageForm->tempRadioButton->SetFocus(); } else { // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } } } // --------------------------------------------------------------------------- // 2005 Vector Upgrade Shin 0315 void __fastcall TVectorForm::btFirstPointClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->JoinFirstPoint(); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade Shin 0315 void __fastcall TVectorForm::btCutClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (!(VecDraw->NVector->bMergeMode)) { if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->MoveCopyVectorObject(true, 0); // ÇöÀç º¹»ç ÁßÀÎ »óÅÂÀÎÁö À̵¿ ÁßÀÎ »óÅÂÀÎÁö¸¦ ¾Ë·ÁÁÖ´Â º¯¼ö - by monkman (2005.08.03) nMoveCopy = 1; // MainImageForm->iMainImage->bVectorModify = true; } // // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) // if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // if (!(VecDraw->NVector->bSelected)) return; // // VecDraw->MoveCopyVectorObject(true, 0); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade Shin 0315 void __fastcall TVectorForm::btReverseCopyClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (!(VecDraw->NVector->bMergeMode)) { if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->MoveCopyVectorObject(false, 1); // VecDraw->MoveCopyVectorObject(false, 2); // ÇöÀç º¹»ç ÁßÀÎ »óÅÂÀÎÁö À̵¿ ÁßÀÎ »óÅÂÀÎÁö¸¦ ¾Ë·ÁÁÖ´Â º¯¼ö - by monkman (2005.08.03) nMoveCopy = 2; // MainImageForm->iMainImage->bVectorModify = true; } // // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) // if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); // if (!(VecDraw->NVector->bSelected)) return; // // VecDraw->MoveCopyVectorObject(false, 1); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade Shin 0315 void __fastcall TVectorForm::sbRatioClick(TObject *Sender) { if (sbRatio->Caption == IDS_NRATIO) { sbRatio->Caption = IDS_NLENGTH; // by lhskys (2005.05.19) VecDraw->bRatio = false; eXSize->IntegerOnly = false; eYSize->IntegerOnly = false; } else { sbRatio->Caption = IDS_NRATIO; // by lhskys (2005.05.19) VecDraw->bRatio = true; eXSize->IntegerOnly = true; eYSize->IntegerOnly = true; } } // --------------------------------------------------------------------------- // 2005 Vector Upgrade Shin 0315 void __fastcall TVectorForm::btFowardClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->ChangeObjectOrder(true, true); END_LOG; } // --------------------------------------------------------------------------- // 2005 Vector Upgrade Shin 0315 void __fastcall TVectorForm::btBackwordClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } VecDraw->ChangeObjectOrder(false, true); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eData2KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TNumEdit *edit = (TNumEdit*)Sender; if (Key == VK_RETURN) { int max = 0; double dTempUnit = 0; double dTemp = edit->Value; if (V_Item == M_D_LINE) { if (dTemp > 0) { dTempUnit = dTemp; if (dTemp >= 0 && dTempUnit <= 360) { NVector->bUserLength2 = true; NVector->bUserInput = true; } else { NVector->bUserLength2 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); eData2->Value = 0; eData2->SelectAll(); } } else { NVector->bUserLength2 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); eData2->Value = 0; eData2->SelectAll(); } } else { if (dTemp > 0) { dTempUnit = dTemp; switch(MainImageForm->CurrentUnit) { case uDot: break; case uInch: dTempUnit = dTempUnit * MainImageForm->CanvasInfor.DotsPerInch; break; case uCm: dTempUnit = dTempUnit * MainImageForm->CanvasInfor.DotsPerInch / 2.54; break; } max = MainImageForm->CanvasInfor.Height - 100; if ((dTemp > 0) && (dTempUnit < max)) { NVector->bUserLength2 = true; NVector->bUserInput = true; } else { NVector->bUserLength2 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); eData2->Value = 0; eData2->SelectAll(); } } else { NVector->bUserLength2 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); eData2->Value = 0; eData2->SelectAll(); } } // ¸¶¿ì½º·Î ùÁ¡À» ÀÔ·ÂÇÑ »óÅ¿¡¼­ »ç¿ëÀÚ ÀÔ·ÂÀ» ÇÏ¸é µµÇüÀÌ µÎ °³ ³ª¿À´Â ¹®Á¦°¡ »ý±ä´Ù - by monkman (2005.06.16) if (V_Item == M_D_SQUARE || V_Item == M_D_RECT || V_Item == M_D_CIRCLE || V_Item == M_D_ELLIPSE) { NVector->step = 0; } // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } else { NVector->bUserLength2 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eData1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TNumEdit *edit = (TNumEdit*)Sender; if (Key == VK_RETURN) { double dTemp = 0, dTempUnit = 0; int max = 0; dTemp = eData1->Value; if (eData1->Value > 0) { dTempUnit = dTemp; switch(MainImageForm->CurrentUnit) { case uDot: break; case uInch: dTempUnit = dTempUnit * MainImageForm->CanvasInfor.DotsPerInch; break; case uCm: dTempUnit = dTempUnit * MainImageForm->CanvasInfor.DotsPerInch / 2.54; break; } if (V_Item == M_D_CIRCLE) max = MainImageForm->CanvasInfor.Height / 2 - 100; else max = MainImageForm->CanvasInfor.Height - 100; if ((dTemp > 0) && (dTempUnit < max)) { NVector->bUserLength1 = true; NVector->bUserInput = true; } else { NVector->bUserLength1 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); eData1->Value = 0; eData1->SelectAll(); } } else { NVector->bUserLength1 = false; NVector->bUserInput = false; MoveRect = Rect(0, 0, 0, 0); eData1->Value = 0; eData1->SelectAll(); } // ¸¶¿ì½º·Î ùÁ¡À» ÀÔ·ÂÇÑ »óÅ¿¡¼­ »ç¿ëÀÚ ÀÔ·ÂÀ» ÇÏ¸é µµÇüÀÌ µÎ °³ ³ª¿À´Â ¹®Á¦°¡ »ý±ä´Ù - by monkman (2005.06.16) if (V_Item == M_D_SQUARE || V_Item == M_D_RECT || V_Item == M_D_CIRCLE || V_Item == M_D_ELLIPSE) { NVector->step = 0; } // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } else { NVector->bUserInput = false; NVector->bUserLength1 = false; MoveRect = Rect(0, 0, 0, 0); } } // --------------------------------------------------------------------------- // void __fastcall TVectorForm::sbVectorObjectIrregularClick(TObject *Sender) // { // TSpeedButton *speedbutton = (TSpeedButton *)Sender; // //V_EditItem = 9; // // // º¯¼ö »ç¿ë ¾ÈÇÏ·Á°í ÀÌ·¸°Ô ¸· ÄÚµùÀ».. T.T // if (speedbutton->Tag == 9){ // shVectorObjectIrregular->Brush->Color = clAqua; // shVectorObjectIrregular->Pen->Color = clBlue; // sbVectorObjectIrregular->Down = true; // //V_EditItem = speedbutton->Tag; // speedbutton->Tag = 91; // } else if (speedbutton->Tag == 91) { // shVectorObjectIrregular->Brush->Color = clBlack; // shVectorObjectIrregular->Pen->Color = clBlack; // sbVectorObjectIrregular->Down = false; // speedbutton->Tag = 9; // } // } // --------------------------------------------------------------------------- void __fastcall TVectorForm::DrawSetDashPattern(double penthick) { eSetD_0->Text = ""; eSetD_1->Text = ""; eSetD_2->Text = ""; eSetD_3->Text = ""; eSetD_4->Text = ""; eSetD_5->Text = ""; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; String strtemp; int index = PenStyleComboBox->ItemIndex; PenThick = penthick; // PenManagerForm->VectorPenThick; switch(index) { case 0: break; case 1: eSetD_0->Visible = true; eSetD_1->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; strtemp = FloatToStr(PenThick * 3); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; break; case 2: eSetD_0->Visible = true; eSetD_1->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; strtemp = FloatToStr(PenThick); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; break; case 3: eSetD_0->Visible = true; eSetD_1->Visible = true; eSetD_2->Visible = true; eSetD_3->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; stSet2_d->Visible = true; stSet2_g->Visible = true; strtemp = FloatToStr(PenThick * 3); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_2->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_3->Text = strtemp + " pt"; break; case 4: eSetD_0->Visible = true; eSetD_1->Visible = true; eSetD_2->Visible = true; eSetD_3->Visible = true; eSetD_4->Visible = true; eSetD_5->Visible = true; stSet1_d->Visible = true; stSet1_g->Visible = true; stSet2_d->Visible = true; stSet2_g->Visible = true; stSet3_d->Visible = true; stSet3_g->Visible = true; strtemp = FloatToStr(PenThick * 3); eSetD_0->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_1->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_2->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_3->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_4->Text = strtemp + " pt"; strtemp = FloatToStr(PenThick); eSetD_5->Text = strtemp + " pt"; break; } // UDPen->SetFocus(); // ´Ù¸¥°÷¿¡ focus¸¦ µ¹¸² // cbObjAntialiasing->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PenComboBoxChange(TObject *Sender) { TRzComboBox *combobox = (TRzComboBox*)Sender; double dKey = 0; if (!combobox->Text.IsEmpty()) { if (combobox->ItemIndex == 2) { if (PenStyleComboBox->ItemIndex != 0) DrawingThick = 2; // typeÀÌ solid°¡ ¾Æ´Ï¸é ¼³Á¤ÀÌ ¾ÈµÊ else DrawingThick = dKey; // Åõ¸íó¸® } else if (TryStrToFloat(combobox->Text, dKey) && !bPenComboBoxCloseup) { if (dKey > 0) { if (dKey < 0.0001) { dKey = 0.001; combobox->Text = FloatToStr(dKey); } else if (dKey >= 1000) { dKey = 1000; combobox->Text = FloatToStr(dKey); } combobox->Items->Strings[0] = FloatToStr(dKey); DrawingThick = dKey; } } else { // ¼ýÀÚÀÌ¿ÜÀÇ °ªÀÌ µé¾î°¡¸é ÃÖ±Ù °ªÀ¸·Î ¼±Åõǵµ·Ï ¼öÁ¤ 20080605 if (dKey == 0) PenComboBox->ItemIndex = 0; } bPenComboBoxCloseup = false; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PenComboBoxCloseUp(TObject *Sender) { TRzComboBox *combobox = (TRzComboBox*)Sender; int tempindex = 0; double thick = 0.0; bPenComboBoxCloseup = true; if (!combobox->Text.IsEmpty()) { if (combobox->ItemIndex != 1 && combobox->ItemIndex != 0) { // ³ª´®¼±°ú Other°¡ ¾Æ´Ò°æ¿ì if (combobox->Items->Strings[combobox->ItemIndex] != NULL) { if (combobox->ItemIndex == 2) { if (PenStyleComboBox->ItemIndex != 0) { // typeÀÌ solid°¡ ¾Æ´Ï¸é ¼³Á¤ÀÌ ¾ÈµÊ combobox->ItemIndex = 0; } else DrawingThick = 0; // µÎ²²¸¦ 0À¸·Î ÁöÁ¤(Åõ¸í¼± ó¸®) } else if (TryStrToFloat(combobox->Items->Strings[combobox->ItemIndex], thick)) { DrawingThick = thick; } else { DrawingThick = 2; // default value } } else { DrawingThick = 2; // default value } } else if (combobox->ItemIndex == 0) { // other À§Ä¡ if (combobox->Items->Strings[combobox->ItemIndex] != NULL) { if (TryStrToFloat(combobox->Items->Strings[combobox->ItemIndex], thick)) { DrawingThick = thick; } else { // other ¶Ç´Â ¼ýÀÚ°¡ ÀÌ´Ñ ´Ù¸¥ °ªÀÏ °æ¿ì DrawingThick = 2; // default value } } else { DrawingThick = 2; // default value } } else { // ³ª´®¼±ÀÏ °æ¿ì if (TryStrToFloat(combobox->Items->Strings[0], thick)) { // Other°¡ ¼ýÀÚ°ªÀÏ °æ¿ì DrawingThick = thick; } else { DrawingThick = 2; // default value } } } if (combobox->ItemIndex != 2) { // Åõ¸íÀÌ ¾Æ´Ò °æ¿ì¿¡¸¸ Other¿¡ ÀÌÀü µÎ²²¸¦ ÀÔ·ÂÇÑ´Ù. combobox->Items->Strings[0] = FloatToStr(DrawingThick); combobox->ItemIndex = 0; } // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PenComboBoxDblClick(TObject *Sender) { TRzComboBox *combobox = (TRzComboBox*)Sender; combobox->Items->Strings[0] = ""; combobox->ItemIndex = -1; combobox->Text = ""; combobox->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PenThickSpinButtonBottomClick(TObject *Sender) { /* if (PenComboBox->Text.IsEmpty()){ PenComboBox->Text = "1"; MainImageForm->tempRadioButton->SetFocus(); return; } */ double tempthick = 0; if (!TryStrToFloat(PenComboBox->Text, tempthick)) tempthick = DrawingThick; if (tempthick > 2) tempthick--; else if (tempthick == 2) tempthick = 1.5; else if (tempthick == 1.5) tempthick = 1.0; else if (tempthick == 1) tempthick = 0.75; else if (tempthick == 0.75) tempthick = 0.5; else if (tempthick == 0.25) tempthick = 0.25; else tempthick = 0.25; PenComboBox->Text = FloatToStr(tempthick); DrawingThick = tempthick; DrawSetDashPattern(DrawingThick); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PenThickSpinButtonTopClick(TObject *Sender) { /* if (PenComboBox->Text.IsEmpty()){ PenComboBox->Text = "1"; MainImageForm->tempRadioButton->SetFocus(); return; } */ double tempthick = 0; if (!TryStrToFloat(PenComboBox->Text, tempthick)) tempthick = DrawingThick; if (tempthick >= 2) tempthick++; else if (tempthick == 1.5) tempthick = 2; else if (tempthick == 1.0) tempthick = 1.5; else if (tempthick == 0.75) tempthick = 1; else if (tempthick == 0.5) tempthick = 0.75; else if (tempthick == 0.25) tempthick = 0.5; else tempthick = 0.25; PenComboBox->Text = FloatToStr(tempthick); DrawingThick = tempthick; DrawSetDashPattern(DrawingThick); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CalculateObject(gdp::Rect &rect, int px, int py, bool bView) { int ZoomIn = MainImageForm->iMainImage->ZoomIn; int ZoomOut = MainImageForm->iMainImage->ZoomOut; int PositionX = MainImageForm->iMainImage->PositionX; int PositionY = MainImageForm->iMainImage->PositionY; int lex, ley, lsx, lsy, cux, cuy; if (!bView) { cux = NVector->Cux; cuy = NVector->Cuy; lsx = NVector->Lsx; lsy = NVector->Lsy; } else { cux = (NVector->Cux - PositionX) * ZoomIn / ZoomOut - px; cuy = (NVector->Cuy - PositionY) * ZoomIn / ZoomOut - py; lsx = (NVector->Lsx - PositionX) * ZoomIn / ZoomOut - px; lsy = (NVector->Lsy - PositionY) * ZoomIn / ZoomOut - py; } double UserData1 = 0, UserData2 = 0; if (NVector->bUserLength1) { UserData1 = eData1->Value; } if (NVector->bUserLength2) { UserData2 = eData2->Value; } switch(MainImageForm->CurrentUnit) { case uDot: break; case uInch: UserData1 = UserData1 * MainImageForm->CanvasInfor.DotsPerInch; if (V_Item != M_D_LINE || V_Item != M_D_CURVE) UserData2 = UserData2 * MainImageForm->CanvasInfor.DotsPerInch; break; case uCm: UserData1 = UserData1 * MainImageForm->CanvasInfor.DotsPerInch / 2.54; if (V_Item != M_D_LINE || V_Item != M_D_CURVE) UserData2 = UserData2 * MainImageForm->CanvasInfor.DotsPerInch / 2.54; break; } if (UserData1 && bView) UserData1 = UserData1 * ZoomIn / ZoomOut; if (UserData2 && bView) UserData2 = UserData2 * ZoomIn / ZoomOut; switch(V_Item) { case M_D_LINE: // Line if (!(NVector->bUserLength2)) { if (cux > lsx) rect.X = lsx; else rect.X = lsx - UserData1; if (cuy > lsy) rect.Y = lsy; else rect.Y = lsy - UserData1; rect.Width = UserData1; rect.Height = UserData1; } else { if (NVector->bUserLength1) { if (cux > lsx) rect.X = lsx; else rect.X = lsx - UserData1; if (cuy > lsy) rect.Y = lsy; else rect.Y = lsy - UserData1; rect.Width = UserData1; rect.Height = UserData1; // rect.X = lsx - UserData1; // rect.Y = lsy - UserData1; // rect.Width = UserData1*2; // rect.Height = UserData1*2; } else { int temp = sqrt((lsx - cux) * (lsx - cux) + (lsy - cuy) * (lsy - cuy)); if (cux > lsx) rect.X = lsx; else rect.X = lsx - temp; if (cuy > lsy) rect.Y = lsy; else rect.Y = lsy - temp; rect.Width = temp; rect.Height = temp; } } break; case M_D_CURVE: // Curve if (!(NVector->bUserLength2)) { if (cux > lsx) rect.X = lsx; else rect.X = lsx - UserData1; if (cuy > lsy) rect.Y = lsy; else rect.Y = lsy - UserData1; rect.Width = UserData1; rect.Height = UserData1; } else { if (NVector->bUserLength1) { if (cux > lsx) rect.X = lsx; else rect.X = lsx - UserData1; if (cuy > lsy) rect.Y = lsy; else rect.Y = lsy - UserData1; rect.Width = UserData1; rect.Height = UserData1; // rect.X = lsx - UserData1; // rect.Y = lsy - UserData1; // rect.Width = UserData1*2; // rect.Height = UserData1*2; } else { int temp = sqrt((lsx - cux) * (lsx - cux) + (lsy - cuy) * (lsy - cuy)); if (cux > lsx) rect.X = lsx; else rect.X = lsx - temp; if (cuy > lsy) rect.Y = lsy; else rect.Y = lsy - temp; rect.Width = temp; rect.Height = temp; } } break; case M_D_SQUARE: // Square if (NVector->bUserLength1) { lsx = cux - UserData1 / 2; lex = cux + UserData1 / 2; lsy = cuy - UserData1 / 2; ley = cuy + UserData1 / 2; rect.X = lsx; rect.Y = lsy; rect.Width = UserData1; rect.Height = UserData1; } break; case M_D_RECT: // Rectangle if (NVector->bUserLength1 && NVector->bUserLength2) { lsx = cux - UserData1 / 2; lex = cux + UserData1 / 2; lsy = cuy - UserData2 / 2; ley = cuy + UserData2 / 2; rect.X = lsx; rect.Y = lsy; rect.Width = UserData1; rect.Height = UserData2; } break; case M_D_CIRCLE: // Circle if (NVector->bUserLength1) { double ra = UserData1; rect.X = cux - ra; rect.Y = cuy - ra; rect.Width = ra * 2; rect.Height = ra * 2; } break; case M_D_ELLIPSE: // Ellipse if (NVector->bUserLength1 && NVector->bUserLength2) { lsx = cux - UserData1 / 2; lsy = cuy - UserData2 / 2; lex = cux + UserData1 / 2; ley = cuy + UserData2 / 2; rect.X = lsx; rect.Y = lsy; rect.Width = UserData1; rect.Height = UserData2; } break; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::EditPenComboBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TRzComboBox *combobox = (TRzComboBox*)Sender; double tempThick = 0; if (Key == VK_RETURN) { if (!combobox->Text.IsEmpty()) { if (TryStrToFloat(combobox->Text, tempThick)) { if (tempThick < 0.001) { tempThick = 0.001; combobox->Text = FloatToStr(tempThick); } else if (tempThick > 1000) { tempThick = 1000; combobox->Text = FloatToStr(tempThick); } combobox->Items->Strings[0] = combobox->Text; combobox->ItemIndex = 0; } else { combobox->Text = "1"; combobox->ItemIndex = 5; } } else { combobox->Text = "1"; combobox->ItemIndex = 5; } VectorPenThickChange(); // MainImageForm->tempRadioButton->SetFocus(); g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- // --> by linuxjun for CurvedVectorText void __fastcall TVectorForm::sbCurveTextDrawClick(TObject *Sender) { BEGIN_LOG(""); if (V_MainItem == 1) { if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->DeleteEmptyObject(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); } } TVecData * Data = VecDraw->GetLastCurvedData(); if (Data) { if (Data->ParentTextBox) { END_LOG; return; } // CaretÀ» ±×·ÁÁÖ¾î¾ß ÇÏ´Â MainImage - by monkman (2004.11.08) sbNewTextEdit->Click(); // Data->PenThick = 0; //by linuxjun for CurvedVectorText 7¿ù¸» // MainImageForm->bDrawCaret = true; // by linuxjun for CurveText bDrawCaretÀÌ Textile¿£ ¾ø¾î¼­ ÀÏ´Ü ¸·À½ // ¸¶¿ì½º ´Ù¿îÀ» ÇÏ¸é Æ÷ÀÎÆ®°¡ ÀÌ¹Ì TestBox°¡ ÀÖ´ÂÁö ¾ø´ÂÁö È®ÀÎÇϰí // ÀÖ´Ù¸é ¼±ÅÃÇÑ Box¿¡ Caret¸¦ ±×¸®°í Űº¸µå ÀÔ·ÂÀ» ±â´Ù¸°´Ù. // ¾ø´Ù¸é »õ·Î¿î Box¸¦ ¸¸µé°í Űº¸µå ÀÔ·ÂÀ» ±â´Ù¸°´Ù. NVector->bTextState = true; // MouseDown½ÃÁ¡¿¡¼­ Text Object¸¦ Ãß°¡ // VecDraw->AddTextBox(X, Y); VecDraw->MakeCurveTextFromObject(Data); // *bDownState = true; // VecDraw->NVector->bFirstMove = true; MainMenuForm->UseEditFunction = true; // To Do:À̺κР¼öÁ¤ÇØÁÙ°Í!!!!!º¤ÅÍ Ã¢À» ¹Ù²Ù´Â ¹æÇâÀ¸·Î. // UpdateForm(); ````````` btUndo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canundo(); // by linuxjun btRedo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canredo(); // by linuxjun } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbCurveTextEditClick(TObject *Sender) { // * BEGIN_LOG(""); TVecData * Data = VecDraw->GetSelectedCurvedData(); if (Data) { if (!Data->ParentTextBox) { // CaretÀ» ±×·ÁÁÖ¾î¾ß ÇÏ´Â MainImage - by monkman (2004.11.08) sbNewTextEdit->Click(); // Data->PenThick = 0; //by linuxjun for CurvedVectorText 7¿ù¸» MainImageForm->bDrawCaret = true; // shin vectorform NVector->bTextState = true; // MouseDown½ÃÁ¡¿¡¼­ Text Object¸¦ Ãß°¡ VecDraw->MakeCurveTextFromObject(Data); MainMenuForm->UseEditFunction = true; // To Do:À̺κР¼öÁ¤ÇØÁÙ°Í!!!!!º¤ÅÍ Ã¢À» ¹Ù²Ù´Â ¹æÇâÀ¸·Î. btUndo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canundo(); // by linuxjun btRedo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canredo(); // by linuxjun END_LOG; return; } } Data = VecDraw->GetSelectedTextData(); if (Data) { if (!Data->ListOfAllLine->CurveData) { END_LOG; return; } TSWordData *tsWordData; for (int i = 0; i < Data->ListOfAllLine->Count; i++) { tsWordData = (TSWordData*)Data->ListOfAllLine->Items(i); tsWordData->Selected = true; } sbNewTextEdit->Click(); // Data->PenThick = 0; NVector->bTextState = true; // MouseDown½ÃÁ¡¿¡¼­ Text Object¸¦ Ãß°¡ // VecDraw->ExistSelected = true; VecDraw->SetTextSelected(Data); MainMenuForm->UseEditFunction = true; // To Do:À̺κР¼öÁ¤ÇØÁÙ°Í!!!!!º¤ÅÍ Ã¢À» ¹Ù²Ù´Â ¹æÇâÀ¸·Î. btUndo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canundo(); // by linuxjun btRedo->Enabled = ((TPVectorUndo*)MainImageForm->VecUndo)->canredo(); // by linuxjun } END_LOG; } // <-- by linuxjun for CurvedVectorText // --------------------------------------------------------------------------- void __fastcall TVectorForm::spdbtnFillColorFromOutlineColorClick (TObject *Sender) { // ¿ÀºêÁ§Æ® Ä÷¯¸¦ ¿Ü°û¼± Ä÷¯·Î ä¿ì±â - by monkman (2011.11.29) BEGIN_LOG("spdbtnFillColorFromOutlineColorClick"); TList *DataList = NVector->DataList; TVecData *data = NULL; bool sw = true; // by linuxjun for Undo for (int i = 0; i < DataList->Count; i++) { data = (TVecData*)DataList->Items[i]; if (data && data->bSelected) { VecDraw->UndoSave(VU_MODIFY, i, sw); // by linuxjun for Undo sw = false; if (data->bPatternFill) { if (data->TBitmap) { delete data->TBitmap; data->TBitmap = NULL; } if (data->TBitmapSource) { delete data->TBitmapSource; data->TBitmapSource = NULL; } if (data->MaskBitmap) { delete data->MaskBitmap; data->MaskBitmap = NULL; } data->bPatternFill = false; } data->bFill = true; data->Brush = data->Color; } } MainImageForm->iMainImage->Repaint(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::spdbtnOutlineColorFromFillColorClick (TObject *Sender) { // ¿Ü°û¼± Ä÷¯¸¦ ¿ÀºêÁ§Æ® Ä÷¯·Î ä¿ì±â - by monkman (2011.11.29) BEGIN_LOG("spdbtnFillColorFromOutlineColorClick"); TList *DataList = NVector->DataList; TVecData *data = NULL; bool sw = true; // by linuxjun for Undo for (int i = 0; i < DataList->Count; i++) { data = (TVecData*)DataList->Items[i]; if (data && data->bSelected && data->bFill) { // ä¿öÁø °Í¸¸.. VecDraw->UndoSave(VU_MODIFY, i, sw); // by linuxjun for Undo sw = false; data->Color = data->Brush; } } MainImageForm->iMainImage->Repaint(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::MakeMenuHintByShortcut() { BEGIN_LOG(""); sbLine->Hint = TexActionManager->GetHint("Vector", "Line"); sbCurve->Hint = TexActionManager->GetHint("Vector", "Curve"); mnitmRectangle->Caption = TexActionManager->GetHint("Vector", "Rectangle"); mnitmSquare->Caption = TexActionManager->GetHint("Vector", "Square"); mnitmEllipse->Caption = TexActionManager->GetHint("Vector", "Ellipse"); mnitmCircle->Caption = TexActionManager->GetHint("Vector", "Circle"); sbNewTextEdit->Hint = TexActionManager->GetHint("Vector", "Text"); sbObjectEdit->Hint = TexActionManager->GetHint("Vector", "EditObject"); sbDirectSelect->Hint = TexActionManager->GetHint("Vector", "SelectDirect"); // sbConvertDirection->Hint = TexActionManager->GetHint("Vector", "Convert"); // sbPointAdd->Hint = TexActionManager->GetHint("Vector", "AddPoint"); sbPointDelete->Hint = TexActionManager->GetHint("Vector", "DeletePoint"); sbKnife->Hint = TexActionManager->GetHint("Vector", "Knife"); btUndo->Hint = TexActionManager->GetHint("Vector", "Undo"); btRedo->Hint = TexActionManager->GetHint("Vector", "Redo"); sbCutting->Hint = TexActionManager->GetHint("Vector", "Cutting"); // ´ÜÃà۰¡ ³ª¿ÀÁö ¾Êµµ·Ï ÇØ´Þ¶ó´Â µðÀÚÀÎ½Ç ¿ä±¸»çÇ× - by monkman (2011.04.11) // PopupToFront->Caption = TexActionManager->GetHint("Vector", "BringToFront"); // PopupToBack->Caption = TexActionManager->GetHint("Vector", "SendToBack"); DynamicMenu[0] = TexActionManager->GetHint("Vector", "Group"); DynamicMenu[1] = TexActionManager->GetHint("Vector", "Ungroup"); PopupGroup->Caption = DynamicMenu[0]; DynamicMenu[2] = TexActionManager->GetHint("Vector", "Lock"); DynamicMenu[3] = TexActionManager->GetHint("Vector", "Unlock"); PopupLock->Caption = DynamicMenu[2]; PopupJoin->Caption = TexActionManager->GetHint("Vector", "JoinPoint"); AverageHorz->Caption = TexActionManager->GetHint("Vector", "ArrangePointHorz"); AverageVert->Caption = TexActionManager->GetHint("Vector", "ArrangePointVert"); AverageBoth->Caption = TexActionManager->GetHint("Vector", "ArrangePointBoth"); END_LOG; } // --------------------------------------------------------------------------- void TVectorForm::TPMTextOperation(TMessage &msg) { BEGIN_LOG(""); TFont *font = MainImageForm->iMainImage->Canvas->Font; switch(msg.WParam) { case F_Name: if (VecDraw->ExistSelected) { VecDraw->ChangeFontSeletedWordData(font); } else { CheckNChangeFont(true); } // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // MainImageForm->tempRadioButton->SetFocus(); break; case F_Size: if (VecDraw->ExistSelected) { VecDraw->ChangeSizeSeletedWordData(font); } else { CheckNChangeFont(true); } // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // MainImageForm->tempRadioButton->SetFocus(); break; case F_Style: if (VecDraw->ExistSelected) { VecDraw->ChangeStyleSeletedWordData(font); } else { CheckNChangeFont(true); } // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // MainImageForm->tempRadioButton->SetFocus(); break; case F_WidthGap: if (VecDraw->ExistSelected) { if (WidthGapComboBox->ItemIndex == 0) VecDraw->ChangeWGapSeletedWordData(TTextWidthGap[0]); else VecDraw->ChangeWGapSeletedWordData (TTextWidthGap[WidthGapComboBox->ItemIndex - 1]); } else { // CheckNChangeFont(false); } // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // MainImageForm->tempRadioButton->SetFocus(); break; case F_HeightGap: if (VecDraw->ExistSelected) { if (HeightGapComboBox->ItemIndex == 0) VecDraw->ChangeHGapSeletedWordData(TTextHeightGap[0]); else VecDraw->ChangeHGapSeletedWordData (TTextHeightGap[HeightGapComboBox->ItemIndex - 1]); } else { CheckNChangeFont(false); // ³ôÀ̸¸ ¿µÇ⸦ ÁÙ°Í °°¾Æ¼­ width´Â ¸·À½ } // MainImageForm->sbHorz->SetFocus(); //by linuxjun for CurvedVectorText Æ÷Ä¿½º¹®Á¦ ÇØ°áÀ» À§ÇÔ. // MainImageForm->tempRadioButton->SetFocus(); break; } g_FocusControl->SetFocus(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbCuttingClick(TObject *Sender) { if (!(VecDraw->NVector->bSelected)) return; BEGIN_LOG(""); // if (VecDraw->SelectedObjectCount() != 2){ // Application->MessageBox(IDS_MESSAGE003.c_str(), L"Information", MB_OK); // END_LOG; // return; // } TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; speedbutton->Down = true; // Key Event·Î ¿À´Â °æ¿ì´Â DownÀÌ ¾ÈµÇ¹Ç·Î °­Á¦ Down V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); if (SprayOnceEnabled) WriteIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btOutlineRunClick(TObject *Sender) { // Outline Å×½ºÆ® // ¼±Åà ¾È µÈ °Í if (!(VecDraw->NVector->bSelected)) return; BEGIN_LOG(""); double margin, limit; int nMargin, nMaxLen; /* // Margin ÀԷ°ª Á¦ÇÑ - by monkman (2009.04.28) int count = edCount->Value; try{ margin = edMargin->Value; margin = SimpleRoundTo(margin,-2); // RoundTo() => SimpleRountTo() º¯°æ - by monkman (2009.04.028) } catch(Exception &e) { edMargin->Value = 1.0; margin = 1.0; return; } edMargin->Text = margin; */ int count = edCount->Value; margin = edMargin->Value; switch(MainImageForm->CurrentUnit) { case uDot: nMargin = margin; break; case uInch: nMargin = int(margin * MainImageForm->CanvasInfor.DotsPerInch); break; case uCm: nMargin = int(margin * MainImageForm->CanvasInfor.DotsPerInch / 2.54); break; } nMaxLen = max(MainImageForm->Width, MainImageForm->Height) * 2; if (0 < nMargin && nMargin < nMaxLen) { switch(MainImageForm->CurrentUnit) { case uDot: VecDraw->MakeOutlineByMarginFromCenter(count, nMargin); break; case uInch: VecDraw->MakeOutlineByMarginFromCenter(count, nMargin); break; case uCm: VecDraw->MakeOutlineByMarginFromCenter(count, nMargin); break; } } else { switch(MainImageForm->CurrentUnit) { case uDot: limit = nMaxLen; break; case uInch: limit = nMaxLen / MainImageForm->CanvasInfor.DotsPerInch; break; case uCm: limit = nMaxLen / (MainImageForm->CanvasInfor.DotsPerInch / 2.54); break; } limit = SimpleRoundTo(limit, -2); MessageDlg(IDS_MESSAGE004 + " (1 ~ " + FloatToStr(limit) + ")", mtWarning, TMsgDlgButtons() << mbOK, 0); } MainImageForm->iMainImage->Repaint(); FullViewForm->Image->Repaint(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbSprayClick(TObject *Sender) { BEGIN_LOG(""); TRzMenuToolbarButton *speedbutton = (TRzMenuToolbarButton*)Sender; V_MainItem = 2; V_Item = speedbutton->Tag; VectorMenuCurrentPanel(); // SprayPanel->Height = 157; // gbOutLineAndSpray->Height = 151; // pnMotive->Height = 100; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + SprayPanel->Height; // Parent->Height = ParentHeight + ClientHeight; // ShapeComboBox->ItemIndex = 0; //FreeLine,Center,UseCount,5, ¼±ÅÃµÈ ¿ÀºêÁ§Æ®ÀÇ ÆøÀ¸·Î default°ª ¼³Á¤. // PositionComboBox->ItemIndex = 0; // rzcbUseCount->Checked = true; // CountEdit->Text = IntToStr(5); MotiveModeComboBox->ItemIndex = 0; TList *DataList = NVector->DataList; // MainImageForm->V_DATA; TVecData *data; RECT bound_rect; bound_rect = Rect(10000, 10000, 0, 0); for (int i = 0; i < DataList->Count; i++) { data = (TVecData*)DataList->Items[i]; if (data->bSelected) { bound_rect = Rect(min(bound_rect.left, data->First.x), min(bound_rect.top, data->First.y), max(bound_rect.right, data->Second.x), max(bound_rect.bottom, data->Second.y)); } } int width_dot = bound_rect.right - bound_rect.left; double width_inch = (double)width_dot / 160; double width_cm = (double)width_inch * 2.54; if (MainImageForm->CurrentUnit == uCm) { CmEdit->Value = width_cm; } else if (MainImageForm->CurrentUnit == uInch) { CmEdit->Value = width_inch; } else { CmEdit->Value = width_dot; } lbMargin->Caption = MainImageForm->UnitName(); lbMotiveGap->Caption = MainImageForm->UnitName(); ReadIni_Spray(); // Vector Ini ÆÄÀÏ ÀúÀå µû·Î ExitFormÀÌ ¾øÀ¸´Ï by tmddn85 if (TextOnceEnabled) WriteIni_Text(); SprayOnceEnabled = true; // HotKey Ȱ¼ºÈ­ - by monkman (2010.07.06) MainMenuForm->UseEditFunction = false; // by maxleo21c (2004.08.06) NVector->bTextState = false; VecDraw->BeReadyEdit = false; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::editClick(TObject *Sender) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CuttingObjectsClick(TObject *Sender) { if (!(VecDraw->NVector->bSelected)) return; BEGIN_LOG(""); TRzMenuToolbarButton *bt = (TRzMenuToolbarButton*)Sender; bool Option = false; // if (bt->Tag == 0){ // Option = cbSpaceObject->Checked; // } VecDraw->CuttingObjects(bt->Tag, Option); UpdateForm(); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzcbUseCountClick(TObject *Sender) { if (rzcbUseCount->Checked == true) { CmEdit->Visible = false; CmLabel->Visible = false; CountEdit->Visible = true; CountLabel->Visible = true; } else { CmEdit->Visible = true; CmLabel->Visible = true; CountEdit->Visible = false; CountLabel->Visible = false; } ChangeUnit(MainImageForm->CurrentUnit); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ShapeComboBoxChange(TObject *Sender) { if (ShapeComboBox->ItemIndex == 4) { CmLabel->Caption = "Deg"; CmEdit->Value = 90; // 081204 embakum deg°ªÀÌ 0ÀÌ µÇ´Â °æ¿ì¹æÁö ÃʱâÈ­ } else { CmLabel->Caption = "Cm"; } if (ShapeComboBox->ItemIndex == 6) { checkboxContinue->Visible = true; sbRun->Visible = true; } else { checkboxContinue->Visible = false; sbRun->Visible = false; } // spray ÃʱâÈ­ by embakum 080326 POINT First = Point(0, 0); VecDraw->DrawShape(0, 0, 0, 0); VecDraw->DrawCurve(First, First, First); VecDraw->mousedown = 0; MainImageForm->iMainImage->Repaint(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CmEditChange(TObject *Sender) { // VecDraw->UpdateLimitDot(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ChangeUnit(TUnit CUnit) // by embakum ¸ÞÀÎÀ̹ÌÁöÀÇ unitÀÌ ¹Ù²ð ¶§ CmEditÀ» º¯°æÇØ ÁÜ { if (V_Item == M_O_OUTLINE) { lbMargin->Caption = MainImageForm->UnitName(CUnit); } if (V_Item == M_O_SPRAY) { if (ShapeComboBox->ItemIndex != 4) { CmLabel->Caption = MainImageForm->UnitName(CUnit); if (CUnit == uDot) { CmEdit->Value = (int)VecDraw->LimitDot; } else if (CUnit == uInch) { CmEdit->Value = (double)VecDraw->LimitDot / 160.0; } else if (CUnit == uCm) { CmEdit->Value = (double)VecDraw->LimitDot / 160 * 2.54; } } else if (ShapeComboBox->ItemIndex == 4) { CmLabel->Caption = "Deg"; CmEdit->Value = VecDraw->LimitDeg; } } if (lbMotiveGap->Visible) lbMotiveGap->Caption = MainImageForm->UnitName(CUnit); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CountEditChange(TObject *Sender) { int count = CountEdit->Value; if (count <= 0) CountEdit->Value = 1; if (count >= 50) CountEdit->Value = 50; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::SprayItemClick(TObject *Sender) { BEGIN_LOG(""); TRzBitBtn *bt = (TRzBitBtn*)Sender; if (bt->Tag == 0) { pnOutline->BringToFront(); V_Item = M_O_OUTLINE; // spray ÃʱâÈ­ by embakum 080326 POINT First = Point(0, 0); VecDraw->DrawShape(0, 0, 0, 0); VecDraw->DrawCurve(First, First, First); VecDraw->mousedown = 0; MainImageForm->iMainImage->Repaint(); // SprayPanel->Height = 157; // gbOutLineAndSpray->Height = 152; // pnMotive->Height = 100; // ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + SprayPanel->Height; // Parent->Height = ParentHeight + ClientHeight; } else if (bt->Tag == 1) { if (VecDraw->NVector->bSelected) { V_MainItem = 2; } pnSpray->BringToFront(); if (ShapeComboBox->ItemIndex != 6) { checkboxContinue->Visible = false; } else { checkboxContinue->Visible = true; } sbRun->Visible = false; V_Item = M_O_SPRAY; // SprayPanel->Height = 157; // gbOutLineAndSpray->Height = 152; // pnMotive->Height = 100; // ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + SprayPanel->Height; // Parent->Height = ParentHeight + ClientHeight; } else if (bt->Tag == 2) { // by embakum 2009.02.10 ¸ðƼºê¹Ýº¹ pnMotive->BringToFront(); V_Item = M_O_MOTIVEREPEAT; // VecDraw->InitMotivePanel(); // SprayPanel->Height = 195; // gbOutLineAndSpray->Height = 190; // pnMotive->Height = 140; // ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + SprayPanel->Height; // Parent->Height = ParentHeight + ClientHeight; MotiveModeComboBoxCloseUp(this); } ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + SprayPanel->Height; // Parent->Height = ParentHeight + ClientHeight; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbGradientFillClick(TObject *Sender) { BEGIN_LOG(""); // Merge»óŶó¸é MergeµÇ´Â Object¸¦ Áö¿ì±â À§Çؼ­... maxleo21c (04.12.22) if (VecDraw->NVector->bMergeMode) VecDraw->ExitMerge(); if (!(VecDraw->NVector->bSelected)) { END_LOG; return; } EditPanel->Visible = false; PatternPanel->Visible = true; pnGradientFill->BringToFront(); // shin 080401 pnGradientFill->Visible = true; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + PatternPanel->Height; // Parent->Height = ParentHeight+ClientHeight; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // ¹ÝÀü °Å¿ï ±â´É - ¹ÝÀü °Å¿ï ¹öưÀ» Ȱ¼ºÈ­/ºñȰ¼ºÈ­ ÇÑ´Ù - by monkman (2005.03.02) MainImageForm->sbVertical->Enabled = false; MainImageForm->sbHorizontal->Enabled = false; // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- gItem = G_LINEAR_SIMPLE; GradientCount = 2; GradientPos = 0; shGradientColor1->Pen->Width = 2; shGradientColor2->Pen->Width = 1; // ColorValues[0] = clWhite; // ColorValues[1] = clWhite; GradientColorChange(); mbtG0->Down = true; // cbGradientAngle->Visible = true; rgCenter->ItemIndex = 0; rgCenter->Visible = false; trbPart->Visible = false; pnGradientComp->Top = rgCenter->Top; InitGradientButtonImage(); if (VecDraw->NVector->bPatternMode) { VecDraw->NVector->bPatternMode = false; MainImageForm->iMainImage->Repaint(); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FGChange(int Value) { if (V_Item == M_O_FILL && sbGradientFill->Down == true) { ColorValues[GradientPos] = MainImageForm->Palette->ColorData[Value]->Color; GradientColorChange(); /* GradientPos++; if (GradientPos > 1) GradientPos = 0; if (GradientPos == 0){ shGradientColor1->Pen->Width = 2; shGradientColor2->Pen->Width = 1; } else { shGradientColor1->Pen->Width = 1; shGradientColor2->Pen->Width = 2; } */ /* if (GradientCount < 2){//10){ ColorValues[GradientCount] = MainImageForm->Palette->ColorData[Value]->Color; GradientCount++; } else { if (GradientPos == 2) GradientPos = 0; //10) GradientPos = 0; ColorValues[GradientPos] = MainImageForm->Palette->ColorData[Value]->Color; GradientPos++; } DrawGradientImage(); */ } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::btColorFillClick(TObject *Sender) { BEGIN_LOG(""); VecDraw->ChangeObjectColor(true); END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbGradientRunClick(TObject *Sender) { BEGIN_LOG(""); int count = 0; if (gItem == G_CENTER) { if (rgCenter->Visible && rgCenter->ItemIndex == 0) { count = 0; } else { count = trbPart->Position; } } else { count = GAngle; // cbGradientAngle->ItemIndex; } VecDraw->SetGradientData(gItem, GradientCount, ColorValues, count); // StrToInt(cbGradientAngle->Text)); MainImageForm->iMainImage->Repaint(); // rectpaint·Î ¼öÁ¤ÇÒ°Í END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rgCenterClick(TObject *Sender) { BEGIN_LOG(""); trbPart->Position = trbPart->Min; if (rgCenter->ItemIndex == 1) { trbPart->Enabled = true; } else { trbPart->Enabled = false; } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::checkboxContinueClick(TObject *Sender) { BEGIN_LOG(""); if (checkboxContinue->Checked == true) { sbRun->Visible = true; VecDraw->mousedown = 0; MainImageForm->DrawFreeLineLocate(Point(0, 0), 0); VecDraw->InitData(); } else { sbRun->Visible = false; VecDraw->mousedown = 0; MainImageForm->DrawFreeLineLocate(Point(0, 0), 0); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbRunClick(TObject *Sender) { BEGIN_LOG(""); if (VecDraw->pstore->Count > 1) { VecDraw->VectorSpray(); MainImageForm->DrawFreeLineLocate(Point(0, 0), 0); VecDraw->mousedown = 0; } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::shGradientColorMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { BEGIN_LOG(""); TShape *shape = (TShape*)Sender; GradientPos = shape->Tag; if (GradientPos == 0) { shGradientColor1->Pen->Width = 2; shGradientColor2->Pen->Width = 1; } else { shGradientColor1->Pen->Width = 1; shGradientColor2->Pen->Width = 2; } if (sbDelete->Down) { ColorValues[GradientPos] = clWhite; GradientColorChange(); sbDelete->Down = false; } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::GradientColorChange() { shGradientColor1->Brush->Color = ColorValues[0]; shGradientColor2->Brush->Color = ColorValues[1]; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::mbtGradientDropDown(TObject *Sender) { miGradient0->ImageIndex = miGradient0->Tag + gItem * 4; miGradient1->ImageIndex = miGradient1->Tag + gItem * 4; miGradient2->ImageIndex = miGradient2->Tag + gItem * 4; miGradient3->ImageIndex = miGradient3->Tag + gItem * 4; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::GradientMenuItemClick(TObject *Sender) { TMenuItem *mi = (TMenuItem*)Sender; GAngle = mi->Tag; if (mbtG0->Down) { mbtG0->ImageIndex = mi->Tag + mbtG0->Tag * 4; } else if (mbtG1->Down) { mbtG1->ImageIndex = mi->Tag + mbtG1->Tag * 4; } else if (mbtG2->Down) { mbtG2->ImageIndex = mi->Tag + mbtG2->Tag * 4; } else if (mbtG3->Down) { mbtG3->ImageIndex = mi->Tag + mbtG3->Tag * 4; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::mbtGradientMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TRzMenuButton *button = (TRzMenuButton*)Sender; gItem = button->Tag; InitGradientButtonImage(); if (gItem == 3) { pnGradientComp->Top = rgCenter->Top + rgCenter->Height; trbPart->Visible = true; trbPart->Enabled = true; trbPart->Min = 3; bool hasCurve = VecDraw->hasCurveInSelectObject(); if (hasCurve) { rgCenter->Visible = false; trbPart->Enabled = true; } else { rgCenter->Visible = true; if (rgCenter->ItemIndex == 0) trbPart->Enabled = false; } } else { rgCenter->Visible = false; trbPart->Visible = false; pnGradientComp->Top = rgCenter->Top; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::InitGradientButtonImage() { mbtG0->ImageIndex = 0; mbtG1->ImageIndex = 4; mbtG2->ImageIndex = 8; mbtG3->ImageIndex = 12; } // --------------------------------------------------------------------------- // 20080605 Focus°¡ »ç¶óÁö´Â ¹®Á¦°¡ ¹ß»ýÇØ¼­ Enter¸¦ Ä¡¸é À̰÷À¸·Î Focus°¡ °¡µµ·Ï // ó¸®Çß´Ù. ÇöÀç È®ÀÎ °á°ú ComboBox, EditBox¿¡¼­ ±Û ÀÔ·Â Áß¿¡ Mouse¸¦ MainImageFormÀ¸·Î // ¿Å±â¸é Focus°¡ »ç¶óÁø´Ù. void __fastcall TVectorForm::PenComboBoxKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { // if (Key == VK_RETURN) btFirstPoint->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::sbMotiveListClick(TObject *Sender) { BEGIN_LOG(""); if (VecMotiveForm) { if (VecMotiveForm->Visible) { VecMotiveForm->Visible = false; END_LOG; return; } else { VecMotiveForm->Visible = true; } } else { VecMotiveForm = new TVecMotiveForm(this); VecMotiveForm->Parent = MainForm; VecMotiveForm->Left = MainMenuForm->Left - VecMotiveForm->Width; VecMotiveForm->Top = MainMenuForm->Top + 73; VecMotiveForm->InitForm(); VecMotiveForm->Show(); } if (sbSprayMotive->Down) { END_LOG; return; } sbSpray->Click(); sbSprayMotive->Click(); sbSprayMotive->Down = true; END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::MotiveModeComboBoxChange(TObject *Sender) { /* V_MainItem = 1; switch (MotiveModeComboBox->ItemIndex) { case 0: // free V_Item = M_D_FREEDRAW; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 1: // oblique V_Item = M_D_LINE; LineType = 1; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 2: // H/V Line V_Item = M_D_LINE; LineType = 1; VecDraw->bZKey = true; cbMotiveCurveConti->Visible = false; break; case 3: // Rectangle V_Item = M_D_RECT; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 4: // Circle V_Item = M_D_CIRCLE; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 5: // Ellipse V_Item = M_D_ELLIPSE; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 6: // Curve V_Item = M_D_CURVE; LineType = 2; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = true; break; } */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::MotiveModeComboBoxCloseUp(TObject *Sender) { BEGIN_LOG(""); V_MainItem = 1; if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { VecDraw->NVector->bExtend = false; NVector->step = 0; VecDraw->bZKey = false; VecDraw->DeleteEmptyObject(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); } VecDraw->NVector->bFstLine = true; // Mode º¯°æ ½Ã À̾îÁöÁö ¾Ê´Â ¿ÀºêÁ§Æ®·Î ½ÃÀÛ - by monkman (2009.04.15) switch(MotiveModeComboBox->ItemIndex) { case 0: // free V_Item = M_D_FREEDRAW; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 1: // oblique V_Item = M_D_LINE; LineType = 1; rzbtnLType->Hint = IDS_CONTINUOUSLINE; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 2: // H/V Line V_Item = M_D_LINE; LineType = 1; rzbtnLType->Hint = IDS_CONTINUOUSLINE; VecDraw->bZKey = true; cbMotiveCurveConti->Visible = false; break; case 3: // Rectangle V_Item = M_D_RECT; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 4: // Circle V_Item = M_D_CIRCLE; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 5: // Ellipse V_Item = M_D_ELLIPSE; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = false; break; case 6: // Curve V_Item = M_D_CURVE; LineType = 2; rzbtnLType->Hint = IDS_SEPARATELINE; VecDraw->bZKey = false; cbMotiveCurveConti->Visible = true; cbMotiveCurveContiClick(Sender); break; } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::MotiveModeClick(TObject *Sender) { TRadioButton *bt = (TRadioButton*)Sender; TList *DataList = NVector->DataList; TVecData *temp; for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected && temp->ChildList) { if (bt->Tag == 0) { // mode 0 : ÃÖ´ë°³¼ö temp->mode = 0; } else if (bt->Tag == 1) { // mode 1 : °³¼ö¼³Á¤ temp->mode = 1; } else if (bt->Tag == 2) { // mode 2 : °£°Ý¼³Á¤ temp->mode = 2; } } } MainImageForm->iMainImage->Invalidate(); FullViewForm->Image->Repaint(); // VecDraw->InitMotivePanel(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eMotiveCountClick(TObject *Sender) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); TList *DataList = NVector->DataList; TVecData *temp; for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected && temp->ChildList) { temp->mode = 1; } } rbMotiveCount->Checked = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eMotiveCountKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TList *DataList = NVector->DataList; TVecData *temp; int mCount = 0; if (Key == VK_RETURN) { mCount = eMotiveCount->Value; if (eMotiveCount->Value == 0) { eMotiveCount->Value = 5; mCount = 5; } for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected) { if (temp->ChildList) { temp->motivecount = mCount; } } } MainImageForm->iMainImage->Invalidate(); FullViewForm->Image->Repaint(); for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected && temp->ChildList) { switch(MainImageForm->CurrentUnit) { case uDot: eMotiveGap->Value = int(temp->gap); break; case uInch: eMotiveGap->Value = double (int(temp->gap / MainImageForm->CanvasInfor.DotsPerInch * 100) / 100.f); break; case uCm: eMotiveGap->Value = double (int(temp->gap / MainImageForm->CanvasInfor.DotsPerInch * 2.54 * 100) / 100.f); break; } break; } } // VecDraw->InitMotivePanel(); g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eMotiveGapClick(TObject *Sender) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); TList *DataList = NVector->DataList; TVecData *temp; for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected && temp->ChildList) { temp->mode = 2; } } rbMotiveGap->Checked = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eMotiveGapKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TList *DataList = NVector->DataList; TVecData *temp; float mGap = 0; if (Key == VK_RETURN) { mGap = eMotiveGap->Value; if (mGap == 0) { eMotiveGap->Value = 100; mGap = 100; } // String t_String = t_String.FormatFloat("#,##0.00", mGap); // eMotiveGap->Text = t_String; for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected) { if (temp->ChildList) { if (MainImageForm->CurrentUnit == uDot) { temp->gap = mGap; } else if (MainImageForm->CurrentUnit == uInch) { temp->gap = mGap * MainImageForm->CanvasInfor.DotsPerInch; } else if (MainImageForm->CurrentUnit == uCm) { temp->gap = mGap * MainImageForm->CanvasInfor.DotsPerInch / 2.54; } } } } MainImageForm->iMainImage->Invalidate(); FullViewForm->Image->Repaint(); for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected && temp->ChildList) { eMotiveCount->Value = temp->motivecount; break; } } // VecDraw->InitMotivePanel(); g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eMotiveProportionClick(TObject *Sender) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); rbMotiveProportion->Checked = true; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::eMotiveProportionKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TList *DataList = NVector->DataList; TVecData *temp; float fValue = 0; if (Key == VK_RETURN) { fValue = eMotiveProportion->Value; if (fValue == 0) { eMotiveProportion->Value = 100; // eMotiveGap->Text = "100"; fValue = 100; } // String t_String = t_String.FormatFloat("#,##0.00", fValue); // eMotiveProportion->Text = t_String; if (fValue > 1000) { fValue = 1000; eMotiveProportion->Value = 1000; } for (int i = 0; i < DataList->Count; i++) { temp = (TVecData*)DataList->Items[i]; if (temp->bSelected && temp->ChildList) { temp->proportion = fValue / 100; // break; //090722 ¼±ÅÃµÈ °ÍÁß Çϳª¸¸ 󸮵Ǵ ¹®Á¦·Î ÁÖ¼®Ã³¸® } } MainImageForm->iMainImage->Invalidate(); FullViewForm->Image->Repaint(); // VecDraw->InitMotivePanel(); g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbMotiveCurveContiClick(TObject *Sender) { BEGIN_LOG(""); if (V_MainItem == 1) { if (V_Item == M_D_LINE || V_Item == M_D_CURVE) { VecDraw->NVector->bFstLine = true; VecDraw->NVector->bExtend = false; bSeparate = true; NVector->step = 0; VecDraw->DeleteEmptyObject(); MainImageForm->iMainImage->Repaint(); FullViewForm->InitForm(MainImageForm->iMainImage); } } if (cbMotiveCurveConti->Checked) { // °î¼±ÀÏ °æ¿ì¿¡¸¸ ±â¿ï±â À̾îÁöÁö ¾Ê´Â °î¼±À¸·Î - by monkman (2009.04.15) if (V_Item == M_D_CURVE) { LineType = 1; rzbtnLType->Hint = IDS_CONTINUOUSLINE; } else { LineType = 2; rzbtnLType->Hint = IDS_SEPARATELINE; } } else { LineType = 2; rzbtnLType->Hint = IDS_SEPARATELINE; } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CmEditKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { // double margin = 1.0; // margin = StrToFloat(CmEdit->Text); // margin = RoundTo(margin,-2); // CmEdit->Text = FloatToStr(margin); VecDraw->UpdateLimitDot(); g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::edMarginKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { /* double margin = 1.0; if(Key == VK_RETURN){ try{ margin = edMargin->Text.ToDouble(); margin = RoundTo(margin,-2); } catch(Exception &e) { edMargin->Text = "1.0"; margin = 1.0; return; } edMargin->Text = margin; } */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::CountEditKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { /* double margin = 1.0; margin = StrToFloat(CountEdit->Text); margin = RoundTo(margin,-2); CountEdit->Text = FloatToStr(margin); */ VecDraw->UpdateLimitDot(); g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::EditClick(TObject *Sender) { TEdit *ed = (TEdit*)Sender; ed->SetFocus(); ed->SelectAll(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ReadIni_Spray() { double value; TIniFile *VecIni = new TIniFile(AppDataItem + "\\VectorSpray.ini"); if (VecIni) { // OutLine, ImageSpray, Motive Ini ÆÄÀÏ // edCount->Value = VecIni->ReadFloat("Outline", "edCount", 0); edMargin->Value = VecIni->ReadFloat("Outline", "edMargin", 0); ShapeComboBox->ItemIndex = VecIni->ReadInteger("Spray", "ShapeCombo", 0); PositionComboBox->ItemIndex = VecIni->ReadInteger("Spray", "PositionCombo", 0); rzcbUseCount->Checked = VecIni->ReadInteger("Spray", "rzcbUseCount", 1); if (rzcbUseCount->Checked) { CountEdit->Value = VecIni->ReadFloat("Spray", "CountEdit", 5); } else { CmEdit->Value = VecIni->ReadFloat("Spray", "CmEdit", 0); } MotiveModeComboBox->ItemIndex = VecIni->ReadInteger("Motive", "MotiveModeComboBox", 0); eMotiveCount->Value = VecIni->ReadFloat("Motive", "eMotiveCount", 5); eMotiveGap->Value = VecIni->ReadFloat("Motive", "eMotiveGap", 100); eMotiveProportion->Value = VecIni->ReadFloat("Motive", "eMotiveProportion", 100); cbMotiveCurveConti->Checked = VecIni->ReadInteger("Motive", "cbMotiveCurveConti", 0); delete VecIni; } else { edCount->Value = 0; edMargin->Value = 0; ShapeComboBox->ItemIndex = 0; PositionComboBox->ItemIndex = 0; rzcbUseCount->Checked = 1; CountEdit->Value = 5; CmEdit->Value = 0; MotiveModeComboBox->ItemIndex = 0; eMotiveCount->Value = 5; eMotiveGap->Value = 100; eMotiveProportion->Value = 100; cbMotiveCurveConti->Checked = 0; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WriteIni_Spray() { TIniFile *VecIni = new TIniFile(AppDataItem + "\\VectorSpray.ini"); if (VecIni) { // OutLine, ImageSpray, Motive Ini ÆÄÀÏ // VecIni->WriteFloat("OutLine", "edCount", edCount->Value); VecIni->WriteFloat("OutLine", "edMargin", edMargin->Value); VecIni->WriteInteger("Spray", "ShapeCombo", ShapeComboBox->ItemIndex); VecIni->WriteInteger("Spray", "PositionCombo", PositionComboBox->ItemIndex); VecIni->WriteInteger("Spray", "rzcbUseCount", rzcbUseCount->Checked); if (rzcbUseCount->Checked) { VecIni->WriteFloat("Spray", "CountEdit", CountEdit->Value); } else { VecIni->WriteFloat("Spray", "CmEdit", CmEdit->Value); } VecIni->WriteInteger("Motive", "MotiveModeComboBox", MotiveModeComboBox->ItemIndex); VecIni->WriteFloat("Motive", "eMotiveCount", eMotiveCount->Value); VecIni->WriteFloat("Motive", "eMotiveGap", eMotiveGap->Value); VecIni->WriteFloat("Motive", "eMotiveProportion", eMotiveProportion->Value); VecIni->WriteInteger("Motive", "cbMotiveCurveConti", cbMotiveCurveConti->Checked); delete VecIni; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ReadIni_Text() { TIniFile *VecIni = new TIniFile(AppDataItem + "\\VectorText.ini"); String fontName = DefaultFontName; int index = -1; if (VecIni && FileExists(AppDataItem + "\\VectorText.ini")) { // Text Ini ÆÄÀÏ // fontName = VecIni->ReadString("Text", "FontNameBox", fontName); index = FontNameBox->Items->IndexOf(fontName); if (index < 0) { TFont *_font = new TFont(); _font->Handle = (HFONT)GetStockObject(DEFAULT_GUI_FONT); // ±¼¸² fontName = _font->Name; delete _font; _font = NULL; index = FontNameBox->Items->IndexOf(fontName); } if (index < 0) { index = FontNameBox->Items->IndexOf(DefaultFontName); } FontNameBox->ItemIndex = index; FontSizeComboBox->ItemIndex = VecIni->ReadInteger("Text", "FontSizeComboBox", 7); if (FontSizeComboBox->ItemIndex < 0 || (FontSizeComboBox->ItemIndex == 0 && TFontSize[0] == 0)) FontSizeComboBox->ItemIndex = 7; FontStyleBox->ItemIndex = VecIni->ReadInteger("Text", "FontStyleBox", 0); WidthGapComboBox->ItemIndex = VecIni->ReadInteger("Text", "WidthGapComboBox", 6); if (WidthGapComboBox->ItemIndex < 0 || (WidthGapComboBox->ItemIndex == 0 && TTextWidthGap[0] == 0)) WidthGapComboBox->ItemIndex = 6; HeightGapComboBox->ItemIndex = VecIni->ReadInteger("Text", "HeightGapComboBox", 6); if (HeightGapComboBox->ItemIndex < 0 || (HeightGapComboBox->ItemIndex == 0 && TTextHeightGap[0] == 0)) HeightGapComboBox->ItemIndex = 6; cbTextAntialiasing->Checked = VecIni->ReadInteger("Text", "cbTextAntialiasing", 0); delete VecIni; } else { TFont *_font = new TFont(); _font->Handle = (HFONT)GetStockObject(DEFAULT_GUI_FONT); // ±¼¸² fontName = _font->Name; delete _font; _font = NULL; index = FontNameBox->Items->IndexOf(fontName); if (index < 0) { index = FontNameBox->Items->IndexOf(DefaultFontName); } FontNameBox->ItemIndex = index; FontSizeComboBox->ItemIndex = 7; FontStyleBox->ItemIndex = 0; WidthGapComboBox->ItemIndex = 6; HeightGapComboBox->ItemIndex = 6; // cbTextAntialiasing->Checked = 0; cbTextAntialiasing->Checked = 1; // ±âº»Àº ¾ÈƼ üũ µÇÀÖµµ·Ï º¯°æ } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WriteIni_Text() { TIniFile *VecIni = new TIniFile(AppDataItem + "\\VectorText.ini"); if (VecIni) { // Text Ini ÆÄÀÏ // VecIni->WriteString("Text", "FontNameBox", FontNameBox->FontName); VecIni->WriteInteger("Text", "FontSizeComboBox", FontSizeComboBox->ItemIndex); VecIni->WriteInteger("Text", "FontStyleBox", FontStyleBox->ItemIndex); VecIni->WriteInteger("Text", "WidthGapComboBox", WidthGapComboBox->ItemIndex); VecIni->WriteInteger("Text", "HeightGapComboBox", HeightGapComboBox->ItemIndex); VecIni->WriteInteger("Text", "cbTextAntialiasing", cbTextAntialiasing->Checked); delete VecIni; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ReadIni_Arrow() { TIniFile *IniFile = new TIniFile(AppDataItem + "\\VectorArrowLine.ini"); if (IniFile) { cbArrowFill->Checked = IniFile->ReadBool("Arrow", "Fill", true); cbArrowBoth->Checked = IniFile->ReadBool("Arrow", "Both", false); rzspCapWidthScale->Value = IniFile->ReadInteger("Arrow", "WidthScale", 3); rzspCapWidth->Value = IniFile->ReadInteger("Arrow", "Width", 1); rzspCapHeight->Value = IniFile->ReadInteger("Arrow", "Height", 1); delete IniFile; } else { LineCapWidthScale = 3; LineCapWidth = 1; LineCapHeight = 1; LineCapLine = 1; bFillLineCap = true; bShowArrowBoth = false; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WriteIni_Arrow() { TIniFile *IniFile = new TIniFile(AppDataItem + "\\VectorArrowLine.ini"); if (IniFile) { IniFile->WriteBool("Arrow", "Fill", cbArrowFill->Checked); IniFile->WriteBool("Arrow", "Both", cbArrowBoth->Checked); IniFile->WriteInteger("Arrow", "WidthScale", rzspCapWidthScale->Value); IniFile->WriteInteger("Arrow", "Width", rzspCapWidth->Value); IniFile->WriteInteger("Arrow", "Height", rzspCapHeight->Value); delete IniFile; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::PenStyleComboBoxCloseUp(TObject *Sender) { // btTemp->SetFocus(); TRzComboBox *comboBox = (TRzComboBox*)Sender; // 2: Åõ¸í¼± if ((PenComboBox->ItemIndex == 2 || DrawingThick == 0) && comboBox->ItemIndex > 0 && comboBox->ItemIndex < 5) { // Åõ¸í ¶óÀÎÀº solid¸¸ °¡´É comboBox->ItemIndex = 0; } if (PenStyle != comboBox->ItemIndex) { VecDraw->NVector->bFstLine = true; } pnArrow->Visible = false; //@jhs - ¼± ¸ð¾ç¿¡ µû¶ó PenStyleComboBox º¯°æ ³»¿ë Àû¿ë bArrowBoth_measure = false; // bArrowBoth_measure °ª ÃʱâÈ­ if (comboBox->ItemIndex == 5) { CapStyle[0] = 1; CapStyle[1] = 0; PenStyle = 0; eSetD_0->Text = ""; eSetD_1->Text = ""; eSetD_2->Text = ""; eSetD_3->Text = ""; eSetD_4->Text = ""; eSetD_5->Text = ""; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; pnArrow->Visible = true; cbArrowFill->Enabled = true; Label11->Enabled = false; rzspCapLine->Enabled = false; bFillLineCap = cbArrowFill->Checked; bShowArrowBoth = cbArrowBoth->Checked; LineCapWidthScale = rzspCapWidthScale->Value; LineCapWidth = rzspCapWidth->Value; LineCapHeight = rzspCapHeight->Value; LineCapLine = rzspCapLine->Value; } else if (comboBox->ItemIndex == 6) { //²÷¾îÁø ¼± LineType = 2; cbFill->Enabled = false; rzbtnLType->Hint = IDS_SEPARATELINE; ChangeLTypeImg(); //¾ç¹æÇâ È­»ìÇ¥ bArrowBoth_measure = true; CapStyle[0] = 2; CapStyle[1] = 2; PenStyle = 0; eSetD_0->Text = ""; eSetD_1->Text = ""; eSetD_2->Text = ""; eSetD_3->Text = ""; eSetD_4->Text = ""; eSetD_5->Text = ""; eSetD_0->Visible = false; eSetD_1->Visible = false; eSetD_2->Visible = false; eSetD_3->Visible = false; eSetD_4->Visible = false; eSetD_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; pnArrow->Visible = true; cbArrowFill->Enabled = false; Label11->Enabled = true; rzspCapLine->Enabled = true; bFillLineCap = cbArrowFill->Checked; bShowArrowBoth = cbArrowBoth->Checked; LineCapWidthScale = rzspCapWidthScale->Value; LineCapWidth = rzspCapWidth->Value; LineCapHeight = rzspCapHeight->Value; LineCapLine = rzspCapLine->Value; } else { CapStyle[0] = 0; CapStyle[1] = 0; PenStyle = comboBox->ItemIndex; DrawSetDashPattern(VectorForm->DrawingThick); } cbObjAntialiasing->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::EditPenStyleBoxCloseUp(TObject *Sender) { // btTemp->SetFocus(); eSet_0->Text = ""; eSet_1->Text = ""; eSet_2->Text = ""; eSet_3->Text = ""; eSet_4->Text = ""; eSet_5->Text = ""; eSet_0->Visible = false; eSet_1->Visible = false; eSet_2->Visible = false; eSet_3->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet1d->Visible = false; stSet1g->Visible = false; stSet2d->Visible = false; stSet2g->Visible = false; stSet3d->Visible = false; stSet3g->Visible = false; String strtemp; int index = EditPenStyleBox->ItemIndex; pnArrowEdit->Visible = false; if (index == 6) { if (VecDraw->CheckZigZag()) { ZigZagDialogFunc(min(MainImageForm->iMainImage->uBitmap->Width / 2, MainImageForm->iMainImage->uBitmap->Height / 2)); } else { Application->MessageBox(IDS_MESSAGE001.c_str(), L"Error", MB_OK); } } else if (index == 5 || index == 7) { pnArrowEdit->Visible = true; if (index == 5) { cbArrowFillEdit->Enabled = true; Label12->Enabled = false; rzspCapLineEdit->Enabled = false; } else if (index == 7) { cbArrowFillEdit->Enabled = false; Label12->Enabled = true; rzspCapLineEdit->Enabled = true; } bFillLineCap = cbArrowFill->Checked; cbArrowFillEdit->Checked = cbArrowFill->Checked; bShowArrowBoth = cbArrowBoth->Checked; cbArrowBothEdit->Checked = cbArrowBoth->Checked; LineCapWidthScale = rzspCapWidthScale->Value; rzspCapWidthScaleEdit->Value = rzspCapWidthScale->Value; LineCapWidth = rzspCapWidth->Value; rzspCapWidthEdit->Value = rzspCapWidth->Value; LineCapHeight = rzspCapHeight->Value; rzspCapHeightEdit->Value = rzspCapHeight->Value; LineCapLine = rzspCapLine->Value; rzspCapLineEdit->Value = rzspCapLine->Value; VecDraw->ChangeObjectPenStyle(index); } else { VecDraw->ChangeObjectPenStyle(index); } switch(index) { case 0: break; case 1: eSet_0->Visible = true; eSet_1->Visible = true; stSet1d->Visible = true; stSet1g->Visible = true; strtemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strtemp + " pt"; break; case 2: eSet_0->Visible = true; eSet_1->Visible = true; stSet1d->Visible = true; stSet1g->Visible = true; strtemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strtemp + " pt"; break; case 3: eSet_0->Visible = true; eSet_1->Visible = true; eSet_2->Visible = true; eSet_3->Visible = true; stSet1d->Visible = true; stSet1g->Visible = true; stSet2d->Visible = true; stSet2g->Visible = true; strtemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[2]); eSet_2->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[3]); eSet_3->Text = strtemp + " pt"; break; case 4: eSet_0->Visible = true; eSet_1->Visible = true; eSet_2->Visible = true; eSet_3->Visible = true; eSet_4->Visible = true; eSet_5->Visible = true; stSet1d->Visible = true; stSet1g->Visible = true; stSet2d->Visible = true; stSet2g->Visible = true; stSet3d->Visible = true; stSet3g->Visible = true; strtemp = FloatToStr(VecDraw->set[0]); eSet_0->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[1]); eSet_1->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[2]); eSet_2->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[3]); eSet_3->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[4]); eSet_4->Text = strtemp + " pt"; strtemp = FloatToStr(VecDraw->set[5]); eSet_5->Text = strtemp + " pt"; break; case 5: eSet_0->Visible = false; eSet_1->Visible = false; stSet1d->Visible = false; stSet1g->Visible = false; eSet_2->Visible = false; eSet_3->Visible = false; stSet2d->Visible = false; stSet2g->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet3d->Visible = false; stSet3g->Visible = false; break; case 7: //bArrowBoth_measure = true; eSet_0->Visible = false; eSet_1->Visible = false; eSet_2->Visible = false; eSet_3->Visible = false; eSet_4->Visible = false; eSet_5->Visible = false; stSet1_d->Visible = false; stSet1_g->Visible = false; stSet2_d->Visible = false; stSet2_g->Visible = false; stSet3_d->Visible = false; stSet3_g->Visible = false; break; } // UDPen->SetFocus(); // ´Ù¸¥°÷¿¡ focus¸¦ µ¹¸² cbObjAntialiasing2->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ExecuteHotKey(String command) { BEGIN_LOG(""); if (command == "Line") { if (V_Item != M_D_LINE) sbLine->Click(); } else if (command == "Curve") { if (V_Item != M_D_CURVE) sbCurve->Click(); } else if (command == "Square") { if (V_Item != M_D_SQUARE) { mnitmSquareClick(mnitmSquare); } } else if (command == "Rectangle") { if (V_Item != M_D_RECT) { mnitmSquareClick(mnitmRectangle); } } else if (command == "Circle") { if (V_Item != M_D_CIRCLE) { mnitmSquareClick(mnitmCircle); } } else if (command == "Ellipse") { if (V_MainItem != M_D_ELLIPSE) { mnitmSquareClick(mnitmEllipse); } } else if (command == "Text") { if (V_Item != M_D_NEWTEXT) sbNewTextEdit->Click(); } else if (command == "EditObject") { if (V_Item != M_O_EDIT) sbObjectEdit->Click(); } else if (command == "SelectAll") { // Merge ModeÀÏ °æ¿ì SELECT ALLÀÌ µÇÁö ¾Êµµ·Ï ÇÑ´Ù - by monkman (2004.12.15) if (VecDraw->NVector->bProportion) { MainImageForm->iMainImage->Repaint(); END_LOG; return; } else if (VecDraw->NVector->bRotation) { MainImageForm->iMainImage->Repaint(); END_LOG; return; } else if (!VecDraw->NVector->bMergeMode) { VecDraw->SelectAll(); } if (V_Item != M_O_EDIT) sbObjectEdit->Click(); MainImageForm->iMainImage->Repaint(); UpdateForm(); } else if (command == "SelectDirect") { if (V_Item != M_P_EDIT) sbDirectSelect->Click(); } else if (command == "Convert") { if (V_Item != M_P_CONVERTDIRECTION) sbConvertDirection->Click(); } else if (command == "AddPoint") { if (V_Item != M_P_ADD) sbPointAdd->Click(); } else if (command == "DeletePoint") { if (V_Item != M_P_DELETE) sbPointDelete->Click(); } else if (command == "Knife") { if (V_Item != M_P_KNIFE) sbKnife->Click(); } else if (command == "BringToFront") { VecDraw->ChangeObjectOrder(true, true); // PopupForwardClick } else if (command == "SendToBack") { VecDraw->ChangeObjectOrder(false, true); // PopupBackwardClick } else if (command == "Group") { PopupGroup->Click(); } else if (command == "Ungroup") { PopupGroup->Click(); } else if (command == "Lock") { PopupLock->Click(); } else if (command == "Unlock") { PopupLock->Click(); } else if (command == "JoinPoint") { VecDraw->InitJoin(); } else if (command == "ArrangePointHorz") { VecDraw->InitAverage(true, false); } else if (command == "ArrangePointVert") { VecDraw->InitAverage(false, true); } else if (command == "ArrangePointBoth") { VecDraw->InitAverage(true, true); } else if (command == "Undo") { btUndo->Click(); } else if (command == "Redo") { btRedo->Click(); } else if (command == "QualitySpeed") { TIniFile *IniFile = new TIniFile(AppDataItem + "\\status.ini"); switch(MainForm->nVectorMode) { case 0: // Quality MainForm->nVectorMode = 1; break; case 1: // Speed MainForm->nVectorMode = 0; break; } if (IniFile != NULL) { // Vector Speed - by monkman (2007.09.12) IniFile->WriteInteger("VectorForm", "VectorMode", MainForm->nVectorMode); delete IniFile; } MainImageForm->iMainImage->Repaint(); // Vector Repaint } else if (command == "ImageSpray") { sbSpray->Click(); } else if (command == "Cutting") { sbCutting->Click(); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::TextProc(tagMSG &msg, bool &handled) { if (UseComboBoxForText == true) return; if (edText->Focused() == false) edText->SetFocus(); HIMC hImc; int len = 0; TCHAR szComp[2] = {0}; if (msg.message == WM_KEYDOWN || msg.message == WM_KEYUP) { WORD key = msg.wParam; TShiftState shift; if (GetAsyncKeyState(VK_MENU) & 0x8000) shift << ssAlt; if (GetAsyncKeyState(VK_SHIFT) & 0x8000) shift << ssShift; if (GetAsyncKeyState(VK_CONTROL) & 0x8000) shift << ssCtrl; if (msg.message == WM_KEYDOWN) iMainImageKeyDown(key, shift); else if (msg.message == WM_KEYUP) iMainImageKeyUp(key, shift); } else if (msg.message == WM_CHAR || msg.message == WM_IME_CHAR) { if (bComp) { //Á¶¸³Áß¿¡ Æ÷Ä¿½º°¡ À̵¿ÇÒ °æ¿ì ÀÌ¹Ì Á¶¸³ÁßÀÎ °ÍÀÌ ¸Þ¸ð¸®¿¡ bComp = 0; //Ãß°¡ µÇ¾ú±â ¶§¹®¿¡ ³²¾Æ ÀÖ´Â °ÍÀº ó¸®ÇÏÁö ¾Ê´Â´Ù. handled = true; return; } TMessage tMsg; tMsg.Msg = msg.message; tMsg.WParam = msg.wParam; tMsg.LParam = msg.lParam; tMsg.Result = 0; if(EnterException == 3) { TFont *font = MainImageForm->iMainImage->Canvas->Font; VecDraw->ChangeSizeSeletedWordData(font); EnterException = 0; } else EditProcessing(tMsg); handled = true; } else if (msg.message == WM_IME_COMPOSITION) { //ÇÑ±Û ÀÌ¿ÜÀÇ ¹®Àڴ ƯÈ÷ Áß±¹¾î´Â Á¶ÇÕ ¹®ÀÚ·Î µé¾î ¿À¸é¼­ Á¤»óÀûÀ¸·Î //󸮰¡ µÇÁö ¾Ê´Â ¹®Á¦°¡ À־ ÇÑ±Û ¸ðµå°¡ ¾Æ´Ò °æ¿ì 󸮰¡ µÇÁö //¾Êµµ·Ï ó¸®ÇÔ. if (MainForm->sFontLanguage != "KOREAN" ) { bComp = 0; handled = false; return; } //-------------------------------------------------------------------- TMessage tMsg; tMsg.Msg = msg.message; tMsg.WParam = msg.wParam; tMsg.LParam = msg.lParam; tMsg.Result = 0; hImc = ImmGetContext(msg.hwnd); if (msg.lParam & GCS_COMPSTR) { len = ImmGetCompositionString(hImc, GCS_COMPSTR, NULL, 0); ImmGetCompositionString(hImc, GCS_COMPSTR, szComp, len); szComp[1] = 0; if (len == 0) { //Á¶ÇÕ ±ÛÀÚ°¡ ¾ø´Â °æ¿ì bComp = 0; //Á¶ÇÕ Áß¿¡ back key¸¦ ´­·¯ Áö¿ï °æ¿ì tMsg.Msg = WM_CHAR; tMsg.WParam = VK_BACK; tMsg.LParam = 1; szComp[0] = 0; szComp[1] = 0; } else bComp++; if (len == 0) EditProcessing(tMsg); else EditProcessing(tMsg, szComp); } else if (msg.lParam & GCS_RESULTSTR) { len = ImmGetCompositionString(hImc, GCS_RESULTSTR, NULL, 0); ImmGetCompositionString(hImc, GCS_RESULTSTR, szComp, len); szComp[1] = 0; if (bComp) { EditProcessing(tMsg, szComp); } bComp = 0; szComp[0] = 0; szComp[1] = 0; } ImmReleaseContext(msg.hwnd, hImc); if (msg.lParam & GCS_COMPSTR) handled = false; else handled = true; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::mnitmSquareClick(TObject *Sender) { int num = 0; TRzMenuToolbarButton *btn = NULL; TMenuItem *mnItm = dynamic_cast(Sender); if (mnItm == mnitmRectangle) { num = 0; V_Item = M_D_RECT; btn = sbRect; } else if (mnItm == mnitmSquare) { num = 1; V_Item = M_D_SQUARE; btn = sbRect; } else if (mnItm == mnitmEllipse) { num = 2; V_Item = M_D_ELLIPSE; btn = sbEllipse; } else if (mnItm == mnitmCircle) { num = 3; V_Item = M_D_CIRCLE; btn = sbEllipse; } btn->Glyph->Assign(mnItm->Bitmap); btn->Hint = mnItm->Caption; VectorMenuCurrentPanel(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::mnitmSeparateClick(TObject *Sender) { /* if (V_Item == M_D_LINE) { if (LineType == 1) { LineType = 2; rzbtnLType->Hint = IDS_SEPARATELINE; cbFill->Enabled = false; }else if (LineType == 2) { LineType = 1; rzbtnLType->Hint = IDS_CONTINUOUSLINE; cbFill->Enabled = true; if (bSeparate) VecDraw->NVector->bFstLine = true; // Separate Line°ú À̾îÁö´Â°ÍÀ» ¹æÁö bSeparate = false; } }else if (V_Item == M_D_CURVE) { if (LineType == 1) { LineType = 2; rzbtnLType->Hint = IDS_SEPARATELINE; cbFill->Enabled = true; // cbFill 2005 Vector upgrade shin }else if (LineType == 2) { LineType = 3; rzbtnLType->Hint = IDS_CONTINUOUSTAN; cbFill->Enabled = true; // cbFill 2005 Vector upgrade shin if (bSeparate) VecDraw->NVector->bFstLine = true; // Separate Line°ú À̾îÁö´Â°ÍÀ» ¹æÁö bSeparate = false; }else if (LineType == 3) { LineType = 1; rzbtnLType->Hint = IDS_CONTINUOUSLINE; cbFill->Enabled = true; // cbFill 2005 Vector upgrade shin } } */ int num = -1; if (Sender == mnitmSeparate) { LineType = 2; cbFill->Enabled = false; rzbtnLType->Hint = IDS_SEPARATELINE; num = 4; } else if (Sender == mnitmContinuous) { if( !bArrowBoth_measure ) { LineType = 1; cbFill->Enabled = true; rzbtnLType->Hint = IDS_CONTINUOUSLINE; num = 5; } } else if (Sender == mnitmTangent) { if( !bArrowBoth_measure ) { LineType = 3; cbFill->Enabled = true; rzbtnLType->Hint = IDS_CONTINUOUSTAN; num = 6; } } if (V_Item == M_D_CURVE) cbFill->Enabled = true; ChangeLTypeImg(); } // --------------------------------------------------------------------------- // void __fastcall TVectorForm::mnitemRoundClick(TObject *Sender) { if (Sender == mnitemRound) { VecDraw->ChangePenShape(true, true); DrawPenShapeButton(0); KindOfPenShape = 1; } else if (Sender == mnitemFlat) { VecDraw->ChangePenShape(true, false); DrawPenShapeButton(1); KindOfPenShape = 2; } /* BEGIN_LOG(""); TSpeedButton *s = (TSpeedButton *)Sender; //V_EditItem = 0; // PenShapeImageListÀÇ À̹ÌÁö ¼ø¼­ // 0: None 1: Round 2: Flat 3: Multi switch(KindOfPenShape){ case 0: DrawPenShapeButton(0); break; case 1: //ÇöÀç Round VecDraw->ChangePenShape(false, false); DrawPenShapeButton(2); // 2: Flat KindOfPenShape = 2; break; case 2: //ÇöÀç Flat VecDraw->ChangePenShape(false, true); DrawPenShapeButton(1); // 1: Round KindOfPenShape = 1; break; case 3: //ÇöÀç multi SelectÀ̰í ù(Ȧ¼ö)¹øÂ° Ŭ¸¯ VecDraw->ChangePenShape(true, true); DrawPenShapeButton(1); // 1: Round KindOfPenShape = 4; break; case 4: //ÇöÀç multi SelectÀÌ°í µÎ(¦¼ö)¹øÂ° Ŭ¸¯ VecDraw->ChangePenShape(true, false); DrawPenShapeButton(2); // 2: Flat KindOfPenShape = 3; break; } s->Down = false; END_LOG; */ } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ChangeLTypeImg() { TMenuItem *menuItem = NULL; if (LineType == 2) menuItem = mnitmSeparate; else if (LineType == 1) menuItem = mnitmContinuous; else if (LineType == 3) menuItem = mnitmTangent; if (menuItem != NULL) rzbtnLType->Glyph->Assign(menuItem->Bitmap); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::TestNEMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TEdit *edit = (TEdit*)Sender; edit->SetFocus(); edit->SelectAll(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::TestNEKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { TNumEdit *edit = (TNumEdit*)Sender; VecDraw->bezierCurveApproximator.Error_Threshold = edit->Value; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontSizeComboBoxExit(TObject *Sender) { Word key = VK_RETURN; FontSizeComboBoxKeyDown(Sender, key, TShiftState()); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::WidthGapComboBoxExit(TObject *Sender) { Word key = VK_RETURN; WidthGapComboBoxKeyDown(Sender, key, TShiftState()); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::HeightGapComboBoxExit(TObject *Sender) { Word key = VK_RETURN; HeightGapComboBoxKeyDown(Sender, key, TShiftState()); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::FontStyleBoxExit(TObject *Sender) { Word key = VK_RETURN; FontStyleBoxKeyDown(Sender, key, TShiftState()); } // --------------------------------------------------------------------------- // Vector Repeat //////////////////////////////////////////////////////////////////////////////////////////////////// // Initialize VectorRepeat Menu void __fastcall TVectorForm::InitVectorRepeat() { BEGIN_LOG(""); if (mVectorRepeat != NULL) delete mVectorRepeat; mVectorRepeat = new TVectorRepeat(); rzcbobxRepeatMode->ItemIndex = REPEAT_NORMAL; rzcbobxRepeatModeChange(rzcbobxRepeatMode); rzchbxCutObj->Checked = false; rzchbxCutObjClick(rzchbxCutObj); rzcbobxGapUnit->ItemIndex = static_cast(TUnit::uDot); mVectorRepeat->GapUnit = static_cast(rzcbobxGapUnit->ItemIndex); edGapX->Value = 0; mVectorRepeat->GapX = edGapX->Value; edGapY->Value = 0; mVectorRepeat->GapY = edGapY->Value; rzspedCntX->Value = 1; rzspedCntChange(rzspedCntX); rzspedCntY->Value = 1; rzspedCntChange(rzspedCntY); rzchbxUseCnt->Checked = false; rzchbxUseCntClick(rzchbxUseCnt); if (mVectorRepeat->Initialize(MainImageForm) == true) { rzpnlVectorRepeat->Left = 0; rzpnlVectorRepeat->Top = RzSeparator->Top + RzSeparator->Height; rzpnlVectorRepeat->Visible = true; rzpnlVectorRepeat->BringToFront(); ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + RzSeparator->Height + rzpnlVectorRepeat->Height; V_MainItem = 2; V_Item = M_O_VECTORREPEAT; } else { ExitVectorRepeat(); } END_LOG; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::ExitVectorRepeat() { rzpnlVectorRepeat->Visible = false; if (mVectorRepeat != NULL) { delete mVectorRepeat; mVectorRepeat = NULL; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzbtnVectorRepeatClick(TObject *Sender) { InitVectorRepeat(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzcbobxRepeatModeChange(TObject *Sender) { mVectorRepeat->Mode = static_cast (rzcbobxRepeatMode->ItemIndex); switch(mVectorRepeat->Mode) { case REPEAT_NORMAL: rzlblMax->Enabled = false; rzcbobxHDLength->Enabled = false; break; case REPEAT_HDHOR: rzlblMax->Enabled = true; rzcbobxHDLength->Enabled = true; rzlblMax->Caption = IDS_HD_MAXLENGTH + " : " + FloatToStr (mVectorRepeat->HalfDropMaxLength); rzcbobxHDLength->Items->Strings[0] = mVectorRepeat->HalfDropLength; rzcbobxHDLength->ItemIndex = 0; break; case REPEAT_HDVER: rzlblMax->Enabled = true; rzcbobxHDLength->Enabled = true; rzlblMax->Caption = IDS_HD_MAXLENGTH + " : " + FloatToStr (mVectorRepeat->HalfDropMaxLength); rzcbobxHDLength->Items->Strings[0] = mVectorRepeat->HalfDropLength; rzcbobxHDLength->ItemIndex = 0; break; } g_FocusControl->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzchbxCutObjClick(TObject *Sender) { mVectorRepeat->IsCutObject = rzchbxCutObj->Checked; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzchbxUseCntClick(TObject *Sender) { mVectorRepeat->IsUsedCount = rzchbxUseCnt->Checked; rzspedCntX->Enabled = rzchbxUseCnt->Checked; rzspedCntY->Enabled = rzchbxUseCnt->Checked; rzchbxCutObj->Enabled = !rzchbxUseCnt->Checked; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspedCntChange(TObject *Sender) { TRzSpinEdit *cntSpinEdit = dynamic_cast(Sender); switch(cntSpinEdit->Tag) { case 0: mVectorRepeat->FixedCountX = cntSpinEdit->Value; break; case 1: mVectorRepeat->FixedCountY = cntSpinEdit->Value; break; } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspedDblClick(TObject *Sender) { TRzSpinEdit *dstSpinEdit = static_cast(Sender); dstSpinEdit->SetFocus(); dstSpinEdit->SelectAll(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzcbobxHDLengthCloseUp(TObject *Sender) { // º¤ÅÍ ¹Ýº¹ °ü·Ã ¼öÁ¤ - by monkman (2011.04.28) double maxLength = mVectorRepeat->HalfDropMaxLength; switch(rzcbobxHDLength->ItemIndex) { case 0: mVectorRepeat->HalfDropLength = rzcbobxHDLength->Items->Strings[0].ToDouble (); break; case 1: rzcbobxHDLength->ItemIndex = 0; mVectorRepeat->HalfDropLength = rzcbobxHDLength->Items->Strings[0].ToDouble (); break; case 2: mVectorRepeat->HalfDropLength = (double)maxLength / 8; break; case 3: mVectorRepeat->HalfDropLength = (double)maxLength / 4; rzcbobxHDLength->Items->Strings[0] = mVectorRepeat->HalfDropLength; break; case 4: mVectorRepeat->HalfDropLength = (double)maxLength / 2; rzcbobxHDLength->Items->Strings[0] = mVectorRepeat->HalfDropLength; break; case 5: mVectorRepeat->HalfDropLength = (double)(3 * maxLength) / 4; rzcbobxHDLength->Items->Strings[0] = mVectorRepeat->HalfDropLength; break; case 6: mVectorRepeat->HalfDropLength = (double)(7 * maxLength) / 8; rzcbobxHDLength->Items->Strings[0] = mVectorRepeat->HalfDropLength; break; } g_FocusControl->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzcbobxHDLengthDblClick(TObject *Sender) { rzcbobxHDLength->SetFocus(); rzcbobxHDLength->SelectAll(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzcbobxHDLengthKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { // º¤ÅÍ ¹Ýº¹ °ü·Ã ¼öÁ¤ - by monkman (2011.04.28) if (Key == VK_RETURN) { double value = 0; if (TryStrToFloat(rzcbobxHDLength->Text, value)) { if (value > mVectorRepeat->HalfDropMaxLength) value = mVectorRepeat->HalfDropMaxLength; rzcbobxHDLength->Items->Strings[0] = value; mVectorRepeat->HalfDropLength = value; } else { mVectorRepeat->HalfDropLength = rzcbobxHDLength->Items->Strings[0] .ToDouble(); } rzcbobxHDLength->ItemIndex = 0; g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzcbobxGapUnitCloseUp(TObject *Sender) { mVectorRepeat->GapUnit = static_cast(rzcbobxGapUnit->ItemIndex); edGapX->Value = mVectorRepeat->GapX; edGapY->Value = mVectorRepeat->GapY; g_FocusControl->SetFocus(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::edGapClick(TObject *Sender) { TNumEdit *gapNumEdit = static_cast(Sender); gapNumEdit->SetFocus(); gapNumEdit->SelectAll(); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::edGapKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { TNumEdit *gapNumEdit = dynamic_cast(Sender); if (gapNumEdit->Value < 0) { gapNumEdit->Value = 0; return; } switch(gapNumEdit->Tag) { case 0: mVectorRepeat->GapX = gapNumEdit->Value; break; case 1: mVectorRepeat->GapY = gapNumEdit->Value; break; } g_FocusControl->SetFocus(); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::edGapXExit(TObject *Sender) { TNumEdit *gapNumEdit = dynamic_cast(Sender); switch(gapNumEdit->Tag) { case 0: if (gapNumEdit->Value != mVectorRepeat->GapX) gapNumEdit->Value = mVectorRepeat->GapX; break; case 1: if (gapNumEdit->Value != mVectorRepeat->GapY) gapNumEdit->Value = mVectorRepeat->GapY; break; } } // --------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////////////////////////// void __fastcall TVectorForm::SubPocketClick(TObject *Sender) { TMenuItem *mi = (TMenuItem*)Sender; PSTYLEDATAFILEHEADER pheader; int number; // 2005 Vector Upgrade =-= [ Begin ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // CombiDetailÀ» È£ÃâÇÒ ¶§ ¿ÀºêÁ§Æ® ÆíÁý ¸Þ´º·Î - by monkman (2005.05.26) VectorMenuButtonOff(); sbObjectEdit->Down = true; V_MainItem = 2; V_Item = M_O_EDIT; VectorMenuCurrentPanel(); // º¤ÅÍ ÆíÁý ¸Þ´º·Î º¯°æµÇµµ·Ï ¼öÁ¤ - by monkman (2011.02.18) VecDraw->NVector->bFstLine = true; NVector->step = 0; VecDraw->bJoinState = false; // stepÀÌ 0 À̸é ÃʱâÈ­ ÇØÁØ´Ù - by monkman (2009.11.26) /* EditPanel->Visible = true; EditPanel->Top = shSeparate->Top + shSeparate->Height; ClientHeight = VectorMenuPanel->Top + VectorMenuPanel->Height + shSeparate->Height + EditPanel->Height; Parent->Height = ParentHeight + ClientHeight; */ // =-=-=-=-=-=-=-=-=-=-=-= [ End ] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- if (DetailForm) { DetailForm->ExitForm(); delete DetailForm; DetailForm = NULL; } DetailForm = new TDetailForm(this); DetailForm->Parent = MainForm; number = VecDraw->CheckStyle(); if (number != 0) { pheader = (PSTYLEDATAFILEHEADER)MainImageForm->StyleHeader->Items [abs(number) - 1]; DetailForm->StyleDivision = pheader->Division; // mi->Tag == 7ÀÎ Etc Ãß°¡ - by monkman (2004.07.19) if (mi->Tag == 3 || mi->Tag == 4 || mi->Tag == 7) // ´ÜÃß³ª Æ÷ÄÏ DetailForm->StyleType = EType(100); else DetailForm->StyleType = pheader->Type; } else { DetailForm->StyleDivision = EDivision(0); DetailForm->StyleType = EType(0); } DetailForm->InitForm(mi->Tag, bool(PopupAttach->Tag)); } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbArrowFillEditClick(TObject *Sender) { if (bUserChange) { // bFillLineCap = cbArrowFill->Checked; bool fill = cbArrowFillEdit->Checked; bool both = cbArrowBothEdit->Checked; double WidthScale = rzspCapWidthScaleEdit->Value; double Width = rzspCapWidthEdit->Value; double Height = rzspCapHeightEdit->Value; double Line = rzspCapLineEdit->Value; VecDraw->ChangeObjectPenCapStyle(fill, both, WidthScale, Width, Height, Line); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbArrowBothEditClick(TObject *Sender) { if (bUserChange) { // bShowArrowBoth = cbArrowBoth->Checked; bool fill = cbArrowFillEdit->Checked; bool both = cbArrowBothEdit->Checked; double WidthScale = rzspCapWidthScaleEdit->Value; double Width = rzspCapWidthEdit->Value; double Height = rzspCapHeightEdit->Value; double Line = rzspCapLineEdit->Value; VecDraw->ChangeObjectPenCapStyle(fill, both, WidthScale, Width, Height, Line); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapWidthScaleEditChange(TObject *Sender) { if (bUserChange) { // LineCapWidthScale = rzspCapWidthScale->Value; bool fill = cbArrowFillEdit->Checked; bool both = cbArrowBothEdit->Checked; double WidthScale = rzspCapWidthScaleEdit->Value; double Width = rzspCapWidthEdit->Value; double Height = rzspCapHeightEdit->Value; double Line = rzspCapLineEdit->Value; VecDraw->ChangeObjectPenCapStyle(fill, both, WidthScale, Width, Height, Line); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapWidthEditChange(TObject *Sender) { if (bUserChange) { // LineCapWidth = rzspCapWidth->Value; bool fill = cbArrowFillEdit->Checked; bool both = cbArrowBothEdit->Checked; double WidthScale = rzspCapWidthScaleEdit->Value; double Width = rzspCapWidthEdit->Value; double Height = rzspCapHeightEdit->Value; double Line = rzspCapLineEdit->Value; VecDraw->ChangeObjectPenCapStyle(fill, both, WidthScale, Width, Height, Line); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapHeightEditChange(TObject *Sender) { if (bUserChange) { // LineCapHeight = rzspCapHeight->Value; bool fill = cbArrowFillEdit->Checked; bool both = cbArrowBothEdit->Checked; double WidthScale = rzspCapWidthScaleEdit->Value; double Width = rzspCapWidthEdit->Value; double Height = rzspCapHeightEdit->Value; double Line = rzspCapLineEdit->Value; VecDraw->ChangeObjectPenCapStyle(fill, both, WidthScale, Width, Height, Line); } } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapLineEditChange(TObject *Sender) { if (bUserChange) { // LineCapHeight = rzspCapHeight->Value; bool fill = cbArrowFillEdit->Checked; bool both = cbArrowBothEdit->Checked; double WidthScale = rzspCapWidthScaleEdit->Value; double Width = rzspCapWidthEdit->Value; double Height = rzspCapHeightEdit->Value; double Line = rzspCapLineEdit->Value; VecDraw->ChangeObjectPenCapStyle(fill, both, WidthScale, Width, Height, Line); } } //--------------------------------------------------------------------------- void __fastcall TVectorForm::cbArrowFillClick(TObject *Sender) { bFillLineCap = cbArrowFill->Checked; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::cbArrowBothClick(TObject *Sender) { bShowArrowBoth = cbArrowBoth->Checked; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapWidthScaleChange(TObject *Sender) { LineCapWidthScale = rzspCapWidthScale->Value; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapWidthChange(TObject *Sender) { LineCapWidth = rzspCapWidth->Value; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapHeightChange(TObject *Sender) { LineCapHeight = rzspCapHeight->Value; } // --------------------------------------------------------------------------- void __fastcall TVectorForm::rzspCapLineChange(TObject *Sender) { LineCapLine = rzspCapLine->Value; } //--------------------------------------------------------------------------- void __fastcall TVectorForm::btProportionRunKeyPress(TObject *Sender, wchar_t &Key) { //# Run button enter action if(Key == VK_RETURN){ btProportionRunClick(Sender); } } //---------------------------------------------------------------------------