//--------------------------------------------------------------------------- #include #include #include "common.h" #pragma hdrstop #include "JacPrt.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "RzEdit" #pragma link "RzSpnEdt" #pragma link "TNumEdit" #pragma link "RzButton" #pragma link "RzCmboBx" #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_JACQUARD StringTable[0] #define IDS_METHOD StringTable[1] //--------------------------------------------------------------------------- __fastcall TJacPrtForm::TJacPrtForm(TComponent* Owner) : TForm(Owner) { //==================================== StringTable.Create(DirectoryItem, Language, "JacPrt"); SetSmallFont(Font); Caption = IDS_JACQUARD; lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; for (int i = 0; i < 3; i++) { cbMethod->Items->AddObject(IDS_COMMON_PRINTMETHOD + " - " + String(i+1), (TObject *)vsList); //Strings[i] = tdi->Name; // cbMethod->Items->Strings[i] = IDS_COMMON_PRINTMETHOD + " - " + String(i+1); } Label1->Caption = IDS_COMMON_PAGE; Label3->Caption = IDS_METHOD; Label2->Caption = IDS_COMMON_ZOOM; Label5->Caption = IDS_COMMON_REPEAT; SetupButton->Caption = IDS_COMMON_SETUP; OKButton->Caption = IDS_COMMON_BUTTONOK; CancelButton->Caption = IDS_COMMON_BUTTONCANCEL; MethodComboBox->Items->Clear(); MethodComboBox->Items->Add(IDS_COMMON_BUTTONNO); MethodComboBox->Items->Add(IDS_COMMON_BUTTONYES); MethodComboBox->ItemIndex = 0; MethodComboBox->Text = IDS_COMMON_BUTTONNO; //==================================== } //--------------------------------------------------------------------------- void __fastcall TJacPrtForm::FormClose(TObject *Sender, TCloseAction &Action) { TIniFile *IniFile = new TIniFile(AppDataItem + "\\status.ini"); if (IniFile) { IniFile->WriteBool("Printer", "Method", cbMethod->ItemIndex); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TJacPrtForm::FormCreate(TObject *Sender) { TIniFile *IniFile = new TIniFile(AppDataItem + "\\status.ini"); if (IniFile) { cbMethod->ItemIndex = IniFile->ReadBool("Printer", "Method", 0); delete IniFile; } MethodComboBox->ItemIndex = 0; } //--------------------------------------------------------------------------- void __fastcall TJacPrtForm::SetupButtonClick(TObject *Sender) { SetupDialog->Execute(); lbPrinter->Caption = IDS_COMMON_PRINTER + " : " + Printer()->Printers->Strings[Printer()->PrinterIndex]; } //--------------------------------------------------------------------------- void __fastcall TJacPrtForm::MethodComboBoxChange(TObject *Sender) { switch (MethodComboBox->ItemIndex) { case 0: EditZoom->Enabled = true; RepeatXEdit->Enabled = true; RepeatYEdit->Enabled = true; Label2->Enabled = true; Label5->Enabled = true; break; case 1: EditZoom->Enabled = false; RepeatXEdit->Enabled = false; RepeatYEdit->Enabled = false; Label2->Enabled = false; Label5->Enabled = false; break; } } //--------------------------------------------------------------------------- void __fastcall TJacPrtForm::EditorSelectAll(TObject *Sender) { SetFocusAndSelectAll(Sender); } //---------------------------------------------------------------------------