//--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "TexturePrint.h" #include "common.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TPSpin" #pragma resource "*.dfm" #define IDS_SMALL StringTable[0] #define IDS_MEDIUM StringTable[1] #define IDS_LARGE StringTable[2] #define IDS_SAVE StringTable[3] //--------------------------------------------------------------------------- TTexturePrintForm *TexturePrintForm; //--------------------------------------------------------------------------- __fastcall TTexturePrintForm::TTexturePrintForm(TComponent* Owner) : TForm(Owner) { SetSmallFont(Font); StringTable.Create(DirectoryItem, Language, "TexturePrint"); Caption = IDS_COMMON_PRINTSETUP; lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; for (int i = 0; i < 3; i++) { cbMethod->Items->Strings[i] = IDS_COMMON_PRINTMETHOD + " - " + AnsiString(i+1); } Label1->Caption = IDS_COMMON_PAGE; btnSetup->Caption = IDS_COMMON_SETUP; btnOK->Caption = IDS_COMMON_BUTTONOK; btnCancel->Caption = IDS_COMMON_BUTTONCANCEL; rgSize->Caption = IDS_COMMON_SIZE; GroupBox->Caption = IDS_COMMON_REPEAT; rgSize->Items->Strings[0] = IDS_SMALL; rgSize->Items->Strings[1] = IDS_MEDIUM; rgSize->Items->Strings[2] = IDS_LARGE; btnSave->Caption = IDS_SAVE; } //--------------------------------------------------------------------------- void __fastcall TTexturePrintForm::FormCreate(TObject *Sender) { TIniFile *IniFile = new TIniFile(DirectoryItem + "\\Environment.ini"); if (IniFile) { cbMethod->ItemIndex = IniFile->ReadBool("Printer", "Method", 0); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TTexturePrintForm::FormDestroy(TObject *Sender) { TIniFile *IniFile = new TIniFile(DirectoryItem + "\\Environment.ini"); if (IniFile) { IniFile->WriteBool("Printer", "Method", cbMethod->ItemIndex); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TTexturePrintForm::btnSetupClick(TObject *Sender) { PrinterSetup->Execute(); lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; } //--------------------------------------------------------------------------- void __fastcall TTexturePrintForm::btnSaveClick(TObject *Sender) { int rx = spEditX->Value; int ry = spEditY->Value; int size = rgSize->ItemIndex; size = size ? (size == 1 ? 16 : 32) : 8; if (FOnSave) FOnSave(rx, ry, size); } //---------------------------------------------------------------------------