//--------------------------------------------------------------------------- #include #include #pragma hdrstop #include "PilePrint.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TPSpin" #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_FORMCAPTION StringTable[0]; #define IDS_RGSIZE StringTable[1]; #define IDS_RGA4 StringTable[2]; #define IDS_RGFREE StringTable[3]; #define IDS_RGTYPE StringTable[4]; #define IDS_RGHEADERNO StringTable[5]; #define IDS_RGHEADERYES StringTable[6]; #define IDS_RGIMAGEYARN StringTable[7]; #define IDS_RGYARNDATA StringTable[8]; #define IDS_RGTEXTUREDATA StringTable[9]; //--------------------------------------------------------------------------- __fastcall TPrintForm::TPrintForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TPrintForm::FormClose(TObject *Sender, TCloseAction &Action) { TIniFile *IniFile = new TIniFile(AppDataItem + "\\Environment.ini"); if (IniFile) { IniFile->WriteBool("Printer", "Method", cbMethod->ItemIndex); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TPrintForm::FormCreate(TObject *Sender) { //======================================================= StringTable.Create(DirectoryItem, Language, "PilePrint"); SetSmallFont(Font); Caption = IDS_FORMCAPTION; 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); } lbPage->Caption = IDS_COMMON_PAGE; btnSetup->Caption = IDS_COMMON_SETUP; btnCancel->Caption = IDS_COMMON_BUTTONCANCEL; btnRun->Caption = IDS_COMMON_RUN; rgSize->Caption = IDS_RGSIZE; rgSize->Items->Strings[0] = IDS_RGA4; rgSize->Items->Strings[1] = IDS_RGFREE; rgType->Caption = IDS_RGTYPE; rgType->Items->Strings[0] = IDS_RGHEADERNO; rgType->Items->Strings[1] = IDS_RGHEADERYES; rgType->Items->Strings[2] = IDS_RGIMAGEYARN; rgType->Items->Strings[3] = IDS_RGYARNDATA; rgType->Items->Strings[4] = IDS_RGTEXTUREDATA; //======================================================= TIniFile *IniFile = new TIniFile(AppDataItem + "\\Environment.ini"); if (IniFile) { cbMethod->ItemIndex = IniFile->ReadBool("Printer", "Method", 0); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TPrintForm::rgSizeClick(TObject *Sender) { if (rgSize->ItemIndex) { rgType->Enabled = false; Method = 5; } else { rgType->Enabled = true; } } //--------------------------------------------------------------------------- void __fastcall TPrintForm::rgTypeClick(TObject *Sender) { Method = rgType->ItemIndex; } //--------------------------------------------------------------------------- void __fastcall TPrintForm::btnSetupClick(TObject *Sender) { PrinterSetupDialog1->Execute(); lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; } //--------------------------------------------------------------------------- void __fastcall TPrintForm::InitForm() { Method = 0; } //---------------------------------------------------------------------------