summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2009-11-21 23:15:04 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2009-11-21 23:15:04 +0200
commit102a169d0b4bc03ee15a469d70250ad5558ca757 (patch)
tree267c2bc43a8a3c50fd5b0ac0acd909d00f59c064
parent76c91c9753c948da37a43ace9ba20ee6500c6e2a (diff)
downloadfpGUI-102a169d0b4bc03ee15a469d70250ad5558ca757.tar.xz
Index listbox now responds the when ENTER key is pressed.
-rw-r--r--src/frm_main.pas12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/frm_main.pas b/src/frm_main.pas
index bc7cba75..e56d069f 100644
--- a/src/frm_main.pas
+++ b/src/frm_main.pas
@@ -102,6 +102,7 @@ type
procedure PageControl1Change(Sender: TObject; NewActiveSheet: TfpgTabSheet);
procedure tvContentsDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
procedure lbIndexDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
+ procedure lbIndexKeyPress(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean);
procedure lbSearchResultsDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
procedure btnSearchClicked(Sender: TObject);
procedure IndexSearchEditOnChange(Sender: TObject);
@@ -181,6 +182,16 @@ begin
TfpgMessageDialog.Critical('An unexpected error occurred.', E.Message);
end;
+procedure TMainForm.lbIndexKeyPress(Sender: TObject; var KeyCode: word;
+ var ShiftState: TShiftState; var Consumed: boolean);
+begin
+ if (KeyCode = keyReturn) or (KeyCode = keyPEnter) then
+ begin
+ Consumed := True;
+ DisplayTopic(nil);
+ end
+end;
+
procedure TMainForm.RichViewClickLink(Sender: TRichTextView; Link: string);
var
LinkIndex: integer;
@@ -1693,6 +1704,7 @@ begin
PopupFrame := False;
TabOrder := 1;
OnDoubleClick := @lbIndexDoubleClick;
+ OnKeyPress:=@lbIndexKeyPress;
end;
IndexSearchEdit := TfpgEdit.Create(tsIndex);