//--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "Window.h" #include "MainImage.h" #include "Main.h" //2001.4.3. by lhskys ÀÛ¾÷±¸¿ª save #include "Fullview.h" #include "LogData.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "Selector" #pragma link "RzButton" #pragma link "RzRadChk" #pragma link "RzEdit" #pragma link "RzSpnEdt" #pragma link "RzBckgnd" #pragma link "RzCmboBx" #pragma link "RzLabel" #pragma link "RzPanel" #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_SHAPE StringTable[0] #define IDS_FULL StringTable[1] #define IDS_IRREGULAR StringTable[2] #define IDS_OFF StringTable[3] #define IDS_SET StringTable[4] #define IDS_ADDITION StringTable[5] #define IDS_SUBTRACTION StringTable[6] #define IDS_DELETEPT StringTable[7] #define IDS_CLOSE StringTable[8] #define IDS_SURFACEMULTI StringTable[9] #define IDS_BORDER StringTable[10] #define IDS_SURFACESINGLE StringTable[11] #define IDS_MAGIC StringTable[12] #define IDS_SURFACE StringTable[13] #define IDS_MULTISURFACEFILL StringTable[14] #define IDS_BORDERFILL StringTable[15] #define IDS_SINGLESURFACEFILL StringTable[16] #define IDS_STACK StringTable[17] #define IDS_SWAP StringTable[18] #define IDS_Similar StringTable[19] #define IDS_gbmagic StringTable[20] #define IDS_bnRun StringTable[21] #define IDS_lbMagic StringTable[22] #define IDS_lbTolerance StringTable[23] #define IDS_FastMethod StringTable[24] #define IDS_SlowMethod StringTable[25] #define IDS_TRANSFORMREGION StringTable[27] //--------------------------------------------------------------------------- TWindowForm *WindowForm; //--------------------------------------------------------------------------- __fastcall TWindowForm::TWindowForm(TComponent* Owner) : TForm(Owner) { BEGIN_LOG(""); hWnd = ((TWinControl *)Owner)->Handle; //=============================== 2001.3.27 lhskys FormCreate(TObject *Sender)³»¿ë ¿Å±è //===================================================================== StringTable.Create(DirectoryBin, Language, "Window"); SetSmallFont(Font); //sbShape->Caption = IDS_SHAPE; //sbFull->Caption = IDS_FULL; //sbIrregular->Caption = IDS_IRREGULAR; //sbOff->Caption = IDS_OFF; //sbOutline->Caption = IDS_COMMON_OUTLINE; //sbUndo->Caption = IDS_COMMON_UNDO; rzbitbtnRunUndo->Caption = IDS_bnRun; rbSet->Caption = IDS_SET; rbAddition->Caption = IDS_ADDITION; rbSubtraction->Caption = IDS_SUBTRACTION; lbShape->Caption = IDS_COMMON_SIZE; rzmtbtShape->Hint = IDS_SHAPE; rzmtbtIrregular->Hint = IDS_IRREGULAR; rzmtbtOutline->Hint = IDS_COMMON_OUTLINE; rzmtbtFull->Hint = IDS_FULL; rzmtbtOff->Hint = IDS_OFF; rzmtbtUndo->Hint = IDS_COMMON_UNDO; //sbShapeRectangle->Caption = IDS_COMMON_RECTANGLE; //sbShapeEllipse->Caption = IDS_COMMON_ELLIPSE; //sbShapeCircle->Caption = IDS_COMMON_CIRCLE; //sbShapeSquare->Caption = IDS_COMMON_SQUARE; miShapeSquare->Caption = IDS_COMMON_SQUARE; miShapeRectangle->Caption = IDS_COMMON_RECTANGLE; miShapeCircle->Caption = IDS_COMMON_CIRCLE; miShapeEllipse->Caption = IDS_COMMON_ELLIPSE; cbIrreCurve->Caption = IDS_COMMON_CURVE; sbIrreDelete->Caption = IDS_DELETEPT; sbIrreClose->Caption = IDS_CLOSE; //sbOutlineSurfaceMulti->Caption = IDS_SURFACEMULTI; //sbOutlineBorder->Caption = IDS_BORDER; //sbOutlineSurfaceSingle->Caption = IDS_SURFACESINGLE; if (MainImageForm->iMainImage->uBitmap->BitsPerPixel == 8) { miOutlineSurfaceSingle->Caption = IDS_SURFACESINGLE; miOutlineSurfaceMulti->Caption = IDS_SURFACEMULTI; miOutlineSurfaceMulti->Bitmap->Assign(miOutlineMultiImg->Bitmap); } else { miOutlineSurfaceSingle->Caption = IDS_SURFACE; miOutlineSurfaceMulti->Caption = IDS_MAGIC; miOutlineSurfaceMulti->Bitmap->Assign(miOutlineMagicImg->Bitmap); } miOutlineBorder->Caption = IDS_BORDER; //gbSurfaceMulti->Caption = IDS_SURFACEMULTI; cbSurfaceMulti->Caption = IDS_COMMON_POSITION; sbSurfaceMultiNew->Hint = IDS_COMMON_NEW; sbSurfaceMultiAll->Hint = IDS_COMMON_ALL; sbSurfaceMultiOne->Hint = IDS_COMMON_BLOCKCOLOR; sbSurfaceMultiDelete->Hint = IDS_COMMON_INSERTCOLOR; sbSurfaceMultiBefore->Hint = IDS_COMMON_BEFORECOLOR; //sbOutlineBorder->Hint = IDS_BORDERFILL; rbSwap->Caption = IDS_SWAP; rbStack->Caption = IDS_STACK; //=================================================================== Similar->Caption = IDS_Similar; gbmagic->Caption = IDS_gbmagic; bnRun->Caption = IDS_bnRun; lbMagic->Caption = IDS_lbMagic; lbTolerance->Caption = IDS_lbTolerance; cbMagic->Items->Strings[0] = IDS_FastMethod; cbMagic->Items->Strings[1] = IDS_SlowMethod; ShapePopup->Caption = IDS_SHAPE; IrregularPopup->Caption = IDS_IRREGULAR; OutlinePopup->Caption = IDS_COMMON_OUTLINE; FullPopup->Caption = IDS_FULL; OffPopup->Caption = IDS_OFF; // InvertRegionPopup->Caption = IDS_INVERTREGION; TransformRegionPopup->Caption = IDS_TRANSFORMREGION; Rectangle1->Caption = IDS_COMMON_RECTANGLE; Square1->Caption = IDS_COMMON_SQUARE; Circle1->Caption = IDS_COMMON_CIRCLE; Ellipse1->Caption = IDS_COMMON_ELLIPSE; SurfaceMulti1->Caption = IDS_SURFACEMULTI; SurfaceSingle1->Caption = IDS_SURFACESINGLE; Border1->Caption = IDS_BORDER; //=================================================================== Height = 110; //90; //pnUndo->Top = Panel->Height; //ClientHeight = pnUndo->Top+pnUndo->Height; //pnUndo->Visible = true; //maneupdate = true; //================================================== END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::FormCreate(TObject *Sender) { workAreaMenu = new TWorkAreaMenu; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::FormDestroy(TObject *Sender) { //codegaurd¸¦ ÅëÇØ¼­ È®ÀÎÇßÀ½. »ý¼ºÇϰí Áö¿ìÁö ¾Ê´Â °æ¿ì°¡ ÀÖ¾úÀ½. //ÀϹÝÀûÀ¸·Î ExitForm()¿¡¼­ Áö¿ìµµ·Ï µÇ¾î ÀÖÀ½. Windowlib_F¿¡¼­ »ç¿ëµÇ´Âµ¥ //±× ºÎºÐ¿¡ ¿µÇâÀ» ¹ÞÀº °Í °°À½. by david 081223 if (workAreaMenu) delete workAreaMenu; workAreaMenu = NULL; } //--------------------------------------------------------------------------- // Public Method //--------------------------------------------------------------------------- void __fastcall TWindowForm::InitForm() { BEGIN_LOG(""); /// °¢ Formµé µ¶¸³ÀûÀ¸·Î °ü¸®Çϱâ À§ÇØ ÁÖ¼®Ã³¸® //ParentHeight = Parent->Height+20; csSurfaceMulti->SetPalette(MainImageForm->Palette); workAreaMenu->Create(); workAreaMenu->MakeMenuHintByShortcut(); workAreaMenu->InitMenu(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::ExitForm() { BEGIN_LOG(""); workAreaMenu->Close(this); if (workAreaMenu) delete workAreaMenu; workAreaMenu = NULL; END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImageChange() { // } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImageMouseDown(TMouseButton Button, TShiftState Shift, int X, int Y) { BEGIN_LOG(""); workAreaMenu->iMainImageMouseDown(this, Button, Shift, X, Y); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImageMouseMove(TShiftState Shift, int X, int Y) { BEGIN_LOG(""); workAreaMenu->iMainImageMouseMove(this, Shift, X, Y); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImageMouseUp(TShiftState Shift, int X, int Y) { BEGIN_LOG(""); workAreaMenu->iMainImageMouseUp(this, NULL, Shift, X, Y); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImagePaint() { BEGIN_LOG(""); workAreaMenu->iMainImagePaint(this); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImageKeyDown(WORD Key, TShiftState Shift)//lhskys x,yȰ¿ë ºÒ±ÔÄ¢¿¡¼­ { BEGIN_LOG(""); workAreaMenu->iMainImageKeyDown(this, Key, Shift); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::iMainImageKeyUp(int Key) //lhskys z۸¦ ´­·¶´Ù°¡ ³õ¾ÒÀ»¶§ { BEGIN_LOG(""); workAreaMenu->iMainImageKeyUp(this, Key); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::WindowOff() { BEGIN_LOG(""); workAreaMenu->WindowOff(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::WindowFull() { BEGIN_LOG(""); workAreaMenu->WindowFull(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::InitItem(TWindowItem item) { BEGIN_LOG(""); workAreaMenu->InitItem(item); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::ExitItem() { BEGIN_LOG(""); workAreaMenu->ExitItem(); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::SetSubItem(TWindowSubItem subItem) { workAreaMenu->SubItem = subItem; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::EditorSelectAll(TObject *Sender) { SetFocusAndSelectAll(Sender); } //--------------------------------------------------------------------------- void __fastcall TWindowForm::ExecuteHotKey(String commmand) { BEGIN_LOG(""); workAreaMenu->ExecuteHotKey(commmand); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::FormClose(TObject *Sender, TCloseAction &Action) { BEGIN_LOG(""); PostMessage(hWnd, TPM_EXITFUNCTION, 0, 0); END_LOG; } //--------------------------------------------------------------------------- void __fastcall TWindowForm::ChangeUnit(TUnit CUnit) { if (workAreaMenu) workAreaMenu->ShowWorkAreaSize(); } //---------------------------------------------------------------------------