Skip to content

Commit

Permalink
When ENTER key is pressed, it calls the "Find Words" function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bare7a committed Feb 25, 2018
1 parent 6277521 commit 79dff9c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
Binary file modified Main.dcu
Binary file not shown.
5 changes: 3 additions & 2 deletions Main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ object FormMain: TFormMain
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
OnKeyPress = FormKeyPress
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
Expand Down Expand Up @@ -94,7 +95,7 @@ object FormMain: TFormMain
Text = '0'
end
object UpDown_MinCharacters: TUpDown
Left = 110
Left = 108
Top = 59
Width = 16
Height = 21
Expand All @@ -111,7 +112,7 @@ object FormMain: TFormMain
Text = '0'
end
object UpDown_MaxCharacters: TUpDown
Left = 241
Left = 239
Top = 59
Width = 16
Height = 21
Expand Down
18 changes: 14 additions & 4 deletions Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ TFormMain = class(TForm)
Label_WordsFoundNumber: TLabel;
procedure FormShow(Sender: TObject);
procedure Button_FindWordClick(Sender: TObject);
procedure UpDown_MinCharactersClick(Sender: TObject; Button: TUDBtnType);
procedure UpDown_MaxCharactersClick(Sender: TObject; Button: TUDBtnType);
procedure ComboBox_LanguageSelect(Sender: TObject);
procedure UpDown_MaxCharactersClick(Sender: TObject; Button: TUDBtnType);
procedure UpDown_MinCharactersClick(Sender: TObject; Button: TUDBtnType);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
dictionary, dictionaryList : TStringList;
Expand Down Expand Up @@ -96,6 +97,14 @@ procedure TFormMain.ComboBox_LanguageSelect(Sender: TObject);
dictionary.LoadFromFile('dictionaries\' + dictionaryList[ComboBox_Language.ItemIndex] + '.txt');;
end;

procedure TFormMain.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = Chr(VK_RETURN) then
begin
self.Button_FindWord.OnClick(Sender);
end;
end;

procedure TFormMain.FormShow(Sender: TObject);
var
I: Integer;
Expand All @@ -105,18 +114,19 @@ procedure TFormMain.FormShow(Sender: TObject);

dictionaryList := ListFiles('dictionaries','*.txt');


ComboBox_Language.Items.BeginUpdate;
ComboBox_Language.Items.Clear;

for I := 0 to dictionaryList.Count - 1 do
ComboBox_Language.Items.Add(dictionaryList[i]);

ComboBox_Language.Items.EndUpdate;

ComboBox_Language.ItemIndex := 0;
ComboBox_Language.OnSelect(Sender);

FormMain.KeyPreview := True;

Memo_Words.Clear;
end;

Expand Down
Binary file modified WordsFinder.exe
Binary file not shown.
7 changes: 0 additions & 7 deletions WordsFinder.groupproj.local

This file was deleted.

Binary file added WordsFinder.identcache
Binary file not shown.

0 comments on commit 79dff9c

Please sign in to comment.