//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Combination.h" #include "CombiResult.h" #include "VIllustForm.h" #include "MainImage.h" #include "define.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "RzPanel" #pragma link "RzSplit" #pragma resource "*.dfm" #define IDS_COAT StringTable[0] #define IDS_JACKET StringTable[1] #define IDS_JUMPER StringTable[2] #define IDS_KNIT StringTable[3] #define IDS_PANTS StringTable[4] #define IDS_SHIRTS StringTable[5] #define IDS_TOP StringTable[6] #define IDS_VEST StringTable[7] #define IDS_ONEPIECE StringTable[8] #define IDS_BLOUSE StringTable[9] #define IDS_SKIRT StringTable[10] #define IDS_CAPE StringTable[11] #define IDS_ROMPERS StringTable[12] #define IDS_MAN StringTable[13] #define IDS_WOMAN StringTable[14] #define IDS_CHILD StringTable[15] #define IDS_BABY StringTable[16] #define IDS_UPPER StringTable[17] #define IDS_LOWER StringTable[18] #define IDS_GOPREV StringTable[19] #define IDS_GONEXT StringTable[20] #define IDS_COMBINATION StringTable[21] #define IDS_SB_CREATE_FOLDER StringTable[22] #define IDS_SB_RENAME_FOLDER StringTable[23] #define IDS_SB_DELETE_FOLDER StringTable[24] #define IDS_SB_DELETE_FILES StringTable[25] #define IDS_SB_COPY_FILES StringTable[26] #define IDS_SB_MOVE_FILES StringTable[27] #define IDS_LB_ORIGINAL StringTable[28] #define IDS_LB_TARGET StringTable[29] #define IDS_SB_SEARCH StringTable[30] #define IDS_SB_OK StringTable[31] #define IDS_SB_NONE StringTable[32] #define IDS_SB_CLOSE StringTable[33] #define IDS_SB_ALLNONE StringTable[34] #define IDS_MESSAGE01 StringTable[35] #define IDS_MESSAGE02 StringTable[36] #define IDS_MESSAGE03 StringTable[37] #define IDS_MESSAGE04 StringTable[38] #define IDS_MESSAGE05 StringTable[39] #define IDS_MESSAGE06 StringTable[40] #define IDS_MESSAGE07 StringTable[41] #define IDS_MESSAGE08 StringTable[42] #define IDS_MESSAGE09 StringTable[43] #define IDS_MESSAGE10 StringTable[44] // 2004.08.17 Ãß°¡ - by monkman #define IDS_WORKINGFOLDER StringTable[45] #define IDS_SETBASEFOLDER StringTable[46] #define IDS_MAINITEMS StringTable[47] #define IDS_CLOTHES StringTable[48] #define IDS_ITEMS StringTable[49] #define IDS_YEAR StringTable[50] #define IDS_SEASON StringTable[51] #define IDS_COMMENT StringTable[52] #define IDS_SEARCH StringTable[53] #define IDS_SEARCHNONE StringTable[54] #define IDS_STYFILEINFO StringTable[55] #define IDS_FRONT StringTable[56] #define IDS_BACK StringTable[57] #define IDS_INFORMATION StringTable[58] #define IDS_PATH StringTable[59] #define IDS_COMBICONDITION StringTable[60] #define IDS_MESSAGE11 StringTable[61] #define IDS_MESSAGE12 StringTable[62] #define IDS_MESSAGE13 StringTable[63] #define IDS_MESSAGE14 StringTable[64] #define IDS_MESSAGE15 StringTable[65] #define IDS_MESSAGE16 StringTable[66] #define IDS_MESSAGE17 StringTable[67] //#define IDS_ StringTable[] #define NUMBEROFSLEEVE 10 #define NUMBEROFCOLLAR 10 #define NUMBEROFSILHOUETTE 10 //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #define SET_RECT \ \ data->First.x = MaxInt; data->First.y = MaxInt; \ data->Second.x = 0; data->Second.y = 0; \ if (data->Kind == V_LINE || data->Kind == V_CURVE) { \ for (int i = 0; i < data->nCount*3+1; i++) { \ if (data->pList == NULL) continue; \ if (data->First.x > data->pList[i].x) data->First.x = data->pList[i].x; \ if (data->First.y > data->pList[i].y) data->First.y = data->pList[i].y; \ if (data->Second.x < data->pList[i].x) data->Second.x = data->pList[i].x; \ if (data->Second.y < data->pList[i].y) data->Second.y = data->pList[i].y; \ } \ } else if (data->Kind == V_TEXTBOX && !(data->ListOfAllLine->CurveData)) { \ for (int i = 0; i < 5; i++) { \ data->First.x = min(data->First.x, data->pList[i].x); \ data->First.y = min(data->First.y, data->pList[i].y); \ data->Second.x = max(data->Second.x, data->pList[i].x); \ data->Second.y = max(data->Second.y, data->pList[i].y); \ } \ } \ if (data->ParentTextBox){ \ int Margin; \ try{ \ Margin = data->ParentTextBox->ListOfAllLine->GetLineTextBox(0)->lineHeight*3; \ }catch(...) { \ Margin = 0; \ } \ data->First.x -= Margin; \ data->First.y -= Margin; \ data->Second.x += Margin; \ data->Second.y += Margin; \ } \ if (data->ChildList) { \ TVecData *item = NULL; \ int w, h, PenThick = 0; \ long minx = MaxInt, miny = MaxInt, maxx = 0, maxy = 0; \ for (int j = 0; j < data->ChildList->Count; j++) { \ item = (TVecData *)data->ChildList->Items[j]; \ minx = min(minx, item->First.x); \ minx = min(minx, item->Second.x); \ maxx = max(maxx, item->First.x); \ maxx = max(maxx, item->Second.x); \ miny = min(miny, item->First.y); \ miny = min(miny, item->Second.y); \ maxy = max(maxy, item->First.y); \ maxy = max(maxy, item->Second.y); \ PenThick = max(PenThick, item->PenThick); \ } \ w = (maxx - minx) / 2; h = (maxy - miny) / 2; \ w = PenThick + sqrt(w*w + h*h) + 0.5; \ data->First.x -= w; \ data->First.y -= w; \ data->Second.x += w; \ data->Second.y += w; \ } \ //--------------------------------------------------------------------------- TCombiForm *CombiForm; String FullDirectory, SilDirectory, SleDirectory, ColDirectory, BeltDirectory; //--------------------------------------------------------------------------- __fastcall TCombiForm::TCombiForm(TComponent* Owner) : TForm(Owner) { StringTable.Create(DirectoryItem, Language, "Combination"); SetSmallFont(Font); ImageList1 = NULL; ImageList2 = NULL; ImageList3 = NULL; ImageList4 = NULL; FileList = NULL; TagDataList = NULL; PreviewFrontList = NULL; PreviewBackList = NULL; SilFileList = NULL; SleFileList = NULL; ColFileList = NULL; PantsFileList = NULL; BeltFileList = NULL; SrcFileList = NULL; SrcFileBackupList = NULL; SCF = new TFileCache; ImageList1 = new TList; ImageList2 = new TList; ImageList3 = new TList; ImageList4 = new TList; FileList = new TStringList; SilFileList = new TStringList; SleFileList = new TStringList; ColFileList = new TStringList; PantsFileList = new TStringList; BeltFileList = new TStringList; TagDataList = new TList; PreviewFrontList = new TList; PreviewBackList = new TList; // µð·ºÅ丮¸¦ °¡Áö°í ÀÖ´Â List - by monkman (2004.05.03) SrcFileList = new TStringList; // Copy & Move µÉ SourceÆÄÀÏ ¸®½ºÆ® SrcFileBackupList = new TStringList; // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) combobxMainItem->AddItem(IDS_MAN, NULL); combobxMainItem->AddItem(IDS_WOMAN, NULL); combobxMainItem->AddItem(IDS_CHILD, NULL); combobxMainItem->AddItem(IDS_BABY, NULL); combobxMainItem->ItemIndex = 0; combobxUpperLower->AddItem(IDS_UPPER, NULL); combobxUpperLower->AddItem(IDS_LOWER, NULL); combobxUpperLower->ItemIndex = 0; spdbtnBack->Hint = IDS_GOPREV; spdbtnNext->Hint = IDS_GONEXT; Caption = IDS_COMBINATION; sbCreateFolder->Hint = IDS_SB_CREATE_FOLDER; sbRenameFolder->Hint = IDS_SB_RENAME_FOLDER; sbDeleteFolder->Hint = IDS_SB_DELETE_FOLDER; sbDeleteFiles->Hint = IDS_SB_DELETE_FILES; sbDeleteFiles2->Hint = IDS_SB_DELETE_FILES; sbCopyFiles->Hint = IDS_SB_COPY_FILES; sbMoveFiles->Hint = IDS_SB_MOVE_FILES; lbSource->Caption = IDS_LB_ORIGINAL; lbDestination->Caption = IDS_LB_TARGET; sbSearch1->Hint = IDS_SB_SEARCH; sbSearch2->Hint = IDS_SB_SEARCH; sbSearch3->Hint = IDS_SB_SEARCH; sbOK->Hint = IDS_SB_OK; sbNone->Hint = IDS_SB_NONE; sbClose->Hint = IDS_SB_CLOSE; sbAllNone->Hint = IDS_SB_ALLNONE; // 2004.08.18 Ãß°¡ - by monkman GroupBoxWorkingFolder->Caption = IDS_WORKINGFOLDER; sbChangeBaseDirectory->Hint = IDS_SETBASEFOLDER; lbMainItem->Caption = IDS_MAINITEMS; lbClothes->Caption = IDS_CLOTHES; lbItem->Caption = IDS_ITEMS; lbYear1->Caption = IDS_YEAR; lbYear2->Caption = IDS_YEAR; lbYear3->Caption = IDS_YEAR; lbSeason1->Caption = IDS_SEASON; lbSeason2->Caption = IDS_SEASON; lbSeason3->Caption = IDS_SEASON; lbCom1->Caption = IDS_COMMENT; lbCom2->Caption = IDS_COMMENT; lbCom3->Caption = IDS_COMMENT; sbSearch1->Hint = IDS_SEARCH; sbSearch2->Hint = IDS_SEARCH; sbSearch3->Hint = IDS_SEARCH; sbSearchNone1->Hint = IDS_SEARCHNONE; sbSearchNone2->Hint = IDS_SEARCHNONE; sbSearchNone3->Hint = IDS_SEARCHNONE; lbInformation->Caption = IDS_STYFILEINFO; lbFront->Caption = IDS_FRONT; lbBack->Caption = IDS_BACK; //gbSTYPreview->Caption = IDS_INFORMATION; LabelSTYPath->Caption = IDS_PATH + " : "; LabelSTYDivision->Caption = IDS_MAINITEMS + " : "; LabelItems->Caption = IDS_ITEMS + " : "; LabelCombinationCondition->Caption = IDS_COMBICONDITION + " : "; LabelSTYYear->Caption = IDS_YEAR + " : "; LabelSTYSeason->Caption = IDS_SEASON + " : "; LabelSTYComment->Caption = IDS_COMMENT + " : "; // DisivionName Ãß°¡ - by monkman (2004.07.06) DivisionName[DV_MAN] = IDS_MAN; DivisionName[DV_WOMAN] = IDS_WOMAN; DivisionName[DV_CHILD] = IDS_CHILD; DivisionName[DV_BABY] = IDS_BABY; StrType[TP_COAT] = IDS_COAT; StrType[TP_JACKET] = IDS_JACKET; StrType[TP_JUMPER] = IDS_JUMPER; StrType[TP_KNIT] = IDS_KNIT; StrType[TP_PANTS] = IDS_PANTS; StrType[TP_SHIRTS] = IDS_SHIRTS; StrType[TP_TOP] = IDS_TOP; StrType[TP_VEST] = IDS_VEST; StrType[TP_ONEPIECE] = IDS_ONEPIECE; StrType[TP_BLOUSE] = IDS_BLOUSE; StrType[TP_SKIRT] = IDS_SKIRT; StrType[TP_CAPE] = IDS_CAPE; StrType[TP_ROMPERS] = IDS_ROMPERS; //////////////////////////////////////////////////////////////////////////////// // SleeveName[DS_SLEEVELESS] = IDS_DS_SLEEVELESS; // SleeveName[DS_SETIN] = IDS_DS_SETIN; // SleeveName[DS_RAGLAN] = IDS_DS_RAGLAN; // SleeveName[DS_YOKE] = IDS_DS_YOKE; // SleeveName[DS_CAP] = IDS_DS_CAP; // SleeveName[DS_DOLMAN] = IDS_DS_DOLMAN; // SleeveName[DS_PUFF] = IDS_DS_PUFF; // SleeveName[DS_BISHOP] = IDS_DS_BISHOP; // SleeveName[DS_DRAPED] = IDS_DS_DRAPED; // SleeveName[DS_HALF] = IDS_DS_HALF; // SleeveName[DS_SHIRTS] = IDS_DS_SHIRTS; // SleeveName[DS_TIGHT] = IDS_DS_TIGHT; // SleeveName[DS_FULL] = IDS_DS_FULL; // SleeveName[DS_HALFSHIRTS] = IDS_DS_HALFSHIRTS; // SleeveName[DS_HALFBISHOP] = IDS_DS_HALFBISHOP; // SleeveName[] = IDS_; // // CollarName[DC_RUFFLED] = IDS_DC_RUFFLED; // CollarName[DC_MANDARIN] = IDS_DC_MANDARIN; // CollarName[DC_SHIRTS] = IDS_DC_SHIRTS; // CollarName[DC_CROSS] = IDS_DC_CROSS; // CollarName[DC_ITALIAN] = IDS_DC_ITALIAN; // CollarName[DC_SHOWL] = IDS_DC_SHOWL; // CollarName[DC_SPORTS] = IDS_DC_SPORTS; // CollarName[DC_SOUTIEN] = IDS_DC_SOUTIEN; // CollarName[DC_TAILORED] = IDS_DC_TAILORED; // CollarName[DC_NAPOLEON] = IDS_DC_NAPOLEON; // CollarName[DC_REEFER] = IDS_DC_REEFER; // CollarName[DC_CONVERTIBLE]= IDS_DC_CONVERTIBLE; // CollarName[DC_BUTTONDOWN] = IDS_DC_BUTTONDOWN; // CollarName[DC_HIGHNECK] = IDS_DC_HIGHNECK; // CollarName[DC_CHIN] = IDS_DC_CHIN; // CollarName[DC_SAILOR] = IDS_DC_SAILOR; // CollarName[DC_CAPE] = IDS_DC_CAPE; // CollarName[DC_PEAKED] = IDS_DC_PEAKED; // CollarName[DC_RIBBON] = IDS_DC_RIBBON; // // CollarName[DN_ROUND] = IDS_DN_ROUND; // CollarName[DN_VNECK] = IDS_DN_VNECK; // CollarName[DN_SQUARE] = IDS_DN_SQUARE; // CollarName[DN_UNECK] = IDS_DN_UNECK; // CollarName[DN_BOAT] = IDS_DN_BOAT; // CollarName[DN_HIGH] = IDS_DN_HIGH; // CollarName[DN_COWL] = IDS_DN_COWL; // CollarName[DN_HALTER] = IDS_DN_HALTER; // CollarName[DN_SLIT] = IDS_DN_SLIT; // CollarName[DN_SURPLICE] = IDS_DN_SURPLICE; // CollarName[DN_LOW] = IDS_DN_LOW; // CollarName[DN_CAMISOLE] = IDS_DN_CAMISOLE; // CollarName[DN_FUNNEL] = IDS_DN_FUNNEL; // CollarName[DN_TURTLE] = IDS_DN_TURTLE; // CollarName[] = IDS_; // // PantsName[DP_BOXER] = IDS_DP_BOXER; // PantsName[DP_SHORTS] = IDS_DP_SHORTS; // PantsName[DP_CAPRI] = IDS_DP_CAPRI; // PantsName[DP_BELLBOTTOM] = IDS_DP_BELLBOTTOM; // PantsName[DP_FLARE] = IDS_DP_FLARE; // PantsName[DP_TROUSERS] = IDS_DP_TROUSERS; // PantsName[DP_TRAINING] = IDS_DP_TRAINING; // PantsName[DP_OVERALLS] = IDS_DP_OVERALLS; // PantsName[DP_CULOTTES] = IDS_DP_CULOTTES; // // BeltName[DB_BELT] = IDS_DB_BELT; // BeltName[DB_BEND] = IDS_DB_BEND; // BeltName[DB_NOBELT] = IDS_DB_NOBELT; //////////////////////////////////////////////////////////////////////////////// #ifndef WORKSHEET // ÀÛ¾÷Áö½Ã¼­¿¡´Â DS_RAGLANÀÌ ¾ø´Ù - by monkman (2011.01.11) VecDraw->SilhouetteName[DE_ALINE] = "A-Line"; VecDraw->SilhouetteName[DE_HLINE] = "H-Line"; VecDraw->SilhouetteName[DE_BUTTON] = "Button"; VecDraw->SilhouetteName[DE_SINGLEBUTTON] = "Single Button"; VecDraw->SilhouetteName[DE_DOUBLEBUTTON] = "Double Button"; VecDraw->SilhouetteName[DE_ZIPPER] = "Zipper"; VecDraw->SilhouetteName[DE_SHORTZIPPER] = "Short Zipper"; VecDraw->SilhouetteName[DE_LONGZIPPER] = "Long Zipper"; VecDraw->SilhouetteName[DE_SHORTPLACKET] = "Short Placket"; VecDraw->SilhouetteName[DE_LONGPLACKET] = "Long Placket"; VecDraw->SilhouetteName[DE_CAMISOLE] = "Camisole"; VecDraw->SilhouetteName[DE_FULLSTYLE] = "Full Style"; VecDraw->SilhouetteName[DE_HIGHWAIST] = "High Waist"; VecDraw->SilhouetteName[DE_KNIT] = "Knit"; VecDraw->SilhouetteName[DE_NORMAL] = "Normal"; VecDraw->SilhouetteName[DE_PLAIN] = "Plain"; VecDraw->SilhouetteName[DE_PRINCESSLINE] = "Princess Line"; VecDraw->SilhouetteName[DE_PLEATS] = "Pleats"; VecDraw->SilhouetteName[DE_HALFSHIRTS] = "Half Shirts"; VecDraw->SilhouetteName[DE_DROPSHOULDER] = "Drop Shoulder"; VecDraw->SilhouetteName[DE_RAGLAN] = "Raglan"; VecDraw->SilhouetteName[DE_SLEEVELESS] = "Sleeveless"; VecDraw->SilhouetteName[DE_TUBE] = "Tube"; VecDraw->SilhouetteName[DE_UNBALANCE] = "Unbalance"; VecDraw->SilhouetteName[DE_FLARE] = "Flare"; VecDraw->SilhouetteName[DE_TIERED] = "Tiered"; VecDraw->SilhouetteName[DE_HIDDENBUTTON] = "Hidden Button"; VecDraw->SilhouetteName[DE_HOOK] = "Hook"; VecDraw->SilhouetteName[DE_FUR] = "Fur"; VecDraw->SilhouetteName[DE_CAPE] = "Cape"; VecDraw->SilhouetteName[DE_SWIMWEAR] = "Swim Wear"; VecDraw->SilhouetteName[DE_CARDIGAN] = "Cardigan"; VecDraw->SilhouetteName[DE_BODYSUIT] = "Body Suit"; VecDraw->SilhouetteName[DE_ALLINONE] = "All-In-One"; VecDraw->SilhouetteName[DE_INCOLLAR] = "Including Collar"; VecDraw->SilhouetteName[DE_INSLEEVE] = "Including Sleeve"; VecDraw->SilhouetteName[DE_INCOLSLE] = "Including Collar & Sleeve"; VecDraw->SilhouetteName[DE_USER01] = "User01"; VecDraw->SilhouetteName[DE_USER02] = "User02"; VecDraw->SilhouetteName[DE_USER03] = "User03"; VecDraw->SilhouetteName[DE_USER04] = "User04"; VecDraw->SilhouetteName[DE_USER05] = "User05"; VecDraw->SilhouetteName[DE_USER06] = "User06"; VecDraw->SilhouetteName[DE_USER07] = "User07"; VecDraw->SilhouetteName[DE_USER08] = "User08"; VecDraw->SilhouetteName[DE_USER09] = "User09"; VecDraw->SilhouetteName[DE_USER10] = "User10"; VecDraw->SleeveName[DS_SLEEVELESS] = "Sleeveless"; VecDraw->SleeveName[DS_SETIN] = "Set in"; VecDraw->SleeveName[DS_RAGLAN] = "Raglan"; VecDraw->SleeveName[DS_YOKE] = "Yoke"; VecDraw->SleeveName[DS_CAP] = "Cap"; VecDraw->SleeveName[DS_DOLMAN] = "Dolman"; VecDraw->SleeveName[DS_PUFF] = "Puff"; VecDraw->SleeveName[DS_BISHOP] = "Bishop"; VecDraw->SleeveName[DS_DRAPED] = "Draped"; VecDraw->SleeveName[DS_HALF] = "Half"; VecDraw->SleeveName[DS_SHIRTS] = "Shirts"; VecDraw->SleeveName[DS_TIGHT] = "Tight"; VecDraw->SleeveName[DS_FULL] = "Full"; VecDraw->SleeveName[DS_HALFSHIRTS] = "Half Shirts"; VecDraw->SleeveName[DS_HALFBISHOP] = "Half Bishop"; VecDraw->SleeveName[DS_TUCK] = "Tuck"; VecDraw->SleeveName[DS_FRILL] = "Frill"; VecDraw->SleeveName[DS_TEIRED] = "Tiered"; VecDraw->SleeveName[DS_RUFFLED] = "Ruffled"; VecDraw->SleeveName[DS_DROPSHOULDER] = "Drop Shoulder"; VecDraw->SleeveName[DS_TRUMPET] = "Trumpet"; VecDraw->SleeveName[DS_SLIT] = "Slit"; VecDraw->SleeveName[DS_FUR] = "Fur"; VecDraw->SleeveName[DS_UNBALANCE] = "Unbalance"; VecDraw->CollarName[DC_RUFFLED] = "Ruffled"; VecDraw->CollarName[DC_MANDARIN] = "Mandarin"; VecDraw->CollarName[DC_SHIRTS] = "Shirts"; VecDraw->CollarName[DC_CROSS] = "Cross"; VecDraw->CollarName[DC_ITALIAN] = "Italian"; VecDraw->CollarName[DC_SHOWL] = "Showl"; VecDraw->CollarName[DC_SPORTS] = "Sports"; VecDraw->CollarName[DC_SOUTIEN] = "Soutien"; VecDraw->CollarName[DC_TAILORED] = "Tailored"; VecDraw->CollarName[DC_NAPOLEON] = "Napoleon"; VecDraw->CollarName[DC_REEFER] = "Reefer"; VecDraw->CollarName[DC_CONVERTIBLE]= "Convertible"; VecDraw->CollarName[DC_BUTTONDOWN] = "Button Down"; VecDraw->CollarName[DC_HIGHNECK] = "Hight Neck"; VecDraw->CollarName[DC_CHIN] = "Chin"; VecDraw->CollarName[DC_SAILOR] = "Sailor"; VecDraw->CollarName[DC_CAPE] = "Cape"; VecDraw->CollarName[DC_PEAKED] = "Peaked"; VecDraw->CollarName[DC_RIBBON] = "Ribbon"; VecDraw->CollarName[DC_HOOD] = "Hood"; VecDraw->CollarName[DC_ETON] = "Eton"; VecDraw->CollarName[DC_SIDEWAY] = "Side way"; VecDraw->CollarName[DC_FRILL] = "Frill"; VecDraw->CollarName[DC_FUR] = "Fur"; VecDraw->CollarName[DN_ROUND] = "Round"; VecDraw->CollarName[DN_VNECK] = "V-Neck"; VecDraw->CollarName[DN_SQUARE] = "Square"; VecDraw->CollarName[DN_UNECK] = "U-Neck"; VecDraw->CollarName[DN_BOAT] = "Boat"; VecDraw->CollarName[DN_HIGH] = "High"; VecDraw->CollarName[DN_COWL] = "Cowl"; VecDraw->CollarName[DN_HALTER] = "Halter"; VecDraw->CollarName[DN_SLIT] = "Slit"; VecDraw->CollarName[DN_SURPLICE] = "Surplice"; VecDraw->CollarName[DN_LOW] = "Low"; VecDraw->CollarName[DN_CAMISOLE] = "Camisole"; VecDraw->CollarName[DN_FUNNEL] = "Funnel"; VecDraw->CollarName[DN_TURTLE] = "Turtle"; VecDraw->CollarName[DN_SCOOP ] = "Scoop"; VecDraw->PantsName[DP_BOXER] = "Boxer"; VecDraw->PantsName[DP_SHORTS] = "Shorts"; VecDraw->PantsName[DP_CAPRI] = "Capri"; VecDraw->PantsName[DP_BELLBOTTOM] = "Bell Bottom"; VecDraw->PantsName[DP_FLARE] = "Flare"; VecDraw->PantsName[DP_TROUSERS] = "Trousers"; VecDraw->PantsName[DP_TRAINING] = "Training"; VecDraw->PantsName[DP_OVERALLS] = "Over Alls"; VecDraw->PantsName[DP_CULOTTES] = "Culottes"; VecDraw->PantsName[DP_JEANS] = "Jeans"; VecDraw->PantsName[DP_HALFPANTS] = "Half Pants"; VecDraw->PantsName[DP_CARGO] = "Cargo"; VecDraw->PantsName[DP_BLOOMER] = "Bloomer"; VecDraw->PantsName[DK_GATHER] = "Gather"; VecDraw->PantsName[DK_DIVIDED] = "Divided"; VecDraw->PantsName[DK_WRAP] = "Wrap"; VecDraw->PantsName[DK_MINI] = "Mini"; VecDraw->PantsName[DK_TIGHT] = "Tight"; VecDraw->PantsName[DK_SEMITIGHT] = "SemiTight"; VecDraw->PantsName[DK_FLARE] = "Flare"; VecDraw->PantsName[DK_PLEATED] = "Pleated"; VecDraw->PantsName[DK_TRUMPET] = "Trumpet"; VecDraw->BeltName[DB_BELT] = "Belt"; VecDraw->BeltName[DB_BEND] = "Bend"; VecDraw->BeltName[DB_NOBELT] = "No-Belt"; VecDraw->BeltName[DB_BELT1] = "Belt1"; VecDraw->BeltName[DB_BELT2] = "Belt2"; VecDraw->BeltName[DB_BELT3] = "Belt3"; VecDraw->BeltName[DB_BELT4] = "Belt4"; VecDraw->BeltName[DB_BELT5] = "Belt5"; VecDraw->SilhouetteCount = DE_LAST; VecDraw->SleeveCount = DS_LAST; VecDraw->CollarCount = DCN_LAST; VecDraw->PantsCount = DPK_LAST; VecDraw->BeltCount = DB_LAST; #else // Á¶ÇÕ ¾ÆÀÌÅÛ Á¤º¸ ·Îµå VecDraw->LoadFromCombiItem(DirectoryBin+"\\CombiItem.cdf"); #endif DSUpper << TP_COAT << TP_JACKET << TP_JUMPER << TP_KNIT << TP_SHIRTS << TP_TOP << TP_VEST << TP_CAPE << TP_ROMPERS << TP_ONEPIECE << TP_BLOUSE; DSLower << TP_PANTS << TP_SKIRT; // VecDraw¿¡¼­ ó¸®Çß´Ù - by monkman (2011.01.13) /* DSMan << TP_COAT << TP_JACKET << TP_JUMPER << TP_KNIT << TP_PANTS << TP_SHIRTS << TP_TOP << TP_VEST; DSWoman << TP_ONEPIECE << TP_BLOUSE << TP_COAT << TP_JACKET << TP_JUMPER << TP_KNIT << TP_PANTS << TP_SHIRTS << TP_TOP << TP_SKIRT << TP_VEST; // DSChild¿¡ TP_JACKET, TP_TOP, TP_KNIT, TP_BLOUSE Ãß°¡ - by monkman (2004.07.03) DSChild << TP_CAPE << TP_COAT << TP_JUMPER << TP_PANTS << TP_SHIRTS << TP_ONEPIECE << TP_SKIRT << TP_VEST << TP_JACKET << TP_TOP << TP_KNIT << TP_BLOUSE; DSBaby << TP_CAPE << TP_PANTS << TP_ROMPERS << TP_SHIRTS << TP_ONEPIECE << TP_SKIRT; */ // Style.ini ÆÄÀÏ¿¡¼­ ¾ò¾î¿Â STYPath °ª - by monkman (2004.07.30) strSTYDirectory = ""; // ¾Æ·¡ ¼Ò½º¸¦ InitFormÀ¸·Î ¿Å±è /* TIniFile *IniFile; IniFile = new TIniFile(AppDataItem+"\\Style.ini"); if (IniFile) { strRootPath = IniFile->ReadString("Combination", "RootPath", DirectoryBin); strSTYDirectory = IniFile->ReadString("Combination", "Directory", strSTYDirectory); if (!DirectoryExists(strSTYRootPath+"\\"+strSTYDirectory)) { if (!DirectoryExists(strSTYRootPath)) { strSTYRootPath = DirectoryBin; IniFile->WriteString("Combination", "RootPath", DirectoryBin); } strSTYDirectory = ""; IniFile->WriteString("Combination", "Directory", strSTYDirectory); } delete IniFile; } IniFile = NULL; */ DirectoryImage = DirectoryBin + "\\Image"; DirectoryStyle = strRootPath + "\\Style"; DstDirectory = ""; SrcDirectory = ""; bInit = true; // ÃʱâÈ­°¡ ÇÊ¿äÇÑÁö ¿©ºÎ - by monkman (2004.10.12) bItemsClickSW = false; // ItemClick()ÇÔ¼ö°¡ È£ÃâµÇ¸é¼­ ³Ñ¾î¿ÔÀ¸¸é true, ¾Æ´Ï¸é false - for Progressbar - by monkman (2004.05.13) } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FormCreate(TObject *Sender) { // CheckedSilhouette[] ¹è¿­À» CheckedSilhouette ¸®½ºÆ®·Î ¼³Á¤ - by monkman (2004.03.24) CheckedSilhouette.Clear(); CheckedSleeve.Clear(); CheckedCollar.Clear(); CheckedPants.Clear(); CheckedBelt.Clear(); memset(&CheckedOldSilhouette, 0, sizeof(int)*100); #ifdef WORKSHEET if (rzsplitterCombination->HotSpotClosed == false) { rzsplitterCombination->CloseHotSpot(); StringGrid1->Width = 639; StringGrid2->Width = 639; StringGrid3->Width = 639; RzPanel1->Width = 653; } #endif } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FormClose(TObject *Sender, TCloseAction &Action) { // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿Ô´ÂÁö üũ bIsStringGrid1First = false; bIsStringGrid2First = false; bIsStringGrid3First = false; // IllustFormÀ» °°ÀÌ ´Ý¾Æ ÁØ´Ù if (bIsIllustForm) { StyleIllustForm->FormClose(Sender, Action); } bIsIllustForm = false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::InitForm() { // STY File Information ·¹À̺íÀ» °¡¿îµ¥ À§Ä¡ÇÏ°Ô ÇÑ´Ù lbInformation->Left = (pnSTYPreview->Width / 2) - (lbInformation->Width / 2); progressbarCombination->Position = 0; // ProgressBarÀÇ À§Ä¡¸¦ ÃʱâÈ­ ÇÑ´Ù - by monkman (2004.05.13) bItemsClickSW = false; // ItemClick()ÇÔ¼ö°¡ È£ÃâµÇ¸é¼­ ³Ñ¾î¿ÔÀ¸¸é true, ¾Æ´Ï¸é false - for Progressbar - by monkman (2004.05.13) // Style.ini ÆÄÀÏ¿¡¼­ ¾ò¾î¿Â STYPath °ª - by monkman (2004.07.30) TIniFile *IniFile; IniFile = new TIniFile(AppDataItem+"\\Style.ini"); if (IniFile) { if (bIsIllustForm) { // IllustForm¿¡¼­ ³Ñ¾î¿ÔÀ» °æ¿ì.. - by monkman (2004.08.02) strRootPath = IniFile->ReadString("StyleIllustForm", "RootPath", DirectoryBin); strSTYDirectory = IniFile->ReadString("StyleIllustForm", "Directory", strSTYDirectory); if (!DirectoryExists(strRootPath+"\\"+strSTYDirectory)) { if (!DirectoryExists(strRootPath)) { strRootPath = DirectoryBin; IniFile->WriteString("Combination", "RootPath", strRootPath); } strSTYDirectory = ""; IniFile->WriteString("Combination", "Directory", strSTYDirectory); } } else { // CombinationForm - by monkman (2004.08.02) strRootPath = IniFile->ReadString("Combination", "RootPath", DirectoryBin); strSTYDirectory = IniFile->ReadString("Combination", "Directory", strSTYDirectory); if (!DirectoryExists(strRootPath+"\\"+strSTYDirectory)) { if (!DirectoryExists(strRootPath)) { strRootPath = DirectoryBin; IniFile->WriteString("Combination", "RootPath", strRootPath); } strSTYDirectory = ""; IniFile->WriteString("Combination", "Directory", strSTYDirectory); } } delete IniFile; } IniFile = NULL; FindFolder(strRootPath + "\\*.*"); //if (!bIsIllustForm) comboSource->ItemIndex = 0; //else comboSource->ItemIndex = StyleFormComboSourceItemIndex; // 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]); } SrcDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; DirectoryStyle = strRootPath + "\\" + SrcDirectory; lbPath->Caption = "[ " + lbSource->Caption + " ] " + DirectoryStyle; firstyear1 = MIN_YEAR; firstyear2 = MAX_YEAR; secondyear1 = MIN_YEAR; secondyear2 = MAX_YEAR; thirdyear1 = MIN_YEAR; thirdyear2 = MAX_YEAR; fourthyear1 = MIN_YEAR; fourthyear2 = MAX_YEAR; firstseason1 = MIN_SSFW; firstseason2 = MAX_SSFW; secondseason1 = MIN_SSFW; secondseason2 = MAX_SSFW; thirdseason1 = MIN_SSFW; thirdseason2 = MAX_SSFW; fourthseason1 = MIN_SSFW; fourthseason2 = MAX_SSFW; bWheelMode = false; // ¸¶¿ì½º ÈÙ °¨Áö¸¦ À§ÇØ - by monkman (2004.06.15) // IllustForm¿¡¼­ ³Ñ¾î¿Â °ÍÀÌ ¾Æ´Ï¶ó¸é.. - by monkman if (!bIsIllustForm) { // Main Items (Ȥ½Ã ÀÌÀü¿¡ ´Ù¸¥°ÍÀÌ ¼±ÅÃµÈ °ªÀÌ ÀÖÀ»±îºÁ.. ´Ù¸¥ °ÍÀº false·Î..) // ÃʱâÈ­ combobxMainItem->ItemIndex = 0; // Top, Bottom Style combobxUpperLower->ItemIndex = 0; lbItem->Visible = false; combobxItem->Visible = false; Panel1->Visible = false; Panel1->Enabled = true; Panel2->Enabled = true; Panel3->Visible = false; Panel3->SendToBack(); sbAllNone->Enabled = false; // ÆûÀÇ À§Ä¡°¡ º¯ÇüµÇ¾ú´Ù¸é ¿ø·¡´ë·Î µ¹·Á³õ´Â´Ù spdbtnBack->Visible = false; } // STYPreview ÆÐ³ÎÀ» ´Ý¾ÆÁØ´Ù pbSTYPreviewBackground->SendToBack(); pbSTYPreviewBackground->Enabled = false; pbSTYPreviewBackground->Visible = false; // comboSource¿¡ Æú´õ°¡ ÇÑ °³ À̰í, ±× Æú´õ°¡ Stylist ±âº» Style Æú´õ¸é »èÁ¦ ºÒ°¡´ÉÇÏ°Ô ÇÑ´Ù if (comboSource->Items->Count <= 1 && strRootPath.LowerCase() == DirectoryBin.LowerCase()) { sbRenameFolder->Enabled = false; sbDeleteFolder->Enabled = false; } else if (comboSource->Items->Count < 1) { // Æú´õ°¡ ¾øÀ» ¶§µµ »èÁ¦ ºÒ°¡´ÉÇÏ°Ô ÇÑ´Ù sbRenameFolder->Enabled = false; sbDeleteFolder->Enabled = false; } else { // Æú´õ°¡ µÎ °³ ÀÏ °æ¿ì sbRenameFolder->Enabled = true; sbDeleteFolder->Enabled = true; } //editStopWatch->Visible = false; //editDetailStopWatch->Visible = false; bInit = false; // CombiResultÆû¿¡¼­ ´Ù½Ã ÃʱâÈ­ÇÏÁö ¾Ê°Ô ÇÑ´Ù - by monkman (2004.10.12) #ifdef WORKSHEET LabelSTYStyleID->Visible = true; lbSTYStyleID->Visible = true; #endif MainItemChange(NULL); return; fail: return; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::ExitForm() { } //--------------------------------------------------------------------------- void __fastcall TCombiForm::SetFont() { SetSmallFont(Font); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::MainItemChange(TObject *Sender) { int i; int nCombiItemIndex; switch (combobxMainItem->ItemIndex) { case 0: Division = DV_MAN; if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Man_Upper; else DSItems = VecDraw->Man_Lower; break; case 1: Division = DV_WOMAN; if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Woman_Upper; else DSItems = VecDraw->Woman_Lower; break; case 2: Division = DV_CHILD; if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Child_Upper; else DSItems = VecDraw->Child_Lower; break; case 3: Division = DV_BABY; if (combobxUpperLower->ItemIndex == 0) DSItems = VecDraw->Baby_Upper; else DSItems = VecDraw->Baby_Lower; break; default: return; } switch (combobxUpperLower->ItemIndex) { case 0: DSClothes = DSUpper; break; case 1: DSClothes = DSLower; break; default: return; } lbItem->Visible = true; combobxItem->Visible = true; itemnumber = 0; memset(temptype, 0, sizeof(EType)*10); if (bIsIllustForm) nCombiItemIndex = combobxItem->ItemIndex; combobxItem->Clear(); for (i = TP_NONE; i < TP_LAST; i++) { if (DSItems.Contains(i) && DSClothes.Contains(i)) { temptype[itemnumber] = EType(i); if (temptype[itemnumber] != TP_NONE) { combobxItem->AddItem(StrType[temptype[itemnumber]], NULL); } itemnumber++; } } if (!bIsIllustForm) combobxItem->ItemIndex = 0; else combobxItem->ItemIndex = nCombiItemIndex; MainType = (EType)0; // bItemsClickSW ·Î rbClothesClick¿¡¼­ ³Ñ¾î¿Ô´Ù´Â°ÍÀ» üũ - by monkman (2004.05.13) bItemsClickSW = true; SubItemChange(this); bItemsClickSW = false; progressbarCombination->Position = 0; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::SubItemChange(TObject *Sender) { // ¹öưÀ» ´©¸¥°Í¸¸ µ¿ÀÛ //////////////////////////////////////////////////////////////////////////////// // // °Ë»öµÈ ¿¬µµ°¡ ¼ýÀÚÀÎÁö üũ // bool yearcheck; // // firstyear1 = MIN_YEAR; // firstyear2 = MAX_YEAR; // secondyear1 = MIN_YEAR; // secondyear2 = MAX_YEAR; // thirdyear1 = MIN_YEAR; // thirdyear2 = MAX_YEAR; // fourthyear1 = MIN_YEAR; // fourthyear2 = MAX_YEAR; // // yearcheck = true; // yearcheck &= YearCheck(comboFirstBegin); // yearcheck &= YearCheck(comboFirstEnd); // yearcheck &= YearCheck(comboSecondBegin); // yearcheck &= YearCheck(comboSecondEnd); // yearcheck &= YearCheck(comboThirdBegin); // yearcheck &= YearCheck(comboThirdEnd); // // if (!yearcheck) { // // ¸Þ½ÃÁö : ¿¬µµ´Â ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù. // MessageDlg(IDS_MESSAGE01, mtError, TMsgDlgButtons() << mbOK, 0); // return; // } else { // if (comboFirstBegin->Text != "" && comboFirstBegin->Text != NULL && comboFirstBegin->Text != "All") firstyear1 = StrToInt(comboFirstBegin->Text); // if (comboFirstEnd->Text != "" && comboFirstEnd->Text != NULL && comboFirstEnd->Text != "All") firstyear2 = StrToInt(comboFirstEnd->Text); // if (comboSecondBegin->Text != "" && comboSecondBegin->Text != NULL && comboSecondBegin->Text != "All") secondyear1 = StrToInt(comboSecondBegin->Text); // if (comboSecondEnd->Text != "" && comboSecondEnd->Text != NULL && comboSecondEnd->Text != "All") secondyear2 = StrToInt(comboSecondEnd->Text); // if (comboThirdBegin->Text != "" && comboThirdBegin->Text != NULL && comboThirdBegin->Text != "All") thirdyear1 = StrToInt(comboThirdBegin->Text); // if (comboThirdEnd->Text != "" && comboThirdEnd->Text != NULL && comboThirdEnd->Text != "All") thirdyear2 = StrToInt(comboThirdEnd->Text); // } // // StringGrid1->Repaint(); // //////////////////////////////////////////////////////////////////////////////// TFileInfor *fi; bool bDirectoryExists; // µð·ºÅ丮°¡ Á¸ÀçÇÏ´ÂÁö ¿©ºÎ¸¦ °Ë»ç (2004.08.17) - by monkman if (0 <= combobxItem->ItemIndex && combobxItem->ItemIndex < 10) { MainType = temptype[combobxItem->ItemIndex]; } // ¼±ÅõÇÁö ¾Ê¾ÒÀ» °æ¿ì StringGrid ÃʱâÈ­ - by monkman (2004.06.17) while(ImageList1->Count>0) { fi = (TFileInfor *) ImageList1->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList1->Remove(fi); delete fi; fi = NULL; } while(ImageList2->Count>0) { fi = (TFileInfor *) ImageList2->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList2->Remove(fi); delete fi; fi = NULL; } while(ImageList3->Count>0) { fi = (TFileInfor *) ImageList3->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList3->Remove(fi); delete fi; fi = NULL; } if (!MainType) return; if (!Division) return; Panel1->Visible = true; sbAllNone->Enabled = true; switch (Division) { case DV_MAN: switch (MainType) { case TP_COAT: FullDirectory = DirectoryStyle + "\\Man" + "\\Coat"; SilDirectory = DirectoryStyle + "\\Man" + "\\Coat" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Coat" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Coat" + "\\Collar"; break; case TP_JACKET: FullDirectory = DirectoryStyle + "\\Man" + "\\Jacket"; SilDirectory = DirectoryStyle + "\\Man" + "\\Jacket" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Jacket" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Jacket" + "\\Collar"; break; case TP_JUMPER: FullDirectory = DirectoryStyle + "\\Man" + "\\Jumper"; SilDirectory = DirectoryStyle + "\\Man" + "\\Jumper" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Jumper" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Jumper" + "\\Collar"; break; case TP_KNIT: FullDirectory = DirectoryStyle + "\\Man" + "\\Knit"; SilDirectory = DirectoryStyle + "\\Man" + "\\Knit" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Knit" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Knit" + "\\Collar"; break; case TP_PANTS: FullDirectory = DirectoryStyle + "\\Man" + "\\Pants"; SilDirectory = DirectoryStyle + "\\Man" + "\\Pants" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Man" + "\\Pants" + "\\Belt"; break; case TP_SHIRTS: FullDirectory = DirectoryStyle + "\\Man" + "\\Shirts"; SilDirectory = DirectoryStyle + "\\Man" + "\\Shirts" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Shirts" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Shirts" + "\\Collar"; break; case TP_TOP: FullDirectory = DirectoryStyle + "\\Man" + "\\Top"; SilDirectory = DirectoryStyle + "\\Man" + "\\Top" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Top" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Top" + "\\Collar"; break; case TP_VEST: FullDirectory = DirectoryStyle + "\\Man" + "\\Vest"; SilDirectory = DirectoryStyle + "\\Man" + "\\Vest" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Man" + "\\Vest" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Man" + "\\Vest" + "\\Collar"; break; } break; case DV_WOMAN: switch (MainType) { case TP_ONEPIECE: FullDirectory = DirectoryStyle + "\\Woman" + "\\1-piece"; SilDirectory = DirectoryStyle + "\\Woman" + "\\1-piece" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\1-piece" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\1-piece" + "\\Collar"; break; case TP_BLOUSE: FullDirectory = DirectoryStyle + "\\Woman" + "\\Blouse"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Blouse" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Blouse" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Blouse" + "\\Collar"; break; case TP_COAT: FullDirectory = DirectoryStyle + "\\Woman" + "\\Coat"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Coat" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Coat" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Coat" + "\\Collar"; break; case TP_JACKET: FullDirectory = DirectoryStyle + "\\Woman" + "\\Jacket"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Jacket" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Jacket" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Jacket" + "\\Collar"; break; case TP_JUMPER: FullDirectory = DirectoryStyle + "\\Woman" + "\\Jumper"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Jumper" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Jumper" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Jumper" + "\\Collar"; break; case TP_KNIT: FullDirectory = DirectoryStyle + "\\Woman" + "\\Knit"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Knit" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Knit" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Knit" + "\\Collar"; break; case TP_PANTS: FullDirectory = DirectoryStyle + "\\Woman" + "\\Pants"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Pants" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Woman" + "\\Pants" + "\\Belt"; break; case TP_SHIRTS: FullDirectory = DirectoryStyle + "\\Woman" + "\\Shirts"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Shirts" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Shirts" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Shirts" + "\\Collar"; break; case TP_SKIRT: FullDirectory = DirectoryStyle + "\\Woman" + "\\Skirt"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Skirt" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Woman" + "\\Skirt" + "\\Belt"; break; case TP_TOP: FullDirectory = DirectoryStyle + "\\Woman" + "\\Top"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Top" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Top" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Top" + "\\Collar"; break; case TP_VEST: FullDirectory = DirectoryStyle + "\\Woman" + "\\Vest"; SilDirectory = DirectoryStyle + "\\Woman" + "\\Vest" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Woman" + "\\Vest" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Woman" + "\\Vest" + "\\Collar"; break; } break; case DV_CHILD: // DSChild¿¡ TP_JACKET, TP_TOP, TP_KNIT, TP_BLOUSE Ãß°¡ - by monkman (2004.07.03) switch (MainType) { case TP_CAPE: FullDirectory = DirectoryStyle + "\\Child" + "\\Cape"; SilDirectory = DirectoryStyle + "\\Child" + "\\Cape" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Cape" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Cape" + "\\Collar"; break; case TP_COAT: FullDirectory = DirectoryStyle + "\\Child" + "\\Coat"; SilDirectory = DirectoryStyle + "\\Child" + "\\Coat" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Coat" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Coat" + "\\Collar"; break; case TP_BLOUSE: FullDirectory = DirectoryStyle + "\\Child" + "\\Blouse"; SilDirectory = DirectoryStyle + "\\Child" + "\\Blouse" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Blouse" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Blouse" + "\\Collar"; break; case TP_JACKET: FullDirectory = DirectoryStyle + "\\Child" + "\\Jacket"; SilDirectory = DirectoryStyle + "\\Child" + "\\Jacket" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Jacket" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Jacket" + "\\Collar"; break; case TP_JUMPER: FullDirectory = DirectoryStyle + "\\Child" + "\\Jumper"; SilDirectory = DirectoryStyle + "\\Child" + "\\Jumper" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Jumper" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Jumper" + "\\Collar"; break; case TP_KNIT: FullDirectory = DirectoryStyle + "\\Child" + "\\Knit"; SilDirectory = DirectoryStyle + "\\Child" + "\\Knit" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Knit" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Knit" + "\\Collar"; break; case TP_PANTS: FullDirectory = DirectoryStyle + "\\Child" + "\\Pants"; SilDirectory = DirectoryStyle + "\\Child" + "\\Pants" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Child" + "\\Pants" + "\\Belt"; break; case TP_SHIRTS: FullDirectory = DirectoryStyle + "\\Child" + "\\Shirts"; SilDirectory = DirectoryStyle + "\\Child" + "\\Shirts" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Shirts" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Shirts" + "\\Collar"; break; case TP_ONEPIECE: FullDirectory = DirectoryStyle + "\\Child" + "\\1-piece"; SilDirectory = DirectoryStyle + "\\Child" + "\\1-piece" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\1-piece" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\1-piece" + "\\Collar"; break; case TP_TOP: FullDirectory = DirectoryStyle + "\\Child" + "\\Top"; SilDirectory = DirectoryStyle + "\\Child" + "\\Top" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Top" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Top" + "\\Collar"; break; case TP_SKIRT: FullDirectory = DirectoryStyle + "\\Child" + "\\Skirt"; SilDirectory = DirectoryStyle + "\\Child" + "\\Skirt" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Child" + "\\Skirt" + "\\Belt"; break; case TP_VEST: FullDirectory = DirectoryStyle + "\\Child" + "\\Vest"; SilDirectory = DirectoryStyle + "\\Child" + "\\Vest" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Child" + "\\Vest" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Child" + "\\Vest" + "\\Collar"; break; } break; case DV_BABY: switch (MainType) { case TP_CAPE: FullDirectory = DirectoryStyle + "\\Baby" + "\\Cape"; SilDirectory = DirectoryStyle + "\\Baby" + "\\Cape" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Baby" + "\\Cape" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Baby" + "\\Cape" + "\\Collar"; break; case TP_PANTS: FullDirectory = DirectoryStyle + "\\Baby" + "\\Pants"; SilDirectory = DirectoryStyle + "\\Baby" + "\\Pants" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Baby" + "\\Pants" + "\\Belt"; break; case TP_ROMPERS: FullDirectory = DirectoryStyle + "\\Baby" + "\\Rompers"; SilDirectory = DirectoryStyle + "\\Baby" + "\\Rompers" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Baby" + "\\Rompers" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Baby" + "\\Rompers" + "\\Collar"; break; case TP_SHIRTS: FullDirectory = DirectoryStyle + "\\Baby" + "\\Shirts"; SilDirectory = DirectoryStyle + "\\Baby" + "\\Shirts" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Baby" + "\\Shirts" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Baby" + "\\Shirts" + "\\Collar"; break; case TP_ONEPIECE: FullDirectory = DirectoryStyle + "\\Baby" + "\\1-piece"; SilDirectory = DirectoryStyle + "\\Baby" + "\\1-piece" + "\\Silhouette"; SleDirectory = DirectoryStyle + "\\Baby" + "\\1-piece" + "\\Sleeve"; ColDirectory = DirectoryStyle + "\\Baby" + "\\1-piece" + "\\Collar"; break; case TP_SKIRT: FullDirectory = DirectoryStyle + "\\Baby" + "\\Skirt"; SilDirectory = DirectoryStyle + "\\Baby" + "\\Skirt" + "\\Silhouette"; BeltDirectory = DirectoryStyle + "\\Baby" + "\\Skirt" + "\\Belt"; break; } break; } if (combobxUpperLower->ItemIndex == 0) { // »óÀÇ //FindSilhouetteFile(firstyear1, firstseason1, firstyear2, firstseason2, firstcomment); sbSearch1->Click(); progressbarCombination->Position += 60; //IllustFormÀÇ Progressbar¸¦ À§Çؼ­ - by monkman (2004.04.28) if (bIsIllustForm) StyleIllustForm->progbarCombination->Position += 20; //FindSleeveFile(secondyear1, secondseason1, secondyear2, secondseason2, secondcomment); sbSearch2->Click(); progressbarCombination->Position += 20; //IllustFormÀÇ Progressbar¸¦ À§Çؼ­ - by monkman (2004.04.28) if (bIsIllustForm) StyleIllustForm->progbarCombination->Position += 5; //FindCollarFile(thirdyear1, thirdseason1, thirdyear2, thirdseason2, thirdcomment); sbSearch3->Click(); progressbarCombination->Position += 20; //IllustFormÀÇ Progressbar¸¦ À§Çؼ­ - by monkman (2004.04.28) if (bIsIllustForm) StyleIllustForm->progbarCombination->Position += 5; }else { //FindPantsFile(firstyear1, fourthseason1, firstyear2, fourthseason2, fourthcomment); sbSearch1->Click(); progressbarCombination->Position += 50; //IllustFormÀÇ Progressbar¸¦ À§Çؼ­ - by monkman (2004.04.28) if (bIsIllustForm) StyleIllustForm->progbarCombination->Position += 15; //FindBeltFile(secondyear1, secondseason1, secondyear2, secondseason2, secondcomment); sbSearch2->Click(); progressbarCombination->Position += 50; //IllustFormÀÇ Progressbar¸¦ À§Çؼ­ - by monkman (2004.04.28) if (bIsIllustForm) StyleIllustForm->progbarCombination->Position += 15; sbSearch3->Click(); // ÃʱâÈ­ ½Ã۱â À§Çؼ­.. } // Á¤º¸°¡ ¹Ù²î¾úÀ¸¹Ç·Î ÀçÁ¶ÇÕÀ» ÇØ¾ßÇÑ´Ù bReCombination = true; // ItemClick()ÇÔ¼ö°¡ È£ÃâµÇ¸é¼­ ³Ñ¾î¿ÔÀ¸¸é true, ¾Æ´Ï¸é false - for Progressbar - by monkman (2004.05.13) if (!bItemsClickSW) { progressbarCombination->Position = 100; progressbarCombination->Position = 0; } StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); StringGrid1->LeftCol = 0; StringGrid2->LeftCol = 0; StringGrid3->LeftCol = 0; CheckedSilhouette.Clear(); CheckedSleeve.Clear(); CheckedCollar.Clear(); CheckedPants.Clear(); CheckedBelt.Clear(); SrcFileList->Clear(); // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) SrcFileBackupList->Clear(); memset(&CheckedOldSilhouette, 0, sizeof(int)*100); CheckedOldSilhouetteCounter = 0; // ¹öÀü 100ÀÎ ÆÄÀÏÀÇ ¼±ÅÃµÈ °³¼ö¸¦ üũ // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(bCheckedOldSilhouette, 0, sizeof(bool)*100); memset(bCheckedSilhouette, 0, sizeof(bool)*MAX_SIL); memset(bCheckedSleeve, 0, sizeof(bool)*MAX_SLE); memset(bCheckedCollar, 0, sizeof(bool)*MAX_COL); memset(bCheckedPants, 0, sizeof(bool)*MAX_PANTS); memset(bCheckedBelt, 0, sizeof(bool)*MAX_BELT); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(DetailSilhouette, 0, sizeof(BYTE)*MAX_SIL*MAX_DETAIL); memset(DetailSleeve, 0, sizeof(BYTE)*MAX_SLE*MAX_DETAIL); memset(DetailCollar, 0, sizeof(BYTE)*MAX_COL*MAX_DETAIL); memset(DetailPants, 0, sizeof(BYTE)*MAX_PANTS*MAX_DETAIL); memset(DetailBelt, 0, sizeof(BYTE)*MAX_BELT*MAX_DETAIL); // ´ëÇ¥½ºÅ¸ÀϺ°·Î DetailÇÏ°Ô ¼±ÅÃµÈ CountÀÇ ¼ö ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(CheckedDetailSilhouetteCounter, 0, sizeof(int)*MAX_SIL); memset(CheckedDetailSleeveCounter, 0, sizeof(int)*MAX_SLE); memset(CheckedDetailCollarCounter, 0, sizeof(int)*MAX_COL); memset(CheckedDetailPantsCounter, 0, sizeof(int)*MAX_PANTS); memset(CheckedDetailBeltCounter, 0, sizeof(int)*MAX_BELT); // ¹öư ÃʱâÈ­ sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles->Enabled = true; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; shDeleteFiles2->Enabled = false; // µð·ºÅ丮°¡ Á¸ÀçÇÏ´ÂÁö ¿©ºÎ¸¦ °Ë»ç (2004.08.17) - by monkman bDirectoryExists = true; if (combobxUpperLower->ItemIndex == 0) { bDirectoryExists &= DirectoryExists(FullDirectory); bDirectoryExists &= DirectoryExists(SilDirectory); } else if (combobxUpperLower->ItemIndex == 1) { bDirectoryExists &= DirectoryExists(FullDirectory); bDirectoryExists &= DirectoryExists(SilDirectory); } // ¸Þ½ÃÁö : Æú´õ ÁöÁ¤ÀÌ Àß ¸øµÈ °Í °°½À´Ï´Ù. ´Ù½Ã ÁöÁ¤ÇØÁֽʽÿÀ. //if (!bDirectoryExists) { // MessageDlg(IDS_MESSAGE11, mtInformation, TMsgDlgButtons() << mbOK, 0); //} } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FindSleeveFile(int year1, BYTE season1, int year2, BYTE season2, String comment) { // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// // HANDLE hSrch, hFile = INVALID_HANDLE_VALUE; // TTexVersion ver; // WIN32_FIND_DATA wfd; // bool result = true; // TFileInfor *fi; // String path, filename; // STYLEDATAFILEHEADER header; // HDC dcTemp = NULL; // DWORD dwRead; // TVecData *data; // int Version; // BYTE *StyleData = NULL; // int nPos; // DWORD dwDataSize; // // while(ImageList2->Count>0) { // fi = (TFileInfor *) ImageList2->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList2->Remove(fi); // delete fi; // fi = NULL; // } // ////////////////////////////////////////////////////////////////////////////////// //// //// path = SleDirectory + "\\*.tfc"; //// SleFileList->Clear(); //// //// if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; //// while (result) { //// filename = SleDirectory + "\\" + wfd.cFileName; //// SleFileList->Add(filename); //// result = FindNextFile(hSrch, &wfd); //// } //// FindClose(hSrch); //// SleFileList->Sort(); //// //// for (int i = 0; i < SleFileList->Count; i++) { //// filename = SleFileList->Strings[i]; //// fi = new TFileInfor; //// //// String temp1 = filename[filename.Length() - 5], temp2 = filename[filename.Length() - 4]; //// fi->Depth = temp1.ToInt()*10 + temp2.ToInt(); //// fi->Name = SleeveName[fi->Depth]; //// if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; //// //// if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; //// if (!LoadFromTexpiaStyleTag(hFile, fi, &ver)) goto fail; //// //// ImageList2->Add(fi); // ImageList2¿¡´Â ½½¸®ºê°¡... //// CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; //// } ////////////////////////////////////////////////////////////////////////////////// // // // path = SleDirectory + "\\*.sty"; // SleFileList->Clear(); // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; // while (result) { // filename = SleDirectory + "\\" + wfd.cFileName; // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // if (STYFileStyleTypeCheck(hFile, filename, Division, DSItems, DSClothes, MainType, SO_SLEEVE)) { SleFileList->Add(filename); } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // result = FindNextFile(hSrch, &wfd); // } // FindClose(hSrch); // SleFileList->Sort(); // // for (int i = 1; i < 30; i++) { // for (int j = 0; j < SleFileList->Count; j++) { // filename = SleFileList->Strings[j]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (year1 <= year2 ) { // if (!(year1 <= header.Year && header.Year <= year2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(year2 <= header.Year && header.Year <= year1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // if (header.ESleeve != EDetailSleeve(i)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // 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; // ÆÄÀÏÅ©±â¸¸Å­ ¸Þ¸ð¸® ÇÒ´ç // ResultForm->ReadSTYFileData(hFile, Version, StyleData, header); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->Depth = i; // fi->Name = SleeveName[fi->Depth]; // fi->Path = filename; // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList2->Add(fi); // ImageList2¿¡´Â ½½¸®ºê°¡... // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // // j = SleFileList->Count; // ¹þ¾î³ª±â // } // } // //fail: //////////////////////////////////////////////////////////////////////////////// HANDLE hFile = INVALID_HANDLE_VALUE; TFileInfor *fi; String path, filename; STYLEDATAFILEHEADER header; HDC dcTemp = NULL; TVecData *data; int Version; STYFILECACHELIST *SFCL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; while(ImageList2->Count>0) { fi = (TFileInfor *) ImageList2->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList2->Remove(fi); delete fi; fi = NULL; } path = SleDirectory; SleFileList->Clear(); SCF->STYSearch(path, Division, MainType, SO_SLEEVE, year1, season1, year2, season2, comment); for (int i = 0; i < VecDraw->SleeveCount; i++) { for (int j = 0; j < SCF->SleList->Count; j++) { SFCL = (STYFILECACHELIST *)SCF->SleList->Items[j]; if (SFCL->HList.ESleeve == 0 || SFCL->HList.ESleeve != EDetailSleeve(i)) { continue; } SleFileList->Add(SCF->SleStrList->Strings[j]); filename = SCF->SleStrList->Strings[j]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->Depth = i; fi->Name = VecDraw->SleeveName[fi->Depth]; fi->Path = filename; fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList2->Add(fi); // ImageList2¿¡´Â ½½¸®ºê°¡... while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } j = SCF->SleList->Count; // ¹þ¾î³ª±â } } fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FindCollarFile(int year1, BYTE season1, int year2, BYTE season2, String comment) { // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// // HANDLE hSrch, hFile = INVALID_HANDLE_VALUE; // TTexVersion ver; // WIN32_FIND_DATA wfd; // bool result = true; // TFileInfor *fi; // String path, filename; // STYLEDATAFILEHEADER header; // HDC dcTemp = NULL; // DWORD dwRead; // TVecData *data; // int Version; // BYTE *StyleData = NULL; // int nPos; // DWORD dwDataSize; // // while(ImageList3->Count>0) { // fi = (TFileInfor *) ImageList3->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList3->Remove(fi); // delete fi; // fi = NULL; // } // ////////////////////////////////////////////////////////////////////////////////// //// path = ColDirectory + "\\*.tfc"; //// ColFileList->Clear(); //// //// if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; //// while (result) { //// filename = ColDirectory + "\\" + wfd.cFileName; //// ColFileList->Add(filename); //// result = FindNextFile(hSrch, &wfd); //// } //// FindClose(hSrch); //// ColFileList->Sort(); //// //// for (int i = 0; i < ColFileList->Count; i++) { //// filename = ColFileList->Strings[i]; //// fi = new TFileInfor; //// String temp1 = filename[filename.Length() - 5], temp2 = filename[filename.Length() - 4]; //// fi->Depth = temp1.ToInt()*10 + temp2.ToInt(); //// fi->Name = CollarName[fi->Depth]; //// if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; //// //// if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; //// if (!LoadFromTexpiaStyleTag(hFile, fi, &ver)) goto fail; //// //// ImageList3->Add(fi); // ImageList3¿¡´Â Ä®¶ó°¡... //// CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; //// } ////////////////////////////////////////////////////////////////////////////////// // // path = ColDirectory + "\\*.sty"; // ColFileList->Clear(); // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; // while (result) { // filename = ColDirectory + "\\" + wfd.cFileName; // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // if (STYFileStyleTypeCheck(hFile, filename, Division, DSItems, DSClothes, MainType, SO_COLLAR)) { ColFileList->Add(filename); } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // result = FindNextFile(hSrch, &wfd); // // } // FindClose(hSrch); // ColFileList->Sort(); // // for (int i = 1; i < 70; i++) { // for (int j = 0; j < ColFileList->Count; j++) { // filename = ColFileList->Strings[j]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (year1 <= year2 ) { // if (!(year1 <= header.Year && header.Year <= year2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(year2 <= header.Year && header.Year <= year1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // if (header.ECollar != EDetailCollar(i)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->Depth = i; // fi->Name = CollarName[fi->Depth]; // fi->Path = filename; // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList3->Add(fi); // ImageList3¿¡´Â Ä®¶ó°¡... // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // // j = ColFileList->Count; // ¹þ¾î³ª±â // } // } // //fail: //////////////////////////////////////////////////////////////////////////////// HANDLE hFile = INVALID_HANDLE_VALUE; TFileInfor *fi; String path, filename; STYLEDATAFILEHEADER header; HDC dcTemp = NULL; TVecData *data; int Version; STYFILECACHELIST *SFCL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; while(ImageList3->Count>0) { fi = (TFileInfor *) ImageList3->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList3->Remove(fi); delete fi; fi = NULL; } path = ColDirectory; ColFileList->Clear(); SCF->STYSearch(path, Division, MainType, SO_COLLAR, year1, season1, year2, season2, comment); for (int i = 0; i < VecDraw->CollarCount; i++) { for (int j = 0; j < SCF->ColList->Count; j++) { SFCL = (STYFILECACHELIST *)SCF->ColList->Items[j]; if (SFCL->HList.ECollar == 0 || SFCL->HList.ECollar != EDetailCollar(i)) { continue; } ColFileList->Add(SCF->ColStrList->Strings[j]); filename = SCF->ColStrList->Strings[j]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->Depth = i; fi->Name = VecDraw->CollarName[fi->Depth]; fi->Path = filename; fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList3->Add(fi); // ImageList3¿¡´Â Ä®¶ó°¡... while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } j = SCF->ColList->Count; // ¹þ¾î³ª±â } } fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FindSilhouetteFile(int year1, BYTE season1, int year2, BYTE season2, String comment) { // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// // // Version 100 À϶§ÀÇ ÆÄÀÏ Ã³¸® // HANDLE hSrch, hFile = INVALID_HANDLE_VALUE; // HDC dcTemp = NULL; // WIN32_FIND_DATA wfd; // String path, filename, temp1, temp2; // char *tempchar = "\\"; // bool result = true; // TFileInfor *fi; // STYLEDATAFILEHEADER header; // DWORD dwRead; // TVecData *data; // BYTE *StyleData = NULL; // int nPos; // DWORD dwDataSize; // // path = SilDirectory + "\\*.sty"; // FileList->Clear(); // // while(ImageList1->Count>0) { // fi = (TFileInfor *) ImageList1->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList1->Remove(fi); // delete fi; // fi = NULL; // } // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; // while (result) { // filename = SilDirectory + "\\" + wfd.cFileName; // FileList->Add(filename); // result = FindNextFile(hSrch, &wfd); // } // FindClose(hSrch); // FileList->Sort(); // // for (int i = 0; i < FileList->Count; i++) { // filename = FileList->Strings[i]; // // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // if (!ReadFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwRead, NULL)) goto fail; // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // fi->Depth = i; // fi->Path = filename; // // temp1 = filename.LowerCase(); // temp2 = ""; // while (char(temp1[temp1.Length()]) != *tempchar) { // temp2 = String(temp1[temp1.Length()]) + temp2; // temp1.SetLength(temp1.Length()-1); // } // temp2.SetLength(4); // if (temp2 == "user") fi->Name = String(fi->Depth+1) + " User"; // user fileÀΰæ¿ì // else fi->Name = String(fi->Depth+1); // // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList1->Add(fi); // ImageList1¿¡´Â ½Ç·ç¿§ÀÌ.. // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // } // // return; // // //fail: // return; //////////////////////////////////////////////////////////////////////////////// // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// // // Version 100, 200 À϶§ÀÇ ÆÄÀÏ Ã³¸® // HANDLE hSrch, hFile = INVALID_HANDLE_VALUE; // HDC dcTemp = NULL; // WIN32_FIND_DATA wfd; // String path, filename, temp1, temp2; // char *tempchar = "\\"; // bool result = true; // TFileInfor *fi; // STYLEDATAFILEHEADER header; // DWORD dwRead; // TVecData *data; // TTexVersion ver; // int Version, tempcount; // BYTE *StyleData = NULL; // int nPos; // DWORD dwDataSize; // // while(ImageList1->Count>0) { // fi = (TFileInfor *) ImageList1->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList1->Remove(fi); // delete fi; // fi = NULL; // } // // path = SilDirectory + "\\*.sty"; // SilFileList->Clear(); // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; // while (result) { // filename = SilDirectory + "\\" + wfd.cFileName; // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // if (STYFileStyleTypeCheck(hFile, filename, Division, DSItems, DSClothes, MainType, SO_SILHOUETTE)) { SilFileList->Add(filename);} // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // result = FindNextFile(hSrch, &wfd); // } // FindClose(hSrch); // SilFileList->Sort(); // // for (int i = 1; i < 110; i++) { // for (int j = 0; j < SilFileList->Count; j++) { // filename = SilFileList->Strings[j]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (year1 <= year2 ) { // if (!(year1 <= header.Year && header.Year <= year2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(year2 <= header.Year && header.Year <= year1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // // SilhouetteÀÌ 0À϶§´Â SilhouetteÀÌ Ã¼Å©µÇÁö ¾Ê´Â´Ù - by monkman (2004.03.30) // if (header.ESilhouette == 0 || header.ESilhouette != EDetailSilhouette(i)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // fi->Path = filename; // // // ¹öÀüº°·Î Ãß°¡ÇÏ´Â ºÎºÐÀÌ ´Ù¸£´Ù - by monkman (2004.03.31) // switch (Version) { ////////////////////////////////////////////////////////////////////////////////// //// //Version 100 //// case 100 : //// fi->Depth = i*(-1); //// temp1 = filename.LowerCase(); //// temp2 = ""; //// while (char(temp1[temp1.Length()]) != *tempchar) { //// temp2 = String(temp1[temp1.Length()]) + temp2; //// temp1.SetLength(temp1.Length()-1); //// } //// temp2.SetLength(4); //// if (temp2 == "user") fi->Name = String(fi->Depth) + " User"; // user fileÀΰæ¿ì //// else fi->Name = String(fi->Depth); //// break; ////////////////////////////////////////////////////////////////////////////////// // //Version 200 // case 200 : // // Man, WomanÀº »óÀÇ ´ëÇ¥ ½ºÅ¸ÀÏÀÌ ÀÖ´Ù // fi->Depth = i; // temp1 = filename.LowerCase(); // temp2 = ""; // while (char(temp1[temp1.Length()]) != *tempchar) { // temp2 = String(temp1[temp1.Length()]) + temp2; // temp1.SetLength(temp1.Length()-1); // } // temp2.SetLength(4); // if (temp2 == "user") fi->Name = String(fi->Depth) + " User"; // user fileÀΰæ¿ì // else fi->Name = SilhouetteName[fi->Depth]; // break; // } // // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList1->Add(fi); // // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // // // Version¿¡ µû¶ó ¹þ¾î³ª±â Á¾·ù°¡ ´Ù¸£´Ù.. // switch (Version) { ////////////////////////////////////////////////////////////////////////////////// //// case 100 : //// if (i == SilFileList->Count) { return; } // ¹þ¾î³ª±â //// else i++; //// break; ////////////////////////////////////////////////////////////////////////////////// // case 200 : // j = SilFileList->Count; // ¹þ¾î³ª±â // break; // } // } // } // // // tempcount = ImageList1->Count; // // for (int i = 0; i < SilFileList->Count; i++) { // filename = SilFileList->Strings[i]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (year1 <= year2 ) { // if (!(year1 <= header.Year && header.Year <= year2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(year2 <= header.Year && header.Year <= year1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // if (header.ESilhouette != 0) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // fi->Depth = (ImageList1->Count - tempcount)*(-1); // fi->Path = filename; // // temp1 = filename.LowerCase(); // temp2 = ""; // while (char(temp1[temp1.Length()]) != *tempchar) { // temp2 = String(temp1[temp1.Length()]) + temp2; // temp1.SetLength(temp1.Length()-1); // } // temp2.SetLength(4); // if (temp2 == "user") fi->Name = String(abs(fi->Depth)+1) + " User"; // user fileÀΰæ¿ì // else fi->Name = String(abs(fi->Depth)+1); // // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList1->Add(fi); // ImageList1¿¡´Â ½Ç·ç¿§ÀÌ.. // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // } // // // // //fail: // return; //*/ //////////////////////////////////////////////////////////////////////////////// HANDLE hFile = INVALID_HANDLE_VALUE; HDC dcTemp = NULL; String path, filename, temp1, temp2; char *tempchar = "\\"; TFileInfor *fi; STYLEDATAFILEHEADER header; TVecData *data; int Version, tempcount; STYFILECACHELIST *SFCL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; while(ImageList1->Count>0) { fi = (TFileInfor *) ImageList1->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList1->Remove(fi); delete fi; fi = NULL; } path = SilDirectory; SilFileList->Clear(); SCF->STYSearch(path, Division, MainType, SO_SILHOUETTE, year1, season1, year2, season2, comment); for (int i = 0; i < VecDraw->SilhouetteCount; i++) { for (int j = 0; j < SCF->SilList->Count; j++) { SFCL = (STYFILECACHELIST *)SCF->SilList->Items[j]; if (SFCL->HList.ESilhouette == 0 || SFCL->HList.ESilhouette != EDetailSilhouette(i)) continue; SilFileList->Add(SCF->SilStrList->Strings[j]); filename = SCF->SilStrList->Strings[j]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; fi->Path = filename; // ¹öÀüº°·Î Ãß°¡ÇÏ´Â ºÎºÐÀÌ ´Ù¸£´Ù - by monkman (2004.03.31) if (Version <= 100) { // Man, WomanÀº »óÀÇ ´ëÇ¥ ½ºÅ¸ÀÏÀÌ ÀÖ´Ù fi->Depth = i; temp1 = filename.LowerCase(); temp2 = ""; while (char(temp1[temp1.Length()]) != *tempchar) { temp2 = String(temp1[temp1.Length()]) + temp2; temp1.SetLength(temp1.Length()-1); } temp2.SetLength(4); if (temp2 == "user") fi->Name = IntToStr(fi->Depth) + " User"; // user fileÀΰæ¿ì else fi->Name = VecDraw->SilhouetteName[fi->Depth]; } else if (200 <= Version) { // Man, WomanÀº »óÀÇ ´ëÇ¥ ½ºÅ¸ÀÏÀÌ ÀÖ´Ù fi->Depth = i; fi->Name = VecDraw->SilhouetteName[fi->Depth]; } if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList1->Add(fi); while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } j = SCF->SilList->Count; // ¹þ¾î³ª±â } } tempcount = ImageList1->Count; for (int i = 0; i < SCF->SilList->Count; i++) { SFCL = (STYFILECACHELIST *)SCF->SilList->Items[i]; if (SFCL->HList.Version != 100) { continue; } SilFileList->Add(SCF->SilStrList->Strings[i]); filename = SCF->SilStrList->Strings[i]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; fi->Depth = (ImageList1->Count - tempcount)*(-1); fi->Path = filename; if (Version == 100) { temp1 = filename.LowerCase(); temp2 = ""; while (char(temp1[temp1.Length()]) != *tempchar) { temp2 = String(temp1[temp1.Length()]) + temp2; temp1.SetLength(temp1.Length()-1); } temp2.SetLength(4); if (temp2 == "user") fi->Name = IntToStr(fi->Depth) + " User"; // user fileÀΰæ¿ì else fi->Name = VecDraw->SilhouetteName[abs(fi->Depth)+1]; } else if (200 <= Version && Version) { fi->Name = VecDraw->SilhouetteName[abs(fi->Depth)+1]; } if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList1->Add(fi); // ImageList1¿¡´Â ½Ç·ç¿§ÀÌ.. while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } } fail: return; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FindPantsFile(int year1, BYTE season1, int year2, BYTE season2, String comment) { // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// // HANDLE hSrch, hFile = INVALID_HANDLE_VALUE; // TTexVersion ver; // WIN32_FIND_DATA wfd; // bool result = true; // TFileInfor *fi; // String path, filename; // STYLEDATAFILEHEADER header; // HDC dcTemp = NULL; // DWORD dwRead; // TVecData *data; // int Version; // BYTE *StyleData = NULL; // int nPos; // DWORD dwDataSize; // // while(ImageList1->Count>0) { // fi = (TFileInfor *) ImageList1->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList1->Remove(fi); // delete fi; // fi = NULL; // } // ////////////////////////////////////////////////////////////////////////////////// //// path = SilDirectory + "\\*.tfc"; //// PantsFileList->Clear(); //// //// if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; //// while (result) { //// filename = SilDirectory + "\\" + wfd.cFileName; //// PantsFileList->Add(filename); //// result = FindNextFile(hSrch, &wfd); //// } //// FindClose(hSrch); //// PantsFileList->Sort(); //// //// for (int i = 0; i < PantsFileList->Count; i++) { //// filename = PantsFileList->Strings[i]; //// fi = new TFileInfor; //// String temp1 = filename[filename.Length() - 5], temp2 = filename[filename.Length() - 4]; //// fi->Depth = temp1.ToInt()*10 + temp2.ToInt(); //// fi->Name = PantsName[fi->Depth]; //// if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; //// //// if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; //// if (!LoadFromTexpiaStyleTag(hFile, fi, &ver)) goto fail; //// //// ImageList1->Add(fi); // ImageList1¿¡ ¹ÙÁö ½Ç·ç¿§À».. //// CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; //// } ////////////////////////////////////////////////////////////////////////////////// // // // path = SilDirectory + "\\*.sty"; // PantsFileList->Clear(); // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; // while (result) { // filename = SilDirectory + "\\" + wfd.cFileName; // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // if (STYFileStyleTypeCheck(hFile, filename, Division, DSItems, DSClothes, MainType, SO_PANTS)) { PantsFileList->Add(filename); } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // result = FindNextFile(hSrch, &wfd); // } // FindClose(hSrch); // PantsFileList->Sort(); // // for (int i = 1; i < 70; i++) { // for (int j = 0; j < PantsFileList->Count; j++) { // filename = PantsFileList->Strings[j]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (year1 <= year2 ) { // if (!(year1 <= header.Year && header.Year <= year2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(year2 <= header.Year && header.Year <= year1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // if (header.EPants != EDetailPants(i)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->Depth = i; // fi->Name = PantsName[fi->Depth]; // fi->Path = filename; // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList1->Add(fi); // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // // j = PantsFileList->Count; // ¹þ¾î³ª±â // } // } // //fail: //////////////////////////////////////////////////////////////////////////////// HANDLE hFile = INVALID_HANDLE_VALUE; TFileInfor *fi; String path, filename; STYLEDATAFILEHEADER header; HDC dcTemp = NULL; TVecData *data; int Version; STYFILECACHELIST *SFCL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; while(ImageList1->Count>0) { fi = (TFileInfor *) ImageList1->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList1->Remove(fi); delete fi; fi = NULL; } path = SilDirectory; PantsFileList->Clear(); SCF->STYSearch(path, Division, MainType, SO_PANTS, year1, season1, year2, season2, comment); for (int i = 0; i < VecDraw->PantsCount; i++) { for (int j = 0; j < SCF->PantsList->Count; j++) { SFCL = (STYFILECACHELIST *)SCF->PantsList->Items[j]; if (SFCL->HList.EPants == 0 || SFCL->HList.EPants != EDetailPants(i)) { continue; } PantsFileList->Add(SCF->PantsStrList->Strings[j]); filename = SCF->PantsStrList->Strings[j]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->Depth = i; fi->Name = VecDraw->PantsName[fi->Depth]; fi->Path = filename; fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList1->Add(fi); while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } j = SCF->PantsList->Count; // ¹þ¾î³ª±â } } fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FindBeltFile(int year1, BYTE season1, int year2, BYTE season2, String comment) { // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// // HANDLE hSrch, hFile = INVALID_HANDLE_VALUE; // TTexVersion ver; // WIN32_FIND_DATA wfd; // bool result = true; // TFileInfor *fi; // String path, filename; // STYLEDATAFILEHEADER header; // HDC dcTemp = NULL; // DWORD dwRead; // TVecData *data; // int Version; // BYTE *StyleData = NULL; // int nPos; // DWORD dwDataSize; // // while(ImageList2->Count>0) { // fi = (TFileInfor *) ImageList2->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList2->Remove(fi); // delete fi; // fi = NULL; // } // ////////////////////////////////////////////////////////////////////////////////// //// path = BeltDirectory + "\\*.tfc"; //// BeltFileList->Clear(); //// //// if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; //// while (result) { //// filename = BeltDirectory + "\\" + wfd.cFileName; //// BeltFileList->Add(filename); //// result = FindNextFile(hSrch, &wfd); //// } //// FindClose(hSrch); //// BeltFileList->Sort(); //// //// for (int i = 0; i < BeltFileList->Count; i++) { //// filename = BeltFileList->Strings[i]; //// fi = new TFileInfor; //// String temp1 = filename[filename.Length() - 5], temp2 = filename[filename.Length() - 4]; //// fi->Depth = temp1.ToInt()*10 + temp2.ToInt(); //// fi->Name = BeltName[fi->Depth]; //// if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; //// //// if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; //// if (!LoadFromTexpiaStyleTag(hFile, fi, &ver)) goto fail; //// //// ImageList2->Add(fi); // ImageList2¿¡ ¹ÙÁö º§Æ®¸¦... //// CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; //// } ////////////////////////////////////////////////////////////////////////////////// // // path = BeltDirectory + "\\*.sty"; // BeltFileList->Clear(); // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) == INVALID_HANDLE_VALUE) goto fail; // while (result) { // filename = BeltDirectory + "\\" + wfd.cFileName; // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // if (STYFileStyleTypeCheck(hFile, filename, Division, DSItems, DSClothes, MainType, SO_BELT)) { BeltFileList->Add(filename); } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // result = FindNextFile(hSrch, &wfd); // } // FindClose(hSrch); // BeltFileList->Sort(); // // for (int i = 1; i < 20; i++) { // for (int j = 0; j < BeltFileList->Count; j++) { // filename = BeltFileList->Strings[j]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (year1 <= year2 ) { // if (!(year1 <= header.Year && header.Year <= year2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(year2 <= header.Year && header.Year <= year1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // if (header.EBelt != EDetailBelt(i)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->Depth = i; // fi->Name = BeltName[fi->Depth]; // fi->Path = filename; // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList2->Add(fi); // ImageList2¿¡´Â º§Æ® // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // // j = BeltFileList->Count; // ¹þ¾î³ª±â // } // } // //fail: //////////////////////////////////////////////////////////////////////////////// HANDLE hFile = INVALID_HANDLE_VALUE; TFileInfor *fi; String path, filename; STYLEDATAFILEHEADER header; HDC dcTemp = NULL; TVecData *data; int Version; STYFILECACHELIST *SFCL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; while(ImageList2->Count>0) { fi = (TFileInfor *) ImageList2->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList2->Remove(fi); delete fi; fi = NULL; } path = BeltDirectory; BeltFileList->Clear(); SCF->STYSearch(path, Division, MainType, SO_BELT, year1, season1, year2, season2, comment); for (int i = 0; i < VecDraw->BeltCount; i++) { for (int j = 0; j < SCF->BeltList->Count; j++) { SFCL = (STYFILECACHELIST *)SCF->BeltList->Items[j]; if (SFCL->HList.EBelt == 0 || SFCL->HList.EBelt != EDetailBelt(i)) { continue; } BeltFileList->Add(SCF->BeltStrList->Strings[j]); filename = SCF->BeltStrList->Strings[j]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->Depth = i; fi->Name = VecDraw->BeltName[fi->Depth]; fi->Path = filename; fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList2->Add(fi); // ImageList2¿¡´Â º§Æ® while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } j = SCF->BeltList->Count; // ¹þ¾î³ª±â } } fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::TagDraw(HDC dcDst, TList *list, int nInstNum, int X, int Y, int W, int H) { HPEN hOldPen = NULL, hPen = NULL; HBRUSH hOldBrush = NULL, hBrush = NULL; int nDrawMode, nFillMode, nTemp, nPenStyle; LOGBRUSH logbrush; Graphics::TBitmap *TempBitmap = NULL; int PositionX, PositionY; int px = 0, py = 0, w ,h; double rx, ry, Zoom; long minx = MaxInt, miny = MaxInt, maxx = 0, maxy = 0; double maxthick = 0; TRect src; TVecData *data = NULL; gdp::Graphics graphics(dcDst); // using GDI+ gdp::Point *pTemps; graphics.SetSmoothingMode(gdp::SmoothingModeHighQuality); // antialiasing if (list == NULL) return; for (int i = 0; i < list->Count; i++) { data = (TVecData *)list->Items[i]; if (nInstNum != -1) if (!data->Equal(nInstNum)) continue; minx = min(minx, data->First.x); minx = min(minx, data->Second.x); maxx = max(maxx, data->First.x); maxx = max(maxx, data->Second.x); miny = min(miny, data->First.y); miny = min(miny, data->Second.y); maxy = max(maxy, data->First.y); maxy = max(maxy, data->Second.y); maxthick = max(maxthick, data->PenThick); } src = Rect(minx-maxthick, miny-maxthick, maxx+maxthick, maxy+maxthick); rx = (double)W/(src.Right-src.Left); ry = (double)H/(src.Bottom-src.Top); if (rx>ry) { w = (src.Right-src.Left)*ry; h = (src.Bottom-src.Top)*ry; Zoom = double(h) / double(src.Bottom-src.Top); }else { w = (src.Right-src.Left)*rx; h = (src.Bottom-src.Top)*rx; Zoom = double(w) / double(src.Right-src.Left); } if (0 >= W || 0 >= H) Zoom = 1.0; PositionX = src.Left; PositionY = src.Top; // Áß¾Ó if (0 <= X || 0 <= Y) { px = (w - W) / 2 - X; py = (h - H) / 2 - Y; } for (int i = 0; i < list->Count; i++) { data = (TVecData *)list->Items[i]; if (nInstNum != -1) if (!data->Equal(nInstNum)) continue; int FirstX = (data->First.x - PositionX) * Zoom -px; int FirstY = (data->First.y - PositionY) * Zoom -py; int SecondX = (data->Second.x - PositionX) * Zoom -px; int SecondY = (data->Second.y - PositionY) * Zoom -py; int pw = data->PenThick/2; gdp::Color penColor(GetRValue(data->Color), GetGValue(data->Color), GetBValue(data->Color)); gdp::Color FillColor(GetRValue(data->Brush), GetGValue(data->Brush), GetBValue(data->Brush)); gdp::Pen ObjectPen(penColor, data->PenThick*Zoom); gdp::SolidBrush ObjectBrush(FillColor); gdp::GraphicsPath gFillPath; float *dashValues = NULL; if (data->Kind == V_TEXTBOX) { pTemps = new gdp::Point[5]; } else { if (data->bClosed){ pTemps = new gdp::Point[(data->nCount+1)*3+1]; } else { pTemps = new gdp::Point[data->nCount*3+1]; } } // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman if (data->Kind != V_TEXTBOX) { for (int i = 0; i < data->nCount*3 +1; i++) { pTemps[i].X = (data->pList[i].x - PositionX) * Zoom -px; pTemps[i].Y = (data->pList[i].y - PositionY) * Zoom -py; } } // else { // StartX = (data->StartPoint.x - PositionX) * Zoom -px; // StartY = (data->StartPoint.y - PositionY) * Zoom -py; // CenterX = (data->CenterPoint.x - PositionX) * Zoom -px; // CenterY = (data->CenterPoint.y - PositionY) * Zoom -py; // FontZoom = Zoom; // for (int i = 0; i < 5; i++) { // pTemp[i].x = (data->pList[i].x - PositionX) * Zoom -px; // pTemp[i].y = (data->pList[i].y - PositionY) * Zoom -py; // } // } if (data->bClosed && data->PenStyle == P_SOLID) { pTemps[data->nCount*3] = pTemps[0]; pTemps[data->nCount*3+1] = pTemps[1]; pTemps[data->nCount*3+2] = pTemps[2]; pTemps[data->nCount*3+3] = pTemps[3]; } nDrawMode = GetROP2(dcDst); nFillMode = GetPolyFillMode(dcDst); logbrush.lbStyle = BS_SOLID; logbrush.lbColor = data->Brush; logbrush.lbHatch = 0; if (data->bPatternFill) { // PatternFill À϶§ - by monkman (ÇöÀç´Â TagDraw() ¿¡ PatternFillÀÌ ¾øÀ½..) //TempBitmap = new Graphics::TBitmap; //TempBitmap->PixelFormat = pf24bit; //TempBitmap->Width = data->Bitmap->Width * Zoom; //TempBitmap->Height = data->Bitmap->Height * Zoom; //StretchBlt(TempBitmap->Canvas->Handle,0,0,TempBitmap->Width,TempBitmap->Height, // data->Bitmap->Canvas->Handle,0,0,data->Bitmap->Width,data->Bitmap->Height,SRCCOPY); //SetBrushOrgEx(dcDst, FirstX, FirstY, NULL); //hBrush = CreatePatternBrush(TempBitmap->Handle); //hOldBrush = SelectObject(dcDst, hBrush); }else if (data->bFill) { // ColorFill À϶§ hBrush = CreateBrushIndirect(&logbrush); hOldBrush = (HBRUSH)SelectObject(dcDst, hBrush); }else { // Fill X hOldBrush = (HBRUSH)SelectObject(dcDst, GetStockObject(NULL_BRUSH)); } // if (data->bWinding) SetPolyFillMode(dcDst, WINDING); // ä¿ì±â ¸ðµå ¼±Åà // else SetPolyFillMode(dcDst, ALTERNATE); if (data->bWinding) gFillPath.SetFillMode(gdp::FillModeWinding); else gFillPath.SetFillMode(gdp::FillModeAlternate); logbrush.lbColor = data->Color; // ÆæÀÇ color¸¦ À§Çؼ­... switch (data->PenStyle) { case 0: nPenStyle = int (PS_SOLID); break; case 1: nPenStyle = int (PS_DASH); break; case 2: nPenStyle = int (PS_DOT); break; case 3: nPenStyle = int (PS_DASHDOT); break; case 4: nPenStyle = int (PS_DASHDOTDOT);break; case 5: nPenStyle = P_USERSTYLE; // 2005 Vector upgrade shin 0330 int count = 0; double temp[6] = { 0, 0, 0, 0, 0, 0}; VecDraw->CheckUserDashedLine(data, temp, count); dashValues = new float[count]; for (int i = 0; i < count; i++){ dashValues[i] = temp[i]; } ObjectPen.SetDashPattern(dashValues, count); break; // DashStyleCustom = 5 //case 5: // nPenStyle = P_USERSTYLE; // int count = data->DashValues[0]; // dashValues = new float[count]; // for (int i = 0; i < count; i++){ // dashValues[i] = data->DashValues[i+1]; // } // //ObjectPen.GetCompoundArray(dashValues, count); // ObjectPen.SetDashPattern(dashValues, count); // break; // DashStyleCustom = 5 } if (VecDraw->osVERSION < 2) { // 3.1, 95, 98 hPen = CreatePen(psSolid, data->PenThick* Zoom, data->Color); } else { if (data->bRound) { // win 2000, NT¿¡¼­¸¸ Á¦´ë·Î ÀÛµ¿ÇÑ´Ù if (data->CapStyle[0] == 1 && data->ArrowCap){ // arrow gdp::AdjustableArrowCap arrowCap(data->ArrowCap->LineCapHeight, data->ArrowCap->LineCapWidth, data->ArrowCap->bFillLineCap); arrowCap.SetWidthScale(data->ArrowCap->LineCapWidthScale); arrowCap.SetStrokeCap(gdp::LineCapRound); ObjectPen.SetCustomStartCap(dynamic_cast(&arrowCap)); if (data->ArrowCap->bShowArrowBoth){ gdp::AdjustableArrowCap arrowCap2(data->ArrowCap->LineCapHeight, data->ArrowCap->LineCapWidth, data->ArrowCap->bFillLineCap); arrowCap2.SetWidthScale(data->ArrowCap->LineCapWidthScale); arrowCap2.SetStrokeCap(gdp::LineCapRound); ObjectPen.SetCustomEndCap(dynamic_cast(&arrowCap2)); } else { ObjectPen.SetEndCap(gdp::LineCapRound); } } else { ObjectPen.SetStartCap(gdp::LineCapRound); ObjectPen.SetEndCap(gdp::LineCapRound); } ObjectPen.SetLineJoin(gdp::LineJoinRound); ObjectPen.SetDashStyle((gdp::DashStyle)nPenStyle); ObjectPen.SetDashCap(gdp::DashCapRound); } else { if (data->CapStyle[0] == 1 && data->ArrowCap){ // arrow gdp::AdjustableArrowCap arrowCap(data->ArrowCap->LineCapHeight, data->ArrowCap->LineCapWidth, data->ArrowCap->bFillLineCap); arrowCap.SetWidthScale(data->ArrowCap->LineCapWidthScale); arrowCap.SetStrokeCap(gdp::LineCapFlat); ObjectPen.SetCustomStartCap(dynamic_cast(&arrowCap)); if (data->ArrowCap->bShowArrowBoth){ gdp::AdjustableArrowCap arrowCap2(data->ArrowCap->LineCapHeight, data->ArrowCap->LineCapWidth, data->ArrowCap->bFillLineCap); arrowCap2.SetWidthScale(data->ArrowCap->LineCapWidthScale); arrowCap2.SetStrokeCap(gdp::LineCapFlat); ObjectPen.SetCustomEndCap(dynamic_cast(&arrowCap2)); } else { ObjectPen.SetEndCap(gdp::LineCapFlat); } } else { ObjectPen.SetStartCap(gdp::LineCapFlat); ObjectPen.SetEndCap(gdp::LineCapFlat); } ObjectPen.SetLineJoin(gdp::LineJoinMiter); ObjectPen.SetDashStyle((gdp::DashStyle)nPenStyle); ObjectPen.SetDashCap(gdp::DashCapFlat); } } hOldPen = (HPEN)SelectObject(dcDst, hPen); SetROP2(dcDst, R2_COPYPEN); switch (data->Kind) { case V_LINE: graphics.DrawPolygon(&ObjectPen, pTemps, data->nCount*3+1); break; case V_CURVE: if (data->bClosed && data->PenStyle == P_SOLID) { graphics.DrawBeziers(&ObjectPen, pTemps, (data->nCount+1)*3+1); } else { if (data->ChildList) { // 090303 embakum motiveobjects TagDrawMotiveObject(dcDst, data, PositionX, PositionY, Zoom); } else { graphics.DrawBeziers(&ObjectPen, pTemps, data->nCount*3+1); } } if (data->bFill) { gFillPath.AddBeziers(pTemps, data->nCount*3+1); graphics.FillPath(&ObjectBrush, &gFillPath); graphics.DrawPath(&ObjectPen,&gFillPath); } break; // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman // case V_TEXTBOX: // VecDraw->DrawTextBox(dcDst, data, StartX, StartY, CenterX, CenterY, FontZoom); // break; } if (data->ChildList) { // 090303 embakum motiveobjects VecDraw->DrawMotiveObjects(dcDst, data, MainImageForm, px, px, 1, PositionX, PositionY, Zoom, nInstNum); } if (dashValues) { delete[] dashValues; dashValues = NULL;} if (pTemps) { delete[] pTemps; pTemps = NULL; } SetROP2(dcDst, nDrawMode); SetPolyFillMode(dcDst, nFillMode); SelectObject(dcDst, hOldBrush); SelectObject(dcDst, hOldPen); if (hBrush) DeleteObject(hBrush); if (hPen) DeleteObject(hPen); hOldPen = NULL; hOldBrush = NULL; hPen = NULL; hBrush = NULL; } return; fail: if (data) { delete data; data = NULL; } } //--------------------------------------------------------------------------- /* void __fastcall TCombiForm::OldTagDraw(HDC dcDst, TList *list, int num) { HPEN hOldPen = NULL , hPen = NULL; HBRUSH hOldBrush = NULL, hBrush = NULL; int nDrawMode, nFillMode, nTemp, nPenStyle;; POINT pTemp[1024]; LOGBRUSH logbrush; Graphics::TBitmap *TempBitmap = NULL; int PositionX, PositionY; int px = 0, py = 0, w ,h; double rx, ry, Zoom; long minx = MaxInt, miny = MaxInt, maxx = 0, maxy = 0; double maxthick = 0; TRect src; TVecData *data = NULL; // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman // int FirstX, FirstY, SecondX, SecondY; // double CenterX, CenterY, FontZoom = 1.0; // int StartX, StartY; // int pw; gdp::Graphics graphics(dcDst); // using GDI+ gdp::Point *pTemps; graphics.SetSmoothingMode(gdp::SmoothingModeHighQuality); // antialiasing for (int i = 0; i < list->Count; i++) { data = (TVecData *)list->Items[i]; if (num != -1) if (!data->Equal(num)) continue; minx = min(minx, data->First.x); minx = min(minx, data->Second.x); maxx = max(maxx, data->First.x); maxx = max(maxx, data->Second.x); miny = min(miny, data->First.y); miny = min(miny, data->Second.y); maxy = max(maxy, data->First.y); maxy = max(maxy, data->Second.y); maxthick = max(maxthick, data->PenThick); } src = Rect(minx-maxthick, miny-maxthick, maxx+maxthick, maxy+maxthick); rx = 80.0/(src.Right-src.Left); ry = 100.0/(src.Bottom-src.Top); if (rx>ry) { w = (src.Right-src.Left)*ry; h = (src.Bottom-src.Top)*ry; Zoom = double(h) / double(src.Bottom-src.top); }else { w = (src.Right-src.Left)*rx; h = (src.Bottom-src.Top)*rx; Zoom = double(w) / double(src.Right-src.Left); } PositionX = src.Left; PositionY = src.Top; for (int i = 0; i < list->Count; i++) { data = (TVecData *)list->Items[i]; if (num != -1) if (!data->Equal(num)) continue; int FirstX = (data->First.x - PositionX) * Zoom -px; int FirstY = (data->First.y - PositionY) * Zoom -py; int SecondX = (data->Second.x - PositionX) * Zoom -px; int SecondY = (data->Second.y - PositionY) * Zoom -py; int pw = data->PenThick/2; gdp::Color penColor(GetRValue(data->Color), GetGValue(data->Color), GetBValue(data->Color)); gdp::Color FillColor(GetRValue(data->Brush), GetGValue(data->Brush), GetBValue(data->Brush)); gdp::Pen ObjectPen(penColor, data->PenThick*Zoom); gdp::SolidBrush ObjectBrush(FillColor); gdp::GraphicsPath gFillPath; float *dashValues = NULL; if (data->Kind == V_TEXTBOX) { pTemps = new gdp::Point[5]; } else { if (data->bClosed){ pTemps = new gdp::Point[(data->nCount+1)*3+1]; } else { pTemps = new gdp::Point[data->nCount*3+1]; } } // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman if (data->Kind != V_TEXTBOX) { for (int i = 0; i < data->nCount*3 +1; i++) { // pTemp[i].x = (data->pList[i].x - PositionX) * Zoom -px; // pTemp[i].y = (data->pList[i].y - PositionY) * Zoom -py; pTemps[i].X = (data->pList[i].x - PositionX) * Zoom -px; pTemps[i].Y = (data->pList[i].y - PositionY) * Zoom -py; } } // else { // StartX = (data->StartPoint.x - PositionX) * Zoom -px; // StartY = (data->StartPoint.y - PositionY) * Zoom -py; // CenterX = (data->CenterPoint.x - PositionX) * Zoom -px; // CenterY = (data->CenterPoint.y - PositionY) * Zoom -py; // FontZoom = Zoom; // for (int i = 0; i < 5; i++) { // pTemp[i].x = (data->pList[i].x - PositionX) * Zoom -px; // pTemp[i].y = (data->pList[i].y - PositionY) * Zoom -py; // } // } if (data->bClosed && data->PenStyle == P_SOLID) { // pTemp[data->nCount*3] = pTemp[0]; // pTemp[data->nCount*3+1] = pTemp[1]; // pTemp[data->nCount*3+2] = pTemp[2]; // pTemp[data->nCount*3+3] = pTemp[3]; pTemps[data->nCount*3] = pTemps[0]; pTemps[data->nCount*3+1] = pTemps[1]; pTemps[data->nCount*3+2] = pTemps[2]; pTemps[data->nCount*3+3] = pTemps[3]; } nDrawMode = GetROP2(dcDst); nFillMode = GetPolyFillMode(dcDst); logbrush.lbStyle = BS_SOLID; logbrush.lbColor = data->Brush; logbrush.lbHatch = 0; if (data->bPatternFill) { // PatternFill À϶§ - by monkman (ÇöÀç´Â TagDraw() ¿¡ PatternFillÀÌ ¾øÀ½..) //TempBitmap = new Graphics::TBitmap; //TempBitmap->PixelFormat = pf24bit; //TempBitmap->Width = data->Bitmap->Width * Zoom; //TempBitmap->Height = data->Bitmap->Height * Zoom; //StretchBlt(TempBitmap->Canvas->Handle,0,0,TempBitmap->Width,TempBitmap->Height, // data->Bitmap->Canvas->Handle,0,0,data->Bitmap->Width,data->Bitmap->Height,SRCCOPY); //SetBrushOrgEx(dcDst, FirstX, FirstY, NULL); //hBrush = CreatePatternBrush(TempBitmap->Handle); //hOldBrush = SelectObject(dcDst, hBrush); }else if (data->bFill) { // ColorFill À϶§ hBrush = CreateBrushIndirect(&logbrush); hOldBrush = (HBRUSH)SelectObject(dcDst, hBrush); }else { // Fill X hOldBrush = (HBRUSH)SelectObject(dcDst, GetStockObject(NULL_BRUSH)); } // if (data->bWinding) SetPolyFillMode(dcDst, WINDING); // ä¿ì±â ¸ðµå ¼±Åà // else SetPolyFillMode(dcDst, ALTERNATE); if (data->bWinding) gFillPath.SetFillMode(gdp::FillModeWinding); else gFillPath.SetFillMode(gdp::FillModeAlternate); logbrush.lbColor = data->Color; // ÆæÀÇ color¸¦ À§Çؼ­... switch (data->PenStyle) { case 0: nPenStyle = int (PS_SOLID); break; case 1: nPenStyle = int (PS_DASH); break; case 2: nPenStyle = int (PS_DOT); break; case 3: nPenStyle = int (PS_DASHDOT); break; case 4: nPenStyle = int (PS_DASHDOTDOT);break; case 5: nPenStyle = P_USERSTYLE; // 2005 Vector upgrade shin 0330 int count = 0; double temp[6] = { 0, 0, 0, 0, 0, 0}; VecDraw->CheckUserDashedLine(data, temp, count); dashValues = new float[count]; for (int i = 0; i < count; i++){ dashValues[i] = temp[i]; } ObjectPen.SetDashPattern(dashValues, count); break; // DashStyleCustom = 5 //case 5: // nPenStyle = P_USERSTYLE; // int count = data->DashValues[0]; // dashValues = new float[count]; // for (int i = 0; i < count; i++){ // dashValues[i] = data->DashValues[i+1]; // } // //ObjectPen.GetCompoundArray(dashValues, count); // ObjectPen.SetDashPattern(dashValues, count); // break; // DashStyleCustom = 5 } if (VecDraw->osVERSION < 2) { // 3.1, 95, 98 hPen = CreatePen(psSolid, data->PenThick* Zoom, data->Color); }else { if (data->bRound){ // win 2000, NT¿¡¼­¸¸ Á¦´ë·Î ÀÛµ¿ÇÑ´Ù //hPen = ExtCreatePen(PS_GEOMETRIC | PS_ENDCAP_ROUND | PS_JOIN_ROUND, // data->PenThick* Zoom, &logbrush, 0, NULL ); ObjectPen.SetStartCap(gdp::LineCapRound); ObjectPen.SetEndCap(gdp::LineCapRound); ObjectPen.SetLineJoin(gdp::LineJoinRound); ObjectPen.SetDashStyle((gdp::DashStyle)nPenStyle); ObjectPen.SetDashCap(gdp::DashCapRound); } else { //hPen = ExtCreatePen(PS_GEOMETRIC | PS_ENDCAP_FLAT | PS_JOIN_MITER, // data->PenThick* Zoom, &logbrush, 0, NULL ); ObjectPen.SetStartCap(gdp::LineCapFlat); ObjectPen.SetEndCap(gdp::LineCapFlat); ObjectPen.SetLineJoin(gdp::LineJoinMiter); ObjectPen.SetDashStyle((gdp::DashStyle)nPenStyle); ObjectPen.SetDashCap(gdp::DashCapFlat); } } hOldPen = (HPEN)SelectObject(dcDst, hPen); SetROP2(dcDst, R2_COPYPEN); switch (data->Kind) { case V_LINE: //Polyline(dcDst, pTemp, data->nCount +1); Polyline(dcDst, pTemp, data->nCount +1); break; case V_CURVE: if (data->bClosed && data->PenStyle == P_SOLID) { graphics.DrawBeziers(&ObjectPen, pTemps, (data->nCount+1)*3+1); } else { if (data->ChildList) { // 090303 embakum motiveobjects TagDrawMotiveObject(dcDst, data, PositionX, PositionY, Zoom); } else { graphics.DrawBeziers(&ObjectPen, pTemps, data->nCount*3+1); } } if (data->bFill) { gFillPath.AddBeziers(pTemps, data->nCount*3+1); graphics.FillPath(&ObjectBrush, &gFillPath); graphics.DrawPath(&ObjectPen,&gFillPath); } //if (data->bFill){ // BeginPath(dcDst); // MoveToEx(dcDst, pTemp[0].x, pTemp[0].y, NULL); // PolyBezierTo (dcDst, pTemp+1, data->nCount*3); // EndPath(dcDst); // FillPath(dcDst); // PolyBezier(dcDst, pTemp, (data->nCount+(data->bClosed&&data->PenStyle==P_SOLID))*3+1); //}else { // PolyBezier(dcDst, pTemp, (data->nCount+(data->bClosed&&data->PenStyle==P_SOLID))*3+1); //} break; // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman // case V_TEXTBOX: // VecDraw->DrawTextBox(dcDst, data, StartX, StartY, CenterX, CenterY, FontZoom); // break; } if (data->ChildList) { // 090303 embakum motiveobjects VecDraw->DrawMotiveObjects(dcDst, data, MainImageForm, px, px, 1, PositionX, PositionY, Zoom, num); } if (dashValues) { delete[] dashValues; dashValues = NULL;} if (pTemps) { delete[] pTemps; pTemps = NULL; } SetROP2(dcDst, nDrawMode); SetPolyFillMode(dcDst, nFillMode); SelectObject(dcDst, hOldBrush); SelectObject(dcDst, hOldPen); if (hBrush) DeleteObject(hBrush); if (hPen) DeleteObject(hPen); hOldPen = NULL; hOldBrush = NULL; hPen = NULL; hBrush = NULL; } return; fail: if (data) { delete data; data = NULL; } } */ //--------------------------------------------------------------------------- void __fastcall TCombiForm::TagDrawMotiveObject(HDC dcDst, TVecData* ParentData, int PositionX, int PositionY, float Zoom) { TList *tDataList = ParentData->ChildList; TVecData *data = NULL; // Ŭ·¡½º ¸â¹ö º¯¼ö¸¦ »ç¿ëÇÏÁö ¾Êµµ·Ï ÇÔ - by monkman (2009.04.01) TList *DataList = new TList; TList * ResultBezierPointList; TPointList *tempPointList; bool bSelectedLine; DPOINT firstPoint, onPoint, normalPoint, tempCurpt, tempOldpt; DPOINT *pTempList = NULL; double dInterval; TBezierPointList * BezierPointList = new TBezierPointList(); //»ý¼º BezierPointList->Init(ParentData); double CurveLength = BezierPointList->GetCurveLength(); int nSegment; int quotient = int(CurveLength/((ParentData->proportion)*(ParentData->childwidth))); if (quotient==0) quotient = 1; switch (ParentData->mode) { case 0: // ²Ë ä¿ì±â nSegment = int(CurveLength/((ParentData->proportion)*(ParentData->childwidth))); if (nSegment ==0) nSegment = 1; ParentData->gap = double(CurveLength/nSegment); ParentData->motivecount = nSegment; break; case 1: // °³¼ö ¼³Á¤ nSegment = StrToInt(ParentData->motivecount); if (nSegment ==0) nSegment = 1; ParentData->gap = double(CurveLength/nSegment); break; case 2: // °£°Ý ¼³Á¤ nSegment = int(CurveLength/ParentData->gap); if (nSegment ==0) nSegment = 1; ParentData->motivecount = nSegment; break; } int count = 1; ResultBezierPointList = BezierPointList->Calculate(ParentData, nSegment); if (!ResultBezierPointList) { delete DataList; DataList; delete BezierPointList; BezierPointList = NULL; return; } pTempList = (DPOINT *)HeapAlloc(GetProcessHeap(), 0, sizeof(DPOINT)*(nSegment*3+1)); double *tangentlist = new double[nSegment+1]; // ±â¿ï±â¸¦ °¡Áö°í ÀÖ´Â ¹è¿­ firstPoint = VecDraw->FindingNormalOnBezier(&ParentData->pList[0], 0, 0, 0); pTempList[0].x = firstPoint.x; pTempList[0].y = firstPoint.y; pTempList[1].x = firstPoint.x; pTempList[1].y = firstPoint.y; tangentlist[0] = VecDraw->FindCurveTangent(&ParentData->pList[0], 0); for(int i=0;iCount;i++) { tempPointList = (TPointList *)ResultBezierPointList->Items[i]; for(tempPointList->First();!tempPointList->IsDone();tempPointList->Next()) { dInterval = tempPointList->CurrentDouble(); // BezierCurve À§ÀÇ Á¡À§Ä¡ // onPoint = FindingPointOnBezier(&tData->pList[i*3], dInterval); // ãÀº Á¡ÀÇ NormalÀÇ À§Ä¡ (ãÀº Á¡Àº ResultBezierPointList¾È¿¡ ÀÖÀ½) normalPoint = VecDraw->FindingNormalOnBezier(&ParentData->pList[i*3], dInterval, 0, count%2); tangentlist[count] = VecDraw->FindCurveTangent(&ParentData->pList[i*3], dInterval); pTempList[count*3 - 2] = pTempList[count*3 - 3]; pTempList[count*3 - 1].x = normalPoint.x; pTempList[count*3 - 1].y = normalPoint.y; pTempList[count*3].x = normalPoint.x; pTempList[count*3].y = normalPoint.y; count++; tempOldpt = tempCurpt; } } if (ParentData->bClosed){ // ´ÝÈù ¿ÀºêÁ§Æ®ÀÇ °æ¿ì ³¡Á¡°ú ùÁ¡À» °°°Ô. pTempList[nSegment*3] = pTempList[0]; pTempList[nSegment*3 - 1] = pTempList[0]; } delete BezierPointList; BezierPointList = NULL; ///////////////////////////////////////////////////// HPEN hOldPen = NULL , hPen = NULL; HBRUSH hOldBrush = NULL, hBrush = NULL; int nDrawMode, nFillMode, nTemp, nPenStyle;; LOGBRUSH logbrush; Graphics::TBitmap *TempBitmap = NULL; int px = 0, py = 0; TRect src; gdp::Graphics graphics(dcDst); // using GDI+ gdp::Point *pTemps; graphics.SetSmoothingMode(gdp::SmoothingModeHighQuality); // antialiasing ///////////////////////////////////////////////////// TVecData *tdata; // motive childÀÇ È®´ë Ãà¼Ò for (int i =0; i < tDataList->Count; i++) { data = (TVecData *)tDataList->Items[i]; tdata = new TVecData(data->GetInstNum()); tdata->Copy(data); tdata->bSelected = data->bSelected; // º¹»ç ºÙ¿©³Ö±â ½Ã º¸¿©Áöµµ·Ï - by monkman (2009.04.02) for (int l = 0; l < data->nCount*3 +1; l++) { tdata->pList[l].x = (data->pList[l].x - ParentData->centerX) * ParentData->proportion + ParentData->centerX; tdata->pList[l].y = (data->pList[l].y - ParentData->centerY) * ParentData->proportion + ParentData->centerY; } DataList->Add(tdata); } ///////////////////////////////////////////////////// for (int k = 0; k < nSegment; k++) { for (int i = 0; i < DataList->Count; i++) { data = (TVecData *)DataList->Items[i]; for (int l = 0; l < data->nCount*3 +1; l++) { data->pList[l].x = data->pList[l].x - ParentData->centerX + pTempList[3*k].x; data->pList[l].y = data->pList[l].y - ParentData->centerY + pTempList[3*k].y; } for (int l = 0; l < data->nCount*3 +1; l++) { double dx = data->pList[l].x - pTempList[3*k].x; double dy = data->pList[l].y - pTempList[3*k].y; data->pList[l].x = dx*cos(tangentlist[k]) - dy*sin(tangentlist[k]) + pTempList[3*k].x; data->pList[l].y = dx*sin(tangentlist[k]) + dy*cos(tangentlist[k]) + pTempList[3*k].y; } SET_RECT; //gradientfill int FirstX = (data->First.x - PositionX) * Zoom -px; int FirstY = (data->First.y - PositionY) * Zoom -py; int SecondX = (data->Second.x - PositionX) * Zoom -px; int SecondY = (data->Second.y - PositionY) * Zoom -py; int pw = data->PenThick/2; gdp::Color penColor(GetRValue(data->Color), GetGValue(data->Color), GetBValue(data->Color)); gdp::Color FillColor(GetRValue(data->Brush), GetGValue(data->Brush), GetBValue(data->Brush)); gdp::Pen ObjectPen(penColor, data->PenThick*Zoom); gdp::SolidBrush ObjectBrush(FillColor); gdp::GraphicsPath gFillPath; float *dashValues = NULL; if (data->Kind == V_TEXTBOX) { pTemps = new gdp::Point[5]; } else { if (data->bClosed){ pTemps = new gdp::Point[(data->nCount+1)*3+1]; } else { pTemps = new gdp::Point[data->nCount*3+1]; } } // TEXTBOX ¼öÁ¤½Ã ÀÌ ºÎºÐÀ» ¼öÁ¤ - by monkman if (data->Kind != V_TEXTBOX) { for (int i = 0; i < data->nCount*3 +1; i++) { pTemps[i].X = (data->pList[i].x - PositionX) * Zoom -px; pTemps[i].Y = (data->pList[i].y - PositionY) * Zoom -py; } } if (data->bClosed && data->PenStyle == P_SOLID) { pTemps[data->nCount*3] = pTemps[0]; pTemps[data->nCount*3+1] = pTemps[1]; pTemps[data->nCount*3+2] = pTemps[2]; pTemps[data->nCount*3+3] = pTemps[3]; } nDrawMode = GetROP2(dcDst); nFillMode = GetPolyFillMode(dcDst); logbrush.lbStyle = BS_SOLID; logbrush.lbColor = data->Brush; logbrush.lbHatch = 0; if (data->bPatternFill) { }else if (data->bFill) { // ColorFill À϶§ hBrush = CreateBrushIndirect(&logbrush); hOldBrush = (HBRUSH)SelectObject(dcDst, hBrush); }else { // Fill X hOldBrush = (HBRUSH)SelectObject(dcDst, GetStockObject(NULL_BRUSH)); } if (data->bWinding) gFillPath.SetFillMode(gdp::FillModeWinding); else gFillPath.SetFillMode(gdp::FillModeAlternate); logbrush.lbColor = data->Color; // ÆæÀÇ color¸¦ À§Çؼ­... switch (data->PenStyle) { case 0: nPenStyle = int (PS_SOLID); break; case 1: nPenStyle = int (PS_DASH); break; case 2: nPenStyle = int (PS_DOT); break; case 3: nPenStyle = int (PS_DASHDOT); break; case 4: nPenStyle = int (PS_DASHDOTDOT);break; case 5: nPenStyle = P_USERSTYLE; // 2005 Vector upgrade shin 0330 int count = 0; double temp[6] = { 0, 0, 0, 0, 0, 0}; VecDraw->CheckUserDashedLine(data, temp, count); dashValues = new float[count]; for (int i = 0; i < count; i++){ dashValues[i] = temp[i]; } ObjectPen.SetDashPattern(dashValues, count); break; // DashStyleCustom = 5 } if (VecDraw->osVERSION < 2) { // 3.1, 95, 98 hPen = CreatePen(psSolid, data->PenThick* Zoom, data->Color); }else { if (data->bRound){ // win 2000, NT¿¡¼­¸¸ Á¦´ë·Î ÀÛµ¿ÇÑ´Ù ObjectPen.SetStartCap(gdp::LineCapRound); ObjectPen.SetEndCap(gdp::LineCapRound); ObjectPen.SetLineJoin(gdp::LineJoinRound); ObjectPen.SetDashStyle((gdp::DashStyle)nPenStyle); ObjectPen.SetDashCap(gdp::DashCapRound); } else { ObjectPen.SetStartCap(gdp::LineCapFlat); ObjectPen.SetEndCap(gdp::LineCapFlat); ObjectPen.SetLineJoin(gdp::LineJoinMiter); ObjectPen.SetDashStyle((gdp::DashStyle)nPenStyle); ObjectPen.SetDashCap(gdp::DashCapFlat); } } hOldPen = (HPEN)SelectObject(dcDst, hPen); SetROP2(dcDst, R2_COPYPEN); switch (data->Kind) { case V_LINE: graphics.DrawPolygon(&ObjectPen, pTemps, data->nCount*3+1); break; case V_CURVE: if (data->bClosed && data->PenStyle == P_SOLID) { graphics.DrawBeziers(&ObjectPen, pTemps, (data->nCount+1)*3+1); } else { graphics.DrawBeziers(&ObjectPen, pTemps, data->nCount*3+1); } if (data->bFill) { gFillPath.AddBeziers(pTemps, data->nCount*3+1); graphics.FillPath(&ObjectBrush, &gFillPath); graphics.DrawPath(&ObjectPen,&gFillPath); } break; } if (dashValues) { delete[] dashValues; dashValues = NULL;} if (pTemps) { delete[] pTemps; pTemps = NULL; } SetROP2(dcDst, nDrawMode); SetPolyFillMode(dcDst, nFillMode); SelectObject(dcDst, hOldBrush); SelectObject(dcDst, hOldPen); if (hBrush) DeleteObject(hBrush); if (hPen) DeleteObject(hPen); hOldPen = NULL; hOldBrush = NULL; hPen = NULL; hBrush = NULL; // 20090220 °¢µµº¯È¯ reverseÇÊ¿ä for (int l = 0; l < data->nCount*3 +1; l++) { double dx = data->pList[l].x - pTempList[3*k].x; double dy = data->pList[l].y - pTempList[3*k].y; data->pList[l].x = dx*cos(-tangentlist[k]) - dy*sin(-tangentlist[k]) + pTempList[3*k].x; data->pList[l].y = dx*sin(-tangentlist[k]) + dy*cos(-tangentlist[k]) + pTempList[3*k].y; } for (int l = 0; l < data->nCount*3 +1; l++) { data->pList[l].x = data->pList[l].x + ParentData->centerX - pTempList[3*k].x; data->pList[l].y = data->pList[l].y + ParentData->centerY - pTempList[3*k].y; } } } if (DataList) { for (int i = 0; i < DataList->Count; i++) { data = (TVecData *)DataList->Items[i]; delete data; } DataList->Clear(); delete DataList; DataList = NULL; } if (tangentlist) delete[] tangentlist; tangentlist = NULL; // ¸Þ¸ð¸® ÇØÁ¦ - by monkman (2009.04.16) if (pTempList) { HeapFree(GetProcessHeap(), 0, pTempList); } pTempList = NULL; return; fail: if (data) { delete data; data = NULL; } if (DataList) { for (int i = 0; i < DataList->Count; i++) { data = (TVecData *)DataList->Items[i]; delete data; } DataList->Clear(); delete DataList; DataList = NULL; } if (tangentlist) delete[] tangentlist; tangentlist = NULL; // ¸Þ¸ð¸® ÇØÁ¦ - by monkman (2009.04.16) if (pTempList) { HeapFree(GetProcessHeap(), 0, pTempList); } pTempList = NULL; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGridDrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect, TGridDrawState State) { TFileInfor *fi; HDC hDC = NULL; TRect r; TStringGrid *StringGrid = NULL; TList *ImageList = NULL; StringGrid = dynamic_cast(Sender); if (StringGrid) { if (StringGrid->Name == "StringGrid1") ImageList = ImageList1; else if (StringGrid->Name == "StringGrid2") ImageList = ImageList2; else if (StringGrid->Name == "StringGrid3") ImageList = ImageList3; if (ImageList && 0 <= ACol && ACol < ImageList->Count) { fi = (TFileInfor *) ImageList->Items[ACol]; if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(StringGrid->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, SRCCOPY); fi->tBitmap->DeleteDC(hDC); if (fi->Name.Length() < 24) { r.Left = Rect.Left+5; r.Top = Rect.Top+TAG_HEIGHT+10; r.Right = Rect.Left+TAG_WIDTH+5; r.Bottom = Rect.Top+TAG_HEIGHT+30; StringGrid->Canvas->TextRect(r, Rect.Left+5, Rect.Top+TAG_HEIGHT+15, fi->Name); }else { String name1, name2; name1 = fi->Name.SubString(1, 24); name2 = fi->Name.SubString(25, 24); r.Left = Rect.Left+5; r.Top = Rect.Top+TAG_HEIGHT+5; r.Right = Rect.Left+TAG_WIDTH+5; r.Bottom = Rect.Top+TAG_HEIGHT+20; StringGrid->Canvas->TextRect(r, Rect.Left+5, Rect.Top+TAG_HEIGHT+5, name1); r.Top = Rect.Top+TAG_HEIGHT+20; r.Bottom = Rect.Top+TAG_HEIGHT+35; StringGrid->Canvas->TextRect(r, Rect.Left+5, Rect.Top+TAG_HEIGHT+20, name2); } } } fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::rzsplitterCombinationHotSpotClick( TObject *Sender) { if (rzsplitterCombination->HotSpotClosed) { // HotSpotÀÌ ´ÝÇûÀ» ¶§ (°Ë»ö ÆÐ³ÎÀÌ ´ÝÈù »óÅÂ) //StringGrid1->Width = 639; //StringGrid2->Width = 639; //StringGrid3->Width = 639; //RzPanel1->Width = 651; StringGrid1->Width = 641; StringGrid2->Width = 641; StringGrid3->Width = 641; RzPanel1->Width = 653; } else { // HotSportÀÌ ¿­·ÈÀ» ¶§ (°Ë»ö ÆÐ³ÎÀÌ ¿­¸° »óÅÂ) //StringGrid1->Width = 512; //StringGrid2->Width = 512; //StringGrid3->Width = 512; //RzPanel1->Width = 526; StringGrid1->Width = 459; StringGrid2->Width = 459; StringGrid3->Width = 459; RzPanel1->Width = 464; } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid1Click(TObject *Sender) { // StringGrid4¸¦ ÀÌ¿ëÇÏ¿© Detail ÇÏ°Ô ¼±ÅÃÇØ¾ßÇÏ°Ô µÇ¾úÀ¸¹Ç·Î // ¸ðµç 󸮴 StringGrid1MouseDown ¿Í StringGrid4Click ¿¡¼­ ÇØÁØ´Ù // - by monkman (2004.05.27) //////////////////////////////////////////////////////////////////////////////// // TFileInfor *fi; // String path; // HDC hDC = NULL; // // if (StringGrid1->Col >= ImageList1->Count) return; // // // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÀÁö ¾Ê¾ÒÀ» ¶§.. // if (!bIsIllustForm) // { // fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; // // // »óÀÇ ´ëÇ¥ ½Ç·ç¿§ ¹®Á¦·Î ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ - by monkman (2004.03.24) // //if (rbUpper->Checked) CheckedSilhouette[StringGrid1->Col] = !CheckedSilhouette[StringGrid1->Col]; // if (rbUpper->Checked) { // if (fi->Depth > 0) { // if (CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) CheckedSilhouette >> EDetailSilhouette(fi->Depth); // else CheckedSilhouette << EDetailSilhouette(fi->Depth); // fi->Name = SilhouetteName[fi->Depth]; // }else { // CheckedOldSilhouette[fi->Depth*(-1)] = !CheckedOldSilhouette[fi->Depth*(-1)]; // } // } // else { // if (CheckedPants.Contains(EDetailPants(fi->Depth))) CheckedPants >> EDetailPants(fi->Depth); // else CheckedPants << EDetailPants(fi->Depth); // fi->Name = PantsName[fi->Depth]; // } // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // // StringGrid1->Repaint(); // } // // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman // else // { // if (bIsStringGrid1First) // { // // »óÀÇ ´ëÇ¥ ½Ç·ç¿§ ¹®Á¦·Î ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ - by monkman (2004.03.24) // //if (rbUpper->Checked) { // // fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; // // CheckedSilhouette[StringGrid1->Col] = !CheckedSilhouette[StringGrid1->Col]; // // // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // // fi->tBitmap->DeleteDC(hDC); // // // // StringGrid1->Repaint(); // //} // if (rbUpper->Checked) { // if (fi->Depth > 0) { // if (CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) CheckedSilhouette >> EDetailSilhouette(fi->Depth); // else CheckedSilhouette << EDetailSilhouette(fi->Depth); // }else { // CheckedOldSilhouette[fi->Depth*(-1)] = !CheckedOldSilhouette[fi->Depth*(-1)]; // } // // // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. // for (int i = 0; i < ImageList1->Count; i++) // { // fi = (TFileInfor*) ImageList1->Items[i]; // // //fi->Name = SilhouetteName[fi->Depth]; // if (fi->Name == SilhouetteName[HDPatUpSil.ESilhouette]) // { // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // StringGrid1->Repaint(); // } // } // }else { // if (CheckedPants.Contains(EDetailPants(HDPatDnSil.EPants))) CheckedPants >> EDetailPants(HDPatDnSil.EPants); // else CheckedPants << EDetailPants(HDPatDnSil.EPants); // // // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. // for (int i = 0; i < ImageList1->Count; i++) // { // fi = (TFileInfor*) ImageList1->Items[i]; // // fi->Name = PantsName[fi->Depth]; // if (fi->Name == PantsName[HDPatDnSil.EPants]) // { // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // StringGrid1->Repaint(); // } // } // } // } // else // { // fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; // // // »óÀÇ ´ëÇ¥ ½Ç·ç¿§ ¹®Á¦·Î ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ - by monkman (2004.03.24) // //if (rbUpper->Checked) CheckedSilhouette[StringGrid1->Col] = !CheckedSilhouette[StringGrid1->Col]; // if (rbUpper->Checked) { // if (fi->Depth > 0) { // if (CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) CheckedSilhouette >> EDetailSilhouette(fi->Depth); // else CheckedSilhouette << EDetailSilhouette(fi->Depth); // }else { // CheckedOldSilhouette[fi->Depth*(-1)] = !CheckedOldSilhouette[fi->Depth*(-1)]; // } // //fi->Name = SilhouetteName[fi->Depth]; // } // else { // if (CheckedPants.Contains(EDetailPants(fi->Depth))) CheckedPants >> EDetailPants(fi->Depth); // else CheckedPants << EDetailPants(fi->Depth); // fi->Name = PantsName[fi->Depth]; // } // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // // StringGrid1->Repaint(); // } // } // //fail: // // bIsStringGrid1First = false; //////////////////////////////////////////////////////////////////////////////// TFileInfor *fi; String path; HDC hDC = NULL; int RandomNumber; if (StringGrid1->Col >= ImageList1->Count) return; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman if (bIsIllustForm) { if (bIsStringGrid1First) { // »óÀǸ¦ ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â °ÍÀ¸·Î ¼öÁ¤ - by monkman (2004.03.24) //if (rbUpper->Checked) return; // »óÀÇ´Â ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â°Ô ¾Æ´ÏÁö·Õ if (combobxUpperLower->ItemIndex == 0) { DetailSort = HDPatUpSil.Sort; // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. for (int i = 0; i < ImageList1->Count; i++) { fi = (TFileInfor*) ImageList1->Items[i]; if (fi->Depth == int(HDPatUpSil.ESilhouette)) { // Version 100Àº ´ëÇ¥½ºÅ¸ÀÏÀÌ ¾ø´Ù // StringGrid1MouseDown() °ú °ÅÀÇ ºñ½ÁÇÏÁö¸¸ °¢ StringGridÀÇ MouseClick() À̺¥Æ®¿¡ »ç¿ëÇÑ´Ù - by monkman (2004.05.27) // ÀÌ ÇÔ¼ö¸¦ µ¹¸é¼­ ´ëÇ¥½ºÅ¸ÀÏÀÌ °°Àº DetailÇÑ °¹¼ö¸¦ ¾Ë¾Æ³½´Ù STYFileFindAndToFileList(HDPatUpSil.ESilhouette, DetailSort); if (fi->Depth > 0) { // Version 200 // ·£´ý ÇÔ¼ö¸¦ µ¹¸é¼­ DETAILRANDOMNUM¸¦ ¼±ÅÃÇÑ´Ù. ¸¸¾à, µðÅ×ÀÏÇÑ °¹¼ö°¡ DETAILRANDOMNUM°³ ÀÌÇ϶ó¸é ÀÖ´Â ¼ö ¸¸Å­ ·çÇÁ¸¦ µ·´Ù while ((CheckedDetailSilhouetteCounter[fi->Depth] < DETAILRANDOMNUM) && (CheckedDetailSilhouetteCounter[fi->Depth] < FileList->Count)) { RandomNumber = random(FileList->Count); if (!(DetailSilhouette[fi->Depth][RandomNumber/8] & (1<<((RandomNumber%8))))) { DetailSilhouette[fi->Depth][RandomNumber/8] += 1<<(RandomNumber%8); CheckedDetailSilhouetteCounter[fi->Depth]++; CheckedStyleFileList(SrcFileList, true, FileList->Strings[RandomNumber]); } } CheckedSilhouette << EDetailSilhouette(fi->Depth); fi->Name = VecDraw->SilhouetteName[fi->Depth] +" "+ String(CheckedDetailSilhouetteCounter[fi->Depth])+"/"+String(FileList->Count); // ¹ÝÀü if (!bCheckedSilhouette[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSilhouette[fi->Depth] = true; } //sbOKClick(this); } } } } else { DetailSort = HDPatDnSil.Sort; // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. for (int i = 0; i < ImageList1->Count; i++) { fi = (TFileInfor*) ImageList1->Items[i]; if (fi->Depth == int(HDPatDnSil.EPants)) { // Version 100Àº ´ëÇ¥½ºÅ¸ÀÏÀÌ ¾ø´Ù // StringGrid1MouseDown() °ú °ÅÀÇ ºñ½ÁÇÏÁö¸¸ °¢ StringGridÀÇ MouseClick() À̺¥Æ®¿¡ »ç¿ëÇÑ´Ù - by monkman (2004.05.27) // ÀÌ ÇÔ¼ö¸¦ µ¹¸é¼­ ´ëÇ¥½ºÅ¸ÀÏÀÌ °°Àº DetailÇÑ °¹¼ö¸¦ ¾Ë¾Æ³½´Ù STYFileFindAndToFileList(HDPatDnSil.EPants, DetailSort); if (fi->Depth > 0) { // Version 200 // ·£´ý ÇÔ¼ö¸¦ µ¹¸é¼­ DETAILRANDOMNUM°³¸¦ ¼±ÅÃÇÑ´Ù. ¸¸¾à, µðÅ×ÀÏÇÑ °¹¼ö°¡ DETAILRANDOMNUM°³ ÀÌÇ϶ó¸é ÀÖ´Â ¼ö ¸¸Å­ ·çÇÁ¸¦ µ·´Ù while ((CheckedDetailPantsCounter[fi->Depth] < DETAILRANDOMNUM) && (CheckedDetailPantsCounter[fi->Depth] < FileList->Count)) { RandomNumber = random(FileList->Count); if (!(DetailPants[fi->Depth][RandomNumber/8] & (1<<((RandomNumber%8))))) { DetailPants[fi->Depth][RandomNumber/8] += 1<<(RandomNumber%8); CheckedDetailPantsCounter[fi->Depth]++; CheckedStyleFileList(SrcFileList, true, FileList->Strings[RandomNumber]); } } CheckedPants << EDetailPants(fi->Depth); fi->Name = VecDraw->PantsName[fi->Depth] +" "+ String(CheckedDetailPantsCounter[fi->Depth])+"/"+String(FileList->Count); // ¹ÝÀü if (!bCheckedPants[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedPants[fi->Depth] = true; } //sbOKClick(this); } } } } } } // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } fail : bIsStringGrid1First = false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid2Click(TObject *Sender) { // StringGrid4¸¦ ÀÌ¿ëÇÏ¿© Detail ÇÏ°Ô ¼±ÅÃÇØ¾ßÇÏ°Ô µÇ¾úÀ¸¹Ç·Î // ¸ðµç 󸮴 StringGrid1MouseDown ¿Í StringGrid4Click ¿¡¼­ ÇØÁØ´Ù // - by monkman (2004.05.27) //////////////////////////////////////////////////////////////////////////////// // TFileInfor *fi; // String path; // HDC hDC = NULL; // // if (StringGrid2->Col >= ImageList2->Count) return; // // // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÀÁö ¾Ê¾ÒÀ» ¶§.. // if (!bIsIllustForm) // { // fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; // // if (rbUpper->Checked) { // if (CheckedSleeve.Contains(EDetailSleeve(fi->Depth))) CheckedSleeve >> EDetailSleeve(fi->Depth); // else CheckedSleeve << EDetailSleeve(fi->Depth); // fi->Name = SleeveName[fi->Depth]; // }else { // if (CheckedBelt.Contains(EDetailBelt(fi->Depth))) CheckedBelt >> EDetailBelt(fi->Depth); // else CheckedBelt << EDetailBelt(fi->Depth); // fi->Name = BeltName[fi->Depth]; // } // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // StringGrid2->Repaint(); // } // // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman // else // { // if (bIsStringGrid2First) // { // if (rbUpper->Checked) { // if (CheckedSleeve.Contains(EDetailSleeve(HDPatUpSle.ESleeve))) CheckedSleeve >> EDetailSleeve(HDPatUpSle.ESleeve); // else CheckedSleeve << EDetailSleeve(HDPatUpSle.ESleeve); // }else { // if (CheckedBelt.Contains(EDetailBelt(HDPatDnBelt.EBelt))) CheckedBelt >> EDetailBelt(HDPatDnBelt.EBelt); // else CheckedBelt << EDetailBelt(HDPatDnBelt.EBelt); // } // // // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. // for (int i = 0; i < ImageList2->Count; i++) // { // fi = (TFileInfor*) ImageList2->Items[i]; // // if (rbUpper->Checked) { // fi->Name = SleeveName[fi->Depth]; // if (fi->Name == SleeveName[HDPatUpSle.ESleeve]) // { // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // StringGrid2->Repaint(); // } // }else { // fi->Name = BeltName[fi->Depth]; // if (fi->Name == BeltName[HDPatDnBelt.EBelt]) // { // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // StringGrid2->Repaint(); // } // } // } // } // else // { // fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; // // if (rbUpper->Checked) { // if (CheckedSleeve.Contains(EDetailSleeve(fi->Depth))) CheckedSleeve >> EDetailSleeve(fi->Depth); // else CheckedSleeve << EDetailSleeve(fi->Depth); // fi->Name = SleeveName[fi->Depth]; // }else { // if (CheckedBelt.Contains(EDetailBelt(fi->Depth))) CheckedBelt >> EDetailBelt(fi->Depth); // else CheckedBelt << EDetailBelt(fi->Depth); // fi->Name = BeltName[fi->Depth]; // } // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // StringGrid2->Repaint(); // } // } // //fail: // // bIsStringGrid2First = false; //////////////////////////////////////////////////////////////////////////////// TFileInfor *fi; String path; HDC hDC = NULL; int RandomNumber; if (StringGrid2->Col >= ImageList2->Count) return; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman if (bIsIllustForm) { if (bIsStringGrid2First) { // »óÀǸ¦ ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â °ÍÀ¸·Î ¼öÁ¤ - by monkman (2004.03.24) //if (rbUpper->Checked) return; // »óÀÇ´Â ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â°Ô ¾Æ´ÏÁö·Õ if (combobxUpperLower->ItemIndex == 0) { DetailSort = HDPatUpSle.Sort; // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. for (int i = 0; i < ImageList2->Count; i++) { fi = (TFileInfor*) ImageList2->Items[i]; if (fi->Depth == int(HDPatUpSle.ESleeve)) { // Version 100Àº ´ëÇ¥½ºÅ¸ÀÏÀÌ ¾ø´Ù // StringGrid2MouseDown() °ú °ÅÀÇ ºñ½ÁÇÏÁö¸¸ °¢ StringGridÀÇ MouseClick() À̺¥Æ®¿¡ »ç¿ëÇÑ´Ù - by monkman (2004.05.27) // ÀÌ ÇÔ¼ö¸¦ µ¹¸é¼­ ´ëÇ¥½ºÅ¸ÀÏÀÌ °°Àº DetailÇÑ °¹¼ö¸¦ ¾Ë¾Æ³½´Ù STYFileFindAndToFileList(HDPatUpSle.ESleeve, DetailSort); if (fi->Depth > 0) { // Version 200 // ·£´ý ÇÔ¼ö¸¦ µ¹¸é¼­ DETAILRANDOMNUM°³¸¦ ¼±ÅÃÇÑ´Ù. ¸¸¾à, µðÅ×ÀÏÇÑ °¹¼ö°¡ DETAILRANDOMNUM°³ ÀÌÇ϶ó¸é ÀÖ´Â ¼ö ¸¸Å­ ·çÇÁ¸¦ µ·´Ù while ((CheckedDetailSleeveCounter[fi->Depth] < DETAILRANDOMNUM) && (CheckedDetailSleeveCounter[fi->Depth] < FileList->Count)) { RandomNumber = random(FileList->Count); if (!(DetailSleeve[fi->Depth][RandomNumber/8] & (1<<((RandomNumber%8))))) { DetailSleeve[fi->Depth][RandomNumber/8] += 1<<(RandomNumber%8); CheckedDetailSleeveCounter[fi->Depth]++; CheckedStyleFileList(SrcFileList, true, FileList->Strings[RandomNumber]); } } CheckedSleeve << EDetailSleeve(fi->Depth); fi->Name = VecDraw->SleeveName[fi->Depth] +" "+ String(CheckedDetailSleeveCounter[fi->Depth])+"/"+String(FileList->Count); // ¹ÝÀü if (!bCheckedSleeve[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSleeve[fi->Depth] = true; } //sbOKClick(this); } } } } else { DetailSort = HDPatDnBelt.Sort; // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. for (int i = 0; i < ImageList2->Count; i++) { fi = (TFileInfor*) ImageList2->Items[i]; if (fi->Depth == int(HDPatDnBelt.EBelt)) { // Version 100Àº ´ëÇ¥½ºÅ¸ÀÏÀÌ ¾ø´Ù // StringGrid2MouseDown() °ú °ÅÀÇ ºñ½ÁÇÏÁö¸¸ °¢ StringGridÀÇ MouseClick() À̺¥Æ®¿¡ »ç¿ëÇÑ´Ù - by monkman (2004.05.27) // ÀÌ ÇÔ¼ö¸¦ µ¹¸é¼­ ´ëÇ¥½ºÅ¸ÀÏÀÌ °°Àº DetailÇÑ °¹¼ö¸¦ ¾Ë¾Æ³½´Ù STYFileFindAndToFileList(HDPatDnBelt.EBelt, DetailSort); if (fi->Depth > 0) { // Version 200 // ·£´ý ÇÔ¼ö¸¦ µ¹¸é¼­ DETAILRANDOMNUM°³¸¦ ¼±ÅÃÇÑ´Ù. ¸¸¾à, µðÅ×ÀÏÇÑ °¹¼ö°¡ DETAILRANDOMNUM°³ ÀÌÇ϶ó¸é ÀÖ´Â ¼ö ¸¸Å­ ·çÇÁ¸¦ µ·´Ù while ((CheckedDetailBeltCounter[fi->Depth] < DETAILRANDOMNUM) && (CheckedDetailBeltCounter[fi->Depth] < FileList->Count)) { RandomNumber = random(FileList->Count); if (!(DetailBelt[fi->Depth][RandomNumber/8] & (1<<((RandomNumber%8))))) { DetailBelt[fi->Depth][RandomNumber/8] += 1<<(RandomNumber%8); CheckedDetailBeltCounter[fi->Depth]++; CheckedStyleFileList(SrcFileList, true, FileList->Strings[RandomNumber]); } } CheckedBelt << EDetailBelt(fi->Depth); fi->Name = VecDraw->BeltName[fi->Depth] +" "+ String(CheckedDetailBeltCounter[fi->Depth])+"/"+String(FileList->Count); // ¹ÝÀü if (!bCheckedBelt[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedBelt[fi->Depth] = true; } //sbOKClick(this); } } } } } } // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } fail : bIsStringGrid2First = false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid3Click(TObject *Sender) { // StringGrid4¸¦ ÀÌ¿ëÇÏ¿© Detail ÇÏ°Ô ¼±ÅÃÇØ¾ßÇÏ°Ô µÇ¾úÀ¸¹Ç·Î // ¸ðµç 󸮴 StringGrid1MouseDown ¿Í StringGrid4Click ¿¡¼­ ÇØÁØ´Ù // - by monkman (2004.05.27) //////////////////////////////////////////////////////////////////////////////// // TFileInfor *fi; // String path; // HDC hDC = NULL; // // if (StringGrid3->Col >= ImageList3->Count) return; // // // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÀÁö ¾Ê¾ÒÀ» ¶§.. // if (!bIsIllustForm) // { // fi = (TFileInfor*) ImageList3->Items[StringGrid3->Col]; // // if (CheckedCollar.Contains(EDetailCollar(fi->Depth))) CheckedCollar >> EDetailCollar(fi->Depth); // else CheckedCollar << EDetailCollar(fi->Depth); // fi->Name = CollarName[fi->Depth]; // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // StringGrid3->Repaint(); // } // // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman // else // { // if (bIsStringGrid3First) // { // if (CheckedCollar.Contains(EDetailCollar(HDPatUpCol.ECollar))) CheckedCollar >> EDetailCollar(HDPatUpCol.ECollar); // else CheckedCollar << EDetailCollar(HDPatUpCol.ECollar); // // // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. // for (int i = 0; i < ImageList3->Count; i++) // { // fi = (TFileInfor*) ImageList3->Items[i]; // // fi->Name = CollarName[fi->Depth]; // if (fi->Name == CollarName[HDPatUpCol.ECollar]) // { // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // StringGrid3->Repaint(); // } // } // } // else // { // fi = (TFileInfor*) ImageList3->Items[StringGrid3->Col]; // // if (CheckedCollar.Contains(EDetailCollar(fi->Depth))) CheckedCollar >> EDetailCollar(fi->Depth); // else CheckedCollar << EDetailCollar(fi->Depth); // fi->Name = CollarName[fi->Depth]; // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // StringGrid3->Repaint(); // } // } // //fail: // // bIsStringGrid3First = false; //////////////////////////////////////////////////////////////////////////////// TFileInfor *fi; String path; HDC hDC = NULL; int RandomNumber; if (StringGrid3->Col >= ImageList3->Count) return; // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman // »çÁøÀ» ÅëÇÑ ½ºÅ¸ÀÏ Á¶ÇÕ Æû¿¡¼­ ³Ñ¾î¿ÔÀ» ¶§.. - by monkman if (bIsIllustForm) { if (bIsStringGrid3First) { // »óÀǸ¦ ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â °ÍÀ¸·Î ¼öÁ¤ - by monkman (2004.03.24) //if (rbUpper->Checked) return; // »óÀÇ´Â ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â°Ô ¾Æ´ÏÁö·Õ if (combobxUpperLower->ItemIndex == 0) { DetailSort = HDPatUpCol.Sort; // IllustForm¿¡¼­ ³Ñ¾î¿À´Â ³»¿ë.. for (int i = 0; i < ImageList3->Count; i++) { fi = (TFileInfor*) ImageList3->Items[i]; if (fi->Depth == int(HDPatUpCol.ECollar)) { // Version 100Àº ´ëÇ¥½ºÅ¸ÀÏÀÌ ¾ø´Ù // StringGrid3MouseDown() °ú °ÅÀÇ ºñ½ÁÇÏÁö¸¸ °¢ StringGridÀÇ MouseClick() À̺¥Æ®¿¡ »ç¿ëÇÑ´Ù - by monkman (2004.05.27) // ÀÌ ÇÔ¼ö¸¦ µ¹¸é¼­ ´ëÇ¥½ºÅ¸ÀÏÀÌ °°Àº DetailÇÑ °¹¼ö¸¦ ¾Ë¾Æ³½´Ù STYFileFindAndToFileList(HDPatUpCol.ECollar, DetailSort); if (fi->Depth > 0) { // Version 200 // ·£´ý ÇÔ¼ö¸¦ µ¹¸é¼­ DETAILRANDOMNUM¸¦ ¼±ÅÃÇÑ´Ù. ¸¸¾à, µðÅ×ÀÏÇÑ °¹¼ö°¡ DETAILRANDOMNUM°³ ÀÌÇ϶ó¸é ÀÖ´Â ¼ö ¸¸Å­ ·çÇÁ¸¦ µ·´Ù while ((CheckedDetailCollarCounter[fi->Depth] < DETAILRANDOMNUM) && (CheckedDetailCollarCounter[fi->Depth] < FileList->Count)) { RandomNumber = random(FileList->Count); if (!(DetailCollar[fi->Depth][RandomNumber/8] & (1<<((RandomNumber%8))))) { DetailCollar[fi->Depth][RandomNumber/8] += 1<<(RandomNumber%8); CheckedDetailCollarCounter[fi->Depth]++; CheckedStyleFileList(SrcFileList, true, FileList->Strings[RandomNumber]); } } CheckedCollar << EDetailCollar(fi->Depth); fi->Name = VecDraw->CollarName[fi->Depth] +" "+ String(CheckedDetailCollarCounter[fi->Depth])+"/"+String(FileList->Count); // ¹ÝÀü if (!bCheckedCollar[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedCollar[fi->Depth] = true; } //sbOKClick(this); } } } } } } // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } fail : bIsStringGrid3First = false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::spdbtnNextClick(TObject *Sender) { // IllustForm¿¡¼­ µ¥ÀÌÅͰ¡ ³Ñ¾î°¥¶§.. if (bIsIllustForm) ResultForm->bIsIllustForm = true; Visible = false; ResultForm->InitForm(); ResultForm->Show(); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FormCloseQuery(TObject *Sender, bool &CanClose) { if (pbSTYPreviewBackground->Visible || pbSTYPreviewBackground->Enabled) { MessageDlg(IDS_MESSAGE15, mtInformation, TMsgDlgButtons() << mbOK, 0); CanClose = false; } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FormDestroy(TObject *Sender) { TFileInfor *fi; TVecData *data; if (ImageList1) { while(ImageList1->Count>0) { fi = (TFileInfor *) ImageList1->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList1->Remove(fi); delete fi; fi = NULL; } delete ImageList1; ImageList1 = NULL; } if (ImageList2) { while(ImageList2->Count>0) { fi = (TFileInfor *) ImageList2->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList2->Remove(fi); delete fi; fi = NULL; } delete ImageList2; ImageList2 = NULL; } if (ImageList3) { while(ImageList3->Count>0) { fi = (TFileInfor *) ImageList3->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList3->Remove(fi); delete fi; fi = NULL; } delete ImageList3; ImageList3 = NULL; } if (ImageList4) { while(ImageList4->Count>0) { fi = (TFileInfor *) ImageList4->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList4->Remove(fi); delete fi; fi = NULL; } delete ImageList4; ImageList4 = NULL; } if (FileList) { FileList->Clear(); delete FileList; FileList = NULL; } if (SilFileList) { SilFileList->Clear(); delete SilFileList; SilFileList = NULL; } if (SleFileList) { SleFileList->Clear(); delete SleFileList; SleFileList = NULL; } if (ColFileList) { ColFileList->Clear(); delete ColFileList; ColFileList = NULL; } if (PantsFileList) { PantsFileList->Clear(); delete PantsFileList; PantsFileList = NULL; } if (BeltFileList) { BeltFileList->Clear(); delete BeltFileList; BeltFileList = NULL; } if (SrcFileList) { SrcFileList->Clear(); delete SrcFileList; SrcFileList = NULL; } // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) if (SrcFileBackupList) { SrcFileBackupList->Clear(); delete SrcFileBackupList; SrcFileBackupList = NULL; } if (TagDataList) { while (TagDataList->Count) { data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } delete TagDataList; TagDataList = NULL; } if (PreviewFrontList) { while (PreviewFrontList->Count>0) { data = (TVecData *)PreviewFrontList->First(); delete data; PreviewFrontList->Remove(data); } delete PreviewFrontList; PreviewFrontList = NULL; } if (PreviewBackList) { while (PreviewBackList->Count>0) { data = (TVecData *)PreviewBackList->First(); delete data; PreviewBackList->Remove(data); } delete PreviewBackList; PreviewBackList = NULL; } if (SCF) { delete SCF; SCF = NULL; } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid4KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == VK_RETURN) { sbOKClick(this); } if (Key == VK_ESCAPE) { sbCloseClick(this); } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid4Click(TObject *Sender) { TFileInfor *fi; String path; HDC hDC = NULL; int CheckStyleNumber; // ¸¶¿ì½º ÈÙ °¨Áö¸¦ À§ÇØ - by monkman (2004.06.15) // ÈÙ À̵¿½Ã¿¡´Â OnClick() À̺¥Æ®°¡ °¡Áö ¾Ê°Ô ÇÑ´Ù if (bWheelMode) return; if (StringGrid4->Col + StringGrid4->Row*4 >= ImageList4->Count) return; fi = (TFileInfor*) ImageList4->Items[StringGrid4->Col + StringGrid4->Row*4]; switch (DetailSort) { // S0_SILHOUETTE°¡ »óÀÇ ½Ç·ç¿§À¸·Î ¹Ù²î¾úÀ¸¸ç SO_PANTS°¡ ÇÏÀÇ ½Ç·ç¿§À¸·Î Ãß°¡µÊ - by monkman (2004.03.24) case SO_SILHOUETTE: if (DetailSilhouette[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] & (1<<((StringGrid4->Col+StringGrid4->Row*4)%8))) { DetailSilhouette[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] -= 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailSilhouetteCounter[DetailItemNumber]--; CheckedStyleFileList(SrcFileList, false, fi->Path); }else { if (!CheckedStyleCount()) goto fail; DetailSilhouette[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] += 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailSilhouetteCounter[DetailItemNumber]++; CheckedStyleFileList(SrcFileList, true, fi->Path); } break; case SO_SLEEVE: if (DetailSleeve[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] & (1<<((StringGrid4->Col+StringGrid4->Row*4)%8))) { DetailSleeve[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] -= 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailSleeveCounter[DetailItemNumber]--; CheckedStyleFileList(SrcFileList, false, fi->Path); }else { if (!CheckedStyleCount()) goto fail; DetailSleeve[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] += 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailSleeveCounter[DetailItemNumber]++; CheckedStyleFileList(SrcFileList, true, fi->Path); } break; case SO_COLLAR: if (DetailCollar[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] & (1<<((StringGrid4->Col+StringGrid4->Row*4)%8))) { DetailCollar[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] -= 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailCollarCounter[DetailItemNumber]--; CheckedStyleFileList(SrcFileList, false, fi->Path); }else { if (!CheckedStyleCount()) goto fail; DetailCollar[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] += 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailCollarCounter[DetailItemNumber]++; CheckedStyleFileList(SrcFileList, true, fi->Path); } break; case SO_BELT: if (DetailBelt[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] & (1<<((StringGrid4->Col+StringGrid4->Row*4)%8))) { DetailBelt[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] -= 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailBeltCounter[DetailItemNumber]--; CheckedStyleFileList(SrcFileList, false, fi->Path); }else { if (!CheckedStyleCount()) goto fail; DetailBelt[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] += 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailBeltCounter[DetailItemNumber]++; CheckedStyleFileList(SrcFileList, true, fi->Path); } break; case SO_PANTS: if (DetailPants[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] & (1<<((StringGrid4->Col+StringGrid4->Row*4)%8))) { DetailPants[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] -= 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailPantsCounter[DetailItemNumber]--; CheckedStyleFileList(SrcFileList, false, fi->Path); }else { if (!CheckedStyleCount()) goto fail; DetailPants[DetailItemNumber][(StringGrid4->Col+StringGrid4->Row*4)/8] += 1<<((StringGrid4->Col+StringGrid4->Row*4)%8); CheckedDetailPantsCounter[DetailItemNumber]++; CheckedStyleFileList(SrcFileList, true, fi->Path); } break; } //////////////////////////////////////////////////////////////////////////////// // // ¹ÝÀüÀº Detail Ä«¿îÅ͸¦ ÅëÇØ¼­ ³ªÁß¿¡ DrawCell¿¡¼­ ó¸®ÇÑ´Ù - by monkman (2004.05.18) - with celberus // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); //////////////////////////////////////////////////////////////////////////////// /* // üũµÈ °ÍÀÌ 0º¸´Ù Å©¸é ÆÄÀÏ º¹»ç, ÆÄÀÏ À̵¿ÀÌ °¡´ÉÇÏ°Ô ¸¸µé¾îÁØ´Ù - by monkman (2004.06.01) CheckStyleNumber = 0; if (rbUpper->Checked) { CheckStyleNumber += CheckedOldSilhouetteCounter; for (int i = 0; i < MAX_SIL; i++) { CheckStyleNumber += CheckedDetailSilhouetteCounter[i]; if (i < MAX_SLE) CheckStyleNumber += CheckedDetailSleeveCounter[i]; if (i < MAX_COL) CheckStyleNumber += CheckedDetailCollarCounter[i]; // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖÀ¸¸é ¹Ù·Î break if (CheckStyleNumber > 0) break; } } if (rbLower->Checked) { for (int i = 0; i < MAX_PANTS; i++) { CheckStyleNumber += CheckedDetailPantsCounter[i]; if (i < MAX_BELT) CheckStyleNumber += CheckedDetailBeltCounter[i]; // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖÀ¸¸é ¹Ù·Î break if (CheckStyleNumber > 0) break; } } */ // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } StringGrid4->Repaint(); fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid4MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { HANDLE hFile = INVALID_HANDLE_VALUE; STYLEDATAFILEHEADER header; TVecData *data; TFileInfor *fi; String path; TGridCoord gridc; int col, row; int Version; String STYInformation; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; bWheelMode = false; // ¸¶¿ì½º ÈÙ °¨Áö¸¦ À§ÇØ - by monkman (2004.06.15) if (Button != mbRight) return; gridc = StringGrid4->MouseCoord(X, Y); col = gridc.X, row = gridc.Y; // ¾Æ·¡ ÄÚµùÀº ¿Ö Çß´ÂÁö Àß ¸ð¸£°ÚÀ½.. Çʿ䰡 ¾ø´Â°Í °°¾Æ ÁÖ¼® ó¸® - by monkman (2004.05.28) // ¾Æ·¡ ÁÖ¼®À» Ç®¸é ¼±Åà ÈÄ ¸¶¿ì½º ¿À¸¥ÂÊ ¹öưÀ» ´­·¶À»¶§ Click À̺¥Æ®°¡ ¹ß»ýÇØ¼­ ¼±ÅÃÀÌ Ç®¾îÁø´Ù // StringGrid´Â ColÀ̳ª Row¸¦ ÁöÁ¤ÇÏ´Â ¼ø°£ Ŭ¸¯ À̺¥Æ®°¡ ¹ß»ýÇϱ⠶§¹®.. //StringGrid4->Col = col; StringGrid4->Row = row; if (col + row*4 >= ImageList4->Count) return; fi = (TFileInfor*) ImageList4->Items[col + row*4]; // ÃʱâÈ­ lbSTYPath->Caption = ""; lbSTYDivision->Caption = ""; LabelType->Caption = ""; lbType->Caption = ""; lbItems->Caption = ""; lbCombinationCondition->Caption = ""; lbSTYYear->Caption = ""; lbSTYSeason->Caption = ""; lbSTYComment->Caption = ""; // ¸®½ºÆ® ÃʱâÈ­ if (PreviewFrontList) { while (PreviewFrontList->Count>0) { data = (TVecData *)PreviewFrontList->First(); delete data; PreviewFrontList->Remove(data); } } if (PreviewBackList) { while (PreviewBackList->Count>0) { data = (TVecData *)PreviewBackList->First(); delete data; PreviewBackList->Remove(data); } } // ÆÄÀÏÀ» ¿­¾î¼­ Preview·Î º¸¿©ÁØ´Ù - by monkman (2004.08.06) if ((hFile = CreateFile(fi->Path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, fi->Path, &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); goto fail; } // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) goto fail; #endif } 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); PreviewFrontList->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); PreviewBackList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // °æ·Î lbSTYPath->Caption = fi->Path; // // LabelÀÇ °³ÇàÀ» À§Çؼ­.. <= Label ¼Ó¼ºÀÇ WordWrap ¼Ó¼ºÀ» true·Î ÇØÁÖ¸é ¾Æ·¡ ÄÚµå ¾øÀ̵µ ÀÚµ¿À¸·Î ÇØ°áµÈ´Ù.. // for (int i = 1; i <= fi->Path.Length(); i++) { // if (fi->Path.IsLeadByte(i)) { // 2BYTE ¹®ÀÚÀÇ 1¹øÂ° BYTE À϶§ // if (!(i%94)) lbSTYPath->Caption = lbSTYPath->Caption + "\n"; // lbSTYPath->Caption = lbSTYPath->Caption + fi->Path.SubString(i, 1); // } else if (fi->Path.IsTrailByte(i)) { // 2BYTE ¹®ÀÚÀÇ 2¹øÂ° BYTE À϶§ // lbSTYPath->Caption = lbSTYPath->Caption + fi->Path.SubString(i, 1); // if (!(i%94)) lbSTYPath->Caption = lbSTYPath->Caption + "\n"; // } else { // 1BYTE ¹®ÀÚÀ϶§ // lbSTYPath->Caption = lbSTYPath->Caption + fi->Path.SubString(i, 1); // if (!(i%94)) lbSTYPath->Caption = lbSTYPath->Caption + "\n"; // } // } lbSTYPath->Caption = fi->Path; // ±¸ºÐ (³²¼º, ¿©¼º, ¾Æµ¿, À¯¾Æ) lbSTYDivision->Caption = DivisionName[header.Division]; // ŸÀÔ (ÄÚÆ®, Á¡ÆÛ, ÀÚÄÏ...) lbType->Caption = StrType[header.Type]; switch (header.Sort) { // case SO_SILHOUETTE : LabelType->Caption = "Silhouette : "; // ¾ÆÀÌÅÛ (Button, Zipper...) lbItems->Caption = VecDraw->SilhouetteName[header.ESilhouette]; break; case SO_SLEEVE : LabelType->Caption = "Sleeve : "; lbItems->Caption = VecDraw->SleeveName[header.ESleeve]; break; case SO_COLLAR : LabelType->Caption = "Collar : "; lbItems->Caption = VecDraw->CollarName[header.ECollar]; break; case SO_PANTS : LabelType->Caption = "Pants : "; lbItems->Caption = VecDraw->PantsName[header.EPants]; break; case SO_BELT : LabelType->Caption = "Belt : "; lbItems->Caption = VecDraw->BeltName[header.EBelt]; break; } // Á¶ÇÕ Á¶°Ç if (header.bSleeve) lbCombinationCondition->Caption = lbCombinationCondition->Caption + " Sleeve "; if (header.bCollar) lbCombinationCondition->Caption = lbCombinationCondition->Caption + " Collar "; if (header.bBelt) lbCombinationCondition->Caption = lbCombinationCondition->Caption + " Belt "; // ¿¬µµ if (header.Year != 0) lbSTYYear->Caption = IntToStr(header.Year); // ½ÃÁð if (header.SSFW != 0) { for (int i=0; i < 8; i++) { if (((header.SSFW >> i) & 1) == 1) { switch (i) { // Spring case SSFW_SPRING : lbSTYSeason->Caption = String(" Spring "); break; // Summer case SSFW_SUMMER : lbSTYSeason->Caption = lbSTYSeason->Caption + String(" Summer "); break; // Fall case SSFW_FALL : lbSTYSeason->Caption = lbSTYSeason->Caption + String(" Fall "); break; // Winter case SSFW_WINTER : lbSTYSeason->Caption =lbSTYSeason->Caption + String(" Winter "); break; default : STYInformation = STYInformation + ""; break; } } } } #ifdef WORKSHEET lbSTYStyleID->Caption = String(header.StyleID); #endif lbSTYComment->Caption = String(header.Comment); //// LabelÀÇ °³ÇàÀ» À§Çؼ­.. <= Label ¼Ó¼ºÀÇ WordWrap ¼Ó¼ºÀ» true·Î ÇØÁÖ¸é ¾Æ·¡ ÄÚµå ¾øÀ̵µ ÀÚµ¿À¸·Î ÇØ°áµÈ´Ù.. // for (int i = 1; i <= strTempComment.Length(); i++) { // if (strTempComment.IsLeadByte(i)) { // 2BYTE ¹®ÀÚÀÇ 1¹øÂ° BYTE À϶§ // if (!(i%90)) lbSTYComment->Caption = lbSTYComment->Caption + "\n"; // lbSTYComment->Caption = lbSTYComment->Caption + strTempComment.SubString(i, 1); // } else if (strTempComment.IsTrailByte(i)) { // 2BYTE ¹®ÀÚÀÇ 2¹øÂ° BYTE À϶§ // lbSTYComment->Caption = lbSTYComment->Caption + strTempComment.SubString(i, 1); // if (!(i%90)) lbSTYComment->Caption = lbSTYComment->Caption + "\n"; // } else { // 1BYTE ¹®ÀÚÀ϶§ // lbSTYComment->Caption = lbSTYComment->Caption + strTempComment.SubString(i, 1); // if (!(i%90)) lbSTYComment->Caption = lbSTYComment->Caption + "\n"; // } // } pbSTYPreviewBackground->BringToFront(); pbSTYPreviewBackground->Visible = true; pbSTYPreviewBackground->Enabled = true; pbSTYPreviewFront->Repaint(); pbSTYPreviewBack->Repaint(); return; fail : if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; return; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::DetailStringGridDrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect, TGridDrawState State) { TFileInfor *fi; HDC hDC = NULL; TRect r; //////////////////////////////////////////////////////////////////////////////// // //±âÁ¸ ¼Ò½º ÁÖ¼® ó¸® - by monkman (2004.05.19) // if (ARow*4+ACol < ImageList4->Count && ImageList4->Count) { // fi = (TFileInfor *) ImageList4->Items[ARow*4+ACol]; // // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, SRCCOPY); // fi->tBitmap->DeleteDC(hDC); // // r.Left = Rect.Left+5; // r.Top = Rect.Top+110; // r.Right = Rect.Left+85; // r.Bottom = Rect.Top+130; // StringGrid4->Canvas->TextRect(r, Rect.Left+5, Rect.Top+115, fi->Name); // } //////////////////////////////////////////////////////////////////////////////// if (ARow*4+ACol < ImageList4->Count && ImageList4->Count) { fi = (TFileInfor *) ImageList4->Items[ARow*4+ACol]; if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, SRCCOPY); if (combobxUpperLower->ItemIndex == 0) { // ¼±ÅÃµÈ SelectedStringGrid¸¦ ¾Ë¾Æ³¿ (0:¾Æ¹«°Íµµ ¼±Åà ¾È µÈ °æ¿ì, 1:ù¹øÂ°, 2:µÎ¹øÂ°, 3:¼¼¹øÂ°) switch (SelectedStringGrid) { case 0 : break; case 1 : if (DetailSilhouette[DetailItemNumber][(ARow*4+ACol)/8] & (1 << ((ARow*4+ACol)%8))) { BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); } break; case 2 : if (DetailSleeve[DetailItemNumber][(ARow*4+ACol)/8] & (1 << ((ARow*4+ACol)%8))) { BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); } break; case 3 : if (DetailCollar[DetailItemNumber][(ARow*4+ACol)/8] & (1 << ((ARow*4+ACol)%8))) { BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); } break; } } else if (combobxUpperLower->ItemIndex == 1) { // ¼±ÅÃµÈ SelectedStringGrid¸¦ ¾Ë¾Æ³¿ (0:¾Æ¹«°Íµµ ¼±Åà ¾È µÈ °æ¿ì, 1:ù¹øÂ°, 2:µÎ¹øÂ°, 3:¼¼¹øÂ°) switch (SelectedStringGrid) { case 0 : break; case 1 : if (DetailPants[DetailItemNumber][(ARow*4+ACol)/8] & (1 << ((ARow*4+ACol)%8))) { BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); } break; case 2 : if (DetailBelt[DetailItemNumber][(ARow*4+ACol)/8] & (1 << ((ARow*4+ACol)%8))) { BitBlt(StringGrid4->Canvas->Handle, Rect.Left+5, Rect.Top+5, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); } break; } } fi->tBitmap->DeleteDC(hDC); if (fi->Name.Length() < 24) { r.Left = Rect.Left+5; r.Top = Rect.Top+TAG_HEIGHT+10; r.Right = Rect.Left+TAG_WIDTH+5; r.Bottom = Rect.Top+TAG_HEIGHT+30; StringGrid4->Canvas->TextRect(r, Rect.Left+5, Rect.Top+TAG_HEIGHT+15, fi->Name); }else { String name1, name2; name1 = fi->Name.SubString(1, 24); name2 = fi->Name.SubString(25, 24); r.Left = Rect.Left+5; r.Top = Rect.Top+TAG_HEIGHT+5; r.Right = Rect.Left+TAG_WIDTH+5; r.Bottom = Rect.Top+TAG_HEIGHT+20; StringGrid4->Canvas->TextRect(r, Rect.Left+5, Rect.Top+TAG_HEIGHT+5, name1); r.Top = Rect.Top+TAG_HEIGHT+20; r.Bottom = Rect.Top+TAG_HEIGHT+35; StringGrid4->Canvas->TextRect(r, Rect.Left+5, Rect.Top+TAG_HEIGHT+20, name2); } } fail: } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbOKClick(TObject *Sender) { TFileInfor *fi; HDC hDC; BYTE SelectedStyle = 0; switch (DetailSort) { // S0_SILHOUETTE°¡ »óÀÇ ½Ç·ç¿§À¸·Î ¹Ù²î¾úÀ¸¸ç SO_PANTS°¡ ÇÏÀÇ ½Ç·ç¿§À¸·Î Ãß°¡µÊ - by monkman (2004.03.24) case SO_SILHOUETTE: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; for (int k = 0; k < MAX_DETAIL; k++) { SelectedStyle |= DetailSilhouette[DetailItemNumber][k]; } if (SelectedStyle) { CheckedSilhouette << EDetailSilhouette(fi->Depth); fi->Name = VecDraw->SilhouetteName[fi->Depth] +" "+ String(CheckedDetailSilhouetteCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedSilhouette[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSilhouette[DetailItemNumber] = true; } } else { if (CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) CheckedSilhouette >> EDetailSilhouette(fi->Depth); fi->Name = VecDraw->SilhouetteName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedSilhouette[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSilhouette[DetailItemNumber] = false; } } break; case SO_SLEEVE: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; for (int k = 0; k < MAX_DETAIL; k++) { SelectedStyle |= DetailSleeve[DetailItemNumber][k]; } if (SelectedStyle) { CheckedSleeve << EDetailSleeve(fi->Depth); fi->Name = VecDraw->SleeveName[fi->Depth] +" "+ String(CheckedDetailSleeveCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedSleeve[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSleeve[DetailItemNumber] = true; } } else { if (CheckedSleeve.Contains(EDetailSleeve(fi->Depth))) CheckedSleeve >> EDetailSleeve(fi->Depth); fi->Name = VecDraw->SleeveName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedSleeve[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSleeve[DetailItemNumber] = false; } } break; case SO_COLLAR: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList3->Items[StringGrid3->Col]; for (int k = 0; k < MAX_DETAIL; k++) { SelectedStyle |= DetailCollar[DetailItemNumber][k]; } if (SelectedStyle) { CheckedCollar << EDetailCollar(fi->Depth); fi->Name = VecDraw->CollarName[fi->Depth] +" "+ String(CheckedDetailCollarCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedCollar[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedCollar[DetailItemNumber] = true; } } else { if (CheckedCollar.Contains(EDetailCollar(fi->Depth))) CheckedCollar >> EDetailCollar(fi->Depth); fi->Name = VecDraw->CollarName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedCollar[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedCollar[DetailItemNumber] = false; } } break; case SO_BELT: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; for (int k = 0; k < MAX_DETAIL; k++) { SelectedStyle |= DetailBelt[DetailItemNumber][k]; } if (SelectedStyle) { CheckedBelt << EDetailBelt(fi->Depth); fi->Name = VecDraw->BeltName[fi->Depth] +" "+ String(CheckedDetailBeltCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedBelt[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedBelt[DetailItemNumber] = true; } } else { if (CheckedBelt.Contains(EDetailBelt(fi->Depth))) CheckedBelt >> EDetailBelt(fi->Depth); fi->Name = VecDraw->BeltName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedBelt[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedBelt[DetailItemNumber] = false; } } break; case SO_PANTS: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; for (int k = 0; k < MAX_DETAIL; k++) { SelectedStyle |= DetailPants[DetailItemNumber][k]; } if (SelectedStyle) { CheckedPants << EDetailPants(fi->Depth); fi->Name = VecDraw->PantsName[fi->Depth] +" "+ String(CheckedDetailPantsCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedPants[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedPants[DetailItemNumber] = true; } } else { if (CheckedPants.Contains(EDetailPants(fi->Depth))) CheckedPants >> EDetailPants(fi->Depth); fi->Name = VecDraw->PantsName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedPants[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedPants[DetailItemNumber] = false; } } break; } //////////////////////////////////////////////////////////////////////////////// // // ±âÁ¸ ¼Ò½º ÁÖ¼® ó¸® - by monkman (2004.05.19) // if (DetailSelectedCount > 0) { // hDC = fi->tBitmap->CreateDC(); // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } Panel3->Visible = false; Panel1->Enabled = true; Panel2->Enabled = true; spdbtnNext->Enabled = true; StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); return; fail : // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } Panel3->Visible = false; Panel1->Enabled = true; Panel2->Enabled = true; spdbtnNext->Enabled = true; StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbNoneClick(TObject *Sender) { TFileInfor *fi, *fiDetail; BYTE SelectedStyle; // DetailÇÏ°Ô ¼±ÅÃµÈ ºÎºÐÀ» Clear ÇØÁØ´Ù - by monkman (2004.05.19) switch (DetailSort) { case SO_SILHOUETTE: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; memset(DetailSilhouette[DetailItemNumber], 0, sizeof(BYTE)*MAX_DETAIL); // SrcFileList ¿¡¼­ ¼±ÅÃµÈ ¸ñ·ÏÀ» »èÁ¦ - by monkman (2004.06.11) for (int i = 0; i < ImageList4->Count; i++) { fiDetail = (TFileInfor*) ImageList4->Items[i]; // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) CheckedStyleFileList(SrcFileList, false, fiDetail->Path); } fi->Name = VecDraw->SilhouetteName[fi->Depth]; CheckedDetailSilhouetteCounter[DetailItemNumber] = 0; break; case SO_SLEEVE: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; memset(DetailSleeve[DetailItemNumber], 0, sizeof(BYTE)*MAX_DETAIL); // SrcFileList ¿¡¼­ ¼±ÅÃµÈ ¸ñ·ÏÀ» »èÁ¦ - by monkman (2004.06.11) for (int i = 0; i < ImageList4->Count; i++) { fiDetail = (TFileInfor*) ImageList4->Items[i]; // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) CheckedStyleFileList(SrcFileList, false, fiDetail->Path); } fi->Name = VecDraw->SleeveName[fi->Depth]; CheckedDetailSleeveCounter[DetailItemNumber] = 0; break; case SO_COLLAR: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList3->Items[StringGrid3->Col]; memset(DetailCollar[DetailItemNumber], 0, sizeof(BYTE)*MAX_DETAIL); // SrcFileList ¿¡¼­ ¼±ÅÃµÈ ¸ñ·ÏÀ» »èÁ¦ - by monkman (2004.06.11) for (int i = 0; i < ImageList4->Count; i++) { fiDetail = (TFileInfor*) ImageList4->Items[i]; // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) CheckedStyleFileList(SrcFileList, false, fiDetail->Path); } fi->Name = VecDraw->CollarName[fi->Depth]; CheckedDetailCollarCounter[DetailItemNumber] = 0; break; case SO_BELT: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; memset(DetailBelt[DetailItemNumber], 0, sizeof(BYTE)*MAX_DETAIL); // SrcFileList ¿¡¼­ ¼±ÅÃµÈ ¸ñ·ÏÀ» »èÁ¦ - by monkman (2004.06.11) for (int i = 0; i < ImageList4->Count; i++) { fiDetail = (TFileInfor*) ImageList4->Items[i]; // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) CheckedStyleFileList(SrcFileList, false, fiDetail->Path); } fi->Name = VecDraw->BeltName[fi->Depth]; CheckedDetailBeltCounter[DetailItemNumber] = 0; break; case SO_PANTS: if (ImageList4->Count <= 0) goto fail; fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; memset(DetailPants[DetailItemNumber], 0, sizeof(BYTE)*MAX_DETAIL); // SrcFileList ¿¡¼­ ¼±ÅÃµÈ ¸ñ·ÏÀ» »èÁ¦ - by monkman (2004.06.11) for (int i = 0; i < ImageList4->Count; i++) { fiDetail = (TFileInfor*) ImageList4->Items[i]; // SrcFileList2´Â ¼±ÅõȰÍÀ» ÇØÁ¦ÇÏ°í ±×³É ´Ý¾ÒÀ»¶§ ´Ù½Ã ³Ö¾îÁÖ±â À§ÇØ »ç¿ë - by monkman (2004.06.11) CheckedStyleFileList(SrcFileList, false, fiDetail->Path); } fi->Name = VecDraw->PantsName[fi->Depth]; CheckedDetailPantsCounter[DetailItemNumber] = 0; break; } // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); StringGrid4->Repaint(); return; fail : // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); StringGrid4->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbCloseClick(TObject *Sender) { TFileInfor *fi; HDC hDC; BYTE SelectedStyle; int CheckStyleNumber; SelectedStyle = 0; switch (DetailSort) { // S0_SILHOUETTE°¡ »óÀÇ ½Ç·ç¿§À¸·Î ¹Ù²î¾úÀ¸¸ç SO_PANTS°¡ ÇÏÀÇ ½Ç·ç¿§À¸·Î Ãß°¡µÊ - by monkman (2004.03.24) case SO_SILHOUETTE: if (ImageList4->Count <= 0) goto fail; if (ImageList1->Count < StringGrid1->Col) StringGrid1->Col = ImageList1->Count-1; fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; CheckedDetailSilhouetteCounter[DetailItemNumber] = CheckedDetailTempCounter; for (int k = 0; k < MAX_DETAIL; k++) { DetailSilhouette[DetailItemNumber][k] = DetailTemp[k]; SelectedStyle |= DetailSilhouette[DetailItemNumber][k]; } // SrcFileLIst ¹é¾÷ SrcFileList->Clear(); for (int j = 0; j < SrcFileBackupList->Count; j++) { SrcFileList->Add(SrcFileBackupList->Strings[j]); } if (SelectedStyle) { CheckedSilhouette << EDetailSilhouette(fi->Depth); fi->Name = VecDraw->SilhouetteName[fi->Depth] +" "+ String(CheckedDetailSilhouetteCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedSilhouette[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSilhouette[DetailItemNumber] = true; } } else { if (CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) CheckedSilhouette >> EDetailSilhouette(fi->Depth); fi->Name = VecDraw->SilhouetteName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedSilhouette[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSilhouette[DetailItemNumber] = false; } } break; case SO_SLEEVE: if (ImageList4->Count <= 0) goto fail; if (ImageList2->Count < StringGrid2->Col) StringGrid2->Col = ImageList2->Count-1; fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; CheckedDetailSleeveCounter[DetailItemNumber] = CheckedDetailTempCounter; for (int k = 0; k < MAX_DETAIL; k++) { DetailSleeve[DetailItemNumber][k] = DetailTemp[k]; SelectedStyle |= DetailSleeve[DetailItemNumber][k]; } // SrcFileLIst ¹é¾÷ SrcFileList->Clear(); for (int j = 0; j < SrcFileBackupList->Count; j++) { SrcFileList->Add(SrcFileBackupList->Strings[j]); } if (SelectedStyle) { CheckedSleeve << EDetailSleeve(fi->Depth); fi->Name = VecDraw->SleeveName[fi->Depth] +" "+ String(CheckedDetailSleeveCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedSleeve[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSleeve[DetailItemNumber] = true; } } else { if (CheckedSleeve.Contains(EDetailSleeve(fi->Depth))) CheckedSleeve >> EDetailSleeve(fi->Depth); fi->Name = VecDraw->SleeveName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedSleeve[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedSleeve[DetailItemNumber] = false; } } break; case SO_COLLAR: if (ImageList4->Count <= 0) goto fail; if (ImageList3->Count < StringGrid3->Col) StringGrid3->Col = ImageList3->Count-1; fi = (TFileInfor*) ImageList3->Items[StringGrid3->Col]; CheckedDetailCollarCounter[DetailItemNumber] = CheckedDetailTempCounter; for (int k = 0; k < MAX_DETAIL; k++) { DetailCollar[DetailItemNumber][k] = DetailTemp[k]; SelectedStyle |= DetailCollar[DetailItemNumber][k]; } // SrcFileLIst ¹é¾÷ SrcFileList->Clear(); for (int j = 0; j < SrcFileBackupList->Count; j++) { SrcFileList->Add(SrcFileBackupList->Strings[j]); } if (SelectedStyle) { CheckedCollar << EDetailCollar(fi->Depth); fi->Name = VecDraw->CollarName[fi->Depth] +" "+ String(CheckedDetailCollarCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedCollar[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedCollar[DetailItemNumber] = true; } } else { if (CheckedCollar.Contains(EDetailCollar(fi->Depth))) CheckedCollar >> EDetailCollar(fi->Depth); fi->Name = VecDraw->CollarName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedCollar[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedCollar[DetailItemNumber] = false; } } break; case SO_BELT: if (ImageList4->Count <= 0) goto fail; if (ImageList2->Count < StringGrid2->Col) StringGrid2->Col = ImageList2->Count-1; fi = (TFileInfor*) ImageList2->Items[StringGrid2->Col]; CheckedDetailBeltCounter[DetailItemNumber] = CheckedDetailTempCounter; for (int k = 0; k < MAX_DETAIL; k++) { DetailBelt[DetailItemNumber][k] = DetailTemp[k]; SelectedStyle |= DetailBelt[DetailItemNumber][k]; } // SrcFileLIst ¹é¾÷ SrcFileList->Clear(); for (int j = 0; j < SrcFileBackupList->Count; j++) { SrcFileList->Add(SrcFileBackupList->Strings[j]); } if (SelectedStyle) { CheckedBelt << EDetailBelt(fi->Depth); fi->Name = VecDraw->BeltName[fi->Depth] +" "+ String(CheckedDetailBeltCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedBelt[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedBelt[DetailItemNumber] = true; } } else { if (CheckedBelt.Contains(EDetailBelt(fi->Depth))) CheckedBelt >> EDetailBelt(fi->Depth); fi->Name = VecDraw->BeltName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedBelt[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedBelt[DetailItemNumber] = false; } } break; case SO_PANTS: if (ImageList4->Count <= 0) goto fail; if (ImageList1->Count < StringGrid1->Col) StringGrid1->Col = ImageList1->Count-1; fi = (TFileInfor*) ImageList1->Items[StringGrid1->Col]; CheckedDetailPantsCounter[DetailItemNumber] = CheckedDetailTempCounter; for (int k = 0; k < MAX_DETAIL; k++) { DetailPants[DetailItemNumber][k] = DetailTemp[k]; SelectedStyle |= DetailPants[DetailItemNumber][k]; } // SrcFileLIst ¹é¾÷ SrcFileList->Clear(); for (int j = 0; j < SrcFileBackupList->Count; j++) { SrcFileList->Add(SrcFileBackupList->Strings[j]); } if (SelectedStyle) { CheckedPants << EDetailPants(fi->Depth); fi->Name = VecDraw->PantsName[fi->Depth] +" "+ String(CheckedDetailPantsCounter[DetailItemNumber])+"/"+String(ImageList4->Count); // ¹ÝÀü if (!bCheckedPants[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedPants[DetailItemNumber] = true; } } else { if (CheckedPants.Contains(EDetailPants(fi->Depth))) CheckedPants >> EDetailPants(fi->Depth); fi->Name = VecDraw->PantsName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedPants[DetailItemNumber]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedPants[DetailItemNumber] = false; } } break; } //////////////////////////////////////////////////////////////////////////////// // // ±âÁ¸ ¼Ò½º ÁÖ¼® ó¸® - by monkman (2004.05.19) // if (DetailSelectedCount > 0) { // hDC = fi->tBitmap->CreateDC(); // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// CheckedDetailTempCounter = 0; memset(DetailTemp, 0, sizeof(BYTE)*MAX_DETAIL); /* // üũµÈ °ÍÀÌ 0º¸´Ù Å©¸é ÆÄÀÏ º¹»ç, ÆÄÀÏ À̵¿ÀÌ °¡´ÉÇÏ°Ô ¸¸µé¾îÁØ´Ù - by monkman (2004.06.01) CheckStyleNumber = 0; if (rbUpper->Checked) { for (int i = 0; i < MAX_SIL; i++) { CheckStyleNumber += CheckedDetailSilhouetteCounter[i]; if (i < MAX_SLE) CheckStyleNumber += CheckedDetailSleeveCounter[i]; if (i < MAX_COL) CheckStyleNumber += CheckedDetailCollarCounter[i]; // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖÀ¸¸é ¹Ù·Î break if (CheckStyleNumber > 0) break; } } if (rbLower->Checked) { for (int i = 0; i < MAX_PANTS; i++) { CheckStyleNumber += CheckedDetailPantsCounter[i]; if (i < MAX_BELT) CheckStyleNumber += CheckedDetailBeltCounter[i]; // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖÀ¸¸é ¹Ù·Î break if (CheckStyleNumber > 0) break; } } */ // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } Panel3->Visible = false; Panel1->Enabled = true; Panel2->Enabled = true; spdbtnNext->Enabled = true; StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); return; fail : // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } Panel3->Visible = false; Panel1->Enabled = true; Panel2->Enabled = true; spdbtnNext->Enabled = true; StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TFileInfor *fi; HDC hDC = NULL, dcTemp = NULL; HANDLE hSrch, hFile; String path, filename, directory, temp1, temp2; char *tempchar = "\\"; WIN32_FIND_DATA wfd; bool result = true; STYLEDATAFILEHEADER header; DWORD dwRead; TVecData *data; TStringGrid *grid; TGridCoord gridc; int col, row; int Version; int Cnt; STYFILECACHELIST *SFCL; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; String strStyleID; grid = (TStringGrid *)Sender; switch (grid->Tag) { case 1 : fourthyear1 = firstyear1; fourthyear2 = firstyear2; fourthseason1 = firstseason1; fourthseason2 = firstseason2; fourthcomment = firstcomment; break; case 2 : fourthyear1 = secondyear1; fourthyear2 = secondyear2; fourthseason1 = secondseason1; fourthseason2 = secondseason2; fourthcomment = secondcomment; break; case 3 : fourthyear1 = thirdyear1; fourthyear2 = thirdyear2; fourthseason1 = thirdseason1; fourthseason2 = thirdseason2; fourthcomment = thirdcomment; break; } // ¸¶¿ì½º ¿À¸¥ÂÊ ¹öưÀ¸·Î À̺¥Æ®°¡ ¹ß»ýÇÏÁö ¾Êµµ·Ï ¼öÁ¤ - by monkman (2004.05.27) //if (Button != mbRight) return; if (Button != mbLeft) return; CheckedDetailTempCounter = 0; memset(DetailTemp, 0, sizeof(BYTE)*MAX_DETAIL); gridc = grid->MouseCoord(X, Y); col = gridc.X, row = gridc.Y; grid->Col = col; grid->Row = row; // ¼±ÅÃµÈ SelectedStringGrid¸¦ ¾Ë¾Æ³¿ (0:¾Æ¹«°Íµµ ¼±Åà ¾È µÈ °æ¿ì, 1:ù¹øÂ°, 2:µÎ¹øÂ°, 3:¼¼¹øÂ°) SelectedStringGrid = grid->Tag; switch (grid->Tag) { case 1: if (col >= ImageList1->Count) return; fi = (TFileInfor*) ImageList1->Items[col]; // »óÀǸ¦ ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â °ÍÀ¸·Î ¼öÁ¤ - by monkman (2004.03.24) //if (rbUpper->Checked) return; // »óÀÇ´Â ´ëÇ¥½ºÅ¸ÀÏ·Î ÇÏ´Â°Ô ¾Æ´ÏÁö·Õ if (combobxUpperLower->ItemIndex == 0) { if (fi->Depth > 0) { // Version 200 //////////////////////////////////////////////////////////////////////////////// // // ±âÁ¸¼Ò½º ÁÖ¼®Ã³¸® - by monkman (2004.05.24) // if (!CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) { // CheckedSilhouette << EDetailSilhouette(fi->Depth); // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// CheckedDetailTempCounter = CheckedDetailSilhouetteCounter[fi->Depth]; for (int i = 0; i < MAX_DETAIL; i++) { DetailTemp[i] = DetailSilhouette[fi->Depth][i]; } // SrcFileLIst ¹é¾÷ SrcFileBackupList->Clear(); for (int j = 0; j < SrcFileList->Count; j++) { SrcFileBackupList->Add(SrcFileList->Strings[j]); } }else { // Version 100 // ¹öÀü 100ÀÎ ÆÄÀÏÀÇ °æ¿ì üũ ¹æ¹ý°ú üũµÈ ¼ýÀÚ °è»ê ¹× SrcFileList Ãß°¡ CheckedOldSilhouette[fi->Depth*(-1)] = !CheckedOldSilhouette[fi->Depth*(-1)]; // ¼±ÅÃµÈ StringGrid¸¦ 4·Î ¸¸µé¾îÁØ´Ù // ¼±ÅÃµÈ SelectedStringGrid¸¦ ¾Ë¾Æ³¿ (0:¾Æ¹«°Íµµ ¼±Åà ¾È µÈ °æ¿ì, 1:ù¹øÂ°, 2:µÎ¹øÂ°, 3:¼¼¹øÂ°) SelectedStringGrid = 4; CheckedOldSilhouetteCounter = 0; for (int i = 0; i < 100; i++) { if (CheckedOldSilhouette[i]) CheckedOldSilhouetteCounter++; } if (!CheckedStyleCount()) { CheckedOldSilhouette[fi->Depth*(-1)] = !CheckedOldSilhouette[fi->Depth*(-1)]; // ÇØÁ¦ if (!CheckedOldSilhouette[fi->Depth*(-1)] && bCheckedOldSilhouette[col] == 1) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedOldSilhouette[col] = 2; } goto fail; } CheckedStyleFileList(SrcFileList, CheckedOldSilhouette[fi->Depth*(-1)], fi->Path); // ¼±Åà if (CheckedOldSilhouette[fi->Depth*(-1)] && (bCheckedOldSilhouette[col] == 0 || bCheckedOldSilhouette[col] == 2)) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedOldSilhouette[col] = 1; } // ÇØÁ¦ if (!CheckedOldSilhouette[fi->Depth*(-1)] && bCheckedOldSilhouette[col] == 1) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); bCheckedOldSilhouette[col] = 2; } } DetailSort = SO_SILHOUETTE; directory = SilDirectory; } else { //////////////////////////////////////////////////////////////////////////////// // // ±âÁ¸¼Ò½º ÁÖ¼®Ã³¸® - by monkman (2004.05.24) // if (!CheckedPants.Contains(EDetailPants(fi->Depth))) { // CheckedPants << EDetailPants(fi->Depth); // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// CheckedDetailTempCounter = CheckedDetailPantsCounter[fi->Depth]; for (int i = 0; i < MAX_DETAIL; i++) { DetailTemp[i] = DetailPants[fi->Depth][i]; } // SrcFileLIst ¹é¾÷ SrcFileBackupList->Clear(); for (int j = 0; j < SrcFileList->Count; j++) { SrcFileBackupList->Add(SrcFileList->Strings[j]); } DetailSort = SO_PANTS; directory = SilDirectory; } break; case 2: if (col >= ImageList2->Count) return; fi = (TFileInfor*) ImageList2->Items[col]; if (combobxUpperLower->ItemIndex == 0) { //////////////////////////////////////////////////////////////////////////////// // ±âÁ¸¼Ò½º ÁÖ¼®Ã³¸® - by monkman (2004.05.24) // if (!CheckedSleeve.Contains(EDetailSleeve(fi->Depth))) { // CheckedSleeve << EDetailSleeve(fi->Depth); // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// CheckedDetailTempCounter = CheckedDetailSleeveCounter[fi->Depth]; for (int i = 0; i < MAX_DETAIL; i++) { DetailTemp[i] = DetailSleeve[fi->Depth][i]; } // SrcFileLIst ¹é¾÷ SrcFileBackupList->Clear(); for (int j = 0; j < SrcFileList->Count; j++) { SrcFileBackupList->Add(SrcFileList->Strings[j]); } DetailSort = SO_SLEEVE; directory = SleDirectory; }else { //////////////////////////////////////////////////////////////////////////////// // // ±âÁ¸¼Ò½º ÁÖ¼®Ã³¸® - by monkman (2004.05.24) // if (!CheckedBelt.Contains(EDetailBelt(fi->Depth))) { // CheckedBelt << EDetailBelt(fi->Depth); // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// CheckedDetailTempCounter = CheckedDetailBeltCounter[fi->Depth]; for (int i = 0; i < MAX_DETAIL; i++) { DetailTemp[i] = DetailBelt[fi->Depth][i]; } // SrcFileLIst ¹é¾÷ SrcFileBackupList->Clear(); for (int j = 0; j < SrcFileList->Count; j++) { SrcFileBackupList->Add(SrcFileList->Strings[j]); } DetailSort = SO_BELT; directory = BeltDirectory; } break; case 3: if (col >= ImageList3->Count) return; fi = (TFileInfor*) ImageList3->Items[col]; if (combobxUpperLower->ItemIndex == 0) { //////////////////////////////////////////////////////////////////////////////// // // ±âÁ¸¼Ò½º ÁÖ¼®Ã³¸® - by monkman (2004.05.24) // if (!CheckedCollar.Contains(EDetailCollar(fi->Depth))) { // CheckedCollar << EDetailCollar(fi->Depth); // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); // } //////////////////////////////////////////////////////////////////////////////// CheckedDetailTempCounter = CheckedDetailCollarCounter[fi->Depth]; for (int i = 0; i < MAX_DETAIL; i++) { DetailTemp[i] = DetailCollar[fi->Depth][i]; } // SrcFileLIst ¹é¾÷ SrcFileBackupList->Clear(); for (int j = 0; j < SrcFileList->Count; j++) { SrcFileBackupList->Add(SrcFileList->Strings[j]); } DetailSort = SO_COLLAR; directory = ColDirectory; }else { return; } break; } DetailItemNumber = fi->Depth; if (fi->Depth < 1) { // üũµÈ °ÍÀÌ 0º¸´Ù Å©¸é ÆÄÀÏ º¹»ç, ÆÄÀÏ À̵¿ÀÌ °¡´ÉÇÏ°Ô ¸¸µé¾îÁØ´Ù - by monkman (2004.06.01) // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖÀ¸¸é ¹Ù·Î break if (CheckedOldSilhouetteCounter > 0 && comboSource->Items->Count > 1) { // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } grid->Repaint(); return; } //////////////////////////////////////////////////////////////////////////////// // if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; // BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); // fi->tBitmap->DeleteDC(hDC); //////////////////////////////////////////////////////////////////////////////// // Speed-Up Upgrade ÀÌÀü - by monkman (2004.06.22) //////////////////////////////////////////////////////////////////////////////// ///////////// Á¶°Ç ¸Â´Â styÆÄÀÏ Ã£¾Æ¼­ FileList¿¡ ³Ö¾îÁÖ±â // FileList = new TStringList; // // path = directory + "\\*.sty"; // FileList->Clear(); // // if ((hSrch = FindFirstFile(path.c_str(), &wfd)) != INVALID_HANDLE_VALUE) { // while (result) { // filename = directory + "\\" + wfd.cFileName; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // switch (DetailSort) { // // S0_SILHOUETTE°¡ »óÀÇ ½Ç·ç¿§À¸·Î ¹Ù²î¾úÀ¸¸ç SO_PANTS°¡ ÇÏÀÇ ½Ç·ç¿§À¸·Î Ãß°¡µÊ - by monkman (2004.03.24) // case SO_SILHOUETTE: // switch (Version) { ////////////////////////////////////////////////////////////////////////////////// //// case 100 : //// // Version == 100 ÀÏ °æ¿ì »óÀÇ´Â ´ëÇ¥½ºÅ¸ÀÏÀÌ ¾ø¾ú±â ¶§¹®¿¡ ¾Æ·¡¿Í °°ÀÌ ÄÚµù - by monkman (2004.04.01) //// //// //// // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) //// if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) //// && header.Type == MainType && header.Sort == SO_SILHOUETTE) { FileList->Add(filename); } //// break; ////////////////////////////////////////////////////////////////////////////////// // // Version == 200 // case 200 : // if (header.ESilhouette == DetailItemNumber) { // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) // && header.Type == MainType && header.Sort == SO_SILHOUETTE) { // FileList->Add(filename); // if (FileList->Count >= 400) break; // } // } // break; // } // break; // case SO_SLEEVE: // if (header.ESleeve == DetailItemNumber) { // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) // && header.Type == MainType && header.Sort == SO_SLEEVE) { FileList->Add(filename); } // } // break; // case SO_COLLAR: // if (header.ECollar == DetailItemNumber) { // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) // && header.Type == MainType && header.Sort == SO_COLLAR) { FileList->Add(filename); } // } // break; // case SO_BELT: // if (header.EBelt == DetailItemNumber) { // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) // && header.Type == MainType && header.Sort == SO_BELT) { FileList->Add(filename); } // } // break; // case SO_PANTS: // if (header.EPants == DetailItemNumber) { // // // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) // if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) // && header.Type == MainType && header.Sort == SO_PANTS) { FileList->Add(filename); } // } // break; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // result = FindNextFile(hSrch, &wfd); // } // } // FindClose(hSrch); // FileList->Sort(); // //////////// ±âÁ¸ÀÇ tagµé ´Ù Áö¿öÁÖ±â // while(ImageList4->Count>0) { // fi = (TFileInfor *) ImageList4->Last(); // if (fi->tBitmap) { // delete fi->tBitmap; // fi->tBitmap = NULL; // } // ImageList4->Remove(fi); // delete fi; // fi = NULL; // } // ///////////// FileList ¾ÈÀÇ ÆÄÀϵéÀ» tagdraw¸¦ ÅëÇØ ImageList¿¡ ³Ö¾îÁÖ±â // Cnt = 0; // for (int i = 0; i < FileList->Count; i++) { // filename = FileList->Strings[i]; // // // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) // if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; // header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version); // // // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // switch (Version) { // case 100 : // Version == 100 // case 200 : // Version == 200 // break; // #ifndef NOT_STYLEDATA_LOCK // case 500 : // Version == 500 (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // // HASP°ú üũ ÇÑ´Ù // if (!VecDraw->CheckSTYLock(hFile, header)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // else break; // #endif // default : // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // // // °Ë»ö ¿¬µµ¿¡ ÇØ´çµÇÁö ¾ÊÀ¸¸é Ãß°¡ µÇÁö ¾Ê´Â´Ù - by monkman (2004.05.11) // if (fourthyear1 <= fourthyear2 ) { // if (!(fourthyear1 <= header.Year && header.Year <= fourthyear2)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } else { // if (!(fourthyear2 <= header.Year && header.Year <= fourthyear1)) { // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // continue; // } // } // // 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); // nPos = 0; // for (int i = 0; i < header.Count1; i++) { // if ((data = new TVecData(0))==NULL) goto fail; // ResultForm->ReadStyleData(StyleData, data, &nPos); // TagDataList->Add(data); // } // if (StyleData) { // HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ // StyleData = NULL; // } // CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; // // fi = new TFileInfor; // //fi->Depth = i; // fi->Depth = Cnt++; // ¹øÈ£ ¼øÀ¸·Î Ç¥½Ã - by monkman (2004.06.14) // fi->Path = filename; // // temp1 = filename.LowerCase(); // temp2 = ""; // while (char(temp1[temp1.Length()]) != *tempchar) { // temp2 = String(temp1[temp1.Length()]) + temp2; // temp1.SetLength(temp1.Length()-1); // } // temp2.SetLength(4); // if (temp2 == "user") fi->Name = String(fi->Depth+1) + " User"; // user fileÀΰæ¿ì // else fi->Name = String(fi->Depth+1); // // if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; // // fi->tBitmap->Create(80, 100, 24); // fi->tBitmap->FillRect(Rect(0, 0, 80, 100), clWhite); // // if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; // // TagDraw(dcTemp, TagDataList); // // fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; // ImageList4->Add(fi); // // while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ // data = (TVecData *)TagDataList->First(); // delete data; // TagDataList->Remove(data); // } // } // // grid->Repaint(); // Panel3->Visible = true; // Panel3->BringToFront(); // StringGrid4->TopRow = 0; // //DetailSelectedCount = 0; // Panel1->Enabled = false; // Panel2->Enabled = false; // spdbtnNext->Enabled = false; // // // //fail: // //////////////////////////////////////////////////////////////////////////////// /////////// Á¶°Ç ¸Â´Â styÆÄÀÏ Ã£¾Æ¼­ FileList¿¡ ³Ö¾îÁÖ±â FileList = new TStringList; path = directory; FileList->Clear(); switch (DetailSort) { // S0_SILHOUETTE°¡ »óÀÇ ½Ç·ç¿§À¸·Î ¹Ù²î¾úÀ¸¸ç SO_PANTS°¡ ÇÏÀÇ ½Ç·ç¿§À¸·Î Ãß°¡µÊ - by monkman (2004.03.24) case SO_SILHOUETTE: SCF->STYSearch(path, Division, MainType, DetailSort, fourthyear1, fourthseason1, fourthyear2, fourthseason2, fourthcomment ,EDetailSilhouette(DetailItemNumber), EDetailSleeve(-1), EDetailCollar(-1), EDetailPants(-1), EDetailBelt(-1)); for (int i = 0; i < SCF->SilStrList->Count; i++) { SFCL = (STYFILECACHELIST *)SCF->SilList->Items[i]; if (200 <= SFCL->HList.Version) { FileList->Add(SCF->SilStrList->Strings[i]); if (FileList->Count >= 400) break; } } break; case SO_SLEEVE: SCF->STYSearch(path, Division, MainType, DetailSort, fourthyear1, fourthseason1, fourthyear2, fourthseason2, fourthcomment, EDetailSilhouette(-1), EDetailSleeve(DetailItemNumber), EDetailCollar(-1), EDetailPants(-1), EDetailBelt(-1)); for (int i = 0; i < SCF->SleStrList->Count; i++) { SFCL = (STYFILECACHELIST *)SCF->SleList->Items[i]; FileList->Add(SCF->SleStrList->Strings[i]); if (FileList->Count >= 400) break; } break; case SO_COLLAR: SCF->STYSearch(path, Division, MainType, DetailSort, fourthyear1, fourthseason1, fourthyear2, fourthseason2, fourthcomment, EDetailSilhouette(-1), EDetailSleeve(-1), EDetailCollar(DetailItemNumber), EDetailPants(-1), EDetailBelt(-1)); for (int i = 0; i < SCF->ColStrList->Count; i++) { SFCL = (STYFILECACHELIST *)SCF->ColList->Items[i]; FileList->Add(SCF->ColStrList->Strings[i]); if (FileList->Count >= 400) break; } break; case SO_BELT: SCF->STYSearch(path, Division, MainType, DetailSort, fourthyear1, fourthseason1, fourthyear2, fourthseason2, fourthcomment, EDetailSilhouette(-1), EDetailSleeve(-1), EDetailCollar(-1), EDetailPants(-1), EDetailBelt(DetailItemNumber)); for (int i = 0; i < SCF->BeltStrList->Count; i++) { SFCL = (STYFILECACHELIST *)SCF->BeltList->Items[i]; FileList->Add(SCF->BeltStrList->Strings[i]); if (FileList->Count >= 400) break; } break; case SO_PANTS: SCF->STYSearch(path, Division, MainType, DetailSort, fourthyear1, fourthseason1, fourthyear2, fourthseason2, fourthcomment, EDetailSilhouette(-1), EDetailSleeve(-1), EDetailCollar(-1), EDetailPants(DetailItemNumber), EDetailBelt(-1)); for (int i = 0; i < SCF->PantsStrList->Count; i++) { SFCL = (STYFILECACHELIST *)SCF->PantsList->Items[i]; FileList->Add(SCF->PantsStrList->Strings[i]); if (FileList->Count >= 400) break; } break; } ////////// ±âÁ¸ÀÇ tagµé ´Ù Áö¿öÁÖ±â if (ImageList4) { while(ImageList4->Count>0) { fi = (TFileInfor *) ImageList4->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList4->Remove(fi); delete fi; fi = NULL; } } /////////// FileList ¾ÈÀÇ ÆÄÀϵéÀ» tagdraw¸¦ ÅëÇØ ImageList¿¡ ³Ö¾îÁÖ±â Cnt = 0; for (int i = 0; i < FileList->Count; i++) { filename = FileList->Strings[i]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; //fi->Depth = i; fi->Depth = Cnt++; // ¹øÈ£ ¼øÀ¸·Î Ç¥½Ã - by monkman (2004.06.14) fi->Path = filename; temp1 = filename.LowerCase(); temp2 = ""; while (char(temp1[temp1.Length()]) != *tempchar) { temp2 = String(temp1[temp1.Length()]) + temp2; temp1.SetLength(temp1.Length()-1); } temp2.SetLength(4); #ifndef WORKSHEET if (temp2 == "user") fi->Name = String(fi->Depth+1) + " User"; // user fileÀΰæ¿ì else fi->Name = String(fi->Depth+1); #else // StyleID ó¸® - by monkman (2011.01.10) strStyleID = String(header.StyleID); fi->Name = String(fi->Depth+1) + " " + strStyleID; if (temp2 == "user") fi->Name += " [User]"; // user fileÀΰæ¿ì #endif if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList4->Add(fi); if (TagDataList) { while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } } } grid->Repaint(); Panel3->Left = rzsplitterCombination->Position + (RzPanel1->Width-Panel3->Width)/2; Panel3->Visible = true; Panel3->BringToFront(); StringGrid4->TopRow = 0; //DetailSelectedCount = 0; Panel1->Enabled = false; Panel2->Enabled = false; spdbtnNext->Enabled = false; fail: } //--------------------------------------------------------------------------- bool __fastcall TCombiForm::CheckedStyleCount() { // °á°ú°¡ 1000°³°¡ ³ÑÁö ¾Êµµ·Ï üũ - by monkman (2004.05.25) int StringGrid1Counter, StringGrid2Counter, StringGrid3Counter; // ¼±ÅõǾú´Ù´Â °¡Á¤ÇÏ¿¡ °è»êÇÑ´Ù // ¼±ÅÃµÈ SelectedStringGrid¸¦ ¾Ë¾Æ³¿ (0:¾Æ¹«°Íµµ ¼±Åà ¾È µÈ °æ¿ì, 1:ù¹øÂ°, 2:µÎ¹øÂ°, 3:¼¼¹øÂ°) switch (SelectedStringGrid) { case 1 : StringGrid1Counter = 1; StringGrid2Counter = 0; StringGrid3Counter = 0; break; case 2 : StringGrid1Counter = 0; StringGrid2Counter = 1; StringGrid3Counter = 0; break; case 3 : StringGrid1Counter = 0; StringGrid2Counter = 0; StringGrid3Counter = 1; break; default : StringGrid1Counter = 0; StringGrid2Counter = 0; StringGrid3Counter = 0; break; } // IllustForm¿¡¼­ ³Ñ¾î¿ÔÀ» °æ¿ì ±× ³Ñ¾î¿Â STI µ¥ÀÌÅ͵µ Æ÷ÇÔ½ÃÄÑÁØ´Ù - by monkman (2004.06.09) if (bIsIllustForm) { if (combobxUpperLower->ItemIndex == 0) { if (HDPatUpSil.Type) StringGrid1Counter += 1; if (HDPatUpSle.Type) StringGrid2Counter += 1; if (HDPatUpCol.Type) StringGrid3Counter += 1; } else if (combobxUpperLower->ItemIndex == 1) { if (HDPatDnSil.Type) StringGrid1Counter += 1; if (HDPatDnBelt.Type) StringGrid2Counter += 1; } } if (combobxUpperLower->ItemIndex == 0) { for (int i = 0; i < MAX_SIL; i++) { StringGrid1Counter += CheckedDetailSilhouetteCounter[i]; if (i < MAX_SLE) StringGrid2Counter += CheckedDetailSleeveCounter[i]; if (i < MAX_COL) StringGrid3Counter += CheckedDetailCollarCounter[i]; } if (StringGrid1Counter <= 0 && CheckedOldSilhouetteCounter <= 0) StringGrid1Counter = 1; if (StringGrid2Counter <= 0) StringGrid2Counter = 1; if (StringGrid3Counter <= 0) StringGrid3Counter = 1; } else if (combobxUpperLower->ItemIndex == 1) { for (int i = 0; i < MAX_PANTS; i++) { StringGrid1Counter += CheckedDetailPantsCounter[i]; if (i < MAX_BELT) StringGrid2Counter += CheckedDetailBeltCounter[i]; } if (StringGrid1Counter <= 0) StringGrid1Counter = 1; if (StringGrid2Counter <= 0) StringGrid2Counter = 1; StringGrid3Counter = 1; } // µÚÀÇ 50Àº ´ëÇ¥½ºÅ¸ÀÏ °³¼ö (ÃßÁ¤Ä¡..) if (((StringGrid1Counter + CheckedOldSilhouetteCounter) * StringGrid2Counter * StringGrid3Counter + 50) > 1000) { // ¸Þ½ÃÁö : ¼±ÅÃµÈ ½ºÅ¸ÀÏÀÇ °³¼ö°¡ ¼±Åà °¡´ÉÇÑ ½ºÅ¸ÀÏÀÇ °³¼ö¸¦ ÃʰúÇÏ¿´½À´Ï´Ù. // \nÀÌ ½ºÅ¸ÀÏÀ» ¼±ÅÃÇϽ÷Á¸é ÀÌÀü¿¡ ¼±ÅõǾú´ø °ÍÀ» ÇØÁ¦ÇÏ°í ´Ù½Ã ¼±ÅÃÇϽʽÿÀ. MessageDlg(IDS_MESSAGE02, mtInformation, TMsgDlgButtons() << mbOK, 0); return false; } return true; } //--------------------------------------------------------------------------- bool __fastcall TCombiForm::CheckedStyleFileList(TStringList *StrList, bool INOUT, String filename) { // INÀÌ trueÀ̸é int index; index = StrList->IndexOf(filename); // IN, OUT ¾î¶°ÇÑ ÀÛ¾÷ÀÌ¶óµµ ¼öÇàÇßÀ¸¸é true¸¦ ¹Ýȯ ¾Æ¹«°Íµµ ÇÏÁö ¾Ê¾ÒÀ¸¸é false¸¦ ¹Ýȯ if (INOUT) { if (index == -1) { StrList->Add(filename); return true; } } else { if (index != -1) { StrList->Delete(index); return true; } } return false; } //--------------------------------------------------------------------------- // IllustFormÀ¸·Î µ¹¾Æ°£´Ù - by monkman void __fastcall TCombiForm::spdbtnBackClick(TObject *Sender) { // IllustForm¿¡¼­ ¿ÔÀ» °æ¿ì if (bIsIllustForm) { StyleIllustForm->progbarCombination->Position = 0; Visible = false; StyleIllustForm->Show(); bIsIllustForm = false; ResultForm->bIsIllustForm = false; StringGrid1->Col = 0; StringGrid2->Col = 0; StringGrid3->Col = 0; } } //--------------------------------------------------------------------------- // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) bool __fastcall TCombiForm::STYFileStyleTypeCheck(HANDLE hFile, String filename, EDivision Division, TypeSet DSItems, TypeSet DSClothes, EType MainType, ESort Sort) { OLDSTYLEDATAFILEHEADER oldheader; STYLEDATAFILEHEADER header; DWORD dwRead; bool check; int Version; Version = VecDraw->CheckSTYFileVersion(hFile, filename); if (Version == 100) { if (SetFilePointer(hFile, 0, NULL, FILE_BEGIN)== 0xFFFFFFFF) goto fail; if (!ReadFile(hFile, &oldheader, sizeof(OLDSTYLEDATAFILEHEADER), &dwRead, NULL)) goto fail; VecDraw->ConvertNewSTYHeader(&header, &oldheader); } else if (200 <= Version && Version < 500) { if (SetFilePointer(hFile, 0, NULL, FILE_BEGIN)== 0xFFFFFFFF) goto fail; if (!ReadFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwRead, NULL)) goto fail; header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) } else if (500 <= Version && Version <= (STYSTIFileVersion+300)) { #ifndef NOT_STYLEDATA_LOCK if (SetFilePointer(hFile, 0, NULL, FILE_BEGIN)== 0xFFFFFFFF) goto fail; if (!ReadFile(hFile, &header, sizeof(STYLEDATAFILEHEADER), &dwRead, NULL)) goto fail; header.FileIndex = 0; // ÃʱâÈ­ÇØÁØ´Ù - by monkman (2011.01.04) #endif } else { return false; } if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) && header.Type == MainType && header.Sort == Sort) check = true; else check = false; return check; fail : return false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::FindFolder(String path) { // path»ó¿¡ µ¿µîÇÏ°Ô Á¸ÀçÇÏ´Â ÇÏÀ§µð·ºÅ丮¸¸ °Ë»öÇÑ´Ù HANDLE hSrch; WIN32_FIND_DATA wfd; Char drive[MAX_PATH]; Char dir[MAX_PATH]; Char newpath[MAX_PATH]; String strSrcDirectory; int nSrcItemIndex; bool bResult = true; String strLowerFileName, strBinDirName; nSrcItemIndex = comboSource->ItemIndex; strSrcDirectory = 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); strBinDirName = DirectoryBin.LowerCase() + "\\*.*"; if (path.LowerCase() == DirectoryBin.LowerCase() || path.LowerCase() == strBinDirName.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); if (nSrcItemIndex >= 0) { comboSource->ItemIndex = comboSource->Items->IndexOf(strSrcDirectory); SrcDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; DirectoryStyle = strRootPath + "\\" + SrcDirectory; lbPath->Caption = "[ " + lbSource->Caption + " ] " + DirectoryStyle; } else { comboSource->ItemIndex = 0; SrcDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; DirectoryStyle = strRootPath + "\\" + SrcDirectory; lbPath->Caption = "[ " + lbSource->Caption + " ] " + DirectoryStyle; } // comboSource¿¡ Æú´õ°¡ ÇÑ °³ À̰í, ±× Æú´õ°¡ Stylist ±âº» Style Æú´õ¸é »èÁ¦ ºÒ°¡´ÉÇÏ°Ô ÇÑ´Ù if (comboSource->Items->Count <= 1 && strRootPath.LowerCase() == DirectoryBin.LowerCase()) { sbRenameFolder->Enabled = false; sbDeleteFolder->Enabled = false; } else if (comboSource->Items->Count < 1) { // Æú´õ°¡ ¾øÀ» ¶§µµ »èÁ¦ ºÒ°¡´ÉÇÏ°Ô ÇÑ´Ù sbRenameFolder->Enabled = false; sbDeleteFolder->Enabled = false; } else { // Æú´õ°¡ µÎ °³ ÀÏ °æ¿ì sbRenameFolder->Enabled = true; sbDeleteFolder->Enabled = true; } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::RefSTYFolderFileClick(TObject *Sender) { // STYLE Æú´õ ¹× STY ÆÄÀÏ °ü·Ã ÄÚµå String CompName, DstDirectory; TSpeedButton *ClickedButton; TShape *ClickedShape; // comboSourceÀÇ ItemIndex int nSrcDirectoryIndex, nDstDirectoryIndex; ClickedButton = (TSpeedButton *)Sender; CompName = ClickedButton->Name; CompName = "sh" + CompName.SubString(3, CompName.Length()); ClickedShape = (TShape *)FindComponent(CompName); ClickedShape->Pen->Color = clRed; nSrcDirectoryIndex = comboSource->ItemIndex; nDstDirectoryIndex = -1; // ÀÏ´Ü ÃʱⰪÀ» ÀÌ·¸°Ô ÁÜ DstDirectory = ""; switch (ClickedButton->Tag) { case 1 : // Æú´õ »ý¼º CombiDirectoryState = COMBIDIR_DIR_CREATE; if (CombiDirectoryDialogFunc(CombiDirectoryState, DirectoryStyle, SrcDirectory, &nSrcDirectoryIndex, &nDstDirectoryIndex)) { comboSource->ItemIndex = nSrcDirectoryIndex; FindFolder(strRootPath + "\\*.*"); } break; case 2 : // Æú´õ¸í º¯°æ if (SrcDirectory.IsEmpty()) { // ¸Þ½ÃÁö : Æú´õ¸íÀÌ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù. MessageDlg(IDS_MESSAGE03, mtError, TMsgDlgButtons() << mbOK, 0); ClickedShape->Pen->Color = clBlack; return; } else if (DirectoryStyle.LowerCase() == (DirectoryBin.LowerCase() + "\\style")) { // ¸Þ½ÃÁö : ±âº» ½ºÅ¸ÀÏ ÆÄÀϵéÀÌ ÀúÀåµÈ Æú´õ¸íÀº º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù. MessageDlg(IDS_MESSAGE04, mtError, TMsgDlgButtons() << mbOK, 0); ClickedShape->Pen->Color = clBlack; return; } else { CombiDirectoryState = COMBIDIR_DIR_RENAME; if (CombiDirectoryDialogFunc(CombiDirectoryState, DirectoryStyle, SrcDirectory, &nSrcDirectoryIndex, &nDstDirectoryIndex)) { FindFolder(strRootPath + "\\*.*"); comboSource->ItemIndex = nDstDirectoryIndex; SrcDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; DirectoryStyle = strRootPath + "\\" + SrcDirectory; lbPath->Caption = "[ " + lbSource->Caption + " ] " + DirectoryStyle; SubItemChange(this); } } break; case 3 : // Æú´õ »èÁ¦ CombiDirectoryState = COMBIDIR_DIR_DELETE; if (CombiDirectoryDialogFunc(CombiDirectoryState, DirectoryStyle, SrcDirectory, &nSrcDirectoryIndex, &nDstDirectoryIndex)) { if (nSrcDirectoryIndex == -1) { // ¿øº» Æú´õ¿Í ´ë»ó Æú´õ(»èÁ¦µÉ Æú´õ)°¡ °°À» °æ¿ì if (strRootPath.LowerCase() == DirectoryBin.LowerCase()) { // Style·Î ¸ÂÃçÁØ´Ù comboSource->ItemIndex = 0; } else { if (comboSource->ItemIndex != 0) { comboSource->ItemIndex = 0; // ù ¹øÂ° Æú´õ·Î ¸ÂÃçÁØ´Ù } else { comboSource->ItemIndex = 1; // µÎ ¹øÂ° Æú´õ·Î ¸ÂÃçÁØ´Ù } } FindFolder(strRootPath + "\\*.*"); comboSource->ItemIndex = 0; SubItemChange(this); } else { comboSource->ItemIndex = nSrcDirectoryIndex; FindFolder(strRootPath + "\\*.*"); } } break; case 4 : // ÆÄÀÏ º¹»ç if (SrcDirectory.IsEmpty()) { // ¸Þ½ÃÁö : º¹»çÇÒ ¿øº» Æú´õ¸¦ ÁöÁ¤ÇØÁֽʽÿÀ. MessageDlg(IDS_MESSAGE05, mtError, TMsgDlgButtons() << mbOK, 0); ClickedShape->Pen->Color = clBlack; return; } else { CombiDirectoryState = COMBIDIR_FILE_COPY; CombiDirectoryDialogFunc(CombiDirectoryState, DirectoryStyle, SrcDirectory, &nSrcDirectoryIndex, &nDstDirectoryIndex, SrcFileList); comboSource->ItemIndex = nSrcDirectoryIndex; FindFolder(strRootPath + "\\*.*"); } break; case 5 : // ÆÄÀÏ À̵¿ if (SrcDirectory.IsEmpty()) { // ¸Þ½ÃÁö : À̵¿ÇÒ ÆÄÀÏÀÌ ÀÖ´Â ¿øº» Æú´õ¸¦ ÁöÁ¤ÇØÁֽʽÿÀ. MessageDlg(IDS_MESSAGE06, mtError, TMsgDlgButtons() << mbOK, 0); ClickedShape->Pen->Color = clBlack; return; } else { CombiDirectoryState = COMBIDIR_FILE_MOVE; if (CombiDirectoryDialogFunc(CombiDirectoryState, DirectoryStyle, SrcDirectory, &nSrcDirectoryIndex, &nDstDirectoryIndex, SrcFileList)) { comboSource->ItemIndex = nSrcDirectoryIndex; FindFolder(strRootPath + "\\*.*"); SubItemChange(this); } } break; } // ÀÌ µð·ºÅ丮¸¦ Stylie.ini ÆÄÀÏ¿¡ ±â¾ï - by monkman (2004.10.12) STYDetailSelectedSave(comboSource->Items->Strings[comboSource->ItemIndex]); ClickedShape->Pen->Color = clBlack; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::comboSourceChange(TObject *Sender) { SrcDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; DirectoryStyle = strRootPath + "\\" + SrcDirectory; lbPath->Caption = "[ " + lbSource->Caption + " ] " + DirectoryStyle; // ÀÌ µð·ºÅ丮¸¦ Stylie.ini ÆÄÀÏ¿¡ ±â¾ï - by monkman (2004.10.12) STYDetailSelectedSave(SrcDirectory); SubItemChange(this); comboSource->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbDeleteFilesClick(TObject *Sender) { //////////////////////////////////////////////////////////////////////////////// // // ¡Ú¡Ù Àӽà - º¯È­µÈ StringGrid¸¦ ´Ù½Ã ±×·ÁÁÖ±â À§Çؼ­.. - by monkman // int firstyear1, firstyear2, secondyear1, secondyear2, thirdyear1, thirdyear2; //////////////////////////////////////////////////////////////////////////////// TFileInfor *fi; TStringList *SrcFileSubList, *DelFileSubList; String Msg; int CheckStyleNumber; // ¾Æ¹«°Íµµ ¼±ÅõÇÁö ¾Ê¾ÒÀ» °æ¿ì - by monkman (2004.06.14) // üũµÈ °ÍÀÌ 0º¸´Ù Å©¸é ÆÄÀÏ º¹»ç, ÆÄÀÏ À̵¿ÀÌ °¡´ÉÇÏ°Ô ¸¸µé¾îÁØ´Ù - by monkman (2004.06.01) CheckStyleNumber = 0; if (combobxUpperLower->ItemIndex == 0) { switch (SelectedStringGrid) { case 1 : CheckStyleNumber = CheckedDetailSilhouetteCounter[DetailItemNumber]; break; case 2 : CheckStyleNumber = CheckedDetailSleeveCounter[DetailItemNumber]; break; case 3 : CheckStyleNumber = CheckedDetailCollarCounter[DetailItemNumber]; break; } } else if (combobxUpperLower->ItemIndex == 1) { switch (SelectedStringGrid) { case 1 : CheckStyleNumber = CheckedDetailPantsCounter[DetailItemNumber]; break; case 2 : CheckStyleNumber = CheckedDetailBeltCounter[DetailItemNumber]; break; } } if (CheckStyleNumber <= 0) { return; } // ±âº» µð·ºÅ丮¿¡¼­µµ »èÁ¦°¡ °¡´ÉÇϵµ·Ï ¼öÁ¤ - by monkman (2009.12.16) /* if (!SrcDirectory.IsEmpty() && DirectoryStyle.LowerCase() != (DirectoryBin.LowerCase() + "\\style") && DirectoryStyle.LowerCase() != (DirectoryBin.LowerCase() + "\\guideimage") && DirectoryStyle.LowerCase() != (DirectoryBin.LowerCase() + "\\stisample") && DirectoryStyle.LowerCase() != (DirectoryBin.LowerCase() + "\\texstylist")) { */ // ¸Þ½ÃÁö : ¼±ÅÃµÈ ÆÄÀϵéÀÌ »èÁ¦µË´Ï´Ù.\nÀÌ ÀÛ¾÷À» ¼öÇàÇϽðڽÀ´Ï±î? Msg = IDS_MESSAGE07; if (MessageDlg(Msg, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrNo) { return; } // ±âº» µð·ºÅ丮¿¡¼­µµ »èÁ¦°¡ °¡´ÉÇϵµ·Ï ¼öÁ¤ - by monkman (2009.12.16) /* // ¸Þ½ÃÁö : ±âº» ½ºÅ¸ÀÏ ÆÄÀϵéÀÌ ÀúÀåµÈ Æú´õÀÔ´Ï´Ù.\n¼±ÅÃµÈ ÆÄÀϵéÀ» »èÁ¦ÇϽðڽÀ´Ï±î? if (DirectoryStyle.LowerCase() == (DirectoryBin.LowerCase() + "\\style")) { Msg = IDS_MESSAGE08; if (MessageDlg(Msg, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrNo) { return; } } */ // StringGrid4¿¡¼­ ¼±ÅÃµÈ ³»¿ëÀ» »èÁ¦ÇÑ´Ù - by monkman (2004.06.16) STYFileFindAndToFileList(DetailItemNumber, DetailSort, false); if (ImageList4->Count > 0) { SrcFileSubList = new TStringList; DelFileSubList = new TStringList; for (int i = 0; i < ImageList4->Count; i++) { fi = (TFileInfor*) ImageList4->Items[i]; SrcFileSubList->Add(fi->Path); } switch (DetailSort) { case SO_SILHOUETTE : for (int i = 0; i < SrcFileSubList->Count; i++) { if (DetailSilhouette[DetailItemNumber][i/8] & (1<<(i%8))) { CheckedStyleFileList(DelFileSubList, true, SrcFileSubList->Strings[i]); } } break; case SO_SLEEVE : for (int i = 0; i < SrcFileSubList->Count; i++) { if (DetailSleeve[DetailItemNumber][i/8] & (1<<(i%8))) { CheckedStyleFileList(DelFileSubList, true, SrcFileSubList->Strings[i]); } } break; case SO_COLLAR : for (int i = 0; i < SrcFileSubList->Count; i++) { if (DetailCollar[DetailItemNumber][i/8] & (1<<(i%8))) { CheckedStyleFileList(DelFileSubList, true, SrcFileSubList->Strings[i]); } } break; case SO_PANTS : for (int i = 0; i < SrcFileSubList->Count; i++) { if (DetailPants[DetailItemNumber][i/8] & (1<<(i%8))) { CheckedStyleFileList(DelFileSubList, true, SrcFileSubList->Strings[i]); } } break; case SO_BELT : for (int i = 0; i < SrcFileSubList->Count; i++) { if (DetailBelt[DetailItemNumber][i/8] & (1<<(i%8))) { CheckedStyleFileList(DelFileSubList, true, SrcFileSubList->Strings[i]); } } break; } for (int i = 0; i < DelFileSubList->Count; i++) { if (!DeleteFile(DelFileSubList->Strings[i].c_str())) { // ¸Þ½ÃÁö : <¿øº» ÆÄÀÏ>\nÀ§ ÆÄÀÏÀ» »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù. Msg = DelFileSubList->Strings[i] + IDS_MESSAGE09; MessageDlg(Msg, mtError, TMsgDlgButtons() << mbOK, 0); } } SrcFileSubList->Clear(); DelFileSubList->Clear(); delete SrcFileSubList; SrcFileSubList = NULL; delete DelFileSubList; DelFileSubList = NULL; // ±âº» µð·ºÅ丮¿¡¼­µµ »èÁ¦°¡ °¡´ÉÇϵµ·Ï ¼öÁ¤ - by monkman (2009.12.16) /* } */ //////////////////////////////////////////////////////////////////////////////// // // ¡Ú¡Ù Àӽà - º¯È­µÈ StringGrid¸¦ ´Ù½Ã ±×·ÁÁÖ±â À§Çؼ­.. - by monkman // firstyear1 = MIN_YEAR; // firstyear2 = MAX_YEAR; // secondyear1 = MIN_YEAR; // secondyear2 = MAX_YEAR; // thirdyear1 = MIN_YEAR; // thirdyear2 = MAX_YEAR; // // if (comboFirstBegin->Text != "" && comboFirstBegin->Text != NULL) firstyear1 = StrToInt(comboFirstBegin->Text); // if (comboFirstEnd->Text != "" && comboFirstEnd->Text != NULL) firstyear2 = StrToInt(comboFirstEnd->Text); // if (comboSecondBegin->Text != "" && comboSecondBegin->Text != NULL) secondyear1 = StrToInt(comboSecondBegin->Text); // if (comboSecondEnd->Text != "" && comboSecondEnd->Text != NULL) secondyear2 = StrToInt(comboSecondEnd->Text); // if (comboThirdBegin->Text != "" && comboThirdBegin->Text != NULL) thirdyear1 = StrToInt(comboThirdBegin->Text); // if (comboThirdEnd->Text != "" && comboThirdEnd->Text != NULL) thirdyear2 = StrToInt(comboThirdEnd->Text); // // // ÇØ´çµÇ´Â ImageList¸¦ ´Ù½Ã StringGrid¸¦ ±×·ÁÁØ´Ù // if (rbUpper->Checked) { // »óÀÇ // switch (SelectedStringGrid) { // case 1 : // FindSilhouetteFile(firstyear1, firstyear2); // StringGrid3->Repaint(); // break; // case 2 : // FindSleeveFile(secondyear1, secondyear2); // StringGrid1->Repaint(); // break; // case 3 : // FindCollarFile(thirdyear1, thirdyear2); // StringGrid2->Repaint(); // break; // } // } // if (rbLower->Checked) { // switch (SelectedStringGrid) { // case 1 : // FindPantsFile(firstyear1, firstyear2); // StringGrid1->Repaint(); // break; // case 2 : // FindBeltFile(secondyear1, secondyear2); // StringGrid2->Repaint(); // break; // } // } //////////////////////////////////////////////////////////////////////////////// // »èÁ¦µÇ¾úÀ¸¹Ç·Î ImageList4¸¦ ´Ù½Ã ¸¸µé°í ±×·ÁÁØ´Ù - by monkman (2004.05.31) STYFileFindAndToFileList(DetailItemNumber, DetailSort, true); // SrcFileLIst ¹é¾÷ SrcFileList->Clear(); for (int j = 0; j < SrcFileBackupList->Count; j++) { SrcFileList->Add(SrcFileBackupList->Strings[j]); } CheckedDetailTempCounter = 0; memset(DetailTemp, 0, sizeof(BYTE)*MAX_DETAIL); // ¼±ÅõȰÍÀÌ Çϳª¶óµµ ÀÖ°í Æú´õ°¡ µÎ °³ ÀÌ»óÀ̸é, º¹»ç, À̵¿, »èÁ¦ ¹öưÀ» Ȱ¼ºÈ­½ÃŲ´Ù if (SrcFileList->Count > 0 && comboSource->Items->Count > 1) { sbCopyFiles->Enabled = true; sbMoveFiles->Enabled = true; sbDeleteFiles2->Enabled = true; shCopyFiles->Enabled = true; shMoveFiles->Enabled = true; } else { sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; } sbNoneClick(this); switch (SelectedStringGrid) { case 1 : STYSearch1(); break; case 2 : STYSearch2(); break; case 3 : STYSearch3(); break; } StringGrid4->Repaint(); return; } else if (SrcDirectory.IsEmpty()) { // ¸Þ½ÃÁö : »èÁ¦ ´ë»óÀÎ ¿øº» Æú´õ¸¦ ÁöÁ¤ÇØÁֽʽÿÀ. MessageDlg(IDS_MESSAGE10, mtError, TMsgDlgButtons() << mbOK, 0); return; } } //--------------------------------------------------------------------------- bool __fastcall TCombiForm::YearCheck(TComboBox *combo) { int intTest; if (!combo->Text.IsEmpty() && combo->Text != "All") { try { intTest = StrToInt(combo->Text); return true; } catch (Exception &e) { return false; } } else return true; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::STYSearch1() { // ÀÌ ÀÛ¾÷ÀÌ Find() ÀÛ¾÷º¸´Ù ¸ÕÀú¿Í¾ß ÇÑ´Ù - by monkman (2004.06.11) // Silhouette Áß¿¡ ¼±ÅÃµÈ °ÍÀ» SrcFileList¿¡¼­ »èÁ¦ÇÑ´Ù - by monkman (2004.06.11) for (int i = 0; i < SilFileList->Count; i++) { CheckedStyleFileList(SrcFileList, false, SilFileList->Strings[i]); } for (int i = 0; i < PantsFileList->Count; i++) { CheckedStyleFileList(SrcFileList, false, PantsFileList->Strings[i]); } if (combobxUpperLower->ItemIndex == 0) { // »óÀÇ FindSilhouetteFile(firstyear1, firstseason1, firstyear2, firstseason2, firstcomment); }else { FindPantsFile(firstyear1, firstseason1, firstyear2, firstseason2, firstcomment); } // Á¤º¸°¡ ¹Ù²î¾úÀ¸¹Ç·Î ÀçÁ¶ÇÕÀ» ÇØ¾ßÇÑ´Ù bReCombination = true; StringGrid1->Repaint(); StringGrid1->LeftCol = 0; CheckedSilhouette.Clear(); CheckedPants.Clear(); CheckedOldSilhouetteCounter = 0; // ¹öÀü 100ÀÎ ÆÄÀÏÀÇ ¼±ÅÃµÈ °³¼ö¸¦ üũ // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(bCheckedOldSilhouette, 0, sizeof(bool)*100); memset(bCheckedSilhouette, 0, sizeof(bool)*MAX_SIL); memset(bCheckedPants, 0, sizeof(bool)*MAX_PANTS); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(DetailSilhouette, 0, sizeof(BYTE)*MAX_SIL*MAX_DETAIL); memset(DetailPants, 0, sizeof(BYTE)*MAX_PANTS*MAX_DETAIL); // ´ëÇ¥½ºÅ¸ÀϺ°·Î DetailÇÏ°Ô ¼±ÅÃµÈ CountÀÇ ¼ö ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(&CheckedOldSilhouette, 0, sizeof(int)*100); memset(CheckedDetailSilhouetteCounter, 0, sizeof(int)*MAX_SIL); memset(CheckedDetailPantsCounter, 0, sizeof(int)*MAX_PANTS); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::STYSearch2() { // ÀÌ ÀÛ¾÷ÀÌ Find() ÀÛ¾÷º¸´Ù ¸ÕÀú¿Í¾ß ÇÑ´Ù - by monkman (2004.06.11) // Silhouette Áß¿¡ ¼±ÅÃµÈ °ÍÀ» SrcFileList¿¡¼­ »èÁ¦ÇÑ´Ù - by monkman (2004.06.11) for (int i = 0; i < SleFileList->Count; i++) { CheckedStyleFileList(SrcFileList, false, SleFileList->Strings[i]); } for (int i = 0; i < BeltFileList->Count; i++) { CheckedStyleFileList(SrcFileList, false, BeltFileList->Strings[i]); } if (combobxUpperLower->ItemIndex == 0) { // »óÀÇ FindSleeveFile(secondyear1, secondseason1, secondyear2, secondseason2, secondcomment); }else { FindBeltFile(secondyear1, secondseason1, secondyear2, secondseason2, secondcomment); } // Á¤º¸°¡ ¹Ù²î¾úÀ¸¹Ç·Î ÀçÁ¶ÇÕÀ» ÇØ¾ßÇÑ´Ù bReCombination = true; StringGrid2->Repaint(); StringGrid2->LeftCol = 0; CheckedSleeve.Clear(); CheckedBelt.Clear(); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(bCheckedSleeve, 0, sizeof(bool)*MAX_SLE); memset(bCheckedBelt, 0, sizeof(bool)*MAX_BELT); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(DetailSleeve, 0, sizeof(BYTE)*MAX_SLE*MAX_DETAIL); memset(DetailBelt, 0, sizeof(BYTE)*MAX_BELT*MAX_DETAIL); // ´ëÇ¥½ºÅ¸ÀϺ°·Î DetailÇÏ°Ô ¼±ÅÃµÈ CountÀÇ ¼ö ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(CheckedDetailSleeveCounter, 0, sizeof(int)*MAX_SLE); memset(CheckedDetailBeltCounter, 0, sizeof(int)*MAX_BELT); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::STYSearch3() { // ÀÌ ÀÛ¾÷ÀÌ Find() ÀÛ¾÷º¸´Ù ¸ÕÀú¿Í¾ß ÇÑ´Ù - by monkman (2004.06.11) // Silhouette Áß¿¡ ¼±ÅÃµÈ °ÍÀ» SrcFileList¿¡¼­ »èÁ¦ÇÑ´Ù - by monkman (2004.06.11) for (int i = 0; i < ColFileList->Count; i++) { CheckedStyleFileList(SrcFileList, false, ColFileList->Strings[i]); } if (combobxUpperLower->ItemIndex == 0) { // »óÀÇ FindCollarFile(thirdyear1, thirdseason1, thirdyear2, thirdseason2, thirdcomment); } // Á¤º¸°¡ ¹Ù²î¾úÀ¸¹Ç·Î ÀçÁ¶ÇÕÀ» ÇØ¾ßÇÑ´Ù bReCombination = true; StringGrid3->Repaint(); StringGrid3->LeftCol = 0; CheckedCollar.Clear(); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(bCheckedCollar, 0, sizeof(bool)*MAX_COL); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(DetailCollar, 0, sizeof(BYTE)*MAX_COL*MAX_DETAIL); // ´ëÇ¥½ºÅ¸ÀϺ°·Î DetailÇÏ°Ô ¼±ÅÃµÈ CountÀÇ ¼ö ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(CheckedDetailCollarCounter, 0, sizeof(int)*MAX_COL); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::STYFileFindAndToFileList(int DetailStyleItemNum, ESort StyleSort, bool ReDrawing) { // StringGrid1MouseDown() °ú °ÅÀÇ ºñ½ÁÇÏÁö¸¸ °¢ StringGridÀÇ MouseClick() À̺¥Æ®¿¡ »ç¿ëÇÑ´Ù - by monkman (2004.05.27) // ÀÌ ÇÔ¼ö¸¦ µ¹¸é¼­ ´ëÇ¥½ºÅ¸ÀÏÀÌ °°Àº DetailÇÑ °¹¼ö¸¦ ¾Ë¾Æ³½´Ù // StringGrid1MouseDown() À̺¥Æ® ÇÔ¼öÀÇ ¾Æ·¡ ºÎºÐ¿¡¼­ ÀÌ ÇÔ¼ö¸¦ È£ÃâÇØµµ µÇÁö¸¸ ¼Ò½º ÀÌÇØÇϱ⠽±µµ·Ï ±×³É µÎ¾ú´Ù.. TFileInfor *fi; HDC hDC = NULL, dcTemp = NULL; HANDLE hSrch, hFile; String path, filename, directory, temp1, temp2; char *tempchar = "\\"; WIN32_FIND_DATA wfd; bool result = true; STYLEDATAFILEHEADER header; TVecData *data; int Version; int Cnt; BYTE *StyleData = NULL; DWORD dwPos; DWORD dwDataSize; String strStyleID; // µð·ºÅ丮 ¼³Á¤ switch (StyleSort) { case SO_SILHOUETTE: directory = SilDirectory; break; case SO_SLEEVE: directory = SleDirectory; break; case SO_COLLAR: directory = ColDirectory; break; case SO_BELT: directory = BeltDirectory; break; case SO_PANTS: directory = SilDirectory; break; } /////////// Á¶°Ç ¸Â´Â styÆÄÀÏ Ã£¾Æ¼­ FileList¿¡ ³Ö¾îÁÖ±â FileList = new TStringList; path = directory + "\\*.sty"; FileList->Clear(); if ((hSrch = FindFirstFile(path.c_str(), &wfd)) != INVALID_HANDLE_VALUE) { while (result) { filename = directory + "\\" + wfd.cFileName; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); // Version¿¡ µû¶ó ÇØ¾ßÇÒ ÀÛ¾÷ÀÌ ÀÖ´Ù¸é ÀÌ °÷¿¡¼­ ÇÑ´Ù - by monkman (2004.11.03) // 100 : // 200 : // 205 : Gdiplus Àû¿ë ÈÄ º¯°æ (05.03.09) // 206 : groupIndex º¯°æ & gradient fill Ãß°¡ (08.05.08) // 207 : MotiveObject Ãß°¡ - by monkman (2009.04.03) // 500 : (¿µ¿ì ÆÇ¸Å¿ë µ¥ÀÌÅÍ) // 505 : Gdiplus Àû¿ë ÈÄ º¯°æ (05.03.09) // 506 : roupIndex º¯°æ & gradient fill Ãß°¡ (08.05.08) // 507 : MotiveObject Ãß°¡ - by monkman (2009.04.03) if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } switch (StyleSort) { // S0_SILHOUETTE°¡ »óÀÇ ½Ç·ç¿§À¸·Î ¹Ù²î¾úÀ¸¸ç SO_PANTS°¡ ÇÏÀÇ ½Ç·ç¿§À¸·Î Ãß°¡µÊ - by monkman (2004.03.24) case SO_SILHOUETTE: if (header.ESilhouette == DetailStyleItemNum) { // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) && header.Type == MainType && header.Sort == SO_SILHOUETTE) { if (STYFileFindAndToFileListSearch(header)) FileList->Add(filename); } } break; case SO_SLEEVE: if (header.ESleeve == DetailStyleItemNum) { // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) && header.Type == MainType && header.Sort == SO_SLEEVE) { if (STYFileFindAndToFileListSearch(header)) FileList->Add(filename); } } break; case SO_COLLAR: if (header.ECollar == DetailStyleItemNum) { // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) && header.Type == MainType && header.Sort == SO_COLLAR) { if (STYFileFindAndToFileListSearch(header)) FileList->Add(filename); } } break; case SO_BELT: if (header.EBelt == DetailStyleItemNum) { // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) && header.Type == MainType && header.Sort == SO_BELT) { if (STYFileFindAndToFileListSearch(header)) FileList->Add(filename); } } break; case SO_PANTS: if (header.EPants == DetailStyleItemNum) { // ÀÐÀº ÆÄÀÏÀÇ Çì´õ¸¦ üũÇÏ¿© ¸Â´Â ½ºÅ¸ÀÏÀÎÁö üũ - by monkman (2004.03.26) if (header.Division == Division && DSItems.Contains(EType(header.Type)) && DSClothes.Contains(EType(header.Type)) && header.Type == MainType && header.Sort == SO_PANTS) { if (STYFileFindAndToFileListSearch(header)) FileList->Add(filename); } } break; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; result = FindNextFile(hSrch, &wfd); } } FindClose(hSrch); FileList->Sort(); if (ReDrawing) { ////////// ±âÁ¸ÀÇ tagµé ´Ù Áö¿öÁÖ±â while(ImageList4->Count>0) { fi = (TFileInfor *) ImageList4->Last(); if (fi->tBitmap) { delete fi->tBitmap; fi->tBitmap = NULL; } ImageList4->Remove(fi); delete fi; fi = NULL; } /////////// FileList ¾ÈÀÇ ÆÄÀϵéÀ» tagdraw¸¦ ÅëÇØ ImageList¿¡ ³Ö¾îÁÖ±â Cnt = 0; for (int i = 0; i < FileList->Count; i++) { filename = FileList->Strings[i]; // *.sty ÆÄÀÏÀ» ¹öÀü º°·Î ÀÐ°í º¯È¯ÇÑ´Ù - by monkman (2004.03.30) if ((hFile = CreateFile(filename.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto fail; header = VecDraw->ReadSTYFileHeader(hFile, filename, &Version, true); if (!((100 <= Version && Version <= STYSTIFileVersion) || (500 <= Version && Version <= (STYSTIFileVersion+300)))) { // »óÀ§ ¹öÀü üũ - by monkman (2009.05.26) if (hFile) CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } if (500 <= Version) { #ifndef NOT_STYLEDATA_LOCK // HASP°ú üũ ÇÑ´Ù if (!VecDraw->CheckSTYLock(hFile, header)) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; continue; } else break; #endif } 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); TagDataList->Add(data); } if (StyleData) { HeapFree(GetProcessHeap(), 0, StyleData); // ¸Þ¸ð¸® ÇØÁ¦ StyleData = NULL; } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; fi = new TFileInfor; //fi->Depth = i; fi->Depth = Cnt++; // ¹øÈ£ ¼øÀ¸·Î Ç¥½Ã - by monkman (2004.06.14) fi->Path = filename; temp1 = filename.LowerCase(); temp2 = ""; while (char(temp1[temp1.Length()]) != *tempchar) { temp2 = String(temp1[temp1.Length()]) + temp2; temp1.SetLength(temp1.Length()-1); } temp2.SetLength(4); #ifndef WORKSHEET if (temp2 == "user") fi->Name = String(fi->Depth+1) + " User"; // user fileÀΰæ¿ì else fi->Name = String(fi->Depth+1); #else // StyleID ó¸® - by monkman (2011.01.10) strStyleID = String(header.StyleID); fi->Name = String(fi->Depth+1) + " " + strStyleID; if (temp2 == "user") fi->Name += " [User]"; // user fileÀΰæ¿ì #endif if ((fi->tBitmap = new TTexpiaBitmap) == NULL) goto fail; fi->tBitmap->Create(TAG_WIDTH, TAG_HEIGHT, 24); fi->tBitmap->FillRect(Rect(0, 0, TAG_WIDTH, TAG_HEIGHT), clWhite); if ((dcTemp = fi->tBitmap->CreateDC()) == NULL) goto fail; TagDraw(dcTemp, TagDataList, -1, 0, 0, TAG_WIDTH, TAG_HEIGHT); fi->tBitmap->DeleteDC(dcTemp); dcTemp = NULL; ImageList4->Add(fi); while (TagDataList->Count) { // ±×·ÁÁáÀ¸´Ï ºñ¿öÁÖÀÚ data = (TVecData *)TagDataList->First(); delete data; TagDataList->Remove(data); } } StringGrid4->TopRow = 0; } fail : } //--------------------------------------------------------------------------- bool __fastcall TCombiForm::STYFileFindAndToFileListSearch(STYLEDATAFILEHEADER header) { // STYFileFindAndToFileList() ¿¡¼­ °Ë»ö Á¶°ÇÀÌ ÀÖÀ» °æ¿ì ¾Æ·¡ ÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù - by monkman (2004.08.30) bool bEqual; int Year1, Year2; BYTE Season1, Season2, FromSeason, ToSeason; bool bFrom, bTo; String FullText, SearchText; bEqual = false; switch (SelectedStringGrid) { case 1 : fourthyear1 = firstyear1; fourthyear2 = firstyear2; fourthseason1 = firstseason1; fourthseason2 = firstseason2; fourthcomment = firstcomment; break; case 2 : fourthyear1 = secondyear1; fourthyear2 = secondyear2; fourthseason1 = secondseason1; fourthseason2 = secondseason2; fourthcomment = secondcomment; break; case 3 : fourthyear1 = thirdyear1; fourthyear2 = thirdyear2; fourthseason1 = thirdseason1; fourthseason2 = thirdseason2; fourthcomment = thirdcomment; break; } // ¿¬µµ °Ë»ö ¾Ë°í¸®Áò (with celberus) // ÇÁ·Î±×·¥ÀÇ ³»¿ë // ¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¨¦¡¦¡¦¡¦¡¦¡¦¡¦¤ // ¦¢ From ¦¢ To ¦¢ //¦£¦¡¦¡¦«¦¡¦¡¦¨¦¡¦¡¦¡¦«¦¡¦¡¦¨¦¡¦¡¦¡¦© //¦¢»óȲ¦¢Year¦¢Season¦¢Year¦¢Season¦¢ //¦§¦¡¦¡¦«¦¡¦¡¦«¦¡¦¡¦¡¦«¦¡¦¡¦«¦¡¦¡¦¡¦© //¦¢ 1 ¦¢All ¦¢ All ¦¢ All¦¢ All ¦¢ ¸ðµÎ °Ë»ö //¦¢ 2 ¦¢All ¦¢ All ¦¢All ¦¢ O ¦¢ ¸ðµÎ °Ë»ö //¦¢ 3 ¦¢All ¦¢ All ¦¢O ¦¢ All ¦¢ To Year±îÁö ÀÌÀü ¸ðµÎ °Ë»ö //¦¢ 4 ¦¢All ¦¢ All ¦¢O ¦¢ O ¦¢ To Year, Season ÀÌÀü ¸ðµÎ °Ë»ö //¦¢ 5 ¦¢All ¦¢ O ¦¢All ¦¢ All ¦¢ ¸ðµÎ °Ë»ö //¦¢ 6 ¦¢All ¦¢ O ¦¢All ¦¢ O ¦¢ ¿¬µµ¿Í »ó°ü¾øÀÌ From SeasonºÎÅÍ To Season±îÁö °Ë»ö //¦¢ 7 ¦¢All ¦¢ O ¦¢O ¦¢ All ¦¢ To Year±îÁö ÀÌÀü ¸ðµÎ °Ë»ö //¦¢ 8 ¦¢All ¦¢ O ¦¢O ¦¢ O ¦¢ To Year, Season ÀÌÀü ¸ðµÎ °Ë»ö //¦¢ 9 ¦¢O ¦¢ All ¦¢All ¦¢ All ¦¢ From Year ÀÌÈÄ ¸ðµÎ °Ë»ö //¦¢ 10 ¦¢O ¦¢ All ¦¢All ¦¢ O ¦¢ From Year ÀÌÈÄ ¸ðµÎ °Ë»ö //¦¢ 11 ¦¢O ¦¢ All ¦¢O ¦¢ All ¦¢ From Year ºÎÅÍ To Year±îÁö ¸ðµÎ °Ë»ö //¦¢ 12 ¦¢O ¦¢ All ¦¢O ¦¢ O ¦¢ From Year ºÎÅÍ To Year, Season ±îÁö ¸ðµÎ °Ë»ö //¦¢ 13 ¦¢O ¦¢ O ¦¢All ¦¢ All ¦¢ From Year, Season ÀÌÈÄ ¸ðµÎ °Ë»ö //¦¢ 14 ¦¢O ¦¢ O ¦¢All ¦¢ O ¦¢ From Year, Season ÀÌÈÄ ¸ðµÎ °Ë»ö //¦¢ 15 ¦¢O ¦¢ O ¦¢O ¦¢ All ¦¢ From Year, Season ºÎÅÍ To Year ±îÁö ¸ðµÎ °Ë»ö //¦¢ 16 ¦¢O ¦¢ O ¦¢O ¦¢ O ¦¢ From Year, Season ºÎÅÍ To Year, Season ¸ðµÎ °Ë»ö //¦¦¦¡¦¡¦ª¦¡¦¡¦ª¦¡¦¡¦¡¦ª¦¡¦¡¦ª¦¡¦¡¦¡¦¥ // From Season ¼³Á¤ To Season ¼³Á¤ // º½ 00001111 00000001 // ¿©¸§ 00001110 00000011 // °¡À» 00001100 00000111 // °Ü¿ï 00001000 00001111 if (fourthyear1 <= fourthyear2) { Year1 = fourthyear1; Year2 = fourthyear2; Season1 = fourthseason1; Season2 = fourthseason2; } else { Year1 = fourthyear2; Year2 = fourthyear1; Season1 = fourthseason2; Season2 = fourthseason1; } switch (Season1) { case 0 : FromSeason = 15; break; case 1 : FromSeason = 15; break; case 2 : FromSeason = 14; break; case 4 : FromSeason = 12; break; case 8 : FromSeason = 8; break; } switch (Season2) { case 0 : ToSeason = 0; break; case 1 : ToSeason = 1; break; case 2 : ToSeason = 3; break; case 4 : ToSeason = 7; break; case 8 : ToSeason = 15; break; case 15 : ToSeason = 15; break; } bEqual = true; bFrom = false; bTo = false; // Year1°ú Year2°¡ All À̰í Season¸¸ ´Ù¸¦ ¶§.. if (Year1 == MIN_YEAR && Year2 == MAX_YEAR && (Season1 != MIN_SSFW && Season1 != MAX_SSFW) && (Season2 != MIN_SSFW && Season2 != MAX_SSFW)) { // Season1 ÀÌ Season2 º¸´Ù Ŭ ¶§.. if (Season1 > Season2) { switch (Season2) { case 0 : FromSeason = 15; break; case 1 : FromSeason = 15; break; case 2 : FromSeason = 14; break; case 4 : FromSeason = 12; break; case 8 : FromSeason = 8; break; } switch (Season1) { case 0 : ToSeason = 0; break; case 1 : ToSeason = 1; break; case 2 : ToSeason = 3; break; case 4 : ToSeason = 7; break; case 8 : ToSeason = 15; break; case 15 : ToSeason = 15; break; } } if (!((FromSeason & ToSeason) & header.SSFW)) bEqual = false; } // ¿¬µµ°¡ °°À» ¶§.. if (Year1 == Year2) { // Season1 ÀÌ Season2 º¸´Ù Ŭ ¶§.. if (Season1 > Season2) { switch (Season2) { case 0 : FromSeason = 15; break; case 1 : FromSeason = 15; break; case 2 : FromSeason = 14; break; case 4 : FromSeason = 12; break; case 8 : FromSeason = 8; break; } switch (Season1) { case 0 : ToSeason = 0; break; case 1 : ToSeason = 1; break; case 2 : ToSeason = 3; break; case 4 : ToSeason = 7; break; case 8 : ToSeason = 15; break; case 15 : ToSeason = 15; break; } } if ((Year1 == header.Year) && (Season1 == MIN_SSFW || Season1 == MAX_SSFW || Season2 == MIN_SSFW || Season2 == MAX_SSFW)) { bFrom = true; bTo = true; } else { if ((Year1 == header.Year) && ((FromSeason & ToSeason) & header.SSFW)) { bFrom = true; bTo = true; } } if (!(bFrom && bTo)) bEqual = false; } else { // ¿¬µµ°¡ ´Ù¸¦ ¶§.. if (Year1 <= header.Year && (Season1 == MIN_SSFW || Season1 == MAX_SSFW)) { // Season1 ÀÌ All ÀÏ ¶§.. bFrom = true; } else { if (Year1 < header.Year || ((Year1 == header.Year) && (FromSeason & header.SSFW))) bFrom = true; } if (Year2 >= header.Year && (Season2 == MAX_SSFW || Season2 == MAX_SSFW)) { // Season2 °¡ All ÀÏ ¶§.. bTo = true; } else { if (Year2 > header.Year || ((Year2 == header.Year) && (ToSeason & header.SSFW))) bTo = true; } if (!(bFrom && bTo)) bEqual = false; } if (bEqual) { if (!fourthcomment.IsEmpty()) { bEqual = false; FullText = String(header.Comment); if (!FullText.IsEmpty()) { FullText = FullText.LowerCase(); SearchText = fourthcomment.LowerCase(); for (int j = 1; j < 100; j++) { if (FullText.SubString(j, SearchText.Length()) == SearchText) { bEqual = true; break; } } if (!bEqual) bEqual = false; else bEqual = true; } } else bEqual = true; } return bEqual; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbAllNoneClick(TObject *Sender) { // ¼±ÅÃµÈ °ÍµéÀ» ÀüºÎ ÃʱâÈ­ ÇÏ´Â ºÎºÐ - by monkman (2004.05.31) TFileInfor *fi; HDC hDC; // ¸Þ½ÃÁö : ¼±ÅÃÀÌ ÇØÁ¦ µË´Ï´Ù. ÀÌ ÀÛ¾÷À» ¼öÇàÇϽðڽÀ´Ï±î? if (MessageDlg(IDS_MESSAGE12, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrNo) return; for (int i = 0; i < 80; i++) { // »óÀÇ if (combobxUpperLower->ItemIndex == 0) { // StringGrid1 if (i < ImageList1->Count) { fi = (TFileInfor*) ImageList1->Items[i]; if (CheckedSilhouette.Contains(EDetailSilhouette(fi->Depth))) { fi->Name = VecDraw->SilhouetteName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedSilhouette[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); } } } // StringGrid2 if (i < ImageList2->Count) { fi = (TFileInfor*) ImageList2->Items[i]; if (CheckedSleeve.Contains(EDetailSleeve(fi->Depth))) { fi->Name = VecDraw->SleeveName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedSleeve[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); } } } // StringGrid3 if (i < ImageList3->Count) { fi = (TFileInfor*) ImageList3->Items[i]; if (CheckedCollar.Contains(EDetailCollar(fi->Depth))) { fi->Name = VecDraw->CollarName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedCollar[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); } } } } else if (combobxUpperLower->ItemIndex == 1) { // StringGrid1 if (i < ImageList1->Count) { fi = (TFileInfor*) ImageList1->Items[i]; if (CheckedPants.Contains(EDetailPants(fi->Depth))) { fi->Name = VecDraw->PantsName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedPants[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); } } } // StringGrid2 if (i < ImageList2->Count) { fi = (TFileInfor*) ImageList2->Items[i]; if (CheckedBelt.Contains(EDetailBelt(fi->Depth))) { fi->Name = VecDraw->BeltName[fi->Depth]; // ¿ø·¡´ë·Î if (bCheckedBelt[fi->Depth]) { if ((hDC = fi->tBitmap->CreateDC()) == NULL) goto fail; BitBlt(hDC, 0, 0, fi->tBitmap->Width, fi->tBitmap->Height, hDC, 0, 0, NOTSRCCOPY); fi->tBitmap->DeleteDC(hDC); } } } } } // ¼±ÅÃµÈ °ÍµéÀ» ÀüºÎ ÃʱâÈ­ ÇÑ´Ù - by monkman (2004.05.31) CheckedSilhouette.Clear(); CheckedSleeve.Clear(); CheckedCollar.Clear(); CheckedPants.Clear(); CheckedBelt.Clear(); SrcFileList->Clear(); SrcFileBackupList->Clear(); memset(&CheckedOldSilhouette, 0, sizeof(int)*100); CheckedOldSilhouetteCounter = 0; // ¹öÀü 100ÀÎ ÆÄÀÏÀÇ ¼±ÅÃµÈ °³¼ö¸¦ üũ // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(bCheckedOldSilhouette, 0, sizeof(bool)*100); memset(bCheckedSilhouette, 0, sizeof(bool)*MAX_SIL); memset(bCheckedSleeve, 0, sizeof(bool)*MAX_SLE); memset(bCheckedCollar, 0, sizeof(bool)*MAX_COL); memset(bCheckedPants, 0, sizeof(bool)*MAX_PANTS); memset(bCheckedBelt, 0, sizeof(bool)*MAX_BELT); // ´ëÇ¥½ºÅ¸ÀϺ°·Î ¹è¿­¸¸Å­ ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(DetailSilhouette, 0, sizeof(BYTE)*MAX_SIL*MAX_DETAIL); memset(DetailSleeve, 0, sizeof(BYTE)*MAX_SLE*MAX_DETAIL); memset(DetailCollar, 0, sizeof(BYTE)*MAX_COL*MAX_DETAIL); memset(DetailPants, 0, sizeof(BYTE)*MAX_PANTS*MAX_DETAIL); memset(DetailBelt, 0, sizeof(BYTE)*MAX_BELT*MAX_DETAIL); // ´ëÇ¥½ºÅ¸ÀϺ°·Î DetailÇÏ°Ô ¼±ÅÃµÈ CountÀÇ ¼ö ÃʱâÈ­ - by monkman (2004.05.18) - with celberus memset(CheckedDetailSilhouetteCounter, 0, sizeof(int)*MAX_SIL); memset(CheckedDetailSleeveCounter, 0, sizeof(int)*MAX_SLE); memset(CheckedDetailCollarCounter, 0, sizeof(int)*MAX_COL); memset(CheckedDetailPantsCounter, 0, sizeof(int)*MAX_PANTS); memset(CheckedDetailBeltCounter, 0, sizeof(int)*MAX_BELT); CheckedDetailTempCounter = 0; memset(DetailTemp, 0, sizeof(BYTE)*MAX_DETAIL); Panel3->Visible = false; Panel1->Enabled = true; Panel2->Enabled = true; spdbtnNext->Enabled = true; StringGrid1->Repaint(); StringGrid2->Repaint(); StringGrid3->Repaint(); // ¹öư ÃʱâÈ­ sbCopyFiles->Enabled = false; sbMoveFiles->Enabled = false; sbDeleteFiles->Enabled = true; sbDeleteFiles2->Enabled = false; shCopyFiles->Enabled = false; shMoveFiles->Enabled = false; shDeleteFiles2->Enabled = false; fail : } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid4MouseWheelDown(TObject *Sender, TShiftState Shift, TPoint &MousePos, bool &Handled) { bWheelMode = true; // ¸¶¿ì½º ÈÙ °¨Áö¸¦ À§ÇØ - by monkman (2004.06.15) } //--------------------------------------------------------------------------- void __fastcall TCombiForm::StringGrid4MouseWheelUp(TObject *Sender, TShiftState Shift, TPoint &MousePos, bool &Handled) { bWheelMode = true; // ¸¶¿ì½º ÈÙ °¨Áö¸¦ À§ÇØ - by monkman (2004.06.15) } //--------------------------------------------------------------------------- // ±âº» µð·ºÅ丮 º¯°æÀ» À§ÇØ - by monkman (2004.07.23) void __fastcall TCombiForm::sbChangeBaseDirectoryClick(TObject *Sender) { String Msg; String strOldRootPath; shChangeBaseDirectory->Pen->Color = clRed; strOldRootPath = strRootPath; strRootPath = BaseDirectoryDialogFunc("Combination", strRootPath); Msg = IDS_MESSAGE13 + strRootPath + IDS_MESSAGE14; if (strOldRootPath.LowerCase() != strRootPath.LowerCase()) { // ¸Þ½ÃÁö : ±âº» Æú´õ°¡ <Æú´õ¸í>·Î º¯°æµÇ¾ú½À´Ï´Ù. MessageDlg(Msg, mtInformation, TMsgDlgButtons() << mbOK, 0); FindFolder(strRootPath + "\\*.*"); if (comboSource->Items->Count >= 0) { comboSource->ItemIndex = 0; SrcDirectory = comboSource->Items->Strings[comboSource->ItemIndex]; DirectoryStyle = strRootPath + "\\" + SrcDirectory; lbPath->Caption = "[ " + lbSource->Caption + " ] " + DirectoryStyle; } comboSourceChange(this); } shChangeBaseDirectory->Pen->Color = clBlack; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::comboYearChange(TObject *Sender) { // TComboBox *comboYear; // // comboYear = (TComboBox *)Sender; // // // switch (comboYear->Tag) { // case 1 : // // ÇÑÂÊÀÌ AllÀÏ °æ¿ì ´Ù¸¥Âʵµ All·Î ¸ÂÃç ÁÜ // if (comboYear->ItemIndex == 0) { // comboYearTo1->ItemIndex = 0; // comboYearTo1->Text = comboYearTo1->Items->Strings[comboYearTo1->ItemIndex]; // comboSeasonFrom1->ItemIndex = 0; // comboSeasonFrom1->Text = comboSeasonFrom1->Items->Strings[comboSeasonFrom1->ItemIndex]; // comboSeasonTo1->ItemIndex = 0; // comboSeasonTo1->Text = comboSeasonTo1->Items->Strings[comboSeasonTo1->ItemIndex]; // } // break; // case 2 : // // ÇÑÂÊÀÌ AllÀÏ °æ¿ì ´Ù¸¥Âʵµ All·Î ¸ÂÃç ÁÜ // if (comboYear->ItemIndex == 0) { // comboYearFrom1->ItemIndex = 0; // comboYearFrom1->Text = comboYearFrom1->Items->Strings[comboYearFrom1->ItemIndex]; // comboSeasonFrom1->ItemIndex = 0; // comboSeasonFrom1->Text = comboSeasonFrom1->Items->Strings[comboSeasonFrom1->ItemIndex]; // comboSeasonTo1->ItemIndex = 0; // comboSeasonTo1->Text = comboSeasonTo1->Items->Strings[comboSeasonTo1->ItemIndex]; // } // break; // case 3 : // // ÇÑÂÊÀÌ AllÀÏ °æ¿ì ´Ù¸¥Âʵµ All·Î ¸ÂÃç ÁÜ // if (comboYear->ItemIndex == 0) { // comboYearTo2->ItemIndex = 0; // comboYearTo2->Text = comboYearTo2->Items->Strings[comboYearTo2->ItemIndex]; // comboSeasonFrom2->ItemIndex = 0; // comboSeasonFrom2->Text = comboSeasonFrom2->Items->Strings[comboSeasonFrom2->ItemIndex]; // comboSeasonTo2->ItemIndex = 0; // comboSeasonTo2->Text = comboSeasonTo2->Items->Strings[comboSeasonTo2->ItemIndex]; // } // break; // case 4 : // // ÇÑÂÊÀÌ AllÀÏ °æ¿ì ´Ù¸¥Âʵµ All·Î ¸ÂÃç ÁÜ // if (comboYear->ItemIndex == 0) { // comboYearFrom2->ItemIndex = 0; // comboYearFrom2->Text = comboYearFrom2->Items->Strings[comboYearFrom2->ItemIndex]; // comboSeasonFrom2->ItemIndex = 0; // comboSeasonFrom2->Text = comboSeasonFrom2->Items->Strings[comboSeasonFrom2->ItemIndex]; // comboSeasonTo2->ItemIndex = 0; // comboSeasonTo2->Text = comboSeasonTo2->Items->Strings[comboSeasonTo2->ItemIndex]; // } // break; // case 5 : // // ÇÑÂÊÀÌ AllÀÏ °æ¿ì ´Ù¸¥Âʵµ All·Î ¸ÂÃç ÁÜ // if (comboYear->ItemIndex == 0) { // comboYearTo3->ItemIndex = 0; // comboYearTo3->Text = comboYearTo3->Items->Strings[comboYearTo3->ItemIndex]; // comboSeasonFrom3->ItemIndex = 0; // comboSeasonFrom3->Text = comboSeasonFrom3->Items->Strings[comboSeasonFrom3->ItemIndex]; // comboSeasonTo3->ItemIndex = 0; // comboSeasonTo3->Text = comboSeasonTo3->Items->Strings[comboSeasonTo3->ItemIndex]; // } // break; // case 6 : // // ÇÑÂÊÀÌ AllÀÏ °æ¿ì ´Ù¸¥Âʵµ All·Î ¸ÂÃç ÁÜ // if (comboYear->ItemIndex == 0) { // comboYearFrom3->ItemIndex = 0; // comboYearFrom3->Text = comboYearFrom3->Items->Strings[comboYearFrom3->ItemIndex]; // comboSeasonFrom3->ItemIndex = 0; // comboSeasonFrom3->Text = comboSeasonFrom3->Items->Strings[comboSeasonFrom3->ItemIndex]; // comboSeasonTo3->ItemIndex = 0; // comboSeasonTo3->Text = comboSeasonTo3->Items->Strings[comboSeasonTo3->ItemIndex]; // } // break; // default : // break; // } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::comboCommentClick(TObject *Sender) { TComboBox *comboComment; comboComment = (TComboBox *)Sender; comboComment->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::comboCommentKeyUp(TObject *Sender, WORD &Key, TShiftState Shift) { // ¹Ýµå½Ã ÆûÀÇ KeyPreview ¼Ó¼ºÀ» true·Î ÇØÁÖ¾î¾ß Çϰí, // ÀÌ ¸Þ½ÃÁö´Â MainImageForm->iMainImageKeyDown()¿¡ ¿µÇâÀ» ¹ÌÃļ­ // Ű À̺¥Æ®¸¦ ¿­¾îÁØ´Ù - by monkman (2004.08.05) MainImageForm->KeyPreview = false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbSearchConditionClick(TObject *Sender) { TSpeedButton *sbSearch; TComboBox *comboYearFrom; TComboBox *comboYearTo; TComboBox *comboSeasonFrom; TComboBox *comboSeasonTo; TComboBox *comboComment; int *nYearFrom; int *nYearTo; BYTE *cSeasonFrom; BYTE *cSeasonTo; String *strComment; sbSearch = (TSpeedButton *)Sender; switch (sbSearch->Tag) { case 1 : comboYearFrom = comboYearFrom1; comboYearTo = comboYearTo1; comboSeasonFrom = comboSeasonFrom1; comboSeasonTo = comboSeasonTo1; comboComment = comboComment1; nYearFrom = &firstyear1; nYearTo = &firstyear2; cSeasonFrom = &firstseason1; cSeasonTo = &firstseason2; strComment = &firstcomment; break; case 2 : comboYearFrom = comboYearFrom2; comboYearTo = comboYearTo2; comboSeasonFrom = comboSeasonFrom2; comboSeasonTo = comboSeasonTo2; comboComment = comboComment2; nYearFrom = &secondyear1; nYearTo = &secondyear2; cSeasonFrom = &secondseason1; cSeasonTo = &secondseason2; strComment = &secondcomment; break; case 3 : comboYearFrom = comboYearFrom3; comboYearTo = comboYearTo3; comboSeasonFrom = comboSeasonFrom3; comboSeasonTo = comboSeasonTo3; comboComment = comboComment3; nYearFrom = &thirdyear1; nYearTo = &thirdyear2; cSeasonFrom = &thirdseason1; cSeasonTo = &thirdseason2; strComment = &thirdcomment; break; default : break; } if (!comboYearFrom->Text.IsEmpty() && comboYearFrom->Text != "All") { try { if (StrToInt(comboYearFrom->Text) >= 0) { *nYearFrom = StrToInt(comboYearFrom->Text); } else { // ¸Þ½ÃÁö : "¿¬µµ´Â ¾ç¼ö¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE16, mtError, TMsgDlgButtons() << mbOK, 0); } } catch (Exception &e) { // ¸Þ½ÃÁö : "¿¬µµ´Â ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE01, mtError, TMsgDlgButtons() << mbOK, 0); return; } } else if (comboYearFrom->Text == "All") { *nYearFrom = MIN_YEAR; } if (!comboSeasonFrom->Text.IsEmpty() && comboSeasonFrom->Text != "All") { // None, Spring, Summer, Fall, Winter üũ - by monkman (2004.08.02) switch (comboSeasonFrom->ItemIndex) { // None case 0 : *cSeasonFrom = 0; break; // Spring case 1 : *cSeasonFrom = 1; break; // Summer case 2 : *cSeasonFrom = 2; break; // Fall case 3 : *cSeasonFrom = 4; break; // Winter case 4 : *cSeasonFrom = 8; break; default : *cSeasonFrom = 15; break; } } else if (comboSeasonFrom->Text == "All") { *cSeasonFrom = MIN_SSFW; } if (!comboYearTo->Text.IsEmpty() && comboYearTo->Text != "All") { try { *nYearTo = StrToInt(comboYearTo->Text); } catch (Exception &e) { // ¸Þ½ÃÁö : "¿¬µµ´Â ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." MessageDlg(IDS_MESSAGE01, mtError, TMsgDlgButtons() << mbOK, 0); return; } } else if (comboYearTo->Text == "All") { *nYearTo = MAX_YEAR; } if (!comboSeasonTo->Text.IsEmpty() && comboSeasonTo->Text != "All") { // None, Spring, Summer, Fall, Winter üũ - by monkman (2004.08.02) switch (comboSeasonTo->ItemIndex) { // None case 0 : *cSeasonTo = 15; break; // Spring case 1 : *cSeasonTo = 1; break; // Summer case 2 : *cSeasonTo = 2; break; // Fall case 3 : *cSeasonTo = 4; break; // Winter case 4 : *cSeasonTo = 8; break; default : *cSeasonTo = 15; break; } } else if (comboSeasonTo->Text == "All") { *cSeasonTo = MAX_SSFW; } *strComment = comboComment->Text; // ÀÌÀü¿¡ °Ë»öÇß´ø °Ë»ö¾î¿Í °°Àº °ÍÀÌ ¾øÀ¸¸é comboComment¿¡ Ãß°¡ÇÏ°í ±×·¸Áö ¾ÊÀ¸¸é Ãß°¡ÇÏÁö ¾Ê´Â´Ù bool bCommentExist = false; for (int i = 0; i < comboComment->Items->Count; i++) { if (comboComment->Text.LowerCase() == comboComment->Items->Strings[i].LowerCase()) bCommentExist = true; } if (!bCommentExist) comboComment->Items->Add(comboComment->Text); switch (sbSearch->Tag) { case 1 : STYSearch1(); // °Ë»ö break; case 2 : STYSearch2(); // °Ë»ö break; case 3 : STYSearch3(); // °Ë»ö break; } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::sbSearchNoneClick(TObject *Sender) { TSpeedButton *sbNone; sbNone = (TSpeedButton *)Sender; switch (sbNone->Tag) { case 1 : firstyear1 = MIN_YEAR; firstyear2 = MAX_YEAR; firstseason1 = MIN_SSFW; firstseason2 = MAX_SSFW; firstcomment = ""; comboYearFrom1->ItemIndex = 0; comboYearFrom1->Text = comboYearFrom1->Items->Strings[comboYearFrom1->ItemIndex]; comboSeasonFrom1->ItemIndex = 0; comboSeasonFrom1->Text = comboSeasonFrom1->Items->Strings[comboSeasonFrom1->ItemIndex]; comboYearTo1->ItemIndex = 0; comboYearTo1->Text = comboYearTo1->Items->Strings[comboYearTo1->ItemIndex]; comboSeasonTo1->ItemIndex = 0; comboSeasonTo1->Text = comboSeasonTo1->Items->Strings[comboSeasonTo1->ItemIndex]; comboComment1->Text = ""; break; case 2 : secondyear1 = MIN_YEAR; secondyear2 = MAX_YEAR; secondseason1 = MIN_SSFW; secondseason2 = MAX_SSFW; secondcomment = ""; comboYearFrom2->ItemIndex = 0; comboYearFrom2->Text = comboYearFrom2->Items->Strings[comboYearFrom2->ItemIndex]; comboSeasonFrom2->ItemIndex = 0; comboSeasonFrom2->Text = comboSeasonFrom2->Items->Strings[comboSeasonFrom2->ItemIndex]; comboYearTo2->ItemIndex = 0; comboYearTo2->Text = comboYearTo2->Items->Strings[comboYearTo2->ItemIndex]; comboSeasonTo2->ItemIndex = 0; comboSeasonTo2->Text = comboSeasonTo2->Items->Strings[comboSeasonTo2->ItemIndex]; comboComment2->Text = ""; break; case 3 : thirdyear1 = MIN_YEAR; thirdyear2 = MAX_YEAR; thirdseason1 = MIN_SSFW; thirdseason2 = MAX_SSFW; thirdcomment = ""; comboYearFrom3->ItemIndex = 0; comboYearFrom3->Text = comboYearFrom3->Items->Strings[comboYearFrom3->ItemIndex]; comboSeasonFrom3->ItemIndex = 0; comboSeasonFrom3->Text = comboSeasonFrom3->Items->Strings[comboSeasonFrom3->ItemIndex]; comboYearTo3->ItemIndex = 0; comboYearTo3->Text = comboYearTo3->Items->Strings[comboYearTo3->ItemIndex]; comboSeasonTo3->ItemIndex = 0; comboSeasonTo3->Text = comboSeasonTo3->Items->Strings[comboSeasonTo3->ItemIndex]; comboComment3->Text = ""; break; default : break; } } //--------------------------------------------------------------------------- void __fastcall TCombiForm::pnSTYPreviewMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { pbSTYPreviewBackground->SendToBack(); pbSTYPreviewBackground->Enabled = false; pbSTYPreviewBackground->Visible = false; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::pbSTYPreviewFrontPaint(TObject *Sender) { // ÆäÀÎÆ® ¹Ú½º¿¡ ¾Õ¸éÀ» »Ñ·ÁÁØ´Ù - by monkman (2004.08.06) //VecDraw->ArbitraryDraw(pbSTYPreviewFront->Canvas->Handle, PreviewFrontList, pbSTYPreviewFront->Width, pbSTYPreviewFront->Height, 0, 0.35); VecDraw->DrawVector(pbSTYPreviewFront->Canvas->Handle, PreviewFrontList, -1, 0, 0, pbSTYPreviewFront->Width, pbSTYPreviewFront->Height, 0.0, true); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::pbSTYPreviewBackPaint(TObject *Sender) { // ÆäÀÎÆ® ¹Ú½º¿¡ µÞ¸éÀ» »Ñ·ÁÁØ´Ù - by monkman (2004.08.06) //VecDraw->ArbitraryDraw(pbSTYPreviewBack->Canvas->Handle, PreviewBackList, pbSTYPreviewBack->Width, pbSTYPreviewBack->Height, 1, 0.35); VecDraw->DrawVector(pbSTYPreviewBack->Canvas->Handle, PreviewBackList, -1, 0, 0, pbSTYPreviewBack->Width, pbSTYPreviewBack->Height, 0.0, true); } //--------------------------------------------------------------------------- void __fastcall TCombiForm::STYDetailSelectedSave(String strSelectedDetailDirectory) { // Style.ini ÆÄÀÏ¿¡¼­ ¾ò¾î¿Â STYPath °ª - by monkman (2004.10.12) TIniFile *IniFile = NULL; IniFile = new TIniFile(AppDataItem+"\\Style.ini"); if (IniFile) { IniFile->WriteString("Combination", "Directory", strSelectedDetailDirectory); delete IniFile; } IniFile = NULL; } //--------------------------------------------------------------------------- void __fastcall TCombiForm::comboCommentDblClick(TObject *Sender) { TComboBox *comboComment; comboComment = (TComboBox *)Sender; comboComment->SetFocus(); } //---------------------------------------------------------------------------