//--------------------------------------------------------------------------- #include #pragma hdrstop #include "ComboPrint_F.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "RzEdit" #pragma link "RzSpnEdt" #pragma link "RzButton" #pragma link "RzPanel" #pragma link "RzRadChk" #pragma resource "*.dfm" TComboPrintForm *ComboPrintForm; //--------------------------------------------------------------------------- #define IDS_COMBO_FORMNAME StringTable[0] #define IDS_COMBO_PRINTERNAME StringTable[1] #define IDS_COMBO_REALPRINT StringTable[2] #define IDS_COMBO_FITPRINT StringTable[3] #define IDS_COMBO_PAGENUMBER StringTable[4] #define IDS_COMBO_SETUPBTN StringTable[5] #define IDS_COMBO_OKBTN StringTable[6] #define IDS_COMBO_CANCLEBTN StringTable[7] #define IDS_COMBO_PRINT StringTable[8] #define IDS_COMBO_WITHCHIP StringTable[9] #define IDS_COMBO_FitInPaper StringTable[10] #define IDS_COMBO_OnlyColorchipPrint StringTable[11] #define IDS_COMBO_GROUPBOX StringTable[12] //--------------------------------------------------------------------------- __fastcall TComboPrintForm::TComboPrintForm(TComponent* Owner) : TForm(Owner) { StringTable.Create(DirectoryItem, Language, "ComboPrint"); SetSmallFont(Font); Caption = IDS_COMBO_FORMNAME; PrintNameLabel->Caption = IDS_COMBO_PRINTERNAME; RealSize->Caption = IDS_COMBO_REALPRINT; AllInPaper->Caption = IDS_COMBO_FITPRINT; PageNumLabel->Caption = IDS_COMBO_PAGENUMBER; SetupBtn->Caption = IDS_COMBO_SETUPBTN; OKBtn->Caption = IDS_COMBO_OKBTN; CancleBtn->Caption = IDS_COMBO_CANCLEBTN; WithChipCheckBox->Caption = IDS_COMBO_WITHCHIP; FitInPaper->Caption = IDS_COMBO_FitInPaper; OnlyColorchipPrint->Caption = IDS_COMBO_OnlyColorchipPrint; GroupBox1->Caption = IDS_COMBO_GROUPBOX; Print_OKBtn = false; InitComboPrint(); } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::SetupBtnClick(TObject *Sender) { PrinterSetupDialog1->Execute(); InitComboPrint(); } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::OKBtnClick(TObject *Sender) { Print_OKBtn = true; Close(); } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::CancleBtnClick(TObject *Sender) { Close(); } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::InitComboPrint() { TPrinter *print = Printer(); PrintNameLabel->Caption = IDS_COMBO_PRINT +" : " + print->Printers->Strings[print->PrinterIndex]; PageNumLabel->Caption = IDS_COMBO_PAGENUMBER + " : "; } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::SpinEditPageChange(TObject *Sender) { if (SpinEditPage->Text.Length() > 0) { if (SpinEditPage->Value < SpinEditPage->Min) SpinEditPage->Value = SpinEditPage->Min; else if (SpinEditPage->Value > SpinEditPage->Max) SpinEditPage->Value = SpinEditPage->Max; } } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::AllInPaperClick(TObject *Sender) { WithChipCheckBox->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::RealSizeClick(TObject *Sender) { WithChipCheckBox->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TComboPrintForm::EditorSelectAll(TObject *Sender) { SetFocusAndSelectAll(Sender); } //---------------------------------------------------------------------------