Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit UnitTranslateFromEnglish;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
- Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.ValEdit,
- Vcl.ExtCtrls, Vcl.StdCtrls;
- type
- TFrameTranslateFromEnglish = class(TFrame)
- PanelSearch: TPanel;
- EditSearch: TLabeledEdit;
- PanelLeftBorder: TPanel;
- PanelRightBorder: TPanel;
- PanelBottomBorder: TPanel;
- ComboBoxSort: TComboBox;
- Dictionary: TValueListEditor;
- SearchDictionary: TValueListEditor;
- procedure EditSearchKeyPress(Sender: TObject; var Key: Char);
- procedure EditSearchChange(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- implementation
- {$R *.dfm}
- uses MainForm;
- type
- TPartsOfSpeech = MainForm.TPartsOfSpeech;
- TWord = MainForm.TWord;
- procedure TFrameTranslateFromEnglish.EditSearchChange(Sender: TObject);
- begin
- MainForm.FormMenu.ClearDictionary(SearchDictionary, (SearchDictionary.RowCount - 1));
- SearchDictionary.Visible := MainForm.FormMenu.Search(Dictionary, SearchDictionary, EditSearch.Text);
- Dictionary.Visible := not(SearchDictionary.Visible);
- end;
- procedure TFrameTranslateFromEnglish.EditSearchKeyPress(Sender: TObject;
- var Key: Char);
- var
- EditLength: Integer;
- begin
- EditLength := Length(EditSearch.Text);
- if not(Key in [#96..#122, #8, #45, #28, ' ']) then
- Key := #0;
- if (EditLength = 0) and (Key in ['-', ' ']) then
- Key := #0;
- if (EditLength > 0) and (EditSearch.Text[EditLength] in ['-', ' ']) and (Key in ['-', ' ']) then
- Key := #0;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement