//--------------------------------------------------------------------------- #include #include #include "Common.h" #pragma hdrstop #include "CommonPrint.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TPSpin" #pragma resource "*.dfm" //--------------------------------------------------------------------------- __fastcall TCommonPrintForm::TCommonPrintForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TCommonPrintForm::FormClose(TObject *Sender, TCloseAction &Action) { TIniFile *IniFile = new TIniFile(DirectoryItem + "\\Environment.ini"); if (IniFile) { IniFile->WriteBool("Printer", "Method", cbMethod->ItemIndex); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TCommonPrintForm::FormCreate(TObject *Sender) { SetSmallFont(Font); Caption = IDS_COMMON_PRINTSETUP; lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; for (int i = 0; i < 2; 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; TIniFile *IniFile = new TIniFile(DirectoryItem + "\\Environment.ini"); if (IniFile) { cbMethod->ItemIndex = IniFile->ReadBool("Printer", "Method", 0); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TCommonPrintForm::btnSetupClick(TObject *Sender) { PrinterSetup->Execute(); lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; } //---------------------------------------------------------------------------