//--------------------------------------------------------------------------- #include #include "Common.h" #pragma hdrstop #include "Dialog_F.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "RzEdit" #pragma link "RzSpnEdt" #pragma link "RzButton" #pragma link "RzCmboBx" #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_COMPRESSKIND StringTable[0] #define IDS_COMPRESSLEVEL StringTable[1] #define IDS_LOW StringTable[2] #define IDS_MEDIUM StringTable[3] #define IDS_HIGH StringTable[4] #define IDS_NAME StringTable[5] #define IDS_KIND StringTable[6] #define IDS_TRANSPARENCY StringTable[7] #define IDS_BACKGROUND StringTable[8] #define IDS_SOURCE StringTable[9] #define IDS_DESTINATION StringTable[10] TDialogForm *DialogForm; //--------------------------------------------------------------------------- __fastcall TDialogForm::TDialogForm(TComponent* Owner) : TForm(Owner) { StringTable.Create(DirectoryBin, Language, "Dialog_F"); SetSmallFont(Font); //Compress panel Button1->Caption = IDS_COMMON_BUTTONOK; Button2->Caption = IDS_COMMON_BUTTONCANCEL; Label8->Caption = IDS_COMPRESSKIND; lbQFactor->Caption = IDS_COMPRESSLEVEL; cbComKind->Items->Clear(); cbComKind->Items->Add(IDS_LOW); cbComKind->Items->Add(IDS_MEDIUM); cbComKind->Items->Add(IDS_HIGH); cbComKind->Text = IDS_LOW; cbComKind->ItemIndex = 0; //copy panel Label3->Caption = IDS_NAME; //exchange panel Label4->Caption = IDS_SOURCE; Label5->Caption = IDS_DESTINATION; } //--------------------------------------------------------------------------- void __fastcall TDialogForm::FormCreate(TObject *Sender) { cbComKind->ItemIndex = 0; } //--------------------------------------------------------------------------- void __fastcall TDialogForm::InitForm(int Max, AnsiString name, int item) { spSrc->Max = Max; spDst->Max = Max; if (item == 1) { EditCopy->Text = name; TntEditCopy->Text = name; } Item = item; } //--------------------------------------------------------------------------- void __fastcall TDialogForm::cbComKindChange(TObject *Sender) { if (cbComKind->ItemIndex) { lbQFactor->Enabled = true; spQFactor->Enabled = true; } else { lbQFactor->Enabled = false; spQFactor->Enabled = false; } } //--------------------------------------------------------------------------- void __fastcall TDialogForm::EditClick(TObject *Sender) { TEdit *edit = (TEdit *) Sender; edit->SetFocus(); edit->SelectAll(); } //--------------------------------------------------------------------------- void __fastcall TDialogForm::FormShow(TObject *Sender) { if (Item == 1) { EditCopy->SetFocus(); EditCopy->SelectAll(); } else if (Item == 2) { spSrc->SetFocus(); spSrc->SelectAll(); } else if (Item == 3) { InputEdit->SetFocus(); } } //--------------------------------------------------------------------------- void __fastcall TDialogForm::EditorSelectAll(TObject *Sender) { SetFocusAndSelectAll(Sender); } //--------------------------------------------------------------------------- void __fastcall TDialogForm::TntEditCopyClick(TObject *Sender) { TEdit *edit = (TEdit *) Sender; edit->SetFocus(); edit->SelectAll(); } //--------------------------------------------------------------------------- void __fastcall TDialogForm::SetInputForm(AnsiString aCaption, AnsiString aPrompt) { InputPanel->BringToFront(); this->Caption = aCaption; InputLabel->Caption = aPrompt; Item = 3; } //---------------------------------------------------------------------------