From 102a169d0b4bc03ee15a469d70250ad5558ca757 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Sat, 21 Nov 2009 23:15:04 +0200 Subject: Index listbox now responds the when ENTER key is pressed. --- src/frm_main.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- cgit v1.2.3-70-g09d2