//--------------------------------------------------------------------------- #include #pragma hdrstop #include "DataTrans.h" #include "Combination.h" #include "define.h" #include "BaseDirectoryDialog_F.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "RzGrids" #pragma link "RzLabel" #pragma link "RzTreeVw" #pragma link "RzShellCtrls" #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_STYLEPOINTSAVE StringTable[0] #define IDS_INFORMATION StringTable[1] #define IDS_FRONT StringTable[2] #define IDS_BACK StringTable[3] #define IDS_IMAGESAVE StringTable[4] #define IDS_BRINGTHEFRONTOBJECTS StringTable[5] #define IDS_BRINGTHEBACKOBJECTS StringTable[6] #define IDS_MOVETHEOBJECTTOLEFT StringTable[7] #define IDS_MOVETHEOBJECTTOINITPOSITION StringTable[8] #define IDS_MOVETHEOBJECTTORIGHT StringTable[9] #define IDS_INITIALIZATION StringTable[10] #define IDS_STYFILESAVE StringTable[11] #define IDS_STYFILELOAD StringTable[12] #define IDS_STIFILESAVE StringTable[13] #define IDS_BRINGTHEIMAGEINTHECANVAS StringTable[14] #define IDS_BRINGTHEIMAGEINTHEFILE StringTable[15] #define IDS_COMMENT StringTable[16] #define IDS_MESSAGE1 StringTable[17] #define IDS_MESSAGE2 StringTable[18] #define IDS_MESSAGE3 StringTable[19] #define IDS_MESSAGE4 StringTable[20] #define IDS_MESSAGE5 StringTable[21] #define IDS_MESSAGE6 StringTable[22] #define IDS_MESSAGE7 StringTable[23] #define IDS_MESSAGE8 StringTable[24] #define IDS_MESSAGE9 StringTable[25] #define IDS_MESSAGE10 StringTable[26] #define IDS_MESSAGE11 StringTable[27] // 2004.08.17 Ãß°¡ - by monkman #define IDS_MAINITEMS StringTable[28] #define IDS_MAN StringTable[29] #define IDS_WOMAN StringTable[30] #define IDS_CHILD StringTable[31] #define IDS_BABY StringTable[32] #define IDS_CLOTHES StringTable[33] #define IDS_TOPCLOTHES StringTable[34] #define IDS_BOTTOMCLOTHES StringTable[35] #define IDS_ITEMS StringTable[36] #define IDS_SETBASEFOLDER StringTable[37] #define IDS_ORIGINAL StringTable[38] #define IDS_MESSAGE12 StringTable[39] #define IDS_MESSAGE13 StringTable[40] #define IDS_MESSAGE14 StringTable[41] #define IDS_MESSAGE15 StringTable[42] #define IDS_MESSAGE16 StringTable[43] #define IDS_NEWCLOTHES StringTable[44] #define IDS_CONFIRMDELETEFOLDER StringTable[45] #define IDS_SAMEFOLDERNAME StringTable[46] #define IDS_NOTINPUTFOLDERNAME StringTable[47] #define IDS_CANNOTCREATEFOLDER StringTable[48] #define IDS_CANNOTRENAMEFOLDER StringTable[49] #define IDS_CANNOTDELETEFOLDER StringTable[50] #define IDS_SUBMATERIAL StringTable[51] #define IDS_SELECTEDFOLDER StringTable[52] #define IDS_NEWFOLDER StringTable[53] #define IDS_RENAMEFOLDER StringTable[54] #define IDS_DELETEFOLDER StringTable[55] #define IDS_SIZEINFORMATION StringTable[56] #define IDS_SIZE55BASE StringTable[57] #define IDS_UPPER StringTable[58] #define IDS_TOTALLENGTH StringTable[59] #define IDS_CHEST StringTable[60] #define IDS_WAIST StringTable[61] #define IDS_HEM StringTable[62] #define IDS_SHOULDER StringTable[63] #define IDS_SLEEVELENGTH StringTable[64] #define IDS_SLEEVEWIDTH StringTable[65] #define IDS_SLEEVEENDWIDTH StringTable[66] #define IDS_BLANK StringTable[67] #define IDS_BOTTOMS StringTable[68] #define IDS_BOTTOMSLENGTH StringTable[69] #define IDS_BOTTOMSWAIST StringTable[70] #define IDS_HIP StringTable[71] #define IDS_THIGH StringTable[72] #define IDS_KNEE StringTable[73] #define IDS_BOTTOMSHEM StringTable[74] #define IDS_FRONTSIDECHAIRSET StringTable[75] #define IDS_BACKSIDECHAIRSET StringTable[76] #define IDS_BELT StringTable[77] #define IDS_SIZEINFORMATIONSAVE StringTable[78] #define IDS_SIZEINFORMATIONLOAD StringTable[79] #define IDS_INPUTFILENAME StringTable[80] #define IDS_MAINTYPE StringTable[81] #define IDS_TOPTYPE StringTable[82] #define IDS_BOTTOMTYPE StringTable[83] #define IDS_TOPWHOLE StringTable[84] #define IDS_TOPSILHOUETTE StringTable[85] #define IDS_TOPSLEEVE StringTable[86] #define IDS_TOPCOLLAR StringTable[87] #define IDS_BOTTOMWHOLE StringTable[88] #define IDS_BOTTOMSILHOUETTE StringTable[89] #define IDS_BOTTOMBENDBELT StringTable[90] #define IDS_DETAIL StringTable[91] #define IDS_COMBINATIONSLEEVE StringTable[92] #define IDS_COMBINATIONCOLLAR StringTable[93] #define IDS_COMBINATIONBELT StringTable[94] #define IDS_TOPSILHOUETTETYPE StringTable[95] #define IDS_SLEEVETYPE StringTable[96] #define IDS_COLLARTYPE StringTable[97] #define IDS_BOTTOMSILHOUETTETYPE StringTable[98] #define IDS_BENDBELTTYPE StringTable[99] #define IDS_SPRING StringTable[100] #define IDS_SUMMER StringTable[101] #define IDS_FALL StringTable[102] #define IDS_WINTER StringTable[103] //#define IDS_ StringTable[] #define SORT_NONE 0 #define SORT_TOPSILHOUETTE 1 #define SORT_TOPSLEEVE 2 #define SORT_TOPCOLLAR 4 #define SORT_TOPWHOLESTYLE 8 #define SORT_BOTTOMSILHOUETTE 16 #define SORT_BOTTOMBELT 32 #define SORT_BOTTOMWHOLESTYLE 64 //--------------------------------------------------------------------------- TDataTransForm *DataTransForm; //--------------------------------------------------------------------------- __fastcall TDataTransForm::TDataTransForm(TComponent* Owner) : TForm(Owner) { StringTable.Create(DirectoryItem, Language, "DataTransForm"); SetSmallFont(Font); Caption = IDS_STYLEPOINTSAVE; GroupBoxInformations->Caption = IDS_INFORMATION; TabFront->Caption = IDS_FRONT; TabBack->Caption = IDS_BACK; BitBtnPattern->Caption = IDS_IMAGESAVE; spdbtnBringToFrontObjects->Hint = IDS_BRINGTHEFRONTOBJECTS; spdbtnBringToBackObjects->Hint = IDS_BRINGTHEBACKOBJECTS; spdbtnLeft->Hint = IDS_MOVETHEOBJECTTOLEFT; spdbtnPositionReset->Hint = IDS_MOVETHEOBJECTTOINITPOSITION; spdbtnRight->Hint = IDS_MOVETHEOBJECTTORIGHT; sbButtonInitialize->Caption = IDS_INITIALIZATION; sbSave->Hint = IDS_STYFILESAVE; sbStyLoad->Hint = IDS_STYFILELOAD; sbChangeImageFromCanvas->Hint = IDS_BRINGTHEIMAGEINTHECANVAS; sbChangeImage->Hint = IDS_BRINGTHEIMAGEINTHEFILE; lbComment->Caption = IDS_COMMENT + " : "; // 2004.08.17 Ãß°¡ - by monkman lbMainItem->Caption = IDS_MAINITEMS; combobxDivision->AddItem(IDS_MAN, NULL); combobxDivision->AddItem(IDS_WOMAN, NULL); combobxDivision->AddItem(IDS_CHILD, NULL); combobxDivision->AddItem(IDS_BABY, NULL); lbUpperLower->Caption = IDS_CLOTHES; combobxUpperLower->AddItem(IDS_TOPCLOTHES, NULL); combobxUpperLower->AddItem(IDS_BOTTOMCLOTHES, NULL); lbItems->Caption = IDS_ITEMS; sbChangeBaseDirectory->Hint = IDS_SETBASEFOLDER; lbSource->Caption = IDS_ORIGINAL + " : "; spdbtnNewClothes->Hint = IDS_NEWCLOTHES; // »óÀÇ rbTopWhole->Caption = IDS_TOPWHOLE; rbTopSilhouette->Caption = IDS_TOPSILHOUETTE; rbTopSleeve->Caption = IDS_TOPSLEEVE; rbTopCollar->Caption = IDS_TOPCOLLAR; rbTopMaterial->Caption = IDS_DETAIL; lbTopWholeType->Caption = IDS_TOPTYPE; lbTopWholeSilhouette->Caption = IDS_TOPSILHOUETTETYPE; lbTopWholeSleeve->Caption = IDS_SLEEVETYPE; lbTopWholeCollar->Caption = IDS_COLLARTYPE; lbTopSilhouetteType->Caption = IDS_TOPSILHOUETTETYPE; lbTopSilhouetteSilhouette->Caption = IDS_TOPSILHOUETTETYPE; cbSleeve->Caption = IDS_COMBINATIONSLEEVE; cbCollar->Caption = IDS_COMBINATIONCOLLAR; lbTopSleeveSleeve->Caption = IDS_SLEEVETYPE; lbTopCollarCollar->Caption = IDS_COLLARTYPE; rbBottomWhole->Caption = IDS_BOTTOMWHOLE; rbBottomSilhouette->Caption = IDS_BOTTOMSILHOUETTE; rbBottomBelt->Caption = IDS_BOTTOMBENDBELT; rbBottomMaterial->Caption = IDS_DETAIL; lbBottomWholeSilhouette->Caption = IDS_BOTTOMSILHOUETTETYPE; lbBottomWholeBelt->Caption = IDS_BENDBELTTYPE; lbBottomSilhouetteSilhouette->Caption = IDS_BOTTOMSILHOUETTETYPE; cbBelt->Caption = IDS_COMBINATIONBELT; lbBottomBeltBelt->Caption = IDS_BENDBELTTYPE; clbSSFW->Items->Strings[0] = IDS_SPRING; clbSSFW->Items->Strings[1] = IDS_SUMMER; clbSSFW->Items->Strings[2] = IDS_FALL; clbSSFW->Items->Strings[3] = IDS_WINTER; LabelPatDivision->Caption = IDS_MAINTYPE; LabelPatUpType->Caption = IDS_TOPTYPE; LabelPatDnType->Caption = IDS_BOTTOMTYPE; LabelPatUpWhole->Caption = IDS_TOPWHOLE; LabelPatUpSilType->Caption = IDS_TOPSILHOUETTE; LabelPatUpSil->Caption = IDS_TOPSILHOUETTETYPE; LabelPatUpSle->Caption = IDS_SLEEVETYPE; LabelPatUpCol->Caption = IDS_COLLARTYPE; LabelPatDnWhole->Caption = IDS_BOTTOMWHOLE; LabelPatDnSil->Caption = IDS_BOTTOMSILHOUETTETYPE; LabelPatDnBelt->Caption = IDS_BENDBELTTYPE; clbIllustSSFW->Items->Strings[0]= IDS_SPRING; clbIllustSSFW->Items->Strings[1]= IDS_SUMMER; clbIllustSSFW->Items->Strings[2]= IDS_FALL; clbIllustSSFW->Items->Strings[3]= IDS_WINTER; lbMaterial->Caption = IDS_SUBMATERIAL; //lbSelectedFolderName->Caption = IDS_SELECTEDFOLDER; spdbtnCreateFolder->Hint = IDS_NEWFOLDER; //spdbtnRenameFolder->Hint = IDS_RENAMEFOLDER; //spdbtnDeleteFolder->Hint = IDS_DELETEFOLDER; spdbtnSizeInformation->Caption = IDS_SIZEINFORMATION; grpbxSizeInformation->Caption = IDS_SIZE55BASE; rzlbUpper->Caption = IDS_UPPER; rzstrgrdUpperSizeInformation->Cells[0][0] = IDS_TOTALLENGTH; rzstrgrdUpperSizeInformation->Cells[0][1] = IDS_CHEST; rzstrgrdUpperSizeInformation->Cells[0][2] = IDS_WAIST; rzstrgrdUpperSizeInformation->Cells[0][3] = IDS_HEM; rzstrgrdUpperSizeInformation->Cells[0][4] = IDS_SHOULDER; rzstrgrdUpperSizeInformation->Cells[0][5] = IDS_SLEEVELENGTH; rzstrgrdUpperSizeInformation->Cells[0][6] = IDS_SLEEVEWIDTH; rzstrgrdUpperSizeInformation->Cells[0][7] = IDS_SLEEVEENDWIDTH; rzstrgrdUpperSizeInformation->Cells[0][8] = IDS_BLANK; rzlbLower->Caption = IDS_BOTTOMS; rzstrgrdLowerSizeInformation->Cells[0][0] = IDS_BOTTOMSLENGTH; rzstrgrdLowerSizeInformation->Cells[0][1] = IDS_BOTTOMSWAIST; rzstrgrdLowerSizeInformation->Cells[0][2] = IDS_HIP; rzstrgrdLowerSizeInformation->Cells[0][3] = IDS_THIGH; rzstrgrdLowerSizeInformation->Cells[0][4] = IDS_KNEE; rzstrgrdLowerSizeInformation->Cells[0][5] = IDS_BOTTOMSHEM; rzstrgrdLowerSizeInformation->Cells[0][6] = IDS_FRONTSIDECHAIRSET; rzstrgrdLowerSizeInformation->Cells[0][7] = IDS_BACKSIDECHAIRSET; rzstrgrdLowerSizeInformation->Cells[0][8] = IDS_BELT; spdbtnSizeInformationSave->Hint = IDS_SIZEINFORMATIONSAVE; spdbtnSizeInformationLoad->Hint = IDS_SIZEINFORMATIONLOAD; PatUpWhole = NULL; PatUpSil = NULL; PatUpSle = NULL; PatUpCol = NULL; PatDnWhole = NULL; PatDnSil = NULL; PatDnBelt = NULL; IllustBitmap = NULL; // Çì´õµéÀÇ ÃʱâÈ­ - by monkman (2004.04.03) VecDraw->InitSTYHeader(&HDPatUpWhole); VecDraw->InitSTYHeader(&HDPatUpSil); VecDraw->InitSTYHeader(&HDPatUpSle); VecDraw->InitSTYHeader(&HDPatUpCol); VecDraw->InitSTYHeader(&HDPatDnWhole); VecDraw->InitSTYHeader(&HDPatDnSil); VecDraw->InitSTYHeader(&HDPatDnBelt); // °¢°¢ ÀúÀåµÇ°Å³ª ºÒ·Á¿ÍÁø STY ÆÄÀϸí - by monkman (2010.09.08) strTopWholeFileName = strTopSilhouetteFileName = strTopSleeveFileName = strTopCollarFileName = ""; strBottomWholeFileName = strBottomSilhouetteFileName = strBottomBendBeltFileName = ""; // ÀÛ¾÷Áö½Ã¼­¿¡¼­ »ç¿ëÇÏ´Â ºÎºÐ ÃʱâÈ­ - by monkman (2011.01.17) DSUpperSilhouette.Clear(); DSUpperSleeve.Clear(); DSUpperCollar.Clear(); DSUpperMaterial.Clear(); DSLowerPants.Clear(); DSLowerBelt.Clear(); DSLowerMaterial.Clear(); // ´õºí¹öÆÛ¸µÀ» ÇØÁÖ¾î¾ß À§¿¡ ¿Ã¶ó°¡ÀÖ´Â PaintBox°¡ ±ôºý°Å¸®Áö ¾Ê´Â´Ù - by monkman (2011.02.21) // http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_qna&no=59538 Panel1->DoubleBuffered = true; Panel2->DoubleBuffered = true; combobxDivision->ItemIndex = 0; combobxUpperLower->ItemIndex = 0; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::InitForm() { String DirectoryGI = DirectoryBin + "\\GuideImage"; Visible = true; // ¸¶¿ì½º ÃʱâÈ­ - by monkman (2004.03.29) isMouseDown = false; // sty OpenDialog ÃʱâÈ­ - by monkman (2004.04.23) OpenDialogStyLoad->FileName = ""; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÃʱâÈ­ - by monkman PatternPanel->Visible = false; StylePanel->Left = 10; Width = StylePanel->Width + 16; //DataTransForm->Left += (PatternPanel->Left + PatternPanel->Width); Left = (Screen->Width - Width); Top = 0; sbClickedButton = NULL; pnCurrentPanel = NULL; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÃʱâÈ­ - by monkman // Disivion LabelPatDivision->Font->Color = clSilver; LabelIllustDivision->Caption = ""; // Top Type LabelPatUpType->Font->Color = clSilver; LabelIllustUpType->Caption = ""; // Down Type LabelPatDnType->Font->Color = clSilver; LabelIllustDnType->Caption = ""; // Top Whole Style LabelPatUpWhole->Font->Color = clSilver; LabelIllustUpWhole->Caption = ""; // Top Silhouette Type LabelPatUpSilType->Font->Color = clSilver; LabelIllustUpSilType->Caption = ""; // Top Silhouette LabelPatUpSil->Font->Color = clSilver; LabelIllustUpSil->Caption = ""; // Top Sleeve LabelPatUpSle->Font->Color = clSilver; LabelIllustUpSle->Caption = ""; // Top Collar LabelPatUpCol->Font->Color = clSilver; LabelIllustUpCol->Caption = ""; // Bottom Whole Style LabelPatDnWhole->Font->Color = clSilver; LabelIllustDnWhole->Caption = ""; // Bottom Silhouette LabelPatDnSil->Font->Color = clSilver; LabelIllustDnSil->Caption = ""; // Bottom Belt LabelPatDnBelt->Font->Color = clSilver; LabelIllustDnBelt->Caption = ""; // ¾È³» À̹ÌÁö if (imgTopWholeFront->Picture->Bitmap->Empty) imgTopWholeFront->Picture->LoadFromFile(DirectoryGI + "\\TopWholeFront.bmp"); if (imgTopSilhouetteFront->Picture->Bitmap->Empty) imgTopSilhouetteFront->Picture->LoadFromFile(DirectoryGI + "\\TopSilhouetteFront.bmp"); if (imgTopSleeveFront->Picture->Bitmap->Empty) imgTopSleeveFront->Picture->LoadFromFile(DirectoryGI + "\\TopSleeveFront.bmp"); if (imgTopCollarFront->Picture->Bitmap->Empty) imgTopCollarFront->Picture->LoadFromFile(DirectoryGI + "\\TopCollarFront.bmp"); if (imgTopWholeBack->Picture->Bitmap->Empty) imgTopWholeBack->Picture->LoadFromFile(DirectoryGI + "\\TopWholeBack.bmp"); if (imgTopSilhouetteBack->Picture->Bitmap->Empty) imgTopSilhouetteBack->Picture->LoadFromFile(DirectoryGI + "\\TopSilhouetteBack.bmp"); if (imgTopSleeveBack->Picture->Bitmap->Empty) imgTopSleeveBack->Picture->LoadFromFile(DirectoryGI + "\\TopSleeveBack.bmp"); if (imgTopCollarBack->Picture->Bitmap->Empty) imgTopCollarBack->Picture->LoadFromFile(DirectoryGI + "\\TopCollarBack.bmp"); if (imgTopWholeRaglanFront->Picture->Bitmap->Empty) imgTopWholeRaglanFront->Picture->LoadFromFile(DirectoryGI + "\\TopWholeRaglanFront.bmp"); if (imgTopSilhouetteRaglanFront->Picture->Bitmap->Empty) imgTopSilhouetteRaglanFront->Picture->LoadFromFile(DirectoryGI + "\\TopSilhouetteRaglanFront.bmp"); if (imgTopSleeveRaglanFront->Picture->Bitmap->Empty) imgTopSleeveRaglanFront->Picture->LoadFromFile(DirectoryGI + "\\TopSleeveRaglanFront.bmp"); if (imgTopCollarRaglanFront->Picture->Bitmap->Empty) imgTopCollarRaglanFront->Picture->LoadFromFile(DirectoryGI + "\\TopCollarRaglanFront.bmp"); if (imgTopWholeRaglanBack->Picture->Bitmap->Empty) imgTopWholeRaglanBack->Picture->LoadFromFile(DirectoryGI + "\\TopWholeRaglanBack.bmp"); if (imgTopSilhouetteRaglanBack->Picture->Bitmap->Empty) imgTopSilhouetteRaglanBack->Picture->LoadFromFile(DirectoryGI + "\\TopSilhouetteRaglanBack.bmp"); if (imgTopSleeveRaglanBack->Picture->Bitmap->Empty) imgTopSleeveRaglanBack->Picture->LoadFromFile(DirectoryGI + "\\TopSleeveRaglanBack.bmp"); if (imgTopCollarRaglanBack->Picture->Bitmap->Empty) imgTopCollarRaglanBack->Picture->LoadFromFile(DirectoryGI + "\\TopCollarRaglanBack.bmp"); if (imgBottomWholeFront->Picture->Bitmap->Empty) imgBottomWholeFront->Picture->LoadFromFile(DirectoryGI + "\\BottomWholePantsFront.bmp"); if (imgBottomSilhouetteFront->Picture->Bitmap->Empty) imgBottomSilhouetteFront->Picture->LoadFromFile(DirectoryGI + "\\BottomSilhouettePantsFront.bmp"); if (imgBottomBeltFront->Picture->Bitmap->Empty) imgBottomBeltFront->Picture->LoadFromFile(DirectoryGI + "\\BottomBeltPantsFront.bmp"); if (imgBottomWholeBack->Picture->Bitmap->Empty) imgBottomWholeBack->Picture->LoadFromFile(DirectoryGI + "\\BottomWholePantsBack.bmp"); if (imgBottomSilhouetteBack->Picture->Bitmap->Empty) imgBottomSilhouetteBack->Picture->LoadFromFile(DirectoryGI + "\\BottomSilhouettePantsBack.bmp"); if (imgBottomBeltBack->Picture->Bitmap->Empty) imgBottomBeltBack->Picture->LoadFromFile(DirectoryGI + "\\BottomBeltPantsBack.bmp"); if (imgBottomWholeSkirtFront->Picture->Bitmap->Empty) imgBottomWholeSkirtFront->Picture->LoadFromFile(DirectoryGI + "\\BottomWholeSkirtFront.bmp"); if (imgBottomSilhouetteSkirtFront->Picture->Bitmap->Empty) imgBottomSilhouetteSkirtFront->Picture->LoadFromFile(DirectoryGI + "\\BottomSilhouetteSkirtFront.bmp"); if (imgBottomBeltSkirtFront->Picture->Bitmap->Empty) imgBottomBeltSkirtFront->Picture->LoadFromFile(DirectoryGI + "\\BottomBeltSkirtFront.bmp"); if (imgBottomWholeSkirtBack->Picture->Bitmap->Empty) imgBottomWholeSkirtBack->Picture->LoadFromFile(DirectoryGI + "\\BottomWholeSkirtBack.bmp"); if (imgBottomSilhouetteSkirtBack->Picture->Bitmap->Empty) imgBottomSilhouetteSkirtBack->Picture->LoadFromFile(DirectoryGI + "\\BottomSilhouetteSkirtBack.bmp"); if (imgBottomBeltSkirtBack->Picture->Bitmap->Empty) imgBottomBeltSkirtBack->Picture->LoadFromFile(DirectoryGI + "\\BottomBeltSkirtBack.bmp"); dFrontZoomRatio = 1.0; dBackZoomRatio = 1.0; FrontMoveX = 0; FrontMoveY = 0; BackMoveX = 0; BackMoveY = 0; IllustBitmap = NULL; ObjectCount1 = VecDraw->GetTransCount(false); ObjectCount2 = VecDraw->GetTransCount(true); // ±âº» Æû ¼ÂÆÃ - by monkman (2004.04.06) pnTopWhole->Visible = false; pnTopWholeFront->Visible = false; pnTopWholeBack->Visible = false; pnTopWholeRaglanFront->Visible = false; pnTopWholeRaglanBack->Visible = false; pnTopSilhouette->Visible = false; pnTopSilhouetteFront->Visible = false; pnTopSilhouetteBack->Visible = false; pnTopSilhouetteRaglanFront->Visible= false; pnTopSilhouetteRaglanBack->Visible = false; pnTopSleeve->Visible = false; pnTopSleeveFront->Visible = false; pnTopSleeveBack->Visible = false; pnTopSleeveRaglanFront->Visible = false; pnTopSleeveRaglanBack->Visible = false; pnTopCollar->Visible = false; pnTopCollarFront->Visible = false; pnTopCollarBack->Visible = false; pnTopCollarRaglanFront->Visible = false; pnTopCollarRaglanBack->Visible = false; pnBottomWhole->Visible = false; pnBottomWholeFront->Visible = false; pnBottomWholeBack->Visible = false; pnBottomWholeSkirtFront->Visible = false; pnBottomWholeSkirtBack->Visible = false; pnBottomSilhouette->Visible = false; pnBottomSilhouetteFront->Visible = false; pnBottomSilhouetteBack->Visible = false; pnBottomSilhouetteSkirtFront->Visible = false; pnBottomSilhouetteSkirtBack->Visible = false; pnBottomBelt->Visible = false; pnBottomBeltFront->Visible = false; pnBottomBeltBack->Visible = false; pnBottomBeltSkirtFront->Visible = false; pnBottomBeltSkirtBack->Visible = false; pnMaterial->Visible = false; pnTopStyle->BringToFront(); pnTopWhole->BringToFront(); pnTopWholeFront->BringToFront(); pnCurrentPanel = pnTopWholeFront; pnTopStyle->Visible = true; pnTopWhole->Visible = true; pnTopWholeFront->Visible = true; shTopWholeFrontStyle->Pen->Color = clRed; shTopSilhouetteFrontStyle->Pen->Color = clRed; shTopSleeveFrontStyle->Pen->Color = clRed; shTopCollarFrontStyle->Pen->Color = clRed; shBottomWholeFrontStyle->Pen->Color = clRed; shBottomSilhouetteFrontStyle->Pen->Color = clRed; shBottomBeltFrontStyle->Pen->Color = clRed; // À̹ÌÁö·Î º¯ÇÑ ¹öưµé¿¡ °üÇÑ ¼ÂÆÃ - by monkman (2004.04.06) InitStylePanel(pnTopWholeFront, false); // Æû ÃʱâÈ­ - by monkman (2004.04.08) DSClothes = CombiForm->DSUpper; pnTopStyle->BringToFront(); pnTopStyle->Visible = true; DSItems = VecDraw->Man_Upper; Division = DV_MAN; combobxItems->Clear(); memset(temptype, 0, sizeof(EType)*10); bool bFirst = true; for (int i = TP_NONE; i < TP_LAST; i++) { if (DSItems.Contains(i) && DSClothes.Contains(i)) { if (bFirst) { Type = EType(i); bFirst = false; } combobxItems->Items->AddObject(CombiForm->StrType[i], (TObject *)i); } } // ListBox1ÀÇ Ã¹¹øÂ° ¼±Åà - by monkman (2004.09.03) PreListBox_ItemIndex = -1; if (combobxItems->Items->Count >= 0) { combobxItems->ItemIndex = 0; combobxItemsChange(this); } // Style.ini ÆÄÀÏ¿¡¼­ ¾ò¾î¿Â STYPath °ª - by monkman (2004.08.04) strRootPath = ""; TIniFile *IniFile = NULL; IniFile = new TIniFile(AppDataItem+"\\Style.ini"); if (IniFile) { strRootPath = IniFile->ReadString("DataTransForm", "RootPath", DirectoryBin); strSTYDirectory = IniFile->ReadString("DataTransForm", "Directory", strSTYDirectory); strMaterialRootPath = IniFile->ReadString("DataTransForm_Material", "RootPath", strMaterialRootPath); if (!DirectoryExists(strRootPath+"\\"+strSTYDirectory)) { if (!DirectoryExists(strRootPath)) { strRootPath = DirectoryBin; IniFile->WriteString("DataTransForm", "RootPath", strRootPath); } strSTYDirectory = ""; IniFile->WriteString("DataTransForm", "Directory", strSTYDirectory); } if (!DirectoryExists(strMaterialRootPath)) { if (DirectoryExists(DirectoryBin+"\\Material")) strMaterialRootPath = DirectoryBin + "\\Material"; else strMaterialRootPath = DirectoryBin; IniFile->WriteString("DataTransForm_Material", "RootPath", strMaterialRootPath); } delete IniFile; } IniFile = NULL; // µð·ºÅ丮 °ü·Ã - by monkman (2004.08.04) DirectoryStyle = strRootPath + "\\Style"; // µð·ºÅ丮 °ü·Ã - by monkman (2004.05.12) FindFolder(strRootPath + "\\*.*"); //comboSource->ItemIndex = 0; // Style.ini ÆÄÀÏ¿¡¼­ ¾ò¾î¿Â STYPath °ª - by monkman (2004.10.12) comboSource->ItemIndex = comboSource->Items->IndexOf(strSTYDirectory); if (comboSource->ItemIndex < 0) { comboSource->ItemIndex = 0; STYDetailSelectedSave(comboSource->Items->Strings[0]); } DirectoryStyle = strRootPath + "\\" + comboSource->Items->Strings[comboSource->ItemIndex]; strPreLoadPath = ""; // ÀÛ¾÷Áö½Ã¼­¿¡¼­ »ç¿ëÇÏ´Â ºÎºÐ ÃʱâÈ­ - by monkman (2011.01.17) DSUpperSilhouette.Clear(); DSUpperSleeve.Clear(); DSUpperCollar.Clear(); DSUpperMaterial.Clear(); DSLowerPants.Clear(); DSLowerBelt.Clear(); DSLowerMaterial.Clear(); #ifdef WORKSHEET lbStyleID->Visible = true; edStyleID->Visible = true; #endif } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::ExitForm() { sbClickedButton = NULL; pnCurrentPanel = NULL; // ¾È³» À̹ÌÁö imgTopWholeFront->Picture->Bitmap->Free(); imgTopSilhouetteFront->Picture->Bitmap->Free(); imgTopSleeveFront->Picture->Bitmap->Free(); imgTopCollarFront->Picture->Bitmap->Free(); imgTopWholeBack->Picture->Bitmap->Free(); imgTopSilhouetteBack->Picture->Bitmap->Free(); imgTopSleeveBack->Picture->Bitmap->Free(); imgTopCollarBack->Picture->Bitmap->Free(); imgTopWholeRaglanFront->Picture->Bitmap->Free(); imgTopSilhouetteRaglanFront->Picture->Bitmap->Free(); imgTopSleeveRaglanFront->Picture->Bitmap->Free(); imgTopCollarRaglanFront->Picture->Bitmap->Free(); imgTopWholeRaglanBack->Picture->Bitmap->Free(); imgTopSilhouetteRaglanBack->Picture->Bitmap->Free(); imgTopSleeveRaglanBack->Picture->Bitmap->Free(); imgTopCollarRaglanBack->Picture->Bitmap->Free(); imgBottomWholeFront->Picture->Bitmap->Free(); imgBottomSilhouetteFront->Picture->Bitmap->Free(); imgBottomBeltFront->Picture->Bitmap->Free(); imgBottomWholeBack->Picture->Bitmap->Free(); imgBottomSilhouetteBack->Picture->Bitmap->Free(); imgBottomBeltBack->Picture->Bitmap->Free(); imgBottomWholeSkirtFront->Picture->Bitmap->Free(); imgBottomSilhouetteSkirtFront->Picture->Bitmap->Free(); imgBottomBeltSkirtFront->Picture->Bitmap->Free(); imgBottomWholeSkirtBack->Picture->Bitmap->Free(); imgBottomSilhouetteSkirtBack->Picture->Bitmap->Free(); imgBottomBeltSkirtBack->Picture->Bitmap->Free(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::FormCreate(TObject *Sender) { // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - TList·Î »ý¼º.. - by monkman PatUpWhole = new TList; PatUpSil = new TList; PatUpSle = new TList; PatUpCol = new TList; PatDnWhole = new TList; PatDnSil = new TList; PatDnBelt = new TList; // *.sti ÆÄÀÏÀÇ Çì´õ¸¦ ÃʱâÈ­ ÇÑ´Ù - by monkman (2004.04.02) VecDraw->InitSTIHeader(&IllustHeader); // »çÀÌÁî Á¤º¸ ´ÙÀ̾ó·Î±× ±âº» °æ·Î ¼³Á¤ - by monkman (2011.01.18) savedlgSizeInformation->InitialDir = DirectoryBin; opendlgSizeInformationLoad->InitialDir = DirectoryBin; ComboYear->ItemIndex = ComboYear->Items->IndexOf(TDateTime::CurrentDate().FormatString("YYYY")); #ifdef WORKSHEET cbYW->Visible = false; cbYW->Checked = true; rbTopMaterial->Visible = true; rbBottomMaterial->Visible = true; spdbtnSizeInformation->Visible = true; #endif } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::FormDestroy(TObject *Sender) { // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - TList¿¡ ´ã°ÜÀÖ´Â µ¥ÀÌÅ͸¦ Áö¿ò - by monkman TVecData *data; if (PatUpWhole) { VecDraw->ClearDataList(PatUpWhole); delete PatUpWhole; PatUpWhole = NULL; } if (PatUpSil) { VecDraw->ClearDataList(PatUpSil); delete PatUpSil; PatUpSil = NULL; } if (PatUpSle) { VecDraw->ClearDataList(PatUpSle); delete PatUpSle; PatUpSle = NULL; } if (PatUpCol) { VecDraw->ClearDataList(PatUpCol); delete PatUpCol; PatUpCol = NULL; } if (PatDnWhole) { VecDraw->ClearDataList(PatDnWhole); delete PatDnWhole; PatDnWhole = NULL; } if (PatDnSil) { VecDraw->ClearDataList(PatDnSil); delete PatDnSil; PatDnSil = NULL; } if (PatDnBelt) { VecDraw->ClearDataList(PatDnBelt); delete PatDnBelt; PatDnBelt = NULL; } // ´Ù¸¥ °÷¿¡ Æ÷Ä¿½º¸¦ Áà¾ßÇÑ´Ù // g_FocusControl->SetFocus(); if (IllustBitmap) { delete IllustBitmap; IllustBitmap = NULL; } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::FormClose(TObject *Sender, TCloseAction &Action) { // ´Ù¸¥ °÷¿¡ Æ÷Ä¿½º¸¦ Áà¾ßÇÑ´Ù // g_FocusControl->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnBringToFrontObjectsClick(TObject *Sender) { RECT rtVector; int nWidth = 0, nHeight = 0; double dRatio = 0.0, dRatioW = 0.0, dRatioH = 0.0; dFrontZoomRatio = 1.0; FrontMoveX = 0; FrontMoveY = 0; ObjectCount1 = VecDraw->InitTrans(); InitStylePanel(pnCurrentPanel, false); memset(TempNumber1, 0, sizeof(int)*80); // º¤ÅÍÀÇ ¿µ¿ªÀ» ±¸ÇÏ¿© ºñÀ²À» Á¤ÇÑ´Ù - by monkman (2011.04.12) rtVector = VecDraw->GetUnionVectorRect(VecDraw->TransList1, MainImageForm->Number, false); nWidth = rtVector.right - rtVector.left; nHeight = rtVector.bottom - rtVector.top; // »óÇÏÁ¿ì 6px´Â margin if (0 < nWidth) dRatioW = (double)(PaintBox1->Width-12) / nWidth; if (0 < nHeight) dRatioH = (double)(PaintBox1->Height-12) / nHeight; dRatio = dRatioW < dRatioH ? dRatioW : dRatioH; dFrontZoomRatio = dRatio < 1.0 ? dRatio : 1.0; // sty ÆÄÀÏÀÌ OverWrite µÇÁö ¾Êµµ·Ï ÃʱâÈ­ ÇØÁØ´Ù - by monkman OpenDialogStyLoad->FileName = ""; PaintBox1->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnBringToBackObjectsClick(TObject *Sender) { RECT rtVector; int nWidth = 0, nHeight = 0; double dRatio = 0.0, dRatioW = 0.0, dRatioH = 0.0; dBackZoomRatio = 1.0; BackMoveX = 0; BackMoveY = 0; ObjectCount2 = VecDraw->InitTrans(true); InitStylePanel(pnCurrentPanel, false); memset(TempNumber2, 0, sizeof(int)*80); // º¤ÅÍÀÇ ¿µ¿ªÀ» ±¸ÇÏ¿© ºñÀ²À» Á¤ÇÑ´Ù - by monkman (2011.04.12) rtVector = VecDraw->GetUnionVectorRect(VecDraw->TransList2, MainImageForm->Number, false); nWidth = rtVector.right - rtVector.left; nHeight = rtVector.bottom - rtVector.top; // »óÇÏÁ¿ì 6px´Â margin if (0 < nWidth) dRatioW = (double)(PaintBox2->Width-12) / nWidth; if (0 < nHeight) dRatioH = (double)(PaintBox2->Height-12) / nHeight; dRatio = dRatioW < dRatioH ? dRatioW : dRatioH; dBackZoomRatio = dRatio < 1.0 ? dRatio : 1.0; // sty ÆÄÀÏÀÌ OverWrite µÇÁö ¾Êµµ·Ï ÃʱâÈ­ ÇØÁØ´Ù - by monkman OpenDialogStyLoad->FileName = ""; PaintBox2->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::PaintBox1Paint(TObject *Sender) { TPaintBox *paintbox = (TPaintBox *)Sender; if (paintbox->Tag == 0) { // Front VecDraw->TransFormDraw(paintbox->Canvas->Handle, FrontMoveX, FrontMoveY, paintbox->Tag, dFrontZoomRatio); } else { // Back VecDraw->TransFormDraw(paintbox->Canvas->Handle, BackMoveX, BackMoveY, paintbox->Tag, dBackZoomRatio); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::PaintBox1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TPaintBox *paintbox = (TPaintBox *)Sender; // Component À̸§À» ã±â À§Çؼ­.. - by monkman (2004.04.07) String CompName; TShape *sh; btnPaintBoxFocus->SetFocus(); // ĵ¹ö½º¸¦ µå·¡±×ÇØ¼­ À̵¿ ½Ã۱â À§ÇÑ ¸¶¿ì½º ÁÂÇ¥ ÀÔ·Â - by monkman (2004.03.26) // CtrlŰ¿Í ÇÔ²² ´­·¶À» ¶§¸¸ if (Shift.Contains(ssCtrl) && Button == mbLeft) { BeforeMousePosition.x = X; BeforeMousePosition.y = Y; isMouseDown = true; //paintbox->Cursor = crSizeAll; } else { // CtrlŰ¿Í °°ÀÌ ´©¸£Áö ¾Ê¾ÒÀ¸¸é À½¼ö¸¦ ÀÔ·ÂÇÏ¿© °ËÃâµÇÁö ¾Êµµ·Ï ÇÔ BeforeMousePosition.x = -1; BeforeMousePosition.y = -1; isMouseDown = false; } if (!sbClickedButton) return; CompName = sbClickedButton->Name; CompName = "sh" + CompName.SubString(3, CompName.Length()); sh = (TShape *)FindComponent(CompName); sbClickedButton->Down = false; if (sh->Pen->Color != 0x00FEE004) return; //if (sbClickedButton) if (!sbClickedButton->Down) return; if (paintbox->Cursor == crDrag && ButtonDown) { if (!paintbox->Tag) { // ¾ÕÆÇ int result = VecDraw->OnMouseTransSelect(X, Y, ObjectTrait, false, FrontMoveX, FrontMoveY, dFrontZoomRatio); if (result == -1) { //sbClickedButton->Down = false; }else { TempNumber1[int(ObjectTrait)] = result; //sbClickedButton->Down = false; sh->Pen->Color = 0x004B04FE; sh->Repaint(); //sbClickedButton->Enabled = false; AutoDown(pnCurrentPanel, sbClickedButton); } }else { // µÞÆÇ int result = VecDraw->OnMouseTransSelect(X, Y, ObjectTrait, true, BackMoveX, BackMoveY, dBackZoomRatio); if (result == -1) { //sbClickedButton->Down = false; }else { TempNumber2[int(ObjectTrait)] = result; //sbClickedButton->Enabled = false; //sbClickedButton->Down = false; sh->Pen->Color = 0x004B04FE; sh->Repaint(); AutoDown(pnCurrentPanel, sbClickedButton); } } } else { if (paintbox->Tag == 0) { // ¾ÕÆÇ VecDraw->OnMouseTransDown(Shift, X, Y, paintbox->Tag, FrontMoveX, FrontMoveY, dFrontZoomRatio); } else { VecDraw->OnMouseTransDown(Shift, X, Y, paintbox->Tag, BackMoveX, BackMoveY, dBackZoomRatio); } } paintbox->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::PaintBox1MouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TPaintBox *paintbox = (TPaintBox *)Sender; isMouseDown = false; paintbox->Cursor = crDefault; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::PaintBox1MouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { TPaintBox *paintbox = (TPaintBox *)Sender; // ĵ¹ö½º¸¦ µå·¡±×ÇØ¼­ À̵¿ ½Ã۱â À§ÇÑ ¸¶¿ì½º ÁÂÇ¥ ÀÔ·Â - by monkman (2004.03.26) // CtrlŰ¿Í ÇÔ²² ´­·¶À» ¶§¸¸ if (isMouseDown && Shift.Contains(ssCtrl) && BeforeMousePosition.x >= 0 && BeforeMousePosition.y >= 0) { // X ÁÂÇ¥ if (paintbox->Tag == 0) { // ¾ÕÆÇ FrontMoveX -= (X - BeforeMousePosition.x); if (FrontMoveX <= 0) FrontMoveX = 0; if (FrontMoveX >= (PaintBox1->Width*dFrontZoomRatio)) FrontMoveX = (PaintBox1->Width*dFrontZoomRatio); } else { // µÞÆÇ BackMoveX -= (X - BeforeMousePosition.x); if (BackMoveX <= 0) BackMoveX = 0; if (BackMoveX >= (PaintBox2->Width*dBackZoomRatio)) BackMoveX = (PaintBox2->Width*dBackZoomRatio); } // Y ÁÂÇ¥ if (paintbox->Tag == 0) { // ¾ÕÆÇ FrontMoveY -= (Y - BeforeMousePosition.y); if (FrontMoveY <= 0) FrontMoveY = 0; if (FrontMoveY >= (PaintBox1->Height*dFrontZoomRatio)) FrontMoveY = (PaintBox1->Height*dFrontZoomRatio); } else { // µÞÆÇ BackMoveY -= (Y - BeforeMousePosition.y); if (BackMoveY <= 0) BackMoveY = 0; if (BackMoveY >= (PaintBox2->Height*dBackZoomRatio)) BackMoveY = (PaintBox2->Height*dBackZoomRatio); } BeforeMousePosition.x = X; BeforeMousePosition.y = Y; //paintbox->Cursor = crSizeAll; //paintbox->Repaint(); } else { isMouseDown = false; if (paintbox->Tag == 0) { // ¾ÕÆÇ if (VecDraw->OnMouseTransMove(X, Y, paintbox->Tag, FrontMoveX, FrontMoveY, dFrontZoomRatio)) { paintbox->Cursor = crDrag; } else paintbox->Cursor = crDefault; } else { // µÞÆÇ if (VecDraw->OnMouseTransMove(X, Y, paintbox->Tag, BackMoveX, BackMoveY, dBackZoomRatio)) { paintbox->Cursor = crDrag; } else paintbox->Cursor = crDefault; } } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::MainItemChange(TObject *Sender) { // Clothes Ãß°¡ (¾Æ·¡¿Í ¼ø¼­¸¦ ¹Ù²Ù¸é ¾È µÈ´Ù..) - 2004.03.19 by monkman if (combobxUpperLower->ItemIndex == 0) { DSClothes = CombiForm->DSUpper; pnTopStyle->BringToFront(); pnTopStyle->Visible = true; pnBottomStyle->Visible = false; rbTopClick(this); } else if (combobxUpperLower->ItemIndex == 1) { DSClothes = CombiForm->DSLower; pnBottomStyle->BringToFront(); pnBottomStyle->Visible = true; pnTopStyle->Visible = false; rbBottomClick(this); } else return; // Silhouette ComboBox°¡ Man, Woman ½Ã¿¡¸¸ º¸ÀÌ°Ô ÇÑ´Ù (À§¿Í ¼ø¼­¸¦ ¹Ù²Ù¸é ¾È µÈ´Ù..) - by monkman (2004.04.08) if (combobxDivision->ItemIndex == 0) { if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Man_Upper; else if (combobxUpperLower->ItemIndex == 1) DSItems = VecDraw->Man_Lower; Division = DV_MAN; lbTopWholeSilhouette->Visible = true; lbTopSilhouetteSilhouette->Visible = true; ComboTopWholeSilhouette->Visible = true; ComboTopSilhouetteSilhouette->Visible = true; } else if (combobxDivision->ItemIndex == 1) { if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Woman_Upper; else if (combobxUpperLower->ItemIndex == 1) DSItems = VecDraw->Woman_Lower; Division = DV_WOMAN; lbTopWholeSilhouette->Visible = true; lbTopSilhouetteSilhouette->Visible = true; ComboTopWholeSilhouette->Visible = true; ComboTopSilhouetteSilhouette->Visible = true; } else if (combobxDivision->ItemIndex == 2) { if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Child_Upper; else if (combobxUpperLower->ItemIndex == 1) DSItems = VecDraw->Child_Lower; Division = DV_CHILD; lbTopWholeSilhouette->Visible = true; lbTopSilhouetteSilhouette->Visible = true; ComboTopWholeSilhouette->Visible = true; ComboTopSilhouetteSilhouette->Visible = true; } else if (combobxDivision->ItemIndex == 3) { if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Baby_Upper; else if (combobxUpperLower->ItemIndex == 1) DSItems = VecDraw->Baby_Lower; Division = DV_BABY; lbTopWholeSilhouette->Visible = true; lbTopSilhouetteSilhouette->Visible = true; ComboTopWholeSilhouette->Visible = true; ComboTopSilhouetteSilhouette->Visible = true; } else return; combobxItems->Clear(); // ListBox ÃʱâÈ­ PreListBox_ItemIndex = -1; // ÀÌÀü ¼±ÅõǾú´ø Type - by monkman (2004.07.13) // Clothes Ãß°¡·Î ÁÖ¼®Ã³¸® - 2004.03.19 by monkman //for (int i = 1; i < 30; i++) // if (DSItems.Contains(EType(i))) combobxItems->Items->Add(CombiForm->StrType[i]); memset(temptype, 0, sizeof(EType)*10); bool bFirst = true; #ifndef WORKSHEET for (int i = TP_NONE; i < TP_LAST; i++) { if (DSItems.Contains(EType(i)) && DSClothes.Contains(EType(i))) { if (bFirst) { Type = EType(i); bFirst = false; } combobxItems->Items->Add(CombiForm->StrType[i]); } } #else for (int i = TP_NONE; i < TP_LAST; i++) { if (DSItems.Contains(i) && DSClothes.Contains(i)) { if (bFirst) { Type = i; bFirst = false; } combobxItems->Items->Add(CombiForm->StrType[i]); } } #endif // ListBox1ÀÇ Ã¹¹øÂ° ¼±Åà - by monkman (2004.09.03) if (combobxItems->Items->Count >= 0) { combobxItems->ItemIndex = 0; combobxItemsChange(this); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::combobxItemsChange(TObject *Sender) { int i = 0, count = 0; // ÀÌÀü ¼±ÅõǾú´ø Type - by monkman (2004.07.13) if (PreListBox_ItemIndex == combobxItems->ItemIndex) return; while (count != combobxItems->ItemIndex+1) { if (DSItems.Contains(EType(++i)) && DSClothes.Contains(EType(i))) count++; } Type = EType(i); // ¼±ÅÃµÈ ¸®½ºÆ®Ç׸ñ¿¡ µû¸¥ ÄÞº¸¹Ú½º Ç׸ñµé ¼³Á¤ - by monkman (2004.03.24) DSSilhouette.Clear(); DSUpperSilhouette.Clear(); DSUpperSleeve.Clear(); DSUpperCollar.Clear(); DSUpperMaterial.Clear(); DSLowerPants.Clear(); DSLowerBelt.Clear(); DSLowerMaterial.Clear(); // ÀÛ¾÷Áö½Ã¼­¿¡´Â DS_RAGLANÀÌ ¾ø´Ù - by monkman (2011.01.11) #ifndef WORKSHEET switch (Division) { case DV_MAN: switch (Type) { case TP_COAT: DSSilhouette << DE_SINGLEBUTTON << DE_DOUBLEBUTTON << DE_ZIPPER << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_CAPE << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_JACKET: DSSilhouette << DE_SINGLEBUTTON << DE_DOUBLEBUTTON << DE_ZIPPER << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_HOOK << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_JUMPER: DSSilhouette << DE_LONGZIPPER << DE_SHORTZIPPER << DE_BUTTON << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_KNIT: DSSilhouette << DE_ZIPPER << DE_BUTTON << DE_NORMAL << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HOOK << DE_FUR << DE_UNBALANCE << DE_CARDIGAN << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_SHIRTS: DSSilhouette << DE_ZIPPER << DE_LONGPLACKET << DE_SHORTPLACKET << DE_UNBALANCE << DE_PLAIN << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_TOP: DSSilhouette << DE_TUBE << DE_UNBALANCE << DE_CAMISOLE << DE_SLEEVELESS << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_SWIMWEAR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_VEST: DSSilhouette << DE_ZIPPER << DE_BUTTON << DE_KNIT << DE_UNBALANCE << DE_PLAIN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; } break; case DV_WOMAN: switch (Type) { case TP_COAT: DSSilhouette << DE_SINGLEBUTTON << DE_DOUBLEBUTTON << DE_ZIPPER << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_CAPE << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_JACKET: DSSilhouette << DE_SINGLEBUTTON << DE_DOUBLEBUTTON << DE_ZIPPER << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_HOOK << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_JUMPER: DSSilhouette << DE_LONGZIPPER << DE_SHORTZIPPER << DE_BUTTON << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_KNIT: DSSilhouette << DE_ZIPPER << DE_BUTTON << DE_NORMAL << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HOOK << DE_FUR << DE_UNBALANCE << DE_CARDIGAN << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_SHIRTS: DSSilhouette << DE_ZIPPER << DE_LONGPLACKET << DE_SHORTPLACKET << DE_UNBALANCE << DE_PLAIN << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_TOP: DSSilhouette << DE_TUBE << DE_UNBALANCE << DE_CAMISOLE << DE_SLEEVELESS << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_SWIMWEAR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_VEST: DSSilhouette << DE_ZIPPER << DE_BUTTON << DE_KNIT << DE_UNBALANCE << DE_PLAIN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_ONEPIECE: DSSilhouette << DE_HLINE << DE_ALINE << DE_PRINCESSLINE << DE_PLEATS << DE_HIGHWAIST << DE_DROPSHOULDER << DE_FLARE << DE_TIERED << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_BLOUSE: DSSilhouette << DE_BUTTON << DE_UNBALANCE << DE_PLAIN << DE_FULLSTYLE << DE_SLEEVELESS << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; } break; case DV_CHILD: switch (Type) { case TP_COAT: DSSilhouette << DE_SINGLEBUTTON << DE_DOUBLEBUTTON << DE_ZIPPER << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_CAPE << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_JUMPER: // DV_CHILD¿¡ DE_PLAIN Ãß°¡ - by monkman (2004.07.03) DSSilhouette << DE_LONGZIPPER << DE_SHORTZIPPER << DE_BUTTON << DE_UNBALANCE << DE_PLAIN << DE_RAGLAN << DE_DROPSHOULDER << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_KNIT: DSSilhouette << DE_ZIPPER << DE_BUTTON << DE_NORMAL << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HOOK << DE_FUR << DE_UNBALANCE << DE_CARDIGAN << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_SHIRTS: DSSilhouette << DE_ZIPPER << DE_LONGPLACKET << DE_SHORTPLACKET << DE_UNBALANCE << DE_PLAIN << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_VEST: DSSilhouette << DE_ZIPPER << DE_BUTTON << DE_KNIT << DE_UNBALANCE << DE_PLAIN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_ONEPIECE: DSSilhouette << DE_HLINE << DE_ALINE << DE_PRINCESSLINE << DE_PLEATS << DE_HIGHWAIST << DE_DROPSHOULDER << DE_FLARE << DE_TIERED << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_CAPE: DSSilhouette << DE_CAPE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; // DSChild¿¡ TP_JACKET, TP_TOP, TP_KNIT, TP_BLOUSE Ãß°¡ - by monkman (2004.07.03) case TP_JACKET: DSSilhouette << DE_SINGLEBUTTON << DE_DOUBLEBUTTON << DE_ZIPPER << DE_UNBALANCE << DE_RAGLAN << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_HOOK << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_TOP: DSSilhouette << DE_TUBE << DE_UNBALANCE << DE_CAMISOLE << DE_SLEEVELESS << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_SWIMWEAR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_BLOUSE: DSSilhouette << DE_BUTTON << DE_UNBALANCE << DE_PLAIN << DE_FULLSTYLE << DE_SLEEVELESS << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; } break; case DV_BABY: switch (Type) { case TP_SHIRTS: DSSilhouette << DE_ZIPPER << DE_LONGPLACKET << DE_SHORTPLACKET << DE_UNBALANCE << DE_PLAIN << DE_RAGLAN << DE_HALFSHIRTS << DE_DROPSHOULDER << DE_HIDDENBUTTON << DE_FUR << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_ONEPIECE: DSSilhouette << DE_HLINE << DE_ALINE << DE_PRINCESSLINE << DE_PLEATS << DE_HIGHWAIST << DE_DROPSHOULDER << DE_FLARE << DE_TIERED << DE_INCOLLAR << DE_INSLEEVE << DE_INCOLSLE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_CAPE: DSSilhouette << DE_CAPE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; case TP_ROMPERS: DSSilhouette << DE_BODYSUIT << DE_ALLINONE << DE_USER01 << DE_USER02 << DE_USER03 << DE_USER04 << DE_USER05 << DE_USER06 << DE_USER07 << DE_USER08 << DE_USER09 << DE_USER10; break; } break; } #else switch (Division) { case DV_MAN: switch (Type) { case TP_COAT: DSUpperSilhouette = VecDraw->Man_Coat_Sil; DSUpperSleeve = VecDraw->Man_Coat_Sle; DSUpperCollar = VecDraw->Man_Coat_Col; DSUpperMaterial = VecDraw->Man_Coat_Mat; break; case TP_JACKET: DSUpperSilhouette = VecDraw->Man_Jacket_Sil; DSUpperSleeve = VecDraw->Man_Jacket_Sle; DSUpperCollar = VecDraw->Man_Jacket_Col; DSUpperMaterial = VecDraw->Man_Jacket_Mat; break; case TP_JUMPER: DSUpperSilhouette = VecDraw->Man_Jumper_Sil; DSUpperSleeve = VecDraw->Man_Jumper_Sle; DSUpperCollar = VecDraw->Man_Jumper_Col; DSUpperMaterial = VecDraw->Man_Jumper_Mat; break; case TP_KNIT: DSUpperSilhouette = VecDraw->Man_Knit_Sil; DSUpperSleeve = VecDraw->Man_Knit_Sle; DSUpperCollar = VecDraw->Man_Knit_Col; DSUpperMaterial = VecDraw->Man_Knit_Mat; break; case TP_SHIRTS: DSUpperSilhouette = VecDraw->Man_Shirts_Sil; DSUpperSleeve = VecDraw->Man_Shirts_Sle; DSUpperCollar = VecDraw->Man_Shirts_Col; DSUpperMaterial = VecDraw->Man_Shirts_Mat; break; case TP_TOP: DSUpperSilhouette = VecDraw->Man_Top_Sil; DSUpperSleeve = VecDraw->Man_Top_Sle; DSUpperCollar = VecDraw->Man_Top_Col; DSUpperMaterial = VecDraw->Man_Top_Mat; break; case TP_VEST: DSUpperSilhouette = VecDraw->Man_Vest_Sil; DSUpperSleeve = VecDraw->Man_Vest_Sle; DSUpperCollar = VecDraw->Man_Vest_Col; DSUpperMaterial = VecDraw->Man_Vest_Mat; break; case TP_PANTS: DSLowerPants = VecDraw->Man_Pants_Sil; DSLowerBelt = VecDraw->Man_Pants_Belt; DSLowerMaterial = VecDraw->Man_Pants_Mat; break; } break; case DV_WOMAN: switch (Type) { case TP_COAT: DSUpperSilhouette = VecDraw->Woman_Coat_Sil; DSUpperSleeve = VecDraw->Woman_Coat_Sle; DSUpperCollar = VecDraw->Woman_Coat_Col; DSUpperMaterial = VecDraw->Woman_Coat_Mat; break; case TP_JACKET: DSUpperSilhouette = VecDraw->Woman_Jacket_Sil; DSUpperSleeve = VecDraw->Woman_Jacket_Sle; DSUpperCollar = VecDraw->Woman_Jacket_Col; DSUpperMaterial = VecDraw->Woman_Jacket_Mat; break; case TP_JUMPER: DSUpperSilhouette = VecDraw->Woman_Jumper_Sil; DSUpperSleeve = VecDraw->Woman_Jumper_Sle; DSUpperCollar = VecDraw->Woman_Jumper_Col; DSUpperMaterial = VecDraw->Woman_Jumper_Mat; break; case TP_KNIT: DSUpperSilhouette = VecDraw->Woman_Knit_Sil; DSUpperSleeve = VecDraw->Woman_Knit_Sle; DSUpperCollar = VecDraw->Woman_Knit_Col; DSUpperMaterial = VecDraw->Woman_Knit_Mat; break; case TP_SHIRTS: DSUpperSilhouette = VecDraw->Woman_Shirts_Sil; DSUpperSleeve = VecDraw->Woman_Shirts_Sle; DSUpperCollar = VecDraw->Woman_Shirts_Col; DSUpperMaterial = VecDraw->Woman_Shirts_Mat; break; case TP_TOP: DSUpperSilhouette = VecDraw->Woman_Top_Sil; DSUpperSleeve = VecDraw->Woman_Top_Sle; DSUpperCollar = VecDraw->Woman_Top_Col; DSUpperMaterial = VecDraw->Woman_Top_Mat; break; case TP_VEST: DSUpperSilhouette = VecDraw->Woman_Vest_Sil; DSUpperSleeve = VecDraw->Woman_Vest_Sle; DSUpperCollar = VecDraw->Woman_Vest_Col; DSUpperMaterial = VecDraw->Woman_Vest_Mat; break; case TP_ONEPIECE: DSUpperSilhouette = VecDraw->Woman_OnePiece_Sil; DSUpperSleeve = VecDraw->Woman_OnePiece_Sle; DSUpperCollar = VecDraw->Woman_OnePiece_Col; DSUpperMaterial = VecDraw->Woman_OnePiece_Mat; break; case TP_BLOUSE: DSUpperSilhouette = VecDraw->Woman_Blouse_Sil; DSUpperSleeve = VecDraw->Woman_Blouse_Sle; DSUpperCollar = VecDraw->Woman_Blouse_Col; DSUpperMaterial = VecDraw->Woman_Blouse_Mat; break; case TP_PANTS: DSLowerPants = VecDraw->Woman_Pants_Sil; DSLowerBelt = VecDraw->Woman_Pants_Belt; DSLowerMaterial = VecDraw->Woman_Pants_Mat; break; case TP_SKIRT: DSLowerPants = VecDraw->Woman_Skirt_Sil; DSLowerBelt = VecDraw->Woman_Skirt_Belt; DSLowerMaterial = VecDraw->Woman_Skirt_Mat; break; } break; case DV_CHILD: switch (Type) { case TP_COAT: DSUpperSilhouette = VecDraw->Child_Coat_Sil; DSUpperSleeve = VecDraw->Child_Coat_Sle; DSUpperCollar = VecDraw->Child_Coat_Col; DSUpperMaterial = VecDraw->Child_Coat_Mat; break; case TP_JUMPER: DSUpperSilhouette = VecDraw->Child_Jumper_Sil; DSUpperSleeve = VecDraw->Child_Jumper_Sle; DSUpperCollar = VecDraw->Child_Jumper_Col; DSUpperMaterial = VecDraw->Child_Jumper_Mat; break; case TP_KNIT: DSUpperSilhouette = VecDraw->Child_Knit_Sil; DSUpperSleeve = VecDraw->Child_Knit_Sle; DSUpperCollar = VecDraw->Child_Knit_Col; DSUpperMaterial = VecDraw->Child_Knit_Mat; break; case TP_SHIRTS: DSUpperSilhouette = VecDraw->Child_Shirts_Sil; DSUpperSleeve = VecDraw->Child_Shirts_Sle; DSUpperCollar = VecDraw->Child_Shirts_Col; DSUpperMaterial = VecDraw->Child_Shirts_Mat; break; case TP_VEST: DSUpperSilhouette = VecDraw->Child_Vest_Sil; DSUpperSleeve = VecDraw->Child_Vest_Sle; DSUpperCollar = VecDraw->Child_Vest_Col; DSUpperMaterial = VecDraw->Child_Vest_Mat; break; case TP_ONEPIECE: DSUpperSilhouette = VecDraw->Child_OnePiece_Sil; DSUpperSleeve = VecDraw->Child_OnePiece_Sle; DSUpperCollar = VecDraw->Child_OnePiece_Col; DSUpperMaterial = VecDraw->Child_OnePiece_Mat; break; case TP_CAPE: DSUpperSilhouette = VecDraw->Child_Cape_Sil; DSUpperSleeve = VecDraw->Child_Cape_Sle; DSUpperCollar = VecDraw->Child_Cape_Col; DSUpperMaterial = VecDraw->Child_Cape_Mat; break; // DSChild¿¡ TP_JACKET, TP_TOP, TP_KNIT, TP_BLOUSE Ãß°¡ - by monkman (2004.07.03) case TP_JACKET: DSUpperSilhouette = VecDraw->Child_Jacket_Sil; DSUpperSleeve = VecDraw->Child_Jacket_Sle; DSUpperCollar = VecDraw->Child_Jacket_Col; DSUpperMaterial = VecDraw->Child_Jacket_Mat; break; case TP_TOP: DSUpperSilhouette = VecDraw->Child_Top_Sil; DSUpperSleeve = VecDraw->Child_Top_Sle; DSUpperCollar = VecDraw->Child_Top_Col; DSUpperMaterial = VecDraw->Child_Top_Mat; break; case TP_BLOUSE: DSUpperSilhouette = VecDraw->Child_Blouse_Sil; DSUpperSleeve = VecDraw->Child_Blouse_Sle; DSUpperCollar = VecDraw->Child_Blouse_Col; DSUpperMaterial = VecDraw->Child_Blouse_Mat; break; case TP_PANTS: DSLowerPants = VecDraw->Child_Pants_Sil; DSLowerBelt = VecDraw->Child_Pants_Belt; DSLowerMaterial = VecDraw->Child_Pants_Mat; break; case TP_SKIRT: DSLowerPants = VecDraw->Child_Skirt_Sil; DSLowerBelt = VecDraw->Child_Skirt_Belt; DSLowerMaterial = VecDraw->Child_Skirt_Mat; break; } break; case DV_BABY: switch (Type) { case TP_SHIRTS: DSUpperSilhouette = VecDraw->Baby_Shirts_Sil; DSUpperSleeve = VecDraw->Baby_Shirts_Sle; DSUpperCollar = VecDraw->Baby_Shirts_Col; DSUpperMaterial = VecDraw->Baby_Shirts_Mat; break; case TP_ONEPIECE: DSUpperSilhouette = VecDraw->Baby_OnePiece_Sil; DSUpperSleeve = VecDraw->Baby_OnePiece_Sle; DSUpperCollar = VecDraw->Baby_OnePiece_Col; DSUpperMaterial = VecDraw->Baby_OnePiece_Mat; break; case TP_CAPE: DSUpperSilhouette = VecDraw->Baby_Cape_Sil; DSUpperSleeve = VecDraw->Baby_Cape_Sle; DSUpperCollar = VecDraw->Baby_Cape_Col; DSUpperMaterial = VecDraw->Baby_Cape_Mat; break; case TP_ROMPERS: DSUpperSilhouette = VecDraw->Baby_Rompers_Sil; DSUpperSleeve = VecDraw->Baby_Rompers_Sle; DSUpperCollar = VecDraw->Baby_Rompers_Col; DSUpperMaterial = VecDraw->Baby_Rompers_Mat; break; case TP_PANTS: DSLowerPants = VecDraw->Baby_Pants_Sil; DSLowerBelt = VecDraw->Baby_Pants_Belt; DSLowerMaterial = VecDraw->Baby_Pants_Mat; break; case TP_SKIRT: DSLowerPants = VecDraw->Baby_Skirt_Sil; DSLowerBelt = VecDraw->Baby_Skirt_Belt; DSLowerMaterial = VecDraw->Baby_Skirt_Mat; break; } break; } #endif #ifndef WORKSHEET ComboTopWholeSilhouette->Text = ""; ComboTopWholeSilhouette->Items->Clear(); ComboTopSilhouetteSilhouette->Text = ""; ComboTopSilhouetteSilhouette->Items->Clear(); i = 0, count = 0; while (count < 127) { if (DSSilhouette.Contains(EDetailSilhouette(++i))) { ComboTopWholeSilhouette->Items->Add(VecDraw->SilhouetteName[EDetailSilhouette(i)]); ComboTopSilhouetteSilhouette->Items->Add(VecDraw->SilhouetteName[EDetailSilhouette(i)]); } count++; } #else if (combobxUpperLower->ItemIndex == 0) { // Silhouette ComboTopWholeSilhouette->Text = ""; ComboTopWholeSilhouette->Items->Clear(); ComboTopSilhouetteSilhouette->Text = ""; ComboTopSilhouetteSilhouette->Items->Clear(); for (int i = 0; i < 127; i++) { if (DSUpperSilhouette.Contains(i)) { ComboTopWholeSilhouette->Items->AddObject(VecDraw->SilhouetteName[i], (TObject *)i); ComboTopSilhouetteSilhouette->Items->AddObject(VecDraw->SilhouetteName[i], (TObject *)i); } } ComboTopWholeSilhouette->ItemIndex = 0; ComboTopSilhouetteSilhouette->ItemIndex = 0; // Sleeve ComboTopWholeSleeve->Text = ""; ComboTopWholeSleeve->Items->Clear(); ComboTopSleeveSleeve->Text = ""; ComboTopSleeveSleeve->Items->Clear(); for (int i = 0; i < 127; i++) { if (DSUpperSleeve.Contains(i)) { ComboTopWholeSleeve->Items->AddObject(VecDraw->SleeveName[i], (TObject *)i); ComboTopSleeveSleeve->Items->AddObject(VecDraw->SleeveName[i], (TObject *)i); } } ComboTopWholeSleeve->ItemIndex = 0; ComboTopSleeveSleeve->ItemIndex = 0; // Collar ComboTopWholeCollar->Text = ""; ComboTopWholeCollar->Items->Clear(); ComboTopCollarCollar->Text = ""; ComboTopCollarCollar->Items->Clear(); for (int i = 0; i < 127; i++) { if (DSUpperCollar.Contains(i)) { ComboTopWholeCollar->Items->AddObject(VecDraw->CollarName[i], (TObject *)i); ComboTopCollarCollar->Items->AddObject(VecDraw->CollarName[i], (TObject *)i); } } ComboTopWholeCollar->ItemIndex = 0; ComboTopCollarCollar->ItemIndex = 0; } else if (combobxUpperLower->ItemIndex == 1) { // Pants Silhouette ComboBottomWholePantsSilhouette->Text = ""; ComboBottomWholePantsSilhouette->Items->Clear(); ComboBottomWholeSkirtSilhouette->Text = ""; ComboBottomWholeSkirtSilhouette->Items->Clear(); ComboBottomSilhouettePantsSilhouette->Text = ""; ComboBottomSilhouettePantsSilhouette->Items->Clear(); ComboBottomSilhouetteSkirtSilhouette->Text = ""; ComboBottomSilhouetteSkirtSilhouette->Items->Clear(); for (int i = 0; i < 127; i++) { if (DSLowerPants.Contains(i)) { ComboBottomWholePantsSilhouette->Items->AddObject(VecDraw->PantsName[i], (TObject *)i); ComboBottomWholeSkirtSilhouette->Items->AddObject(VecDraw->PantsName[i], (TObject *)i); ComboBottomSilhouettePantsSilhouette->Items->AddObject(VecDraw->PantsName[i], (TObject *)i); ComboBottomSilhouetteSkirtSilhouette->Items->AddObject(VecDraw->PantsName[i], (TObject *)i); } } ComboBottomWholePantsSilhouette->ItemIndex = 0; ComboBottomWholeSkirtSilhouette->ItemIndex = 0; ComboBottomSilhouettePantsSilhouette->ItemIndex = 0; ComboBottomSilhouetteSkirtSilhouette->ItemIndex = 0; // Belt ComboBottomWholeBelt->Text = ""; ComboBottomWholeBelt->Items->Clear(); ComboBottomBeltBelt->Text = ""; ComboBottomBeltBelt->Items->Clear(); for (int i = 0; i < 127; i++) { if (DSLowerBelt.Contains(i)) { ComboBottomWholeBelt->Items->AddObject(VecDraw->BeltName[i], (TObject *)i); ComboBottomBeltBelt->Items->AddObject(VecDraw->BeltName[i], (TObject *)i); } } ComboBottomWholeBelt->ItemIndex = 0; ComboBottomBeltBelt->ItemIndex = 0; } // Material ComboMaterial->Text = ""; ComboMaterial->Items->Clear(); if (combobxUpperLower->ItemIndex == 0) { // Upper Material for (int i = 0; i < 127; i++) { if (DSUpperMaterial.Contains(i)) { ComboMaterial->Items->AddObject(VecDraw->UpperMaterialName[i], (TObject *)i); } } } else if (combobxUpperLower->ItemIndex == 1) { // Lower Material for (int i = 0; i < 127; i++) { if (DSLowerMaterial.Contains(i)) { ComboMaterial->Items->AddObject(VecDraw->LowerMaterialName[i], (TObject *)i); } } } ComboMaterial->ItemIndex = 0; #endif // Æû¿¡ ¹Ý¿µ - by monkman (2004.04.08) if (combobxUpperLower->ItemIndex == 0) { rbTopClick(this); } if (combobxUpperLower->ItemIndex == 1) { rbBottomClick(this); } PreListBox_ItemIndex = combobxItems->ItemIndex; // ÀÌÀü ¼±ÅõǾú´ø Type - by monkman (2004.07.13) } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::btTraitClick(TObject *Sender) { sbClickedButton = (TSpeedButton *)Sender; // Component À̸§À» ã±â À§Çؼ­.. - by monkman (2004.04.07) String CompName; TShape *sh; CompName = sbClickedButton->Name; CompName = "sh" + CompName.SubString(3, CompName.Length()); sh = (TShape *)FindComponent(CompName); if (sbClickedButton) sbClickedButton->Down = false; if (sh == NULL) return; if (sh->Pen->Color == 0x004B04FE) { return; } //if (sh->Brush->Color == clRed) {sbClickedButton->Down = false; return; } //sbClickedButton->Down = true; ButtonDown = true; sh->Pen->Color = 0x00FEE004; sh->Repaint(); ObjectTrait = EObjectTrait(sbClickedButton->Tag < 100 ? sbClickedButton->Tag : sbClickedButton->Tag-100); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::sbSaveClick(TObject *Sender) { // originalheader´Â STY¸¦ ÆíÁýÇØ¼­ ÀúÀåÇÒ ¶§, ÆíÁýÇß´ø ¿øº» Çì´õ (¿øº»ÀÌ ÀÖÀ» °æ¿ì) - by monkman (2004.11.04) STYLEDATAFILEHEADER header, originalheader; HANDLE hFile = INVALID_HANDLE_VALUE; // originalheader´Â STY¸¦ ÆíÁýÇØ¼­ ÀúÀåÇÒ ¶§, ÆíÁýÇß´ø ¿øº» ÆÄÀÏÀÇ ÇÚµé (¿øº»ÀÌ ÀÖÀ» °æ¿ì) - by monkman (2004.11.04) HANDLE originalhFile = INVALID_HANDLE_VALUE; TVecData *data, *cdata; DWORD dwRead, dwWrite; String strFileName, strDN, strFN; AnsiString strTemp; int Version; char *tempchar = "\\"; // bEdit°¡ trueÀ̸é LoadµÈ ÆÄÀÏ, falseÀÌ¸é »õ·Î ¸¸µé¾îÁø ÆÄÀÏ - by monkman (2004.11.04) bool bOverWrite, bEdit; // nHASP_SNÀº ¿øº» ÆÄÀÏÀÇ HASP SerialÀ» º¹»çÇØ¼­ ¿Å°Ü¾²±â À§ÇÑ ¹è¿­ - by monkman (2004.11.04) BYTE cHASP_SN[4][9]; BYTE *StyleData = NULL; short nDataCount; DWORD dwPos; DWORD dwDataSize; double dSize; // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman // int linecount, wordcount, lineheight; // TSWordData *srcWordData; // Top Whole Style°ú Bottom Whole Style¿¡¼­ Division°ú TypeÀÌ Ã¼Å©µÇÁö ¾Ê¾Ò´Ù¸é ¼±ÅÃÇ϶ó´Â ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÏ°í ¸®ÅÏÇÑ´Ù if (combobxItems->Items->Count == 0 || combobxItems->ItemIndex == -1) { // ¸Þ½ÃÁö : "ItemsÀ» ¼±ÅÃÇØ¾ß ÀúÀåÇÒ ¼ö ÀÖ½À´Ï´Ù." MessageDlg(IDS_MESSAGE1, mtWarning, TMsgDlgButtons() << mbOK, 0); return; } if (!ComboYear->Text.IsEmpty()) { try { if (StrToInt(ComboYear->Text) >= 0) { header.Year = StrToInt(ComboYear->Text); } else { // ¸Þ½ÃÁö : "¿¬µµ´Â ¾ç¼ö¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE14, mtError, TMsgDlgButtons() << mbOK, 0); } } catch (Exception &e) { // ¸Þ½ÃÁö : "¿¬µµ´Â ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE2, mtError, TMsgDlgButtons() << mbOK, 0); return; } } #ifdef WORKSHEET // ¾ÆÀÌÅÛÀ» ¼±ÅÃÇÏÁö ¾ÊÀ¸¸é °æ°í¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù - by monkman (2011.02.18) if (combobxUpperLower->ItemIndex == 0 && ((rbTopWhole->Checked && (0 == ComboTopWholeSilhouette->ItemIndex || 0 == ComboTopWholeSleeve->ItemIndex || 0 == ComboTopWholeCollar->ItemIndex)) || (rbTopSilhouette->Checked && 0 == ComboTopSilhouetteSilhouette->ItemIndex) || (rbTopSleeve->Checked && 0 == ComboTopSleeveSleeve->ItemIndex) || (rbTopCollar->Checked && 0 == ComboTopCollarCollar->ItemIndex) || (rbTopMaterial->Checked && 0 == ComboMaterial->ItemIndex))) { // ¸Þ½ÃÁö : "ItemsÀ» ¼±ÅÃÇØ¾ß ÀúÀåÇÒ ¼ö ÀÖ½À´Ï´Ù." MessageDlg(IDS_MESSAGE1, mtWarning, TMsgDlgButtons() << mbOK, 0); return; } else if (combobxUpperLower->ItemIndex == 1 && ((rbBottomWhole->Checked && 0 == combobxItems->ItemIndex && (0 == ComboBottomWholePantsSilhouette->ItemIndex || 0 == ComboBottomWholeBelt->ItemIndex)) || (rbBottomWhole->Checked && 0 == combobxItems->ItemIndex && (0 == ComboBottomWholePantsSilhouette->ItemIndex || 0 == ComboBottomWholeBelt->ItemIndex)) || (rbBottomWhole->Checked && 1 == combobxItems->ItemIndex && (0 == ComboBottomWholeSkirtSilhouette->ItemIndex || 0 == ComboBottomWholeBelt->ItemIndex)) || (rbBottomWhole->Checked && 1 == combobxItems->ItemIndex && (0 == ComboBottomWholeSkirtSilhouette->ItemIndex || 0 == ComboBottomWholeBelt->ItemIndex)) || (rbBottomSilhouette->Checked && 0 == combobxItems->ItemIndex && 0 == ComboBottomSilhouettePantsSilhouette->ItemIndex) || (rbBottomSilhouette->Checked && 1 == combobxItems->ItemIndex && 0 == ComboBottomSilhouetteSkirtSilhouette->ItemIndex) || (rbBottomBelt->Checked && 0 == ComboBottomBeltBelt->ItemIndex) || (rbBottomMaterial->Checked && 0 == ComboMaterial->ItemIndex))) { // ¸Þ½ÃÁö : "ItemsÀ» ¼±ÅÃÇØ¾ß ÀúÀåÇÒ ¼ö ÀÖ½À´Ï´Ù." MessageDlg(IDS_MESSAGE1, mtWarning, TMsgDlgButtons() << mbOK, 0); return; } #endif /* if (!OpenDialogStyLoad->FileName.IsEmpty()) { // ¸Þ½ÃÁö : "ÀÛ¾÷ÁßÀÎ ÆÄÀϰú °°Àº À̸§À¸·Î ÀúÀåÇϽðڽÀ´Ï±î?" if (MessageDlg(IDS_MESSAGE3, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { OpenDialogStyLoad->FileName; SaveDialog1->FileName = OpenDialogStyLoad->FileName; bOverWrite = true; // ±âÁ¸ STY ÆíÁýÇØ¼­ ´Ù½Ã ÀúÀåÇÒ ¶§ (Çì´õ µîÀº ¼öÁ¤ÇÏ¸é ¾ÈµÊ....) - by monkman (2004.11.04) bEdit = true; } else { // ¸¸µé¾îÁø path °æ·Î¸¦ OpenDialog¿Í SaveDialog¿¡ ÁöÁ¤ÇØÁØ´Ù - by monkman (2004.05.12) OpenDialogStyLoad->FileName; GetDirectoryName(true); // ±âÁ¸ STY ÆíÁýÇØ¼­ ´Ù½Ã ÀúÀåÇÒ ¶§ (Çì´õ µîÀº ¼öÁ¤ÇÏ¸é ¾ÈµÊ....) - by monkman (2004.11.04) bEdit = false; } if (!SaveDialog1->Execute()) { bOverWrite = false; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; } else { bOverWrite = false; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; } // ÆíÁýÇß´ø ¿øº» Çì´õ¸¦ Àо °¡Áö°í Àִ´٠(ÆÄÀÏÀ» ¾µ¶§ »ç¿ë) - by monkman (2004.03.30) if (FileExists(strPreLoadPath)) { if ((originalhFile = CreateFile(strPreLoadPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; originalheader = VecDraw->ReadSTYFileHeader(originalhFile, OpenDialogStyLoad->FileName, &Version, true); CloseHandle(originalhFile); originalhFile = INVALID_HANDLE_VALUE; } } else { // ¸¸µé¾îÁø path °æ·Î¸¦ OpenDialog¿Í SaveDialog¿¡ ÁöÁ¤ÇØÁØ´Ù - by monkman (2004.05.12) GetDirectoryName(true); if (!SaveDialog1->Execute()) { bOverWrite = false; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; } else { bOverWrite = false; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; } // STY ÆÄÀÏÀ» »õ·Î ¸¸µé ¶§ (»ç¿ëÀÚ ÆÄÀÏ ¹öÀüÀ¸·Î....) - by monkman (2004.11.04) bEdit = false; } */ // Çì´õµéÀÇ ÃʱâÈ­ - by monkman (2004.04.02) VecDraw->InitSTYHeader(&header); header.Version = STYSTIFileVersion; header.Division = Division; header.Type = Type; header.Count1 = ObjectCount1; header.Count2 = ObjectCount2; if (!ComboYear->Text.IsEmpty()) { header.Year = StrToInt(ComboYear->Text); } // Spring, Summer, Fall, Winter üũ - by monkman (2004.04.14) for (int i = 0; i < clbSSFW->Count; i++) { if (clbSSFW->Checked[i]) { switch (i) { // Spring case 0 : header.SSFW += 1; break; // Summer case 1 : header.SSFW += 2; break; // Fall case 2 : header.SSFW += 4; break; // Winter case 3 : header.SSFW += 8; break; default : header.SSFW = 0; break; } } } // ÁÖ¼® ÀÔ·Â - by monkman (2004.06.21) if (!EditComment->Text.IsEmpty()) { strTemp = EditComment->Text; if (EditComment->Text.Length() < 99) { strncpy(header.Comment, strTemp.c_str(), strTemp.Length()); } else { strncpy(header.Comment, strTemp.c_str(), 99); } } #ifdef WORKSHEET // ÀÛ¾÷Áö½Ã¼­ : StyleID ÀúÀå - by monkman (2010.12.28) strTemp = edStyleID->Text; strncpy(header.StyleID, strTemp.c_str(), strTemp.Length()); #endif memcpy(header.TraitFrontNumber, TempNumber1, sizeof(int)*80); memcpy(header.TraitBackNumber, TempNumber2, sizeof(int)*80); /* filename = SaveDialog1->FileName; if (bOverWrite) { if ((hFile = CreateFile(filename.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS , FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; } else { if (cbYW->Checked == false) { while (char(filename[filename.Length()]) != *tempchar) { temp = String(filename[filename.Length()]) + temp; filename.SetLength(filename.Length()-1); } filename = filename + "USER_" + temp; } if ((hFile = CreateFile(filename.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) { if (MessageDlg(IDS_MESSAGE4, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { if ((hFile = CreateFile(filename.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS , FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; } else return; } } */ // switch case ¹®À̾ú´ø ÀúÀåºÎºÐÀ» if() ¹®À¸·Î ´ëü - by monkman (2004.04.06) // Top Whole Style if (combobxUpperLower->ItemIndex == 0 && rbTopWhole->Checked == true) { header.Type = Type; header.Sort = SO_TOPFULL; header.EMethod = EDetailMethod(ComboTopWholeType->ItemIndex+1); // »óÀÇ ´ëÇ¥½ºÅ¸ÀÏ¿¡ µû¸¥ ½Ç·ç¿§ÀÇ Á¾·ù¸¦ ã¾Æ³¿ - by monkman (2004.04.13) int i = 0, count = 0, brk = 0, value = 0; #ifndef WORKSHEET // while (count < 127) { // if (DSSilhouette.Contains(EDetailSilhouette(++i))) { // if (ComboTopWholeSilhouette->ItemIndex == brk) { // value = i; // break; // } // brk++; // } // count++; // } for (int i = 0, j = 0; i < 127; i++) { if (DSSilhouette.Contains(i)) { if (ComboTopSilhouetteSilhouette->ItemIndex == j) { value = i; break; } j++; } } header.ESilhouette = EDetailSilhouette(value); header.ESleeve = EDetailSleeve(ComboTopWholeSleeve->ItemIndex+1); header.ECollar = EDetailCollar(ComboTopWholeCollar->ItemIndex+1); #else if (0 <= ComboTopSilhouetteSilhouette->ItemIndex && ComboTopSilhouetteSilhouette->ItemIndex < ComboTopSilhouetteSilhouette->Items->Count) { header.ESilhouette = EDetailSilhouette(ComboTopSilhouetteSilhouette->Items->Objects[ComboTopSilhouetteSilhouette->ItemIndex]); } if (0 <= ComboTopWholeSleeve->ItemIndex && ComboTopWholeSleeve->ItemIndex < ComboTopWholeSleeve->Items->Count) { header.ESleeve = EDetailSleeve(ComboTopWholeSleeve->Items->Objects[ComboTopWholeSleeve->ItemIndex]); } if (0 <= ComboTopWholeCollar->ItemIndex && ComboTopWholeCollar->ItemIndex < ComboTopWholeCollar->Items->Count) { header.ECollar = EDetailCollar(ComboTopWholeCollar->Items->Objects[ComboTopWholeCollar->ItemIndex]); } #endif } // Top Silhouette if (combobxUpperLower->ItemIndex == 0 && rbTopSilhouette->Checked == true) { header.Type = Type; header.Sort = SO_SILHOUETTE; header.bSleeve = cbSleeve->Checked; header.bCollar = cbCollar->Checked; header.EMethod = EDetailMethod(ComboTopSilhouetteType->ItemIndex+1); // »óÀÇ ´ëÇ¥½ºÅ¸ÀÏ¿¡ µû¸¥ ½Ç·ç¿§ÀÇ Á¾·ù¸¦ ã¾Æ³¿ - by monkman (2004.04.13) int i = 0, count = 0, brk = 0, value = 0; #ifndef WORKSHEET // while (count < 127) { // if (DSSilhouette.Contains(EDetailSilhouette(++i))) { // if (ComboTopSilhouetteSilhouette->ItemIndex == brk) { // value = i; // break; // } // brk++; // } // count++; // } for (int i = 0, j = 0; i < 127; i++) { if (DSSilhouette.Contains(i)) { if (ComboTopSilhouetteSilhouette->ItemIndex == j) { value = i; break; } j++; } } header.ESilhouette = EDetailSilhouette(value); #else if (0 <= ComboTopSilhouetteSilhouette->ItemIndex && ComboTopSilhouetteSilhouette->ItemIndex < ComboTopSilhouetteSilhouette->Items->Count) { header.ESilhouette = EDetailSilhouette(int(ComboTopSilhouetteSilhouette->Items->Objects[ComboTopSilhouetteSilhouette->ItemIndex])); } #endif } // Top Sleeve if (combobxUpperLower->ItemIndex == 0 && rbTopSleeve->Checked == true) { header.Type = Type; header.Sort = SO_SLEEVE; #ifndef WORKSHEET header.ESleeve = EDetailSleeve(ComboTopSleeveSleeve->ItemIndex+1); #else if (0 <= ComboTopSleeveSleeve->ItemIndex && ComboTopSleeveSleeve->ItemIndex < ComboTopSleeveSleeve->Items->Count) { header.ESleeve = EDetailSleeve(int(ComboTopSleeveSleeve->Items->Objects[ComboTopSleeveSleeve->ItemIndex])); } #endif } // Top Collar if (combobxUpperLower->ItemIndex == 0 && rbTopCollar->Checked == true) { header.Type = Type; header.Sort = SO_COLLAR; #ifndef WORKSHEET header.ECollar = EDetailCollar(ComboTopCollarCollar->ItemIndex+1); #else if (0 <= ComboTopCollarCollar->ItemIndex && ComboTopCollarCollar->ItemIndex < ComboTopCollarCollar->Items->Count) { header.ECollar = EDetailCollar(int(ComboTopCollarCollar->Items->Objects[ComboTopCollarCollar->ItemIndex])); } #endif } #ifdef WORKSHEET // Upper Material - by monkman (2011.0119) if (combobxUpperLower->ItemIndex == 0 && rbTopMaterial->Checked == true) { if (0 <= ComboMaterial->ItemIndex && ComboMaterial->ItemIndex < ComboMaterial->Items->Count) { header.Type = Type; header.Sort = SO_UPPERMATRIAL; header.EUpperMaterial = EDetailUpperMaterial(int(ComboMaterial->Items->Objects[ComboMaterial->ItemIndex])); } } #endif // Bottom Whole Style if (combobxUpperLower->ItemIndex == 1 && rbBottomWhole->Checked == true) { header.Type = Type; header.Sort = SO_BOTTOMFULL; // ¹ÙÁö¿Í ½ºÄ¿Æ® ±¸ºÐ - by monkman (2004.04.09) #ifndef WORKSHEET if (TP_SKIRT != Type) { header.EPants = EDetailPants(ComboBottomWholePantsSilhouette->ItemIndex+1); } else { header.EPants = EDetailPants(ComboBottomWholeSkirtSilhouette->ItemIndex+51); } header.EBelt = EDetailBelt(ComboBottomWholeBelt->ItemIndex+1); #else if (TP_SKIRT != Type) { if (0 <= ComboBottomWholePantsSilhouette->ItemIndex && ComboBottomWholePantsSilhouette->ItemIndex < ComboBottomWholePantsSilhouette->Items->Count) { header.EPants = EDetailPants(int(ComboBottomWholePantsSilhouette->Items->Objects[ComboBottomWholePantsSilhouette->ItemIndex])); } } else { if (0 <= ComboBottomWholeSkirtSilhouette->ItemIndex && ComboBottomWholeSkirtSilhouette->ItemIndex < ComboBottomWholeSkirtSilhouette->Items->Count) { header.EPants = EDetailPants(int(ComboBottomWholeSkirtSilhouette->Items->Objects[ComboBottomWholeSkirtSilhouette->ItemIndex])); } } if (0 <= ComboBottomWholeBelt->ItemIndex && ComboBottomWholeBelt->ItemIndex < ComboBottomWholeBelt->Items->Count) { header.EBelt = EDetailBelt(int(ComboBottomWholeBelt->Items->Objects[ComboBottomWholeBelt->ItemIndex])); } #endif } // Bottom Silhouette if (combobxUpperLower->ItemIndex == 1 && rbBottomSilhouette->Checked == true) { header.Type = Type; header.Sort = SO_PANTS; header.bBelt = cbBelt->Checked; // ¹ÙÁö¿Í ½ºÄ¿Æ® ±¸ºÐ - by monkman (2004.04.09) #ifndef WORKSHEET if (TP_SKIRT != Type) { header.EPants = EDetailPants(ComboBottomSilhouettePantsSilhouette->ItemIndex+1); } else { header.EPants = EDetailPants(ComboBottomSilhouetteSkirtSilhouette->ItemIndex+51); } #else if (TP_SKIRT != Type) { if (0 <= ComboBottomSilhouettePantsSilhouette->ItemIndex && ComboBottomSilhouettePantsSilhouette->ItemIndex < ComboBottomSilhouettePantsSilhouette->Items->Count) { header.EPants = EDetailPants(int(ComboBottomSilhouettePantsSilhouette->Items->Objects[ComboBottomSilhouettePantsSilhouette->ItemIndex])); } } else { if (0 <= ComboBottomSilhouetteSkirtSilhouette->ItemIndex && ComboBottomSilhouetteSkirtSilhouette->ItemIndex < ComboBottomSilhouetteSkirtSilhouette->Items->Count) { header.EPants = EDetailPants(int(ComboBottomSilhouetteSkirtSilhouette->Items->Objects[ComboBottomSilhouetteSkirtSilhouette->ItemIndex])); } } #endif } // Bottom Belt if (combobxUpperLower->ItemIndex == 1 && rbBottomBelt->Checked == true) { header.Type = Type; header.Sort = SO_BELT; #ifndef WORKSHEET header.EBelt = EDetailBelt(ComboBottomBeltBelt->ItemIndex+1); #else if (0 <= ComboBottomBeltBelt->ItemIndex && ComboBottomBeltBelt->ItemIndex < ComboBottomBeltBelt->Items->Count) { header.EBelt = EDetailBelt(int(ComboBottomBeltBelt->Items->Objects[ComboBottomBeltBelt->ItemIndex])); } #endif } #ifdef WORKSHEET // Lower Material - by monkman (2011.0119) if (combobxUpperLower->ItemIndex == 1 && rbBottomMaterial->Checked == true) { if (0 <= ComboMaterial->ItemIndex && ComboMaterial->ItemIndex < ComboMaterial->Items->Count) { header.Type = Type; header.Sort = SO_LOWERMATRIAL; header.ELowerMaterial = EDetailLowerMaterial(int(ComboMaterial->Items->Objects[ComboMaterial->ItemIndex])); } } #endif /* if (bEdit) { // STY ÆÄÀÏÀ» ·ÎµåÇØ¼­ ¼öÁ¤ ÁßÀ̾úÀ» ¶§.. if (originalheader.Version == 100) { header.Version = STYSTIFileVersion; #ifndef WORKSHEET // ÀÛ¾÷Áö½Ã¼­ÀÇ °æ¿ì¿¡´Â ¸¸µéÁö ¾Ê´Â´Ù - by monkman (2011.01.04) header = VecDraw->FakeSTYVersionAndHASPSeedCodeAndHASPKey(header); #endif header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) if (!WriteFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwWrite, NULL)) goto fail; } else if (200 <= originalheader.Version && originalheader.Version < 500) { header.Version = STYSTIFileVersion; #ifndef WORKSHEET // ÀÛ¾÷Áö½Ã¼­ÀÇ °æ¿ì¿¡´Â ¸¸µéÁö ¾Ê´Â´Ù - by monkman (2011.01.04) header = VecDraw->FakeSTYVersionAndHASPSeedCodeAndHASPKey(header); #endif header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) if (!WriteFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwWrite, NULL)) goto fail; } else if (500 <= originalheader.Version && originalheader.Version <= (STYSTIFileVersion+300)) { #ifndef NOT_STYLEDATA_LOCK // STY ÆÄÀÏ ¹öÀü, HASP SeedCode, Key °ªÀÌ µé¾îÀÖ´Â Reserved¸¦ º¹»çÇÑ´Ù - by monkman (2004.11.04) // ÆÇ¸Å¿ë header.Version = (STYSTIFileVersion+300); memcpy(header.Crypt, originalheader.Crypt, sizeof(BYTE)*24); memcpy(header.StyleID, originalheader.StyleID, sizeof(BYTE)*20); memcpy(header.Reserved, originalheader.Reserved, sizeof(BYTE)*14); // ÆíÁýÇß´ø ¿øº» Çì´õ¸¦ Àо °¡Áö°í Àִ´٠(ÆÄÀÏÀ» ¾µ¶§ »ç¿ë) - by monkman (2004.03.30) if (FileExists(strPreLoadPath)) { if ((originalhFile = CreateFile(strPreLoadPath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; if (SetFilePointer(originalhFile, sizeof(originalheader), NULL, FILE_BEGIN)== 0xFFFFFFFF) goto fail; // Çì´õ°¡ ³¡³ª´Â À§Ä¡±îÁö °£´Ù if (!ReadFile(originalhFile, &cHASP_SN, sizeof(cHASP_SN), &dwRead, NULL)) goto fail; // HASP Serial Number°¡ ±â·ÏµÇ¾î ÀÖ´Â ºÎºÐÀ» Àд´٠CloseHandle(originalhFile); originalhFile = INVALID_HANDLE_VALUE; header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) if (!WriteFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwWrite, NULL)) goto fail; if (!WriteFile(hFile, &cHASP_SN, sizeof(cHASP_SN), &dwWrite, NULL)) goto fail; } else goto fail; #endif } } else { // STY ÆÄÀÏÀ» »õ·Î ¸¸µé¾úÀ» ¶§.. #ifndef WORKSHEET // ÀÛ¾÷Áö½Ã¼­ÀÇ °æ¿ì¿¡´Â ¸¸µéÁö ¾Ê´Â´Ù - by monkman (2011.01.04) header = VecDraw->FakeSTYVersionAndHASPSeedCodeAndHASPKey(header); #endif header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) if (!WriteFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwWrite, NULL)) goto fail; } */ // STY ÆÄÀÏ Load½Ã STI »óÅ ¼³Á¤ - by monkman (2010.09.09) SetSTIStatus(header); #ifndef WORKSHEET if (OpenDialogStyLoad->FileName.IsEmpty() == false) { // ¸Þ½ÃÁö : "ÀÛ¾÷ÁßÀÎ ÆÄÀϰú °°Àº À̸§À¸·Î ÀúÀåÇϽðڽÀ´Ï±î?" if (MessageDlg(IDS_MESSAGE3, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { OpenDialogStyLoad->FileName; SaveDialog1->FileName = OpenDialogStyLoad->FileName; } else { GetDirectoryName(true); } } else { // ¸¸µé¾îÁø path °æ·Î¸¦ OpenDialog¿Í SaveDialog¿¡ ÁöÁ¤ÇØÁØ´Ù - by monkman (2004.05.12) GetDirectoryName(true); } #else // ÀÌ·£µå´Â ¹«Á¶°Ç StyleID¸¦ µû¸£¸ç ¾øÀ» °æ¿ì À̸§ÀÌ ÀԷµÇÁö ¾Ê´Â´Ù - by monkman (2011.02.25) GetDirectoryName(true); #endif savefile : if (SaveDialog1->Execute() == false) return; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; strFileName = SaveDialog1->FileName; strDN = ExtractFileDir(strFileName); strFN = ExtractFileName(strFileName); if (cbYW->Checked == false) { strTemp = "USER_"; if (1 != strFN.Pos(strTemp)) { strFileName = strDN + "\\USER_" + strFN; } } if (strFN.IsEmpty() == true) { // Message : ÆÄÀÏ À̸§À» ÀÔ·ÂÇϼ¼¿ä. MessageDlg(IDS_INPUTFILENAME, mtWarning, TMsgDlgButtons() << mbOK, 0); goto savefile; } else if (FileExists(strFileName)) { // Message : °°Àº À̸§À» °¡Áø ÆÄÀÏÀÌ Á¸ÀçÇÕ´Ï´Ù.\nµ¤¾î ¾²½Ã°Ú½À´Ï±î? if (MessageDlg(IDS_MESSAGE4, mtWarning, TMsgDlgButtons() << mbYes<< mbNo, 0) == mrNo) return; } if ((hFile = CreateFile(strFileName.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; #ifndef WORKSHEET // ÀÛ¾÷Áö½Ã¼­ÀÇ °æ¿ì¿¡´Â ¸¸µéÁö ¾Ê´Â´Ù - by monkman (2011.01.04) header = VecDraw->FakeSTYVersionAndHASPSeedCodeAndHASPKey(header); #endif header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) if (!WriteFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwWrite, NULL)) goto fail; nDataCount = header.Count1 + header.Count2; dwPos = 0; dwDataSize = 0; if ((StyleData = (BYTE *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwDataSize))==NULL) goto fail; // ÆÄÀÏÅ©±â¸¸Å­ ¸Þ¸ð¸® ÇÒ´ç // Style Data LockÀ» À§ÇØ ÆÄÀÏ¿¡ Á÷Á¢¾²Áö ¾Ê°í ¸Þ¸ð¸®¿¡ ¾´ ÈÄ ÀúÀåÇÏ´Â °ÍÀ¸·Î ¼öÁ¤ - by monkman (2004.12.30) // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ for (int i = 0; i < VecDraw->TransList1->Count; i++) { data = (TVecData *)VecDraw->TransList1->Items[i]; if (header.Sort == SO_TOPFULL || header.Sort == SO_SILHOUETTE || header.Sort == SO_SLEEVE || header.Sort == SO_COLLAR || header.Sort == SO_BOTTOMFULL || header.Sort == SO_PANTS || header.Sort == SO_BELT) { cdata = new TVecData(0); cdata->Copy(data); if (header.Sort == SO_TOPFULL) PatUpWhole->Add(cdata); if (header.Sort == SO_SILHOUETTE) PatUpSil->Add(cdata); if (header.Sort == SO_SLEEVE) PatUpSle->Add(cdata); if (header.Sort == SO_COLLAR) PatUpCol->Add(cdata); if (header.Sort == SO_BOTTOMFULL) PatDnWhole->Add(cdata); if (header.Sort == SO_PANTS) PatDnSil->Add(cdata); if (header.Sort == SO_BELT) PatDnBelt->Add(cdata); } if (data->Kind != V_TEXTBOX) { // STY, STI ÀúÀåÇÏ´Â ºÎºÐ - by monkman (2009.04.03) // HeapReAlloc()À¸·Î ¸Þ¸ð¸® ÁÖ¼Ò°¡ º¯°æµÇ¹Ç·Î ¸Þ¸ð¸® ÁÖ¼Ò¸¦ ¸®ÅÏÇϰí, ±× °ªÀ» ¹Þ¾Æ »ç¿ëÇϵµ·Ï ÇÑ´Ù VecDraw->SaveToSTYMemory(&StyleData, &dwPos, &dwDataSize, data, header.Version); } } // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ for (int i = 0; i < VecDraw->TransList2->Count; i++) { data = (TVecData *)VecDraw->TransList2->Items[i]; if (header.Sort == SO_TOPFULL || header.Sort == SO_SILHOUETTE || header.Sort == SO_SLEEVE || header.Sort == SO_COLLAR || header.Sort == SO_BOTTOMFULL || header.Sort == SO_PANTS || header.Sort == SO_BELT) { cdata = new TVecData(1); cdata->Copy(data); if (header.Sort == SO_TOPFULL) PatUpWhole->Add(cdata); if (header.Sort == SO_SILHOUETTE) PatUpSil->Add(cdata); if (header.Sort == SO_SLEEVE) PatUpSle->Add(cdata); if (header.Sort == SO_COLLAR) PatUpCol->Add(cdata); if (header.Sort == SO_BOTTOMFULL) PatDnWhole->Add(cdata); if (header.Sort == SO_PANTS) PatDnSil->Add(cdata); if (header.Sort == SO_BELT) PatDnBelt->Add(cdata); } // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman if (data->Kind != V_TEXTBOX) { // STY, STI ÀúÀåÇÏ´Â ºÎºÐ - by monkman (2009.04.03) // HeapReAlloc()À¸·Î ¸Þ¸ð¸® ÁÖ¼Ò°¡ º¯°æµÇ¹Ç·Î ¸Þ¸ð¸® ÁÖ¼Ò¸¦ ¸®ÅÏÇϰí, ±× °ªÀ» ¹Þ¾Æ »ç¿ëÇϵµ·Ï ÇÑ´Ù VecDraw->SaveToSTYMemory(&StyleData, &dwPos, &dwDataSize, data, header.Version); } } nDataCount = header.Count1 + header.Count2; if (500 <= header.Version) { // Data LockÀÌ °É·Á ÀÖ´Â ¹öÀü for (unsigned int i = 0; i < dwDataSize - 1; i++) { if (i % nDataCount == 0) { StyleData[i] = ~StyleData[i]; } } } if (!WriteFile(hFile, StyleData, dwDataSize, &dwWrite, NULL)) goto fail; // ÀÛ¾÷Áö½Ã¼­ Size Á¤º¸ Ãß°¡ - by monkman(2011.01.18) for (int i = 0; i < 9; i++) { // »óÀÇ if (TryStrToFloat(rzstrgrdUpperSizeInformation->Cells[1][i], dSize) == false) dSize = 0; if (!WriteFile(hFile, &dSize, sizeof(double), &dwWrite, NULL)) goto fail; } for (int i = 0; i < 9; i++) { // ÇÏÀÇ if (TryStrToFloat(rzstrgrdLowerSizeInformation->Cells[1][i], dSize) == false) dSize = 0; if (!WriteFile(hFile, &dSize, sizeof(double), &dwWrite, NULL)) goto fail; } SetEndOfFile(hFile); CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ SaveDialog1->FileName = "*.sty"; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; fail: CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ SaveDialog1->FileName = "*.sty"; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnLeftClick(TObject *Sender) { if (PageFront->ActivePage == TabFront) { if (FrontMoveX > 0) FrontMoveX -= 50*dFrontZoomRatio; if (FrontMoveX < 0) FrontMoveX = 0; PaintBox1->Repaint(); } else if (PageFront->ActivePage == TabBack) { if (BackMoveX > 0) BackMoveX -= 50*dBackZoomRatio; if (BackMoveX < 0) BackMoveX = 0; PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- // ĵ¹ö½º È­¸é À§Ä¡ ¸®¼Â - by monkman (2004.03.26) void __fastcall TDataTransForm::spdbtnPositionResetClick(TObject *Sender) { if (PageFront->ActivePage == TabFront) { FrontMoveX = 0; FrontMoveY = 0; PaintBox1->Repaint(); } else if (PageFront->ActivePage == TabBack) { BackMoveX = 0; BackMoveY = 0; PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnRightClick(TObject *Sender) { if (PageFront->ActivePage == TabFront) { if (FrontMoveX < (PaintBox1->Width*dFrontZoomRatio)) FrontMoveX += 50*dFrontZoomRatio; if (FrontMoveX > (PaintBox1->Width*dFrontZoomRatio)) FrontMoveX = (PaintBox1->Width*dFrontZoomRatio); PaintBox1->Repaint(); } else if (PageFront->ActivePage == TabBack) { if (BackMoveX < (PaintBox2->Width*dBackZoomRatio)) BackMoveX += 50*dBackZoomRatio; if (BackMoveX > (PaintBox2->Width*dBackZoomRatio)) BackMoveX = (PaintBox2->Width*dBackZoomRatio); PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::btTraitMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TSpeedButton *bt = (TSpeedButton *)Sender; // Component À̸§À» ã±â À§Çؼ­.. - by monkman (2004.04.07) String CompName; TShape *sh; CompName = bt->Name; CompName = "sh" + CompName.SubString(3, CompName.Length()); sh = (TShape *)FindComponent(CompName); if (bt) bt->Down = false; if (sh == NULL) return; if (Button == mbRight) { if (sh->Pen->Color == 0x00FEE004 || sh->Pen->Color == 0x004B04FE) { sh->Pen->Color = 0x00050505; sh->Repaint(); } } } //--------------------------------------------------------------------------- // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÆÐ³ÎÀÌ È°¼ºÈ­/ºñȰ¼ºÈ­ ¿©ºÎ - by monkman void __fastcall TDataTransForm::BitBtnPatternClick(TObject *Sender) { bool bDonnotResize = false; BitBtnPattern->Down = !PatternPanel->Visible; PatternPanel->Visible = !PatternPanel->Visible; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÆÐ³ÎÀÌ º¸À϶§.. if (PatternPanel->Visible == true) { bDonnotResize = pnSizeInformation->Visible; pnSizeInformation->SendToBack(); pnSizeInformation->Visible = false; PatternPanel->BringToFront(); PatternPanel->Visible = true; if (bDonnotResize == false) { if (StylePanel->Left != 10) { StylePanel->Left = 240; Left = (Screen->Width - Width); Top = 0; Width = 1020; } else { StylePanel->Left = PatternPanel->Left + PatternPanel->Width + 10; Width = PatternPanel->Width + StylePanel->Width + 24; Left = (Screen->Width - Width); Top = 0; } } } // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÆÐ³ÎÀÌ º¸ÀÌÁö ¾ÊÀ»¶§.. else { PatternPanel->Visible = false; StylePanel->Left = 10; Width = StylePanel->Width + 16; Left = (Screen->Width - Width); Top = 0; } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnSizeInformationClick(TObject *Sender) { bool bDonnotResize = false; spdbtnSizeInformation->Down = !pnSizeInformation->Visible; pnSizeInformation->Visible = !pnSizeInformation->Visible; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÆÐ³ÎÀÌ º¸À϶§.. if (pnSizeInformation->Visible == true) { bDonnotResize = PatternPanel->Visible; PatternPanel->SendToBack(); PatternPanel->Visible = false; pnSizeInformation->BringToFront(); pnSizeInformation->Visible = true; if (bDonnotResize == false) { if (StylePanel->Left != 10) { StylePanel->Left = 240; //Left = 259; Width = 1020; Left = (Screen->Width - Width); Top = 0; } else { StylePanel->Left = pnSizeInformation->Left + pnSizeInformation->Width + 10; Width = pnSizeInformation->Width + StylePanel->Width + 24; Left = (Screen->Width - Width); Top = 0; } } } // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÆÐ³ÎÀÌ º¸ÀÌÁö ¾ÊÀ»¶§.. else { pnSizeInformation->Visible = false; StylePanel->Left = 10; Width = StylePanel->Width + 16; Left = (Screen->Width - Width); Top = 0; } } //--------------------------------------------------------------------------- // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - ÆäÀÎÆ® ¹Ú½º¸¦ Ŭ¸¯ÇßÀ» ¶§ ¼±ÅÃµÈ ¿µ¿ªÀÇ ÆÐÅÏÀ» °¡Á®¿Â´Ù void __fastcall TDataTransForm::PaintBox3Click(TObject *Sender) { HDC dcSrc = NULL, dcDst = NULL; RECT Src = MainImageForm->WorkArea->Range; if (!MainImageForm->WorkArea->Mask) return; if (IllustBitmap == NULL) IllustBitmap = new TTexpiaBitmap; IllustBitmap->Create(Src.right-Src.left, Src.bottom-Src.top, 24); //if ((dcSrc = MainImageForm->iMainImage->Bitmap->CreateDC())==NULL) goto next; if ((dcDst = IllustBitmap->CreateDC())==NULL) goto next; MainImageForm->iMainImage->uBitmap->UnionBitBlt(dcDst, 0,0, IllustBitmap->Width, IllustBitmap->Height, Src.left, Src.top, SRCCOPY, false); next: //if(dcSrc) MainImageForm->iMainImage->Bitmap->DeleteDC(dcSrc); dcSrc = NULL; if(dcDst) IllustBitmap->DeleteDC(dcDst); dcDst = NULL; PaintBox3->Repaint(); } //--------------------------------------------------------------------------- // À̹ÌÁö º¯°æ ¾ÆÀÌÄÜÀ» Ŭ¸¯ÇßÀ»¶§ ĵ¹ö½º·ÎºÎÅÍ À̹ÌÁö¸¦ °¡Á®¿Â´Ù void __fastcall TDataTransForm::sbChangeImageFromCanvasClick( TObject *Sender) { if (!MainImageForm->WorkArea->Mask) return; if (IllustBitmap != NULL) { // Message : "ĵ¹ö½º¿¡ ¼±ÅõǾîÀÖ´Â À̹ÌÁö·Î º¯°æÇϽðڽÀ´Ï±î?" if (MessageDlg(IDS_MESSAGE6, mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { PaintBox3Click(this); } } else { PaintBox3Click(this); } } //--------------------------------------------------------------------------- // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - °¡Á®¿Â ¼±ÅÃµÈ ¿µ¿ªÀÇ ÆÐÅÏÀ» ÆäÀÎÆ®¹Ú½º¿¡ ±×¸°´Ù void __fastcall TDataTransForm::PaintBox3Paint(TObject *Sender) { HDC dcSrc = NULL; int width, height; if(!IllustBitmap) goto next; if ((dcSrc = IllustBitmap->CreateDC())==NULL) goto next; // ¾î´ÀÂÊÀÌ ÀåÃàÀÎÁö ºñ±³.. ÀåÃà¿¡ µû¶ó ºñÀ²ÀÌ °áÁ¤µÇ°í ±× ºñÀ²¿¡ µû¶ó // ÆäÀÎÆ® ¹Ú½º¿¡ ±×¸°´Ù if (IllustBitmap->Width >= IllustBitmap->Height) { // Á÷Á¢ ±×¸®´Â ºÎºÐº¸´Ù Ŭ¶§¸¸.. Ãà¼Ò.. if (IllustBitmap->Width >= PaintBox3->Width) { width = double(double(IllustBitmap->Width) * (200.0 / double(IllustBitmap->Width))) + 0.5; height = double(double(IllustBitmap->Height) * (200.0 / double(IllustBitmap->Width))) + 0.5; } else { width = IllustBitmap->Width; height = IllustBitmap->Height; } } else { // Á÷Á¢ ±×¸®´Â ºÎºÐº¸´Ù Ŭ¶§¸¸.. Ãà¼Ò.. if (IllustBitmap->Height >= PaintBox3->Height) { width = double(double(IllustBitmap->Width) * (250.0 / double(IllustBitmap->Height))) + 0.5; height = double(double(IllustBitmap->Height) * (250.0 / double(IllustBitmap->Height))) + 0.5; } else { width = IllustBitmap->Width; height = IllustBitmap->Height; } } SetStretchBltMode(PaintBox3->Canvas->Handle, COLORONCOLOR); StretchBlt(PaintBox3->Canvas->Handle, 0,0, width, height, dcSrc, 0,0, IllustBitmap->Width, IllustBitmap->Height, SRCCOPY); next: if(dcSrc) IllustBitmap->DeleteDC(dcSrc); dcSrc = NULL; } //--------------------------------------------------------------------------- // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÀúÀå - by monkman void __fastcall TDataTransForm::sbPatSaveClick(TObject *Sender) { // ÆÄÀÏ Çì´õ¿ë HANDLE hFile = INVALID_HANDLE_VALUE; // µ¥ÀÌÅÍ¿ë TVecData *data; DWORD dwWrite; String filename, temp; char *tempchar = "\\"; // Tag¿ë HDC dcTagSrc = NULL; HDC dcTagDst = NULL; TTexpiaBitmap *tag = NULL; int width, height, w, h, bpp; if (!ComboIllustYear->Text.IsEmpty()) { try { if (StrToInt(ComboIllustYear->Text) >= 0) { IllustHeader.Year = StrToInt(ComboIllustYear->Text); } else { // ¸Þ½ÃÁö : "¿¬µµ´Â ¾ç¼ö¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE14, mtError, TMsgDlgButtons() << mbOK, 0); } } catch (Exception &e) { // ¸Þ½ÃÁö : "ÀԷ¿¡·¯", "¿¬µµ´Â ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE2, mtError, TMsgDlgButtons() << mbOK, 0); return; } } // »óÀÇ ¶Ç´Â ÇÏÀǰ¡ ¿ÏÀüÇÏ°Ô ¸¸µé¾îÁöÁö ¾Ê¾Ò½À´Ï´Ù. ¿ÏÀüÇÏÁö ¾ÊÀº ³»¿ëÀº ÀúÀåµÇÁö ¾Ê½À´Ï´Ù. // °è¼ÓÇϽðڽÀ´Ï±î? - ¸Þ½ÃÁö // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - »óÀǵç ÇÏÀÇµç ¿ÏÀüÇÏ°Ô µÈ °Í¸¸(³ªÁß¿¡ ¼öÁ¤) - by monkman // »óÀÇ, ÇÏÀǰ¡ -- ¸ðµÎ OK°¡ ¾Æ´Ñ °æ¿ì ±×³É Áö³ª°¨ if (LabelPatUpSilType->Font->Color != clWindowText && LabelPatUpSil->Font->Color != clWindowText && LabelPatUpWhole->Font->Color != clWindowText && LabelPatDnSil->Font->Color != clWindowText && LabelPatDnWhole->Font->Color != clWindowText) return; else { // ÀüºÎ ¼±ÅõǾúÀ» °æ¿ì if ((LabelPatUpSilType->Font->Color == clWindowText && LabelPatUpSil->Font->Color == clWindowText && LabelPatUpWhole->Font->Color == clWindowText && LabelPatDnSil->Font->Color == clWindowText && LabelPatDnWhole->Font->Color == clWindowText) && (IllustBitmap != NULL)) goto Process; // »óÀǸ¸ ¼±ÅõǾúÀ» °æ¿ì - Á¶°Ç : Top Whole Style°ú Top Silhouette¸¸ µÇ¸é ÀúÀå °¡´É if ((LabelPatUpSilType->Font->Color == clWindowText && LabelPatUpSil->Font->Color == clWindowText && LabelPatUpWhole->Font->Color == clWindowText) && (LabelPatDnSil->Font->Color != clWindowText && LabelPatDnBelt->Font->Color != clWindowText && LabelPatDnWhole->Font->Color != clWindowText) && (IllustBitmap != NULL)) goto Process; // ÇÏÀǸ¸ ¼±ÅõǾúÀ» °æ¿ì - Á¶°Ç : Bottom Whole Style°ú Bottom Silhouette¸¸ µÇ¸é ÀúÀå °¡´É if ((LabelPatUpSilType->Font->Color != clWindowText && LabelPatUpSil->Font->Color != clWindowText && LabelPatUpSle->Font->Color != clWindowText && LabelPatUpCol->Font->Color != clWindowText && LabelPatUpWhole->Font->Color != clWindowText) && (LabelPatDnSil->Font->Color == clWindowText && LabelPatDnWhole->Font->Color == clWindowText) && (IllustBitmap != NULL)) goto Process; if (IllustBitmap == NULL) { // ¸Þ½ÃÁö : "»çÁø À̹ÌÁö°¡ ¾ø¾î¼­ ÀúÀåÇÒ ¼ö ¾ø½À´Ï´Ù" MessageDlg(IDS_MESSAGE7, mtError, TMsgDlgButtons() << mbOK, 0); // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; } // »ó, ÇÏ ¼¯¿©¼­ ¼±ÅõǾúÀ» °æ¿ì // ¸Þ½ÃÁö : "»óÀÇ ¶Ç´Â ÇÏÀǰ¡ ¿ÏÀüÇÏ°Ô ¸¸µé¾îÁöÁö ¾Ê¾Ò½À´Ï´Ù. ¿ÏÀüÇÏÁö ¾ÊÀº ³»¿ëÀº ÀúÀåÀÌ µÇÁö ¾Ê½À´Ï´Ù. °è¼ÓÇϽðڽÀ´Ï±î?" if (MessageDlg(IDS_MESSAGE8, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrNo) { // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; } } // °è¼Ó ÁøÇà Process : // Çì´õ ÃʱâÈ­ IllustHeader.Version = STYSTIFileVersion; if (!ComboIllustYear->Text.IsEmpty()) { IllustHeader.Year = StrToInt(ComboIllustYear->Text); } // Spring, Summer, Fall, Winter üũ - by monkman (2004.04.14) for (int i = 0; i < clbSSFW->Count; i++) { if (clbSSFW->Checked[i]) { switch (i) { // Spring case 0 : IllustHeader.SSFW += 1; break; // Summer case 1 : IllustHeader.SSFW += 2; break; // Fall case 2 : IllustHeader.SSFW += 4; break; // Winter case 3 : IllustHeader.SSFW += 8; break; default : IllustHeader.SSFW = 0; break; } } } // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - »óÀǵç ÇÏÀÇµç ¿ÏÀüÇÏ°Ô µÈ °Í¸¸(³ªÁß¿¡ ¼öÁ¤) - by monkman // »óÀÇ - Á¶°Ç : Top Whole Style°ú Top Silhouette¸¸ µÇ¸é ÀúÀå °¡´É IllustHeader.UpDown = SORT_NONE; // ÃʱâÈ­ if (!(LabelPatUpSilType->Font->Color == clWindowText && LabelPatUpSil->Font->Color && LabelPatUpWhole->Font->Color == clWindowText)) { // ¿ÏÀüÇÏÁö ¾ÊÀº °ÍÀº ÀúÀåÇÏÁö ¾Ê´Â´Ù.. // Top Whole Style LabelPatUpWhole->Caption = "Top Whole Style"; LabelPatUpWhole->Font->Color = clSilver; LabelIllustUpWhole->Caption = ""; // Top Silhouette Type LabelPatUpSilType->Caption = "Top Type"; LabelPatUpSilType->Font->Color = clSilver; LabelIllustUpSilType->Caption = ""; // Top Silhouette LabelPatUpSil->Caption = "Top Silhouette"; LabelPatUpSil->Font->Color = clSilver; LabelIllustUpSil->Caption = ""; // Top Sleeve LabelPatUpSle->Caption = "Top Sleeve"; LabelPatUpSle->Font->Color = clSilver; LabelIllustUpSle->Caption = ""; // Top Collar LabelPatUpCol->Caption = "Top Collar"; LabelPatUpCol->Font->Color = clSilver; LabelIllustUpCol->Caption = ""; } else { // Top Silhouette if (LabelPatUpSil->Font->Color == clWindowText) IllustHeader.UpDown += SORT_TOPSILHOUETTE; // Top Sleeve if (LabelPatUpSle->Font->Color == clWindowText) IllustHeader.UpDown += SORT_TOPSLEEVE; // Top Collar if (LabelPatUpCol->Font->Color == clWindowText) IllustHeader.UpDown += SORT_TOPCOLLAR; // Top Whole Style if (LabelPatUpWhole->Font->Color == clWindowText) IllustHeader.UpDown += SORT_TOPWHOLESTYLE; } // ÇÏÀÇ - Á¶°Ç : Bottom Whole Style°ú Bottom Silhouette¸¸ µÇ¸é ÀúÀå °¡´É if (!(LabelPatDnSil->Font->Color == clWindowText && LabelPatDnWhole->Font->Color == clWindowText)) { // ¿ÏÀüÇÏÁö ¾ÊÀº °ÍÀº ÀúÀåÇÏÁö ¾Ê´Â´Ù.. // Bottom Whole Style LabelPatDnWhole->Caption = "Bottom Whole Style"; LabelPatDnWhole->Font->Color = clSilver; LabelIllustDnWhole->Caption = ""; // Bottom Silhouette LabelPatDnSil->Caption = "Bottom Silhouette"; LabelPatDnSil->Font->Color = clSilver; LabelIllustDnSil->Caption = ""; // Bottom Belt LabelPatDnBelt->Caption = "Bottom Belt"; LabelPatDnBelt->Font->Color = clSilver; LabelIllustDnBelt->Caption = ""; } else { // Bottom Silhouette if (LabelPatDnSil->Font->Color == clWindowText) IllustHeader.UpDown += SORT_BOTTOMSILHOUETTE; // Bottom Belt if (LabelPatDnBelt->Font->Color == clWindowText) IllustHeader.UpDown += SORT_BOTTOMBELT; // Bottom Whole Style if (LabelPatDnWhole->Font->Color == clWindowText) IllustHeader.UpDown += SORT_BOTTOMWHOLESTYLE; } // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clRed; //sbChangeImage->Enabled = false; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = false; shSave->Pen->Color = clBlack; // ÆÄÀÏ °ü·Ã if (!SaveDialog2->Execute()) { // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; } else { // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; } if (cbPYW->Checked) filename = SaveDialog2->FileName; else { filename = SaveDialog2->FileName; while (char(filename[filename.Length()]) != *tempchar) { temp = String(filename[filename.Length()]) + temp; filename.SetLength(filename.Length()-1); } filename = filename + "USER_Illust" + temp; } if ((hFile = CreateFile(filename.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW , FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) { if (MessageDlg(IDS_MESSAGE4, mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { if ((hFile = CreateFile(filename.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS , FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; }else { shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; } } if(IllustHeader.Version <= 205){ ShowMessage("Low Version"); goto fail; } // 1. Çì´õ¸¦ ¾´´Ù strcpy(IllustHeader.FileType, "StylistIllustFile\0"); if (!WriteFile(hFile, &IllustHeader, sizeof(IllustHeader), &dwWrite, NULL)) goto fail; // 2. Tag¸¦ ¾´´Ù tag = new TTexpiaBitmap; if (!(tag->Create(200, 250, 24))) goto fail; tag->FillRect(Rect(0, 0, 200, 250), clWhite); if ((dcTagDst = tag->CreateDC())==NULL) goto fail; if(!IllustBitmap) return; if ((dcTagSrc = IllustBitmap->CreateDC())==NULL) goto fail; // ¾î´ÀÂÊÀÌ ÀåÃàÀÎÁö ºñ±³.. ÀåÃà¿¡ µû¶ó ºñÀ²ÀÌ °áÁ¤µÇ°í ±× ºñÀ²¿¡ µû¶ó // ÆäÀÎÆ® ¹Ú½º¿¡ ±×¸°´Ù if (IllustBitmap->Width >= IllustBitmap->Height) { width = double(double(IllustBitmap->Width) * (200.0 / double(IllustBitmap->Width))) + 0.5; height = double(double(IllustBitmap->Height) * (200.0 / double(IllustBitmap->Width))) + 0.5; } else { width = double(double(IllustBitmap->Width) * (250.0 / double(IllustBitmap->Height))) + 0.5; height = double(double(IllustBitmap->Height) * (250.0 / double(IllustBitmap->Height))) + 0.5; } SetStretchBltMode(dcTagDst, COLORONCOLOR); StretchBlt(dcTagDst, 0,0, width, height, dcTagSrc, 0,0, IllustBitmap->Width, IllustBitmap->Height, SRCCOPY); IllustBitmap->DeleteDC(dcTagSrc); tag->DeleteDC(dcTagDst); dcTagDst = NULL; if (!tag->SaveToTexpiaFile(hFile, cmNone)) goto fail; if (tag) { delete tag; tag = NULL; } // 3. Data¸¦ ¾´´Ù // Top Silhouette if (LabelPatUpSilType->Font->Color == clWindowText && LabelPatUpSil->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatUpSil, hFile, filename, PatUpSil)) goto fail; } // Top Sleeve if (LabelPatUpSle->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatUpSle, hFile, filename, PatUpSle)) goto fail; } // Top Collar if (LabelPatUpCol->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatUpCol, hFile, filename, PatUpCol)) goto fail; } // Top Whole Style if (LabelPatUpWhole->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatUpWhole, hFile, filename, PatUpWhole)) goto fail; } // Bottom Silhouette if (LabelPatDnSil->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatDnSil, hFile, filename, PatDnSil)) goto fail; } // Bottom Belt if (LabelPatDnBelt->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatDnBelt, hFile, filename, PatDnBelt)) goto fail; } // Bottom Whole Style if (LabelPatDnWhole->Font->Color == clWindowText) { if (!SaveToIllustFile(HDPatDnWhole, hFile, filename, PatDnWhole)) goto fail; } // 4. TTexpiaBitmapÀ» ¾´´Ù w = IllustBitmap->Width, h = IllustBitmap->Height; bpp = 24; if (!WriteFile(hFile, &w, sizeof(int), &dwWrite, NULL)) goto fail; if (!WriteFile(hFile, &h, sizeof(int), &dwWrite, NULL)) goto fail; if (!WriteFile(hFile, &bpp, sizeof(int), &dwWrite, NULL)) goto fail; if (!IllustBitmap->SaveToTexpiaFile(hFile, cmZLib)) goto fail; SetEndOfFile(hFile); CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; SaveDialog2->FileName = "*.sti"; // À̹ÌÁö ¹öư °ü·Ã sbPatSave->Enabled = true; shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; return; fail: CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; SaveDialog2->FileName = "*.sti"; if (dcTagSrc) IllustBitmap->DeleteDC(dcTagSrc); if (dcTagDst) tag->DeleteDC(dcTagDst); if (tag) { delete tag; tag = NULL; } // À̹ÌÁö ¹öư °ü·Ã sbPatSave->Enabled = true; shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; } //--------------------------------------------------------------------------- // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÀúÀå ó¸® ºÎºÐ - by monkman bool __fastcall TDataTransForm::SaveToIllustFile(STYLEDATAFILEHEADER header, HANDLE hFile, String filename, TList *list) { TVecData *data; DWORD dwWrite; String temp; // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman // int linecount, wordcount, lineheight; // TSWordData *srcWordData; header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) if (!WriteFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwWrite, NULL)) return false; for (int i = 0; i < header.Count1; i++) { data = (TVecData *)list->Items[i]; VecDraw->SaveToSTYFile(hFile, data, header.Version); } for (int i = header.Count1; i < (header.Count1+header.Count2); i++) { data = (TVecData *)list->Items[i]; VecDraw->SaveToSTYFile(hFile, data, header.Version); } return true; fail : return false; } //--------------------------------------------------------------------------- // À̹ÌÁö º¯°æ void __fastcall TDataTransForm::sbChangeImageClick(TObject *Sender) { // À̹ÌÁö ÆÄÀÏ ¹Ù²Ù±â¿ë TTexpiaBitmap *LoadImage = NULL, *CopyImage = NULL; TPalette *pPalette = NULL; String ext; int length; HANDLE fh = INVALID_HANDLE_VALUE; TPException ec = EC_NONE; RGBQUAD rgb[256]; if (LoadImage == NULL) LoadImage = new TTexpiaBitmap; if (CopyImage == NULL) CopyImage = new TTexpiaBitmap; // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = false; shChangeImage->Pen->Color = clRed; sbSave->Enabled = false; shSave->Pen->Color = clBlack; // À̹ÌÁö ÆÄÀÏÀ» Àоî¿À´Â ºÎºÐ.. if (OpenDialogChangeImage->Execute()) { if (FileExists(OpenDialogChangeImage->FileName)) { length = OpenDialogChangeImage->FileName.Length(); ext = ExtractFileExt(OpenDialogChangeImage->FileName); ext = ext.LowerCase(); if (ext == ".bmp") { if (!LoadImage->LoadFromFile(OpenDialogChangeImage->FileName)) {ec = EC_FILE_NOT_READ; goto fail;} }else if (ext == ".tex" || ext == ".tfc" || ext == ".wea" || ext == ".knt") { TEXPIAFILEHEADER tpfh; if ((pPalette = new TPalette)==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((fh = CreateFile(OpenDialogChangeImage->FileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) { ec = EC_MEMORY_LACK; goto fail; } if ((ec = LoadFromTexpiaFile(fh, pPalette, tpfh, LoadImage, FindExtension(ext)))!= EC_NONE) goto fail; CloseHandle(fh); }else { if (!LoadImage->LoadFromFile(OpenDialogChangeImage->FileName)) {ec = EC_FILE_NOT_READ; goto fail;} if (!(LoadImage->Width * LoadImage->Height)) {ec = EC_FILE_NOT_READ; goto fail;} } // Load µÈ Image¸¦ IllustImage¿¡ º¹»ç if (IllustBitmap == NULL) { IllustBitmap = new TTexpiaBitmap; } else { CopyImage->Copy(IllustBitmap, SRCCOPY); } // ¹«Á¶°Ç FullColor·Î ÀúÀåµÇµµ·Ï º¯°æ - by monkman (2011.04.21) IllustBitmap->Create(LoadImage->Width, LoadImage->Height, 24, rgb); if (LoadImage->BitsPerPixel == 8) { LoadImage->GetColors(0, 256, rgb); } IllustBitmap->Copy(LoadImage, SRCCOPY); PaintBox3->Repaint(); // ¸Þ½ÃÁö : "À̹ÌÁö¸¦ ¹Ù²Ù½Ã°Ú½À´Ï±î?" if (MessageDlg(IDS_MESSAGE9, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrNo) { if (CopyImage == NULL) { if (IllustBitmap) { delete IllustBitmap; IllustBitmap = NULL; } } else { if (IllustBitmap != NULL) { IllustBitmap->Destroy(); } IllustBitmap->Copy(CopyImage, SRCCOPY); } } if (pPalette) { delete pPalette; pPalette = NULL; } if (LoadImage) { delete LoadImage; LoadImage = NULL; } if (CopyImage) { delete CopyImage; CopyImage = NULL; } } } // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; PaintBox3->Repaint(); fail: if (pPalette) { delete pPalette; pPalette = NULL; } if (LoadImage) { delete LoadImage; LoadImage = NULL; } if (CopyImage) { delete CopyImage; CopyImage = NULL; } // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; sbSave->Enabled = true; shSave->Pen->Color = clBlack; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbTopClick(TObject *Sender) { // Bottom Whole Clock - by monkman (2004.04.06) TSpeedButton *sbSelectedStyle = (TSpeedButton *)Sender; // Component À̸§À» ã±â À§Çؼ­.. - by monkman (2004.04.07) TShape *shSelectedStyle; String CompName; TVecData *data = NULL; CompName = sbSelectedStyle->Name; CompName = "sh" + CompName.SubString(3, CompName.Length()); shSelectedStyle = (TShape *)FindComponent(CompName); if (shSelectedStyle != NULL) { if (pnTopWhole->Visible) { shTopWholeFrontStyle->Pen->Color = clBlack; shTopWholeBackStyle->Pen->Color = clBlack; } if (pnTopSilhouette->Visible) { shTopSilhouetteFrontStyle->Pen->Color = clBlack; shTopSilhouetteBackStyle->Pen->Color = clBlack; } if (pnTopSleeve->Visible) { shTopSleeveFrontStyle->Pen->Color = clBlack; shTopSleeveBackStyle->Pen->Color = clBlack; } if (pnTopCollar->Visible) { shTopCollarFrontStyle->Pen->Color = clBlack; shTopCollarBackStyle->Pen->Color = clBlack; } // ¼±Åà shSelectedStyle->Pen->Color = clRed; } pnTopWhole->Visible = false; pnTopWholeFront->Visible = false; pnTopWholeBack->Visible = false; pnTopWholeRaglanFront->Visible = false; pnTopWholeRaglanBack->Visible = false; pnTopSilhouette->Visible = false; pnTopSilhouetteFront->Visible = false; pnTopSilhouetteBack->Visible = false; pnTopSilhouetteRaglanFront->Visible= false; pnTopSilhouetteRaglanBack->Visible = false; pnTopSleeve->Visible = false; pnTopSleeveFront->Visible = false; pnTopSleeveBack->Visible = false; pnTopSleeveRaglanFront->Visible = false; pnTopSleeveRaglanBack->Visible = false; pnTopCollar->Visible = false; pnTopCollarFront->Visible = false; pnTopCollarBack->Visible = false; pnTopCollarRaglanFront->Visible = false; pnTopCollarRaglanBack->Visible = false; pnBottomWhole->Visible = false; pnBottomWholeFront->Visible = false; pnBottomWholeBack->Visible = false; pnBottomWholeSkirtFront->Visible = false; pnBottomWholeSkirtBack->Visible = false; pnBottomSilhouette->Visible = false; pnBottomSilhouetteFront->Visible = false; pnBottomSilhouetteBack->Visible = false; pnBottomSilhouetteSkirtFront->Visible = false; pnBottomSilhouetteSkirtBack->Visible = false; pnBottomBelt->Visible = false; pnBottomBeltFront->Visible = false; pnBottomBeltBack->Visible = false; pnBottomBeltSkirtFront->Visible = false; pnBottomBeltSkirtBack->Visible = false; pnMaterial->Visible = false; // ºÎÀÚÀçÀÇ °æ¿ì µÞÆÇÀ» ºñȰ¼ºÈ­ ½Ã۱⠶§¹®¿¡ ÀÏ´Ü ´Ù½Ã Ȱ¼ºÈ­ ½ÃŲ´Ù - by monkman (2011.02.21) PageFront->Enabled = true; spdbtnBringToBackObjects->Enabled = true; // Top Whole Style if (rbTopWhole->Checked && combobxUpperLower->ItemIndex == 0) { pnTopWhole->BringToFront(); pnTopWhole->Visible = true; // Normal if (shTopWholeFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopWholeFrontStyle->Pen->Color = clRed; shTopWholeBackStyle->Pen->Color = clBlack; pnTopWholeFront->BringToFront(); pnTopWholeFront->Visible = true; pnCurrentPanel = pnTopWholeFront; PageFront->ActivePage = TabFront; } if (shTopWholeBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopWholeFrontStyle->Pen->Color = clBlack; shTopWholeBackStyle->Pen->Color = clRed; pnTopWholeBack->BringToFront(); pnTopWholeBack->Visible = true; pnCurrentPanel = pnTopWholeBack; PageFront->ActivePage = TabBack; } // Raglan if (shTopWholeFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { shTopWholeFrontStyle->Pen->Color = clRed; shTopWholeBackStyle->Pen->Color = clBlack; pnTopWholeRaglanFront->BringToFront(); pnTopWholeRaglanFront->Visible = true; pnCurrentPanel = pnTopWholeRaglanFront; PageFront->ActivePage = TabFront; } if (shTopWholeBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { shTopWholeFrontStyle->Pen->Color = clBlack; shTopWholeBackStyle->Pen->Color = clRed; pnTopWholeRaglanBack->BringToFront(); pnTopWholeRaglanBack->Visible = true; pnCurrentPanel = pnTopWholeRaglanBack; PageFront->ActivePage = TabBack; } } // Top Silhouette if (rbTopSilhouette->Checked && combobxUpperLower->ItemIndex == 0) { pnTopSilhouette->BringToFront(); pnTopSilhouette->Visible = true; // Normal if (shTopSilhouetteFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopSilhouetteFrontStyle->Pen->Color = clRed; shTopSilhouetteBackStyle->Pen->Color = clBlack; pnTopSilhouetteFront->BringToFront(); pnTopSilhouetteFront->Visible = true; pnCurrentPanel = pnTopSilhouetteFront; PageFront->ActivePage = TabFront; } if (shTopSilhouetteBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopSilhouetteFrontStyle->Pen->Color = clBlack; shTopSilhouetteBackStyle->Pen->Color = clRed; pnTopSilhouetteBack->BringToFront(); pnTopSilhouetteBack->Visible = true; pnCurrentPanel = pnTopSilhouetteBack; PageFront->ActivePage = TabBack; } // Raglan if (shTopSilhouetteFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { ComboTopSilhouetteType->ItemIndex = 2; shTopSilhouetteFrontStyle->Pen->Color = clRed; shTopSilhouetteBackStyle->Pen->Color = clBlack; pnTopSilhouetteRaglanFront->BringToFront(); pnTopSilhouetteRaglanFront->Visible = true; pnCurrentPanel = pnTopSilhouetteRaglanFront; PageFront->ActivePage = TabFront; } if (shTopSilhouetteBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { ComboTopSilhouetteType->ItemIndex = 2; shTopSilhouetteFrontStyle->Pen->Color = clBlack; shTopSilhouetteBackStyle->Pen->Color = clRed; pnTopSilhouetteRaglanBack->BringToFront(); pnTopSilhouetteRaglanBack->Visible = true; pnCurrentPanel = pnTopSilhouetteRaglanBack; PageFront->ActivePage = TabBack; } } // Top Sleeve if (rbTopSleeve->Checked && combobxUpperLower->ItemIndex == 0) { pnTopSleeve->BringToFront(); pnTopSleeve->Visible = true; // Normal if (shTopSleeveFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopSleeveFrontStyle->Pen->Color = clRed; shTopSleeveBackStyle->Pen->Color = clBlack; pnTopSleeveFront->BringToFront(); pnTopSleeveFront->Visible = true; pnCurrentPanel = pnTopSleeveFront; PageFront->ActivePage = TabFront; } if (shTopSleeveBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopSleeveFrontStyle->Pen->Color = clBlack; shTopSleeveBackStyle->Pen->Color = clRed; pnTopSleeveBack->BringToFront(); pnTopSleeveBack->Visible = true; pnCurrentPanel = pnTopSleeveBack; PageFront->ActivePage = TabBack; } // Raglan if (shTopSleeveFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { shTopSleeveFrontStyle->Pen->Color = clRed; shTopSleeveBackStyle->Pen->Color = clBlack; pnTopSleeveRaglanFront->BringToFront(); pnTopSleeveRaglanFront->Visible = true; pnCurrentPanel = pnTopSleeveRaglanFront; PageFront->ActivePage = TabFront; } if (shTopSleeveBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { shTopSleeveFrontStyle->Pen->Color = clBlack; shTopSleeveBackStyle->Pen->Color = clRed; pnTopSleeveRaglanBack->BringToFront(); pnTopSleeveRaglanBack->Visible = true; pnCurrentPanel = pnTopSleeveRaglanBack; PageFront->ActivePage = TabBack; } } // Top Collar if (rbTopCollar->Checked && combobxUpperLower->ItemIndex == 0) { pnTopCollar->BringToFront(); pnTopCollar->Visible = true; // Normal if (shTopCollarFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopCollarFrontStyle->Pen->Color = clRed; shTopCollarBackStyle->Pen->Color = clBlack; pnTopCollarFront->BringToFront(); pnTopCollarFront->Visible = true; pnCurrentPanel = pnTopCollarFront; PageFront->ActivePage = TabFront; } if (shTopCollarBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex != 1) { shTopCollarFrontStyle->Pen->Color = clBlack; shTopCollarBackStyle->Pen->Color = clRed; pnTopCollarBack->BringToFront(); pnTopCollarBack->Visible = true; pnCurrentPanel = pnTopCollarBack; PageFront->ActivePage = TabBack; } // Raglan if (shTopCollarFrontStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { shTopCollarFrontStyle->Pen->Color = clRed; shTopCollarBackStyle->Pen->Color = clBlack; pnTopCollarRaglanFront->BringToFront(); pnTopCollarRaglanFront->Visible = true; pnCurrentPanel = pnTopCollarRaglanFront; PageFront->ActivePage = TabFront; } if (shTopCollarBackStyle->Pen->Color == clRed && ComboTopWholeType->ItemIndex == 1) { shTopCollarFrontStyle->Pen->Color = clBlack; shTopCollarBackStyle->Pen->Color = clRed; pnTopCollarRaglanBack->BringToFront(); pnTopCollarRaglanBack->Visible = true; pnCurrentPanel = pnTopCollarRaglanBack; PageFront->ActivePage = TabBack; } } #ifdef WORKSHEET // Upper Material if (rbTopMaterial->Checked && combobxUpperLower->ItemIndex == 0) { rzshelltreeMaterialExplorer->BaseFolder->PathName = strMaterialRootPath; lbMaterialDirectory->Caption = strMaterialRootPath; // MaterialÀº ¾ÕÆÇ¸¸ ÀúÀåÇϵµ·Ï À¯µµ - by monkman (2011.01.19) PageFront->ActivePage = TabFront; // ºÎÀÚÀçÀÇ °æ¿ì µÞÆÇÀ» ºñȰ¼ºÈ­ ½Ã۱⠶§¹®¿¡ ÀÏ´Ü ´Ù½Ã Ȱ¼ºÈ­ ½ÃŲ´Ù - by monkman (2011.02.21) PageFront->Enabled = true; spdbtnBringToBackObjects->Enabled = false; // µÞÆÇ ÃʱâÈ­ if (VecDraw->TransList2) { for (int i = 0; i < VecDraw->TransList2->Count; i++) { data = (TVecData *)VecDraw->TransList2->Items[i]; if (data) delete data; data = NULL; } VecDraw->TransList2->Clear(); } ObjectCount2 = 0; memset(TempNumber2, 0, sizeof(int)*80); PaintBox2->Repaint(); pnMaterial->BringToFront(); pnMaterial->Visible = true; } #endif // ÀÌÀü Panel¿¡¼­ ¸¶Áö¸· ´­·ÁÁ³´ø ¹öưÀ» ã¾Æ¼­ ÀÚµ¿À¸·Î Ŭ¸¯ÇØÁØ´Ù - by monkman (2004.11.05) PanelSelectButtonAutoClick(); // ÀúÀå °¡´ÉÇÑÁö üũ STYSaveCheck(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbBottomClick(TObject *Sender) { // Bottom Whole Clock - by monkman (2004.04.06) TSpeedButton *sbSelectedStyle = (TSpeedButton *)Sender; // Component À̸§À» ã±â À§Çؼ­.. - by monkman (2004.04.07) TShape *shSelectedStyle; String CompName; TVecData *data = NULL; CompName = sbSelectedStyle->Name; CompName = "sh" + CompName.SubString(3, CompName.Length()); shSelectedStyle = (TShape *)FindComponent(CompName); if (shSelectedStyle != NULL) { if (pnBottomWhole->Visible) { shBottomWholeFrontStyle->Pen->Color = clBlack; shBottomWholeBackStyle->Pen->Color = clBlack; } if (pnBottomSilhouette->Visible) { shBottomSilhouetteFrontStyle->Pen->Color = clBlack; shBottomSilhouetteBackStyle->Pen->Color = clBlack; } if (pnBottomBelt->Visible) { shBottomBeltFrontStyle->Pen->Color = clBlack; shBottomBeltBackStyle->Pen->Color = clBlack; } // ¼±Åà shSelectedStyle->Pen->Color = clRed; } pnTopWhole->Visible = false; pnTopWholeFront->Visible = false; pnTopWholeBack->Visible = false; pnTopWholeRaglanFront->Visible = false; pnTopWholeRaglanBack->Visible = false; pnTopSilhouette->Visible = false; pnTopSilhouetteFront->Visible = false; pnTopSilhouetteBack->Visible = false; pnTopSilhouetteRaglanFront->Visible= false; pnTopSilhouetteRaglanBack->Visible = false; pnTopSleeve->Visible = false; pnTopSleeveFront->Visible = false; pnTopSleeveBack->Visible = false; pnTopSleeveRaglanFront->Visible = false; pnTopSleeveRaglanBack->Visible = false; pnTopCollar->Visible = false; pnTopCollarFront->Visible = false; pnTopCollarBack->Visible = false; pnTopCollarRaglanFront->Visible = false; pnTopCollarRaglanBack->Visible = false; pnBottomWhole->Visible = false; pnBottomWholeFront->Visible = false; pnBottomWholeBack->Visible = false; pnBottomWholeSkirtFront->Visible = false; pnBottomWholeSkirtBack->Visible = false; pnBottomSilhouette->Visible = false; pnBottomSilhouetteFront->Visible = false; pnBottomSilhouetteBack->Visible = false; pnBottomSilhouetteSkirtFront->Visible = false; pnBottomSilhouetteSkirtBack->Visible = false; pnBottomBelt->Visible = false; pnBottomBeltFront->Visible = false; pnBottomBeltBack->Visible = false; pnBottomBeltSkirtFront->Visible = false; pnBottomBeltSkirtBack->Visible = false; pnMaterial->Visible = false; // ºÎÀÚÀçÀÇ °æ¿ì µÞÆÇÀ» ºñȰ¼ºÈ­ ½Ã۱⠶§¹®¿¡ ÀÏ´Ü ´Ù½Ã Ȱ¼ºÈ­ ½ÃŲ´Ù - by monkman (2011.02.21) PageFront->Enabled = true; spdbtnBringToBackObjects->Enabled = true; // Bottom Whole Style if (rbBottomWhole->Checked && combobxUpperLower->ItemIndex == 1) { pnBottomWhole->BringToFront(); pnBottomWhole->Visible = true; // Pants if (TP_SKIRT != Type) { if (shBottomWholeFrontStyle->Pen->Color == clRed) { shBottomWholeFrontStyle->Pen->Color = clRed; shBottomWholeBackStyle->Pen->Color = clBlack; pnBottomWholeFront->BringToFront(); pnBottomWholeFront->Visible = true; pnCurrentPanel = pnBottomWholeFront; PageFront->ActivePage = TabFront; } if (shBottomWholeBackStyle->Pen->Color == clRed) { shBottomWholeFrontStyle->Pen->Color = clBlack; shBottomWholeBackStyle->Pen->Color = clRed; pnBottomWholeBack->BringToFront(); pnBottomWholeBack->Visible = true; pnCurrentPanel = pnBottomWholeBack; PageFront->ActivePage = TabBack; } // ¹ÙÁö¿Í Ä¡¸¶ÀÇ ±¸ºÐ - by monkman (2004.04.09) ComboBottomWholePantsSilhouette->BringToFront(); ComboBottomWholePantsSilhouette->Visible = true; ComboBottomWholeSkirtSilhouette->Visible = false; } // Skirt if (TP_SKIRT == Type) { if (shBottomWholeFrontStyle->Pen->Color == clRed) { shBottomWholeFrontStyle->Pen->Color = clRed; shBottomWholeBackStyle->Pen->Color = clBlack; pnBottomWholeSkirtFront->BringToFront(); pnBottomWholeSkirtFront->Visible = true; pnCurrentPanel = pnBottomWholeSkirtFront; PageFront->ActivePage = TabFront; } if (shBottomWholeBackStyle->Pen->Color == clRed) { shBottomWholeFrontStyle->Pen->Color = clBlack; shBottomWholeBackStyle->Pen->Color = clRed; pnBottomWholeSkirtBack->BringToFront(); pnBottomWholeSkirtBack->Visible = true; pnCurrentPanel = pnBottomWholeSkirtBack; PageFront->ActivePage = TabBack; } // ¹ÙÁö¿Í Ä¡¸¶ÀÇ ±¸ºÐ - by monkman (2004.04.09) ComboBottomWholeSkirtSilhouette->BringToFront(); ComboBottomWholePantsSilhouette->Visible = false; ComboBottomWholeSkirtSilhouette->Visible = true; } } // Bottom Silhouette if (rbBottomSilhouette->Checked && combobxUpperLower->ItemIndex == 1) { pnBottomSilhouette->BringToFront(); pnBottomSilhouette->Visible = true; // Pants if (TP_SKIRT != Type) { if (shBottomSilhouetteFrontStyle->Pen->Color == clRed) { shBottomSilhouetteFrontStyle->Pen->Color = clRed; shBottomSilhouetteBackStyle->Pen->Color = clBlack; pnBottomSilhouetteFront->BringToFront(); pnBottomSilhouetteFront->Visible = true; pnCurrentPanel = pnBottomSilhouetteFront; PageFront->ActivePage = TabFront; } if (shBottomSilhouetteBackStyle->Pen->Color == clRed) { shBottomSilhouetteFrontStyle->Pen->Color = clBlack; shBottomSilhouetteBackStyle->Pen->Color = clRed; pnBottomSilhouetteBack->BringToFront(); pnBottomSilhouetteBack->Visible = true; pnCurrentPanel = pnBottomSilhouetteBack; PageFront->ActivePage = TabBack; } // ¹ÙÁö¿Í Ä¡¸¶ÀÇ ±¸ºÐ - by monkman (2004.04.09) ComboBottomSilhouettePantsSilhouette->BringToFront(); ComboBottomSilhouettePantsSilhouette->Visible = true; ComboBottomSilhouetteSkirtSilhouette->Visible = false; } // Skirt if (TP_SKIRT == Type) { if (shBottomSilhouetteFrontStyle->Pen->Color == clRed) { shBottomSilhouetteFrontStyle->Pen->Color = clRed; shBottomSilhouetteBackStyle->Pen->Color = clBlack; pnBottomSilhouetteSkirtFront->BringToFront(); pnBottomSilhouetteSkirtFront->Visible = true; pnCurrentPanel = pnBottomSilhouetteSkirtFront; PageFront->ActivePage = TabFront; } if (shBottomSilhouetteBackStyle->Pen->Color == clRed) { shBottomSilhouetteFrontStyle->Pen->Color = clBlack; shBottomSilhouetteBackStyle->Pen->Color = clRed; pnBottomSilhouetteSkirtBack->BringToFront(); pnBottomSilhouetteSkirtBack->Visible = true; pnCurrentPanel = pnBottomSilhouetteSkirtBack; PageFront->ActivePage = TabBack; } // ¹ÙÁö¿Í Ä¡¸¶ÀÇ ±¸ºÐ - by monkman (2004.04.09) ComboBottomSilhouetteSkirtSilhouette->BringToFront(); ComboBottomSilhouettePantsSilhouette->Visible = false; ComboBottomSilhouetteSkirtSilhouette->Visible = true; } } // Bottom Belt if (rbBottomBelt->Checked && combobxUpperLower->ItemIndex == 1) { pnBottomBelt->BringToFront(); pnBottomBelt->Visible = true; // Pants if (TP_SKIRT != Type) { if (shBottomBeltFrontStyle->Pen->Color == clRed) { shBottomBeltFrontStyle->Pen->Color = clRed; shBottomBeltBackStyle->Pen->Color = clBlack; pnBottomBeltFront->BringToFront(); pnBottomBeltFront->Visible = true; pnCurrentPanel = pnBottomBeltFront; PageFront->ActivePage = TabFront; } if (shBottomBeltBackStyle->Pen->Color) { shBottomBeltFrontStyle->Pen->Color = clBlack; shBottomBeltBackStyle->Pen->Color = clRed; pnBottomBeltBack->BringToFront(); pnBottomBeltBack->Visible = true; pnCurrentPanel = pnBottomBeltBack; PageFront->ActivePage = TabBack; } } // Skirt if (TP_SKIRT == Type) { if (shBottomBeltFrontStyle->Pen->Color == clRed) { shBottomBeltFrontStyle->Pen->Color = clRed; shBottomBeltBackStyle->Pen->Color = clBlack; pnBottomBeltSkirtFront->BringToFront(); pnBottomBeltSkirtFront->Visible = true; pnCurrentPanel = pnBottomBeltSkirtFront; PageFront->ActivePage = TabFront; } if (shBottomBeltBackStyle->Pen->Color == clRed) { shBottomBeltFrontStyle->Pen->Color = clBlack; shBottomBeltBackStyle->Pen->Color = clRed; pnBottomBeltSkirtBack->BringToFront(); pnBottomBeltSkirtBack->Visible = true; pnCurrentPanel = pnBottomBeltSkirtBack; PageFront->ActivePage = TabBack; } } } #ifdef WORKSHEET // Lower Material if (rbBottomMaterial->Checked && combobxUpperLower->ItemIndex == 1) { rzshelltreeMaterialExplorer->BaseFolder->PathName = strMaterialRootPath; lbMaterialDirectory->Caption = strMaterialRootPath; // MaterialÀº ¾ÕÆÇ¸¸ ÀúÀåÇϹǷΠÀ¯µµ - by monkman (2011.01.19) PageFront->ActivePage = TabFront; // ºÎÀÚÀçÀÇ °æ¿ì µÞÆÇÀ» ºñȰ¼ºÈ­ ½Ã۱⠶§¹®¿¡ ÀÏ´Ü ´Ù½Ã Ȱ¼ºÈ­ ½ÃŲ´Ù - by monkman (2011.02.21) PageFront->Enabled = true; spdbtnBringToBackObjects->Enabled = false; // µÞÆÇ ÃʱâÈ­ if (VecDraw->TransList2) { for (int i = 0; i < VecDraw->TransList2->Count; i++) { data = (TVecData *)VecDraw->TransList2->Items[i]; if (data) delete data; data = NULL; } VecDraw->TransList2->Clear(); } ObjectCount2 = 0; memset(TempNumber2, 0, sizeof(int)*80); PaintBox2->Repaint(); pnMaterial->BringToFront(); pnMaterial->Visible = true; } #endif // ÀúÀå °¡´ÉÇÑÁö üũ STYSaveCheck(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::PageFrontChange(TObject *Sender) { if (PageFront->ActivePage == TabFront) { if (pnTopWhole->Visible) { sbTopWholeFrontStyle->Click(); sbTopWholeFrontStyle->Down = false; } if (pnTopSilhouette->Visible) { sbTopSilhouetteFrontStyle->Click(); sbTopSilhouetteFrontStyle->Down = false; } if (pnTopSleeve->Visible) { sbTopSleeveFrontStyle->Click(); sbTopSleeveFrontStyle->Down = false; } if (pnTopCollar->Visible) { sbTopCollarFrontStyle->Click(); sbTopCollarFrontStyle->Down = false; } if (pnBottomWhole->Visible) { sbBottomWholeFrontStyle->Click(); sbBottomWholeFrontStyle->Down = false; } if (pnBottomSilhouette->Visible) { sbBottomSilhouetteFrontStyle->Click(); sbBottomSilhouetteFrontStyle->Down = false; } if (pnBottomBelt->Visible) { sbBottomBeltFrontStyle->Click(); sbBottomBeltFrontStyle->Down = false; } } if (PageFront->ActivePage == TabBack) { if (pnTopWhole->Visible) { sbTopWholeBackStyle->Click(); sbTopWholeBackStyle->Down = false; } if (pnTopSilhouette->Visible) { sbTopSilhouetteBackStyle->Click(); sbTopSilhouetteBackStyle->Down = false; } if (pnTopSleeve->Visible) { sbTopSleeveBackStyle->Click(); sbTopSleeveBackStyle->Down = false; } if (pnTopCollar->Visible) { sbTopCollarBackStyle->Click(); sbTopCollarBackStyle->Down = false; } if (pnBottomWhole->Visible) { sbBottomWholeBackStyle->Click(); sbBottomWholeBackStyle->Down = false; } if (pnBottomSilhouette->Visible) { sbBottomSilhouetteBackStyle->Click(); sbBottomSilhouetteBackStyle->Down = false; } if (pnBottomBelt->Visible) { sbBottomBeltBackStyle->Click(); sbBottomBeltBackStyle->Down = false; } } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::ComboAutoChange(TObject *Sender) { // ComboBox¸¦ Whole Style¿¡ Á¤º¸¸¦ ÀÌ¿ëÇÏ¿© Silhouette, Sleeve µîÀÇ Á¤º¸¸¦ ÀÚµ¿À¸·Î ¼±ÅÃÇØÁØ´Ù TComboBox *combo = (TComboBox *)Sender; // Top Whole if (combobxUpperLower->ItemIndex == 0 && rbTopWhole->Checked == true && pnTopWhole->Visible == true) { // Top Type switch (ComboTopWholeType->ItemIndex) { case 0 : ComboTopSilhouetteType->ItemIndex = 0; break; case 1 : ComboTopSilhouetteType->ItemIndex = 2; break; default : ComboTopSilhouetteType->ItemIndex = 0; break; } // Top Silhouette ComboTopSilhouetteSilhouette->ItemIndex = ComboTopWholeSilhouette->ItemIndex; // Top Sleeve ComboTopSleeveSleeve->ItemIndex = ComboTopWholeSleeve->ItemIndex; // Top Collar ComboTopCollarCollar->ItemIndex = ComboTopWholeCollar->ItemIndex; } // Bottom Whole if (combobxUpperLower->ItemIndex == 1 && rbBottomWhole->Checked == true && pnBottomWhole->Visible == true) { // Bottom Silhouette // Pants ÀÏ‹š.. if (ComboBottomWholePantsSilhouette->Visible == true) { ComboBottomSilhouettePantsSilhouette->ItemIndex = ComboBottomWholePantsSilhouette->ItemIndex; } // Skirt À϶§.. if (ComboBottomWholeSkirtSilhouette->Visible == true) { ComboBottomSilhouetteSkirtSilhouette->ItemIndex = ComboBottomWholeSkirtSilhouette->ItemIndex; } // Belt ComboBottomBeltBelt->ItemIndex = ComboBottomWholeBelt->ItemIndex; } // ComboBoxÀÇ À̸§ÀÌ ComTopWholeTypeÀÌ¸é ¿©·¯°¡Áö RaglanÀÎÁö µîÀ» ¼ÂÆÃÇØÁÖ¾î¾ß ÇϹǷΠ// rbTopClick() ÇÔ¼ö¸¦ È£ÃâÇÑ´Ù - by monkman (2004.04.12) if (combo->Name == "ComboTopWholeType") rbTopClick(this); combo->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::STYSaveCheck() { // *.sty ÆÄÀÏÀÌ ÀúÀå °¡´ÉÇÑÁö üũÇÑ ÈÄ ÀúÀå¹öưÀ» Ȱ¼ºÈ­ÇÑ´Ù - by monkman (2004.04.13) // Æû º¯°æÀ¸·Î ÀÎÇÑ ¼öÁ¤ - by monkman (2004.04.07) // Top Whole Style - Normal if (combobxUpperLower->ItemIndex == 0 && (pnTopWholeFront->Visible || pnTopWholeBack->Visible)) { if (IsAllButtonDown(pnTopWholeFront) && IsAllButtonDown(pnTopWholeBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Whole Style - Raglan if (combobxUpperLower->ItemIndex == 0 && (pnTopWholeRaglanFront->Visible || pnTopWholeRaglanBack->Visible)) { if (IsAllButtonDown(pnTopWholeRaglanFront) && IsAllButtonDown(pnTopWholeRaglanBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Silhouette - Normal if (combobxUpperLower->ItemIndex == 0 && (pnTopSilhouetteFront->Visible || pnTopSilhouetteBack->Visible)) { if (IsAllButtonDown(pnTopSilhouetteFront) && IsAllButtonDown(pnTopSilhouetteBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Silhouette - Raglan if (combobxUpperLower->ItemIndex == 0 && (pnTopSilhouetteRaglanFront->Visible || pnTopSilhouetteRaglanBack->Visible)) { if (IsAllButtonDown(pnTopSilhouetteRaglanFront) && IsAllButtonDown(pnTopSilhouetteRaglanBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Sleeve - Normal if (combobxUpperLower->ItemIndex == 0 && (pnTopSleeveFront->Visible || pnTopSleeveBack->Visible)) { if (IsAllButtonDown(pnTopSleeveFront) && IsAllButtonDown(pnTopSleeveBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Sleeve - Raglan if (combobxUpperLower->ItemIndex == 0 && (pnTopSleeveRaglanFront->Visible || pnTopSleeveRaglanBack->Visible)) { if (IsAllButtonDown(pnTopSleeveRaglanFront) && IsAllButtonDown(pnTopSleeveRaglanBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Collar - Normal if (combobxUpperLower->ItemIndex == 0 && (pnTopCollarFront->Visible || pnTopCollarBack->Visible)) { if (IsAllButtonDown(pnTopCollarFront) && IsAllButtonDown(pnTopCollarBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Top Collar - Raglan if (combobxUpperLower->ItemIndex == 0 && (pnTopCollarRaglanFront->Visible || pnTopCollarRaglanBack->Visible)) { if (IsAllButtonDown(pnTopCollarRaglanFront) && IsAllButtonDown(pnTopCollarRaglanBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } #ifdef WORKSHEET // Upper Material if (combobxUpperLower->ItemIndex == 0 && pnMaterial->Visible) { sbSave->Enabled = true; } #endif // Bottom Whole Style - Pants if (combobxUpperLower->ItemIndex == 1 && (pnBottomWholeFront->Visible || pnBottomWholeBack->Visible)) { if (IsAllButtonDown(pnBottomWholeFront) && IsAllButtonDown(pnBottomWholeBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Bottom Whole Style - Skirt if (combobxUpperLower->ItemIndex == 1 && (pnBottomWholeSkirtFront->Visible || pnBottomWholeSkirtBack->Visible)) { if (IsAllButtonDown(pnBottomWholeSkirtFront) && IsAllButtonDown(pnBottomWholeSkirtBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Bottom Silhouette - Pants if (combobxUpperLower->ItemIndex == 1 && (pnBottomSilhouetteFront->Visible || pnBottomSilhouetteBack->Visible)) { if (IsAllButtonDown(pnBottomSilhouetteFront) && IsAllButtonDown(pnBottomSilhouetteBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Bottom Silhouette - Skirt if (combobxUpperLower->ItemIndex == 1 && (pnBottomSilhouetteSkirtFront->Visible || pnBottomSilhouetteSkirtBack->Visible)) { if (IsAllButtonDown(pnBottomSilhouetteSkirtFront) && IsAllButtonDown(pnBottomSilhouetteSkirtBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Bottom Belt - Pants if (combobxUpperLower->ItemIndex == 1 && (pnBottomBeltFront->Visible || pnBottomBeltBack->Visible)) { if (IsAllButtonDown(pnBottomBeltFront) && IsAllButtonDown(pnBottomBeltBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } // Bottom Belt - Skirts if (combobxUpperLower->ItemIndex == 1 && (pnBottomBeltSkirtFront->Visible || pnBottomBeltSkirtBack->Visible)) { if (IsAllButtonDown(pnBottomBeltSkirtFront) && IsAllButtonDown(pnBottomBeltSkirtBack)) { cbYW->Enabled = true; sbSave->Enabled = true; } else { cbYW->Enabled = false; sbSave->Enabled = false; } } #ifdef WORKSHEET // Upper Material if (combobxUpperLower->ItemIndex == 1 && pnMaterial->Visible) { sbSave->Enabled = true; } #endif } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::sbButtonInitializeClick(TObject *Sender) { TList *DataList; TVecData *data; // Ȱ¼ºÈ­µÈ ¾È³» À̹ÌÁö ¹öưÀ» ÃʱâÈ­ÇÑ´Ù - by monkman (2004.04.17) // isFrontBack = 0 : Àüü, 1 : ¾ÕÆÇ, 2 : µÞÆÇ // ¸Þ½ÃÁö : "ÇöÀç ÀÔ·Â µÇ¾î ÀÖ´Â Æ÷ÀÎÆ® Á¤º¸¸¦ ÃʱâÈ­ ½ÃŰ°Ú½À´Ï±î?" if (MessageDlg(IDS_MESSAGE11, mtInformation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { if (PageFront->ActivePage == TabFront) { InitStylePanel(pnCurrentPanel, false); memset(TempNumber1, 0, sizeof(int)*80); DataList = VecDraw->TransList1; for (int i = 0; i < DataList->Count; i++) { data = (TVecData *)DataList->Items[i]; data->TraitSet.Clear(); } } if (PageFront->ActivePage == TabBack) { InitStylePanel(pnCurrentPanel, false); memset(TempNumber2, 0, sizeof(int)*80); DataList = VecDraw->TransList2; for (int i = 0; i < DataList->Count; i++) { data = (TVecData *)DataList->Items[i]; data->TraitSet.Clear(); } } } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::sbStyLoadClick(TObject *Sender) { // *.sty ÆÄÀÏ Load - by monkman (2004.04.19) String strFileName; RECT rtVector; int nWidth = 0, nHeight = 0; double dRatio = 0.0, dRatioW = 0.0, dRatioH = 0.0; shStyLoad->Pen->Color = clRed; // ¸¸µé¾îÁø path °æ·Î¸¦ OpenDialog¿Í SaveDialog¿¡ ÁöÁ¤ÇØÁØ´Ù - by monkman (2004.05.12) GetDirectoryName(true); if (OpenDialogStyLoad->Execute()) { if (FileExists(OpenDialogStyLoad->FileName)) { strFileName = OpenDialogStyLoad->FileName; LoadFromSTYFile(strFileName); dFrontZoomRatio = 1.0; FrontMoveX = 0; FrontMoveY = 0; // º¤ÅÍÀÇ ¿µ¿ªÀ» ±¸ÇÏ¿© ºñÀ²À» Á¤ÇÑ´Ù - by monkman (2011.04.12) rtVector = VecDraw->GetUnionVectorRect(VecDraw->TransList1, 0, false); nWidth = rtVector.right - rtVector.left; nHeight = rtVector.bottom - rtVector.top; // »óÇÏÁ¿ì 6px´Â margin if (0 < nWidth) dRatioW = (double)(PaintBox1->Width-12) / nWidth; if (0 < nHeight) dRatioH = (double)(PaintBox1->Height-12) / nHeight; dRatio = dRatioW < dRatioH ? dRatioW : dRatioH; dFrontZoomRatio = dRatio < 1.0 ? dRatio : 1.0; dBackZoomRatio = 1.0; BackMoveX = 0; BackMoveY = 0; // º¤ÅÍÀÇ ¿µ¿ªÀ» ±¸ÇÏ¿© ºñÀ²À» Á¤ÇÑ´Ù - by monkman (2011.04.12) rtVector = VecDraw->GetUnionVectorRect(VecDraw->TransList2, 1, false); nWidth = rtVector.right - rtVector.left; nHeight = rtVector.bottom - rtVector.top; // »óÇÏÁ¿ì 6px´Â margin if (0 < nWidth) dRatioW = (double)(PaintBox2->Width-12) / nWidth; if (0 < nHeight) dRatioH = (double)(PaintBox2->Height-12) / nHeight; dRatio = dRatioW < dRatioH ? dRatioW : dRatioH; dBackZoomRatio = dRatio < 1.0 ? dRatio : 1.0; strPreLoadPath = strFileName; if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } } //--------------------------------------------------------------------------- bool __fastcall TDataTransForm::LoadFromSTYFile(String strFileName) { HANDLE hFile = INVALID_HANDLE_VALUE; STYLEDATAFILEHEADER header; DWORD dwRead; int Version; TVecData *data = NULL, *cdata = NULL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; String strBackPanelName; TPanel *pbBack = NULL; double dSize; int i, value; if (FileExists(strFileName) == false) return false; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(strFileName.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, strFileName, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) MessageDlg(IDS_MESSAGE_NEWERVERSIONFILE, mtInformation, TMsgDlgButtons() << mbOK, 0); if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; goto fail; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; shStyLoad->Pen->Color = clBlack; goto fail; } #endif } // ÆÄÀÏ »ý¼º ³âµµ¸¦ ±¸Çؼ­ 2004³â ÀÌÇϸé sbPatSave ¹öưÀÌ È°¼ºÈ­ ¾ÈµÇ°Ô ÇÑ´Ù. FILETIME c , a, w; if( GetFileTime(hFile, &c, &a, &w) == 0) { CloseHandle(hFile); return false; } SYSTEMTIME sC, sA, sW; FileTimeToSystemTime( &c , &sC ); FileTimeToSystemTime( &a , &sA ); FileTimeToSystemTime( &w , &sW ); if(sC.wYear <= 2004 || sW.wYear <= 2004 || sA.wYear <= 2004){ if(header.Sort == SO_TOPFULL){is2004File_TopWhole = true;} if(header.Sort == SO_SILHOUETTE){is2004File_TopSil = true;} if(header.Sort == SO_SLEEVE){is2004File_TopSle = true;} if(header.Sort == SO_COLLAR){is2004File_TopCol = true;} if(header.Sort == SO_BOTTOMFULL){is2004File_BottomWhole = true;} if(header.Sort == SO_PANTS){is2004File_BottomPants = true;} if(header.Sort == SO_BELT){is2004File_BottomBelt = true;} }else{ if(header.Sort == SO_TOPFULL){is2004File_TopWhole = false;} if(header.Sort == SO_SILHOUETTE){is2004File_TopSil = false;} if(header.Sort == SO_SLEEVE){is2004File_TopSle = false;} if(header.Sort == SO_COLLAR){is2004File_TopCol = false;} if(header.Sort == SO_BOTTOMFULL){is2004File_BottomWhole = false;} if(header.Sort == SO_PANTS){is2004File_BottomPants = false;} if(header.Sort == SO_BELT){is2004File_BottomBelt = false;} } memcpy(TempNumber1, header.TraitFrontNumber, sizeof(int)*80); memcpy(TempNumber2, header.TraitBackNumber, sizeof(int)*80); // Control ÃʱâÈ­ combobxDivision->ItemIndex = 0; combobxUpperLower->ItemIndex = 0; rbTopWhole->Checked = false; rbTopSilhouette->Checked = false; rbTopSleeve->Checked = false; rbTopCollar->Checked = false; rbBottomWhole->Checked = false; rbBottomSilhouette->Checked = false; rbBottomBelt->Checked = false; // 2004.12.21 Ãß°¡ - by monkman cbSleeve->Checked = false; cbCollar->Checked = false; cbBelt->Checked = false; for (int i=0; i < 4; i++) clbSSFW->Checked[i] = false; // Division switch (header.Division) { case DV_MAN : combobxDivision->ItemIndex = 0; break; case DV_WOMAN : combobxDivision->ItemIndex = 1; break; case DV_CHILD : combobxDivision->ItemIndex = 2; break; case DV_BABY : combobxDivision->ItemIndex = 3; break; } // »óÀÇÀÎÁö ÇÏÀÇÀÎÁö ±¸ºÐ if ((header.Sort == SO_TOPFULL) || (header.Sort == SO_SILHOUETTE) || (header.Sort == SO_SLEEVE) || (header.Sort == SO_COLLAR)) combobxUpperLower->ItemIndex = 0; if ((header.Sort == SO_BOTTOMFULL) || (header.Sort == SO_PANTS) || (header.Sort == SO_BELT)) combobxUpperLower->ItemIndex = 1; #ifdef WORKSHEET if (header.Sort == SO_UPPERMATRIAL) combobxUpperLower->ItemIndex = 0; if (header.Sort == SO_LOWERMATRIAL) combobxUpperLower->ItemIndex = 1; #endif // Type Type = header.Type; // ÄÁÆ®·Ñ ÃʱâÈ­ MainItemChange(this); // ListBox °ü·Ã value = 0; for (int i = TP_NONE; i < TP_LAST; i++) { if (DSItems.Contains(EType(i)) && DSClothes.Contains(EType(i))) { if (i == int(header.Type)) break; value++; } } combobxItems->ItemIndex = value; // ListBox ÃʱâÈ­ PreListBox_ItemIndex = -1; // ÀÌÀü ¼±ÅõǾú´ø Type - by monkman (2004.07.13) combobxItemsChange(this); // Type Type = header.Type; ObjectCount1 = header.Count1; ObjectCount2 = header.Count2; // Event i = 0, value = 0; switch (header.Sort) { // Top Whole Style case SO_TOPFULL : rbTopWhole->Checked = true; ComboTopWholeType->ItemIndex = int(header.EMethod)-1; // »óÀÇ ´ëÇ¥½ºÅ¸ÀÏ¿¡ µû¸¥ ½Ç·ç¿§ÀÇ Á¾·ù¸¦ ã¾Æ³¿ - by monkman (2004.04.13) #ifndef WORKSHEET // while (i < 127) { // if (DSSilhouette.Contains(EDetailSilhouette(++i))) { // if (int(header.ESilhouette) == (i)) break; // value++; // } // } for (int i = 0, j = 0; i < 127; i++) { if (DSSilhouette.Contains(i)) { if (header.ESilhouette == i) { value = j; break; } j++; } } ComboTopWholeSilhouette->ItemIndex = value; ComboTopWholeSleeve->ItemIndex = int(header.ESleeve)-1; ComboTopWholeCollar->ItemIndex = int(header.ECollar)-1; #else for (int i = 0; i < ComboTopWholeSilhouette->Items->Count; i++) { value = int(ComboTopWholeSilhouette->Items->Objects[i]); if (value == int(header.ESilhouette)) { ComboTopWholeSilhouette->ItemIndex = i; break; } } for (int i = 0; i < ComboTopWholeSleeve->Items->Count; i++) { value = int(ComboTopWholeSleeve->Items->Objects[i]); if (value == int(header.ESleeve)) { ComboTopWholeSleeve->ItemIndex = i; break; } } for (int i = 0; i < ComboTopWholeCollar->Items->Count; i++) { value = int(ComboTopWholeCollar->Items->Objects[i]); if (value == int(header.ECollar)) { ComboTopWholeCollar->ItemIndex = i; break; } } #endif strTopWholeFileName = strFileName; break; // Top Silhouette case SO_SILHOUETTE : rbTopSilhouette->Checked = true; cbSleeve->Checked = header.bSleeve; cbCollar->Checked = header.bCollar; ComboTopSilhouetteType->ItemIndex = int(header.EMethod)-1; // »óÀÇ ´ëÇ¥½ºÅ¸ÀÏ¿¡ µû¸¥ ½Ç·ç¿§ÀÇ Á¾·ù¸¦ ã¾Æ³¿ - by monkman (2004.04.13) #ifndef WORKSHEET // while (i < 127) { // if (DSSilhouette.Contains(EDetailSilhouette(++i))) { // if (int(header.ESilhouette) == (i)) break; // value++; // } // } for (int i = 0, j = 0; i < 127; i++) { if (DSSilhouette.Contains(i)) { if (header.ESilhouette == i) { value = j; break; } j++; } } ComboTopSilhouetteSilhouette->ItemIndex = value; #else for (int i = 0; i < ComboTopSilhouetteSilhouette->Items->Count; i++) { value = int(ComboTopSilhouetteSilhouette->Items->Objects[i]); if (value == int(header.ESilhouette)) { ComboTopSilhouetteSilhouette->ItemIndex = i; break; } } #endif strTopSilhouetteFileName = strFileName; break; // Top Sleeve case SO_SLEEVE : rbTopSleeve->Checked = true; #ifndef WORKSHEET ComboTopSleeveSleeve->ItemIndex = int(header.ESleeve)-1; #else for (int i = 0; i < ComboTopSleeveSleeve->Items->Count; i++) { value = int(ComboTopSleeveSleeve->Items->Objects[i]); if (value == int(header.ESleeve)) { ComboTopSleeveSleeve->ItemIndex = i; break; } } #endif strTopSleeveFileName = strFileName; break; // Top Collar case SO_COLLAR : rbTopCollar->Checked = true; #ifndef WORKSHEET ComboTopCollarCollar->ItemIndex = int(header.ECollar)-1; #else for (int i = 0; i < ComboTopCollarCollar->Items->Count; i++) { value = int(ComboTopCollarCollar->Items->Objects[i]); if (value == int(header.ECollar)) { ComboTopCollarCollar->ItemIndex = i; break; } } #endif strTopCollarFileName = strFileName; break; // Bottom Whole Style case SO_BOTTOMFULL : rbBottomWhole->Checked = true; // ¹ÙÁö¿Í ½ºÄ¿Æ® ±¸ºÐ - by monkman (2004.04.09) #ifndef WORKSHEET if (TP_SKIRT != Type) { ComboBottomWholePantsSilhouette->Visible = true; ComboBottomWholeSkirtSilhouette->Visible = false; ComboBottomWholePantsSilhouette->ItemIndex = int(header.EPants)-1; } else { ComboBottomWholePantsSilhouette->Visible = false; ComboBottomWholeSkirtSilhouette->Visible = true; ComboBottomWholeSkirtSilhouette->ItemIndex = int(header.EPants)-51; } ComboBottomWholeBelt->ItemIndex = int(header.EBelt)-1; #else if (TP_SKIRT != Type) { ComboBottomWholePantsSilhouette->Visible = true; ComboBottomWholeSkirtSilhouette->Visible = false; for (int i = 0; i < ComboBottomWholePantsSilhouette->Items->Count; i++) { value = int(ComboBottomWholePantsSilhouette->Items->Objects[i]); if (value == int(header.EPants)) { ComboBottomWholePantsSilhouette->ItemIndex = i; break; } } } else { ComboBottomWholePantsSilhouette->Visible = false; ComboBottomWholeSkirtSilhouette->Visible = true; for (int i = 0; i < ComboBottomWholeSkirtSilhouette->Items->Count; i++) { value = int(ComboBottomWholeSkirtSilhouette->Items->Objects[i]); if (value == int(header.EPants)) { ComboBottomWholeSkirtSilhouette->ItemIndex = i; break; } } } for (int i = 0; i < ComboBottomWholeBelt->Items->Count; i++) { value = int(ComboBottomWholeBelt->Items->Objects[i]); if (value == int(header.EBelt)) { ComboBottomWholeBelt->ItemIndex = i; break; } } #endif strBottomWholeFileName = strFileName; break; // Bottom Silhouette case SO_PANTS : rbBottomSilhouette->Checked = true; cbBelt->Checked = header.bBelt; // ¹ÙÁö¿Í ½ºÄ¿Æ® ±¸ºÐ - by monkman (2004.04.09) #ifndef WORKSHEET if (TP_SKIRT != Type) { ComboBottomSilhouettePantsSilhouette->Visible = true; ComboBottomSilhouetteSkirtSilhouette->Visible = false; ComboBottomSilhouettePantsSilhouette->ItemIndex = int(header.EPants)-1; } else { ComboBottomSilhouettePantsSilhouette->Visible = false; ComboBottomSilhouetteSkirtSilhouette->Visible = true; ComboBottomSilhouetteSkirtSilhouette->ItemIndex = int(header.EPants)-51; } #else if (TP_SKIRT != Type) { ComboBottomSilhouettePantsSilhouette->Visible = true; ComboBottomSilhouetteSkirtSilhouette->Visible = false; for (int i = 0; i < ComboBottomSilhouettePantsSilhouette->Items->Count; i++) { value = int(ComboBottomSilhouettePantsSilhouette->Items->Objects[i]); if (value == int(header.EPants)) { ComboBottomSilhouettePantsSilhouette->ItemIndex = i; break; } } } else { ComboBottomSilhouettePantsSilhouette->Visible = false; ComboBottomSilhouetteSkirtSilhouette->Visible = true; for (int i = 0; i < ComboBottomSilhouetteSkirtSilhouette->Items->Count; i++) { value = int(ComboBottomSilhouetteSkirtSilhouette->Items->Objects[i]); if (value == int(header.EPants)) { ComboBottomSilhouetteSkirtSilhouette->ItemIndex = i; break; } } } #endif strBottomSilhouetteFileName = strFileName; break; // Bottom Belt case SO_BELT : rbBottomBelt->Checked = true; #ifndef WORKSHEET ComboBottomBeltBelt->ItemIndex = int(header.EBelt)-1; #else for (int i = 0; i < ComboBottomBeltBelt->Items->Count; i++) { value = int(ComboBottomBeltBelt->Items->Objects[i]); if (value == int(header.EBelt)) { ComboBottomBeltBelt->ItemIndex = i; break; } } #endif strBottomBendBeltFileName = strFileName; break; #ifdef WORKSHEET case SO_UPPERMATRIAL : rbTopMaterial->Checked = true; for (int i = 0; i < ComboMaterial->Items->Count; i++) { value = int(ComboMaterial->Items->Objects[i]); if (value == int(header.EUpperMaterial)) { ComboMaterial->ItemIndex = i; break; } } break; case SO_LOWERMATRIAL : rbBottomMaterial->Checked = true; for (int i = 0; i < ComboMaterial->Items->Count; i++) { value = int(ComboMaterial->Items->Objects[i]); if (value == int(header.ELowerMaterial)) { ComboMaterial->ItemIndex = i; break; } } break; #endif } // Load ÈÄ À̹ÌÁö µîÀ» ¼³Á¤ - by monkman (2004.05.20) if (combobxUpperLower->ItemIndex == 0) rbTopClick(this); if (combobxUpperLower->ItemIndex == 1) rbBottomClick(this); // TransList1, TransList2 ÃʱâÈ­ while (VecDraw->TransList1->Count) { data = (TVecData *)VecDraw->TransList1->First(); delete data; VecDraw->TransList1->Remove(data); } while (VecDraw->TransList2->Count) { data = (TVecData *)VecDraw->TransList2->First(); delete data; VecDraw->TransList2->Remove(data); } // Sort if (header.Sort == SO_TOPFULL) HDPatUpWhole = header; switch (header.Sort) { case SO_TOPFULL : case SO_SILHOUETTE : case SO_SLEEVE : case SO_COLLAR : case SO_BOTTOMFULL : case SO_PANTS : case SO_BELT : #ifdef WORKSHEET case SO_UPPERMATRIAL : case SO_LOWERMATRIAL : #endif // ListÀÇ VecData º¹»ç if (Version == 0 || Version == 100) { // Version 100 ÀÏ °æ¿ì ¸ø Àд ¿¡·¯·Î ±ä±ÞÃß°¡ - by monkman (2005.06.10) dwDataSize = GetFileSize(hFile, NULL) - sizeof(OLDSTYLEDATAFILEHEADER); } else { dwDataSize = GetFileSize(hFile, NULL) - sizeof(STYLEDATAFILEHEADER); } if ((StyleData = (BYTE *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwDataSize))==NULL) goto fail; // ÆÄÀÏÅ©±â¸¸Å­ ¸Þ¸ð¸® ÇÒ´ç VecDraw->ReadSTYFileData(hFile, Version, StyleData, header); dwPos = 0; for (int i = 0; i < header.Count1; i++) { // ¾ÕÆÇ if ((data = new TVecData(0))==NULL) goto fail; VecDraw->LoadFromSTYMemory(&StyleData, &dwPos, data, Version); VecDraw->TransList1->Add(data); } for (int i = header.Count1; i < header.Count1 + header.Count2; i++) { // µÞÆÇ if ((data = new TVecData(1))==NULL) goto fail; VecDraw->LoadFromSTYMemory(&StyleData, &dwPos, data, Version); VecDraw->TransList2->Add(data); } break; } // ÀÛ¾÷Áö½Ã¼­ Size Á¤º¸ ÃʱâÈ­ - by monkman(2011.01.18) for (int i = 0; i < rzstrgrdUpperSizeInformation->RowCount; i++) { // »óÀÇ rzstrgrdUpperSizeInformation->Cells[1][i] = ""; } for (int i = 0; i < rzstrgrdLowerSizeInformation->RowCount; i++) { // ÇÏÀÇ rzstrgrdLowerSizeInformation->Cells[1][i] = ""; } // ÀÛ¾÷Áö½Ã¼­ Size Á¤º¸ Ãß°¡ - by monkman(2011.01.18) if ((208 <= header.Version && header.Version < 500) || (508 <= header.Version)) { for (int i = 0; i < rzstrgrdUpperSizeInformation->RowCount; i++) { // »óÀÇ memcpy(&dSize, StyleData+dwPos, sizeof(double)); dwPos += sizeof(double); if (0 < dSize) rzstrgrdUpperSizeInformation->Cells[1][i] = FloatToStr(dSize); else rzstrgrdUpperSizeInformation->Cells[1][i] = ""; } for (int i = 0; i < rzstrgrdLowerSizeInformation->RowCount; i++) { // ÇÏÀÇ memcpy(&dSize, StyleData+dwPos, sizeof(double)); dwPos += sizeof(double); if (0 < dSize) rzstrgrdLowerSizeInformation->Cells[1][i] = FloatToStr(dSize); else rzstrgrdLowerSizeInformation->Cells[1][i] = ""; } } // ¿¬µµ¸¦ Àд´٠if (header.Year > 0) ComboYear->Text = IntToStr(header.Year); else ComboYear->Text = ""; // SeasonÀ» Àд´٠- by monkman (2004.04.13) // SSFW - Spring : 0, Summer : 1, Fall : 2, Winter : 3 if (header.SSFW != 0) { for (int i=0; i < 4; i++) { if (((header.SSFW >> i) & 1) == 1) { clbSSFW->Checked[i] = true; } } } EditComment->Text = String(header.Comment); #ifdef WORKSHEET edStyleID->Text = String(header.StyleID); #endif // ¹öư üũ InitStylePanel(pnCurrentPanel, true); strBackPanelName = pnCurrentPanel->Name.SubString(1, pnCurrentPanel->Name.Length()-5) + "Back"; pbBack = dynamic_cast(FindComponent(strBackPanelName)); if (pbBack) InitStylePanel(pbBack, true); cbYW->Enabled = true; sbSave->Enabled = true; shSave->Pen->Color = clBlack; if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } SetEndOfFile(hFile); CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; shStyLoad->Pen->Color = clBlack; // STY ÆÄÀÏ Load½Ã STI »óÅ ¼³Á¤ - by monkman (2010.09.09) SetSTIStatus(header); // Style Data LockÀ» À§ÇØ ÆÄÀÏ¿¡ Á÷Á¢¾²Áö ¾Ê°í ¸Þ¸ð¸®¿¡ ¾´ ÈÄ ÀúÀåÇÏ´Â °ÍÀ¸·Î ¼öÁ¤ - by monkman (2004.12.30) // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ for (int i = 0; i < VecDraw->TransList1->Count; i++) { data = (TVecData *)VecDraw->TransList1->Items[i]; cdata = new TVecData(0); cdata->Copy(data); if (header.Sort == SO_TOPFULL) PatUpWhole->Add(cdata); else if (header.Sort == SO_SILHOUETTE) PatUpSil->Add(cdata); else if (header.Sort == SO_SLEEVE) PatUpSle->Add(cdata); else if (header.Sort == SO_COLLAR) PatUpCol->Add(cdata); else if (header.Sort == SO_BOTTOMFULL) PatDnWhole->Add(cdata); else if (header.Sort == SO_PANTS) PatDnSil->Add(cdata); else if (header.Sort == SO_BELT) PatDnBelt->Add(cdata); else delete cdata; } // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ for (int i = 0; i < VecDraw->TransList2->Count; i++) { data = (TVecData *)VecDraw->TransList2->Items[i]; cdata = new TVecData(1); cdata->Copy(data); if (header.Sort == SO_TOPFULL) PatUpWhole->Add(cdata); else if (header.Sort == SO_SILHOUETTE) PatUpSil->Add(cdata); else if (header.Sort == SO_SLEEVE) PatUpSle->Add(cdata); else if (header.Sort == SO_COLLAR) PatUpCol->Add(cdata); else if (header.Sort == SO_BOTTOMFULL) PatDnWhole->Add(cdata); else if (header.Sort == SO_PANTS) PatDnSil->Add(cdata); else if (header.Sort == SO_BELT) PatDnBelt->Add(cdata); else delete cdata; } return true; fail : if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; shStyLoad->Pen->Color = clBlack; // ¸Þ½ÃÁö : "sty (Style Data) ÆÄÀÏ Å¸ÀÔ°ú ´Ù¸¨´Ï´Ù." MessageDlg(IDS_MESSAGE10, mtError, TMsgDlgButtons() << mbOK, 0); // ºÒ·¯¿À´Âµ¥ ½ÇÆÐÇÏ¿´À¸¹Ç·Î ÃʱâÈ­ if (strFileName == strTopWholeFileName) strTopWholeFileName = ""; if (strFileName == strTopSilhouetteFileName) strTopSilhouetteFileName = ""; if (strFileName == strTopSleeveFileName) strTopSleeveFileName = ""; if (strFileName == strTopCollarFileName) strTopCollarFileName = ""; if (strFileName == strBottomWholeFileName) strBottomWholeFileName = ""; if (strFileName == strBottomSilhouetteFileName) strBottomSilhouetteFileName = ""; if (strFileName == strBottomBendBeltFileName) strBottomBendBeltFileName = ""; return false; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::FindFolder(String path) { // path»ó¿¡ µ¿µîÇÏ°Ô Á¸ÀçÇÏ´Â ÇÏÀ§µð·ºÅ丮¸¸ °Ë»öÇÑ´Ù HANDLE hSrch; WIN32_FIND_DATA wfd; Char drive[MAX_PATH]; Char dir[MAX_PATH]; Char newpath[MAX_PATH]; bool bResult = true; String TempDirectory; String strLowerFileName; TempDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; comboSource->Clear(); hSrch=FindFirstFile(path.c_str(), &wfd); while (bResult) { // ÆÐ½º¸¦ µå¶óÀ̺ê, µð·ºÅ丮·Î ºÐ·ù _wsplitpath(path.c_str(), drive, dir, NULL, NULL); // µð·ºÅ丮ÀÎÁö È®ÀÎ if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if (wfd.cFileName[0] != '.') { // ÆÐ½º Àç¼³Á¤ wsprintf(newpath, L"%s%s%s\\*.*", drive, dir, wfd.cFileName); if (path.LowerCase() == DirectoryBin.LowerCase() || path.LowerCase() == (DirectoryBin.LowerCase() + "\\*.*")) { strLowerFileName = strLowerFileName.sprintf(wfd.cFileName); strLowerFileName = strLowerFileName.LowerCase(); // Style µð·ºÅ丮ÀÏ °æ¿ì if (strLowerFileName == "style") { comboSource->Items->Insert(0, wfd.cFileName); } else if (strLowerFileName != "detail" && strLowerFileName != "guideimage" // Stylist¿¡¼­ »ç¿ëÇÏ´Â µð·ºÅ丮ÀÏ °æ¿ì && strLowerFileName != "stisample" && strLowerFileName != "texstylist" && strLowerFileName != "material") { comboSource->Items->Add(wfd.cFileName); } } else { comboSource->Items->Add(wfd.cFileName); } } } bResult = FindNextFile(hSrch, &wfd); } FindClose(hSrch); comboSource->ItemIndex = comboSource->Items->IndexOf(TempDirectory); if (comboSource->ItemIndex < 0) comboSource->ItemIndex = 0; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::comboSourceChange(TObject *Sender) { DirectoryStyle = strRootPath + "\\" + comboSource->Items->Strings[comboSource->ItemIndex]; STYDetailSelectedSave(comboSource->Items->Strings[comboSource->ItemIndex]); comboSource->SetFocus(); } //--------------------------------------------------------------------------- String __fastcall TDataTransForm::GetDirectoryName(bool bDialog) { String strPath, strFileName; if (combobxDivision->ItemIndex == 0) strPath = "Man"; if (combobxDivision->ItemIndex == 1) strPath = "Woman"; if (combobxDivision->ItemIndex == 2) strPath = "Child"; if (combobxDivision->ItemIndex == 3) strPath = "Baby"; switch (Type) { case TP_COAT : strPath = strPath + "\\Coat"; break; case TP_JACKET : strPath = strPath + "\\Jacket"; break; case TP_JUMPER : strPath = strPath + "\\Jumper"; break; case TP_KNIT : strPath = strPath + "\\Knit"; break; case TP_PANTS : strPath = strPath + "\\Pants"; break; case TP_SHIRTS : strPath = strPath + "\\Shirts"; break; case TP_TOP : strPath = strPath + "\\Top"; break; case TP_VEST : strPath = strPath + "\\Vest"; break; case TP_ONEPIECE : strPath = strPath + "\\1-PIECE"; break; case TP_BLOUSE : strPath = strPath + "\\Blouse"; break; case TP_SKIRT : strPath = strPath + "\\Skirt"; break; case TP_CAPE : strPath = strPath + "\\Cape"; break; case TP_ROMPERS : strPath = strPath + "\\Rompers"; break; } if (combobxUpperLower->ItemIndex == 0) { if (rbTopWhole->Checked) ; if (rbTopSilhouette->Checked) strPath = strPath + "\\Silhouette"; if (rbTopSleeve->Checked) strPath = strPath + "\\Sleeve"; if (rbTopCollar->Checked) strPath = strPath + "\\Collar"; } if (combobxUpperLower->ItemIndex == 1) { if (rbBottomWhole->Checked) ; if (rbBottomSilhouette->Checked) strPath = strPath + "\\Silhouette"; if (rbBottomBelt->Checked) strPath = strPath + "\\Belt"; } strPath = DirectoryStyle + "\\" + strPath; if (bDialog) { strFileName = ExtractFileName(OpenDialogStyLoad->FileName); #ifdef WORKSHEET // ÀÛ¾÷Áö½Ã¼­ÀÇ °æ¿ì StyleID°¡ ÆÄÀϸíÀÌ µÊ if (edStyleID->Text.IsEmpty() == false) strFileName = edStyleID->Text + ".sty"; #endif OpenDialogStyLoad->InitialDir = strPath; SaveDialog1->InitialDir = strPath; OpenDialogStyLoad->FileName = strFileName; SaveDialog1->FileName = strFileName; } // ºÎÀÚÀçÀÏ °æ¿ì Æú´õ °æ·Î Àç¼³Á¤ - by monkman (2011.01.22) if (rbTopMaterial->Checked == true || rbBottomMaterial->Checked == true) { strPath = rzshelltreeMaterialExplorer->SelectedPathName; OpenDialogStyLoad->InitialDir = strPath; SaveDialog1->InitialDir = strPath; } return strPath; /* // Path Á¸Àç ¿©ºÎ °Ë»ç // Path¸¦ ¹Þ¾Æ µð·ºÅ丮¿Í ÆÄÀϸíÀ» ±¸ºÐÇØÁØ´Ù brkCnt = 0; isDiffPath = false; SufPath = ""; if (OpenDialogStyLoad->FileName.Length() > 0) { for (int i = OpenDialogStyLoad->FileName.Length() - 1; i >= 0; i--) { if (OpenDialogStyLoad->FileName.SubString(i, 1) == "\\") brkCnt++; if (brkCnt == 1) { isDiffPath = true; PrePath = OpenDialogStyLoad->FileName.SubString(1, i-1); SufPath = OpenDialogStyLoad->FileName.SubString(i+1, TempPath.Length()); break; } } } if (0 < OpenDialogStyLoad->FileName.Length()) { PrePath = ExtractFileDir(OpenDialogStyLoad->FileName); SufPath = ExtractFileName(OpenDialogStyLoad->FileName); } if (isDiffPath && TempPath.LowerCase() != PrePath.LowerCase()) { OpenDialogStyLoad->FileName = SufPath; SaveDialog1->FileName = SufPath; } */ } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::EditMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TEdit *edSelect = NULL; edSelect = dynamic_cast(Sender); if (edSelect) edSelect->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::sbChangeBaseDirectoryClick(TObject *Sender) { String Msg; String strOldRootPath; shChangeBaseDirectory->Pen->Color = clRed; strOldRootPath = strRootPath; strRootPath = BaseDirectoryDialogFunc("DataTransForm", strRootPath); Msg = IDS_MESSAGE12 + strRootPath + IDS_MESSAGE13; if (strOldRootPath.LowerCase() != strRootPath.LowerCase()) { comboSource->ItemIndex = 0; // ¸Þ½ÃÁö : ±âº» Æú´õ°¡ <Æú´õ¸í>·Î º¯°æµÇ¾ú½À´Ï´Ù. MessageDlg(Msg, mtInformation, TMsgDlgButtons() << mbOK, 0); FindFolder(strRootPath + "\\*.*"); if (comboSource->Items->Count >= 0) { comboSource->ItemIndex = 0; DirectoryStyle = strRootPath + "\\" + comboSource->Items->Strings[comboSource->ItemIndex]; } comboSourceChange(this); } shChangeBaseDirectory->Pen->Color = clBlack; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::STYDetailSelectedSave(String strSelectedDetailDirectory) { // Style.ini ÆÄÀÏ¿¡¼­ ¾ò¾î¿Â STYPath °ª - by monkman (2004.10.12) TIniFile *IniFile = NULL; IniFile = new TIniFile(AppDataItem+"\\Style.ini"); if (IniFile) { IniFile->WriteString("DataTransForm", "Directory", strSelectedDetailDirectory); delete IniFile; } IniFile = NULL; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::PanelSelectButtonAutoClick() { // ÀÌÀü Panel¿¡¼­ ¸¶Áö¸· ´­·ÁÁ³´ø ¹öưÀ» ã¾Æ³½´Ù - by monkman (2004.11.05) TPanel *pnTopPanel = NULL; TSpeedButton *sbButton = NULL; TShape *sbShape = NULL; String strComponentName; int nMax, nMemoryi; // nMax = ÃÖ´ë°ªÀ» ã±âÀ§ÇØ, nMemoryi = for loop¿¡¼­ i °ªÀ» ±â¾ï pnTopPanel = dynamic_cast(pnCurrentPanel); nMax = -1; nMemoryi = -1; if (pnTopPanel) { for (int i = 0; i < pnTopPanel->ControlCount; i++) { // Panel À§ÀÇ TShape¸¸ ã´Â´Ù if (!CompareStr(pnTopPanel->Controls[i]->ClassName(), "TShape")) { sbShape = dynamic_cast(pnTopPanel->Controls[i]); // »ö±òÀÌ 0x00FEE004 (Æ÷ÀÎÆ® Âï°í ÀÖÀ» µ¿¾È)ÀÎ °Í¸¸.. if ((sbShape->Pen->Color == 0x00FEE004) && (nMax < sbShape->Tag)) { nMax = sbShape->Tag; nMemoryi = i; } } } if (nMax > -1 && nMemoryi > -1) { strComponentName = pnTopPanel->Controls[nMemoryi]->Name; strComponentName = "sb" + strComponentName.SubString(3, strComponentName.Length()); sbButton = (TSpeedButton *)this->FindComponent(strComponentName); sbButton->Click(); } } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::btnPaintBoxFocusKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { // 'A' Ű // È®´ë (±âÁØÁ¡Àº PaintBox ÁÂÇ¥) if (Key == 65) { // ¾ÕÆÇ if (PageFront->ActivePage == TabFront) { if (dFrontZoomRatio < 1.8) { dFrontZoomRatio += 0.2; PaintBox1->Repaint(); } else return; } // µÞÆÇ else if (PageFront->ActivePage == TabBack) { if (dBackZoomRatio < 1.8) { dBackZoomRatio += 0.2; PaintBox2->Repaint(); } else return; } } else if (Key == 83) { // 'S' Ű // Ãà¼Ò (±âÁØÁ¡Àº PaintBox ÁÂÇ¥) // ¾ÕÆÇ if (PageFront->ActivePage == TabFront) { if (dFrontZoomRatio > 0.4) { dFrontZoomRatio -= 0.2; PaintBox1->Repaint(); } else return; } // µÞÆÇ else if (PageFront->ActivePage == TabBack) { if (dBackZoomRatio > 0.4) { dBackZoomRatio -= 0.2; PaintBox2->Repaint(); } else return; } } else return; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::InitStylePanel(TPanel *pnSel, bool bSelect) { // PanelÀ§¿¡ Á¸ÀçÇÏ´Â Shape°ú SpeedButtonÀ» ÃʱâÈ­ÇØÁÖ´Â ÇÔ¼ö - by monkman (2007.01.31) TPanel *pnPanel = NULL; TShape *shShape = NULL; TSpeedButton *sbButton = NULL; pnPanel = dynamic_cast(pnSel); if (pnPanel) { for (int i = 0; i < pnPanel->ControlCount; i++) { // Shape shShape = dynamic_cast(pnPanel->Controls[i]); if (shShape) { if (bSelect) { shShape->Pen->Color = 0x004B04FE; } else { shShape->Pen->Color = 0x00050505; } } // Button sbButton = dynamic_cast(pnPanel->Controls[i]); if (sbButton) { if (bSelect) { sbButton->Down = true; } else { sbButton->Down = false; } } } } } //--------------------------------------------------------------------------- bool __fastcall TDataTransForm::AutoDown(TPanel *pnSel, TSpeedButton *sbPreDown) { // ÀÚµ¿À¸·Î ´ÙÀ½ ¹öưÀ» Ŭ¸¯ÇØÁÖ´Â ÇÔ¼ö - by monkman (2007.01.31) TPanel *pnPanel = NULL; TSpeedButton *sbButton = NULL, *sbPreDownButton = NULL; TShape *shShape = NULL; int nPreNumber = 0, nNextNumber = 0; nPreNumber = sbPreDown->Tag; sbPreDownButton = dynamic_cast(sbPreDown); if (sbPreDownButton) { // nPreNumber ´ÙÀ½ Tag °ªÀÌ nNextNumber¿¡ µé¾î°£´Ù. // nPreNumber¿Í nNextNumber°¡ °°´Ù¸é ´ÙÀ½ Tag °ªÀ» °¡Áú ¹öưÀÌ ¾ø´Â °ÍÀÌ´Ù. nNextNumber = 1000; // Tag´Â 1000À» ³ÑÁö ¸øÇÑ´Ù for (int i = 0; i < pnSel->ControlCount; i++) { if ((pnSel->Controls[i]->Tag > nPreNumber) && (nNextNumber > pnSel->Controls[i]->Tag)) { if (!CompareStr(pnSel->Controls[i]->ClassName(), String("TSpeedButton"))) { nNextNumber = pnSel->Controls[i]->Tag; sbButton = dynamic_cast(pnSel->Controls[i]); } } } // nPreNumber ´ÙÀ½ Tag °ªÀÌ nNextNumber¿¡ µé¾î°£´Ù. // nPreNumber¿Í nNextNumber°¡ °°´Ù¸é ´ÙÀ½ Tag °ªÀ» °¡Áú ¹öưÀÌ ¾ø´Â °ÍÀÌ´Ù. nNextNumber = 1000; // Tag´Â 1000À» ³ÑÁö ¸øÇÑ´Ù for (int i = 0; i < pnSel->ControlCount; i++) { if ((pnSel->Controls[i]->Tag > nPreNumber) && (nNextNumber > pnSel->Controls[i]->Tag)) { if (!CompareStr(pnSel->Controls[i]->ClassName(), String("TShape"))) { nNextNumber = pnSel->Controls[i]->Tag; shShape = dynamic_cast(pnSel->Controls[i]); } } } } if (IsAllButtonDown(pnSel)) { sbClickedButton = NULL; // Message : "Á¡ ÀÔ·ÂÀÌ ¿Ï·áµÇ¾ú½À´Ï´Ù." MessageDlg(IDS_MESSAGE5, mtInformation, TMsgDlgButtons() << mbOK, 0); STYSaveCheck(); // ÀúÀå °¡´ÉÇÑÁö üũ } if (sbButton && shShape) { sbButton->Click(); shShape->Pen->Color = 0x00FEE004; return true; } else { return false; } } //--------------------------------------------------------------------------- bool __fastcall TDataTransForm::IsAllButtonDown(TPanel *pnSel) { // PanelÀ§ÀÇ ¸ðµç SpeedButtonÀÌ DownµÇ°í ShapeÀÇ Brush Colorµµ º¯°æµÇ¾ú´ÂÁö Á¶»çÇÏ´Â ÇÔ¼ö - by monkman (2007.01.31) TPanel *pnPanel = NULL; TShape *shShape = NULL; TSpeedButton *sbButton = NULL; int nButtonCount = 0, nDownedButtonCount = 0, nShapeCount = 0, nCheckedShapeCount = 0; pnPanel = dynamic_cast(pnSel); if (pnPanel) { for (int i = 0; i < pnPanel->ControlCount; i++) { // Shape shShape = dynamic_cast(pnPanel->Controls[i]); if (shShape) { nShapeCount++; if (shShape->Pen->Color == 0x004B04FE) { nCheckedShapeCount++; } } // Button //sbButton = dynamic_cast(pnPanel->Controls[i]); //if (sbButton) { // nButtonCount++; // if (sbButton->Down == true) { // nDownedButtonCount++; // } //} } if (nShapeCount == nCheckedShapeCount/* && nButtonCount == nDownedButtonCount*/) return true; else return false; } else return false; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnNewClothesClick(TObject *Sender) { // »õ·Î¿î ¿Ê // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ - TList¿¡ ´ã°ÜÀÖ´Â µ¥ÀÌÅ͸¦ Áö¿ò - by monkman TVecData *data = NULL; TShape *shShape = NULL; TSpeedButton *spdbtnButton = NULL; if (MessageDlg(IDS_MESSAGE16, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes) { if (VecDraw->TransList1) { for (int i = 0; i < VecDraw->TransList1->Count; i++) { data = (TVecData *)VecDraw->TransList1->Items[i]; if (data) delete data; data = NULL; } VecDraw->TransList1->Clear(); } if (VecDraw->TransList2) { for (int i = 0; i < VecDraw->TransList2->Count; i++) { data = (TVecData *)VecDraw->TransList2->Items[i]; if (data) delete data; data = NULL; } VecDraw->TransList2->Clear(); } ObjectCount1 = 0; ObjectCount2 = 0; memset(TempNumber1, 0, sizeof(int)*80); memset(TempNumber2, 0, sizeof(int)*80); InitStylePanel(pnBottomBeltBack, false); InitStylePanel(pnBottomBeltFront, false); InitStylePanel(pnBottomBeltSkirtBack, false); InitStylePanel(pnBottomBeltSkirtFront, false); InitStylePanel(pnBottomSilhouetteBack, false); InitStylePanel(pnBottomSilhouetteFront, false); InitStylePanel(pnBottomSilhouetteSkirtBack, false); InitStylePanel(pnBottomSilhouetteSkirtFront, false); InitStylePanel(pnBottomWholeBack, false); InitStylePanel(pnBottomWholeFront, false); InitStylePanel(pnBottomWholeSkirtBack, false); InitStylePanel(pnBottomWholeSkirtFront, false); InitStylePanel(pnTopCollarBack, false); InitStylePanel(pnTopCollarFront, false); InitStylePanel(pnTopCollarRaglanBack, false); InitStylePanel(pnTopCollarRaglanFront, false); InitStylePanel(pnTopSilhouetteBack, false); InitStylePanel(pnTopSilhouetteFront, false); InitStylePanel(pnTopSilhouetteRaglanBack, false); InitStylePanel(pnTopSilhouetteRaglanFront, false); InitStylePanel(pnTopSleeveBack, false); InitStylePanel(pnTopSleeveFront, false); InitStylePanel(pnTopSleeveRaglanBack, false); InitStylePanel(pnTopSleeveRaglanFront, false); InitStylePanel(pnTopWholeBack, false); InitStylePanel(pnTopWholeFront, false); InitStylePanel(pnTopWholeRaglanBack, false); InitStylePanel(pnTopWholeRaglanFront, false); dFrontZoomRatio = 1.0; dBackZoomRatio = 1.0; // ÆÄÀÏÀÌ OverWrite µÇÁö ¾Êµµ·Ï ÃʱâÈ­ ÇØÁØ´Ù - by monkman OpenDialogStyLoad->FileName = ""; OpenDialogChangeImage->FileName = ""; PaintBox1->Repaint(); PaintBox2->Repaint(); // sti ÃʱâÈ­ memset(&IllustHeader, 0, sizeof(ILLUSTDATAFILEHEADER)); // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ ÃʱâÈ­ - by monkman // Disivion LabelPatDivision->Font->Color = clSilver; LabelIllustDivision->Caption = ""; // Top Type LabelPatUpType->Font->Color = clSilver; LabelIllustUpType->Caption = ""; // Down Type LabelPatDnType->Font->Color = clSilver; LabelIllustDnType->Caption = ""; // Top Whole Style LabelPatUpWhole->Font->Color = clSilver; LabelIllustUpWhole->Caption = ""; // Top Silhouette Type LabelPatUpSilType->Font->Color = clSilver; LabelIllustUpSilType->Caption = ""; // Top Silhouette LabelPatUpSil->Font->Color = clSilver; LabelIllustUpSil->Caption = ""; // Top Sleeve LabelPatUpSle->Font->Color = clSilver; LabelIllustUpSle->Caption = ""; // Top Collar LabelPatUpCol->Font->Color = clSilver; LabelIllustUpCol->Caption = ""; // Bottom Whole Style LabelPatDnWhole->Font->Color = clSilver; LabelIllustDnWhole->Caption = ""; // Bottom Silhouette LabelPatDnSil->Font->Color = clSilver; LabelIllustDnSil->Caption = ""; // Bottom Belt LabelPatDnBelt->Font->Color = clSilver; LabelIllustDnBelt->Caption = ""; cbPYW->Enabled = false; sbPatSave->Enabled = false; if (IllustBitmap) { delete IllustBitmap; IllustBitmap = NULL; } PaintBox3->Repaint(); if (PatUpWhole) { while (PatUpWhole->Count) { data = (TVecData *)PatUpWhole->First(); delete data; PatUpWhole->Remove(data); } } if (PatUpSil) { while (PatUpSil->Count) { data = (TVecData *)PatUpSil->First(); delete data; PatUpSil->Remove(data); } } if (PatUpSle) { while (PatUpSle->Count) { data = (TVecData *)PatUpSle->First(); delete data; PatUpSle->Remove(data); } } if (PatUpCol) { while (PatUpCol->Count) { data = (TVecData *)PatUpCol->First(); delete data; PatUpCol->Remove(data); } } if (PatDnWhole) { while (PatDnWhole->Count) { data = (TVecData *)PatDnWhole->First(); delete data; PatDnWhole->Remove(data); } } if (PatDnSil) { while (PatDnSil->Count) { data = (TVecData *)PatDnSil->First(); delete data; PatDnSil->Remove(data); } } if (PatDnBelt) { while (PatDnBelt->Count) { data = (TVecData *)PatDnBelt->First(); delete data; PatDnBelt->Remove(data); } } } strTopWholeFileName = ""; strTopSilhouetteFileName = ""; strTopSleeveFileName = ""; strTopCollarFileName = ""; strBottomWholeFileName = ""; strBottomSilhouetteFileName = ""; strBottomBendBeltFileName = ""; // ÀÛ¾÷Áö½Ã¼­ Size Á¤º¸ ÃʱâÈ­ - by monkman(2011.01.18) for (int i = 0; i < rzstrgrdUpperSizeInformation->RowCount; i++) { // »óÀÇ rzstrgrdUpperSizeInformation->Cells[1][i] = ""; } for (int i = 0; i < rzstrgrdLowerSizeInformation->RowCount; i++) { // ÇÏÀÇ rzstrgrdLowerSizeInformation->Cells[1][i] = ""; } edStyleID->Text = ""; ComboYear->ItemIndex = ComboYear->Items->IndexOf(TDateTime::CurrentDate().FormatString("YYYY")); for (int i = 0; i < clbSSFW->Items->Count; i++) { clbSSFW->Checked[i] = false; } EditComment->Text = ""; // sty OpenDialog ÃʱâÈ­ - by monkman (2011.02.22) OpenDialogStyLoad->FileName = ""; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbTopWholeMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strTopWholeFileName); if (strTopWholeFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strTopWholeFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbTopSilhouetteMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strTopSilhouetteFileName); if (strTopSilhouetteFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strTopSilhouetteFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbTopSleeveMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strTopSleeveFileName); if (strTopSleeveFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strTopSleeveFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbTopCollarMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strTopCollarFileName); if (strTopCollarFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strTopCollarFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbBottomWholeMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strBottomWholeFileName); if (strBottomWholeFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strBottomWholeFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbBottomSilhouetteMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strBottomSilhouetteFileName); if (strBottomSilhouetteFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strBottomSilhouetteFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rbBottomBeltMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { String strCurPath, strFilePath; strCurPath = GetDirectoryName(false); strFilePath = ExtractFileDir(strBottomBendBeltFileName); if (strBottomBendBeltFileName.IsEmpty() == false && strCurPath == strFilePath) { LoadFromSTYFile(strBottomBendBeltFileName); if (PageFront->ActivePage == TabFront) PaintBox1->Repaint(); else if (PageFront->ActivePage == TabBack) PaintBox2->Repaint(); } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::SetSTIStatus(STYLEDATAFILEHEADER sdfhHeader) { // STY ÆÄÀÏ Load½Ã STI »óÅ ¼³Á¤ - by monkman (2010.09.09) if (sdfhHeader.Sort != SO_NONE) { if (sdfhHeader.Sort == SO_TOPFULL) { IllustHeader.Division = sdfhHeader.Division; IllustHeader.Type1 = sdfhHeader.Type; IllustHeader.EMethod = sdfhHeader.EMethod; IllustHeader.ESilhouette = sdfhHeader.ESilhouette; IllustHeader.ESleeve = sdfhHeader.ESleeve; IllustHeader.ECollar = sdfhHeader.ECollar; LabelPatDivision->Font->Color = clWindowText; if (sdfhHeader.Division == DV_MAN) LabelIllustDivision->Caption = " : Man"; if (sdfhHeader.Division == DV_WOMAN) LabelIllustDivision->Caption = " : Woman"; if (sdfhHeader.Division == DV_CHILD) LabelIllustDivision->Caption = " : Child"; if (sdfhHeader.Division == DV_BABY) LabelIllustDivision->Caption = " : Baby"; LabelPatUpType->Font->Color = clWindowText; LabelIllustUpType->Caption = " : " + CombiForm->StrType[Type]; LabelPatUpWhole->Font->Color = clWindowText; VecDraw->ClearDataList(PatUpWhole); // Çì´õ º¹»ç HDPatUpWhole = sdfhHeader; } else if (sdfhHeader.Sort == SO_SILHOUETTE) { IllustHeader.EMethod = sdfhHeader.EMethod; IllustHeader.ESilhouette = sdfhHeader.ESilhouette; LabelPatUpSilType->Font->Color = clWindowText; LabelIllustUpSilType->Caption = " : " + ComboTopSilhouetteType->Text; LabelPatUpSil->Font->Color = clWindowText; // »óÀÇ ´ëÇ¥ ½ºÅ¸ÀÏÀÌ ¾øÀ» °æ¿ì NoneÀ¸·Î ó¸® - by monkman (2004.04.14) if (!ComboTopSilhouetteSilhouette->Text.IsEmpty()) { LabelIllustUpSil->Caption = " : " + ComboTopSilhouetteSilhouette->Text; } else { LabelIllustUpSil->Caption = " : None"; } // Sleeve°¡ üũµÇ¾îÀÖÁö ¾ÊÀ» °æ¿ì if (sdfhHeader.bSleeve == true) { LabelPatUpSle->Font->Color = clNavy; LabelIllustUpSle->Caption = " : Included in Top"; } // Collar°¡ üũµÇ¾îÀÖÁö ¾ÊÀ» °æ¿ì if (sdfhHeader.bCollar == true) { LabelPatUpCol->Font->Color = clNavy; LabelIllustUpCol->Caption = " : Included in Top"; } VecDraw->ClearDataList(PatUpSil); // Çì´õ º¹»ç HDPatUpSil = sdfhHeader; } else if (sdfhHeader.Sort == SO_SLEEVE) { IllustHeader.ESleeve = sdfhHeader.ESleeve; LabelPatUpSle->Font->Color = clWindowText; LabelIllustUpSle->Caption = " : " + ComboTopSleeveSleeve->Text; VecDraw->ClearDataList(PatUpSle); // Çì´õ º¹»ç HDPatUpSle = sdfhHeader; } else if (sdfhHeader.Sort == SO_COLLAR) { IllustHeader.ECollar = sdfhHeader.ECollar; LabelPatUpCol->Font->Color = clWindowText; LabelIllustUpCol->Caption = " : " + ComboTopCollarCollar->Text; VecDraw->ClearDataList(PatUpCol); // Çì´õ º¹»ç HDPatUpCol = sdfhHeader; } else if (sdfhHeader.Sort == SO_BOTTOMFULL) { IllustHeader.Division = sdfhHeader.Division; IllustHeader.Type2 = sdfhHeader.Type; IllustHeader.EPants = sdfhHeader.EPants; IllustHeader.EBelt = sdfhHeader.EBelt; LabelPatDivision->Font->Color = clWindowText; if (sdfhHeader.Division == DV_MAN) LabelIllustDivision->Caption = " : Man"; if (sdfhHeader.Division == DV_WOMAN) LabelIllustDivision->Caption = " : Woman"; if (sdfhHeader.Division == DV_CHILD) LabelIllustDivision->Caption = " : Child"; if (sdfhHeader.Division == DV_BABY) LabelIllustDivision->Caption = " : Baby"; LabelPatDnType->Font->Color = clWindowText; LabelIllustDnType->Caption = " : " + CombiForm->StrType[Type]; LabelPatDnWhole->Font->Color = clWindowText; VecDraw->ClearDataList(PatDnWhole); // Çì´õ º¹»ç HDPatDnWhole = sdfhHeader; } else if (sdfhHeader.Sort == SO_PANTS) { IllustHeader.EPants = sdfhHeader.EPants; // ¹ÙÁö¿Í ½ºÄ¿Æ® ±¸ºÐ - by monkman (2004.04.09) if (sdfhHeader.Type != TP_SKIRT) { LabelIllustDnSil->Caption = " : " + ComboBottomSilhouettePantsSilhouette->Text; } else { LabelIllustDnSil->Caption = " : " + ComboBottomSilhouetteSkirtSilhouette->Text; } LabelPatDnSil->Font->Color = clWindowText; // Belt°¡ üũµÇ¾îÀÖÁö ¾ÊÀ» °æ¿ì if (sdfhHeader.bBelt == true) { LabelPatDnBelt->Font->Color = clNavy; LabelIllustDnBelt->Caption = " : Included in Bottom"; } VecDraw->ClearDataList(PatDnSil); // Çì´õ º¹»ç HDPatDnSil = sdfhHeader; } else if (sdfhHeader.Sort == SO_BELT) { IllustHeader.EBelt = sdfhHeader.EBelt; LabelPatDnBelt->Font->Color = clWindowText; LabelIllustDnBelt->Caption = " : " + ComboBottomBeltBelt->Text; LabelIllustDnBelt->Font->Color = clWindowText; VecDraw->ClearDataList(PatDnBelt); // Çì´õ º¹»ç HDPatDnBelt = sdfhHeader; } // »óÀǵç ÇÏÀÇµç ¿ÏÀüÇÏ°Ô µÈ °Í¸¸(³ªÁß¿¡ ¼öÁ¤) - by monkman // »óÀÇ - Á¶°Ç : Top Whole Style°ú Top Silhouette¸¸ µÇ¸é ÀúÀå °¡´É if (LabelPatUpSilType->Font->Color == clWindowText && LabelPatUpSil->Font->Color == clWindowText && LabelPatUpWhole->Font->Color == clWindowText) { if( is2004File_TopWhole || is2004File_TopSil || is2004File_TopCol || is2004File_TopSle ){ // 2004³âµµ ÆÄÀÏÀÌ ÀÖÀ¸¸é Ȱ¼ºÈ­ ¾ÈµÇ°Ô ÇÑ´Ù. }else{ sbPatSave->Enabled = true; } cbPYW->Enabled = true; } // ÇÏÀÇ - Á¶°Ç : Bottom Whole Style°ú Bottom Silhouette¸¸ µÇ¸é ÀúÀå °¡´É else if (LabelPatDnSil->Font->Color == clWindowText && LabelPatDnWhole->Font->Color == clWindowText) { if( is2004File_BottomWhole || is2004File_BottomPants || is2004File_BottomBelt ){ // 2004³âµµ ÆÄÀÏÀÌ ÀÖÀ¸¸é Ȱ¼ºÈ­ ¾ÈµÇ°Ô ÇÑ´Ù. }else{ sbPatSave->Enabled = true; } sbPatSave->Enabled = true; cbPYW->Enabled = true; } // ¿ÏÀüÇÏÁö ¾ÊÀº °ÍÀº ÀúÀåÇÏÁö ¾Ê´Â´Ù.. else { sbPatSave->Enabled = false; cbPYW->Enabled = false; } // À̹ÌÁö ¹öư °ü·Ã shPatSave->Pen->Color = clBlack; //sbChangeImage->Enabled = true; shChangeImage->Pen->Color = clBlack; } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::CopyVecDataList(TList *DstDataList, TList *SrcDataList, int nInstanceNumber) { // TVecData ¸¦ µ¥ÀÌÅÍ·Î °¡Áö°í ÀÖ´Â ¿øº» ¸®½ºÆ®¿¡¼­ µ¥ÀÌÅ͸¦ »ý¼º, º¹»çÇÑ ÈÄ ´ë»ó ¸®½ºÆ®¿¡ Ãß°¡ÇÑ´Ù - by monkman (2010.09.09) TVecData *dataSrc = NULL, *dataDst = NULL; VecDraw->ClearDataList(DstDataList); for (int i = 0; i < SrcDataList->Count; i++) { dataSrc = (TVecData *)SrcDataList->Items[i]; if (dataSrc) { if (0 <= nInstanceNumber) { dataDst = new TVecData(nInstanceNumber); } else { dataDst = new TVecData(MainImageForm->Number); } dataDst->Copy(dataSrc); DstDataList->Add(dataSrc); } } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::rzstrgrdSizeInformationKeyPress( TObject *Sender, char &Key) { TRzStringGrid *StringGrid = NULL; StringGrid = dynamic_cast(Sender); if (('0' <= Key && Key <= '9') || Key == '.' || Key == VK_LEFT || Key == VK_UP || Key == VK_RIGHT || Key == VK_DOWN || Key == VK_DELETE || Key == VK_BACK) ; // ÀÔ·ÂÀ» ¹Þ¾ÆµéÀÓ else if (Key == VK_RETURN) { if (StringGrid) { if (StringGrid->Row+1 < StringGrid->RowCount) StringGrid->Row++; } } else { Key = 0; } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnSizeInformationSaveClick( TObject *Sender) { TIniFile *IniFile = NULL; float fNum; if (savedlgSizeInformation->Execute()) { IniFile = new TIniFile(savedlgSizeInformation->FileName); if (IniFile) { for (int i = 0; i < rzstrgrdUpperSizeInformation->RowCount; i++) { if (TryStrToFloat(rzstrgrdUpperSizeInformation->Cells[1][i], fNum)) { // ½Ç¼öÀÎÁö È®ÀÎ IniFile->WriteString("UpperSize", IntToStr(i), rzstrgrdUpperSizeInformation->Cells[1][i]); } else { IniFile->WriteString("UpperSize", IntToStr(i), ""); } } for (int i = 0; i < rzstrgrdLowerSizeInformation->RowCount; i++) { if (TryStrToFloat(rzstrgrdLowerSizeInformation->Cells[1][i], fNum)) { // ½Ç¼öÀÎÁö È®ÀÎ IniFile->WriteString("LowerSize", IntToStr(i), rzstrgrdLowerSizeInformation->Cells[1][i]); } else { IniFile->WriteString("LowerSize", IntToStr(i), ""); } } delete IniFile; } IniFile = NULL; } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnSizeInformationLoadClick( TObject *Sender) { TIniFile *IniFile = NULL; String strNum; float fNum; if (opendlgSizeInformationLoad->Execute()) { IniFile = new TIniFile(opendlgSizeInformationLoad->FileName); if (IniFile) { for (int i = 0; i < rzstrgrdUpperSizeInformation->RowCount; i++) { strNum = IniFile->ReadString("UpperSize", IntToStr(i), ""); if (TryStrToFloat(strNum, fNum)) { // ½Ç¼öÀÎÁö È®ÀÎ rzstrgrdUpperSizeInformation->Cells[1][i] = strNum; } else { rzstrgrdUpperSizeInformation->Cells[1][i] = ""; } } for (int i = 0; i < rzstrgrdLowerSizeInformation->RowCount; i++) { strNum = IniFile->ReadString("LowerSize", IntToStr(i), ""); if (TryStrToFloat(strNum, fNum)) { // ½Ç¼öÀÎÁö È®ÀÎ rzstrgrdLowerSizeInformation->Cells[1][i] = strNum; } else { rzstrgrdLowerSizeInformation->Cells[1][i] = ""; } } delete IniFile; } IniFile = NULL; } } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnMaterialDirectoryClick( TObject *Sender) { String Msg; String strOldMaterialRootPath; shMaterialDirectory->Brush->Color = clRed; strOldMaterialRootPath = strMaterialRootPath; strMaterialRootPath = BaseDirectoryDialogFunc("DataTransForm_Material", strMaterialRootPath); Msg = IDS_MESSAGE12 + strMaterialRootPath + IDS_MESSAGE13; if (strOldMaterialRootPath.LowerCase() != strMaterialRootPath.LowerCase()) { // ¸Þ½ÃÁö : ±âº» Æú´õ°¡ <Æú´õ¸í>·Î º¯°æµÇ¾ú½À´Ï´Ù. MessageDlg(Msg, mtInformation, TMsgDlgButtons() << mbOK, 0); rzshelltreeMaterialExplorer->BaseFolder->PathName = strMaterialRootPath; lbMaterialDirectory->Caption = strMaterialRootPath; } shMaterialDirectory->Brush->Color = clBlack; } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::spdbtnCreateFolderClick(TObject *Sender) { rzshelltreeMaterialExplorer->CreateNewFolder(true); /* String strDirectory; int nNumber = 1; // ´Ù¸¥ À̸§À» ã±â À§ÇÑ ÀÛ¾÷ do { strDirectory = rzshelltreeMaterialExplorer->SelectedPathName + "\\New Folder " + IntToStr(nNumber); nNumber++; } while (DirectoryExists(strDirectory)); //if (DirectoryExists(strDirectory) == true) { // // Message : °°Àº Æú´õ¸íÀÌ Á¸ÀçÇÕ´Ï´Ù. // MessageDlg(IDS_SAMEFOLDERNAME, mtInformation, TMsgDlgButtons() << mbOK, 0); //} //else if (strDirectory.IsEmpty() == true) { // // Message : Æú´õ¸íÀÌ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù. // MessageDlg(IDS_SAMEFOLDERNAME, mtInformation, TMsgDlgButtons() << mbOK, 0); //} //else { if (CreateDirectory(strDirectory.c_str(), NULL) != 0) { rzshelltreeMaterialExplorer->RefreshNodes(); rzshelltreeMaterialExplorer->SelectedFolder->PathName = strDirectory; } else { // Message : Æú´õ¸íÀÌ »ý¼º¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. MessageDlg(IDS_CANNOTCREATEFOLDER, mtInformation, TMsgDlgButtons() << mbOK, 0); } //} */ } //--------------------------------------------------------------------------- void __fastcall TDataTransForm::FindPathes(String strRootPath, TStringList *DirList , TStringList *FileList, bool bRecursive) { try { if (strRootPath.c_str()[0] != '\\') strRootPath += '\\'; String strFindPath; TSearchRec srPath; int Found = FindFirst(strRootPath + "*.*", faAnyFile, srPath); while (Found == 0) { strFindPath = strRootPath + srPath.Name; if (*srPath.Name.c_str() != '.') { if (DirectoryExists(strFindPath)) { DirList->Add(strFindPath); if (bRecursive) FindPathes(strFindPath, DirList, FileList, bRecursive); } else if (FileExists(strFindPath)) { FileList->Add(strFindPath); } } Found = FindNext(srPath); } FindClose(srPath); } catch (Exception &e) { //throw e; } } //---------------------------------------------------------------------------