From: <ah...@us...> - 2006-11-12 08:32:52
|
Revision: 11012 http://svn.sourceforge.net/jvcl/?rev=11012&view=rev Author: ahuser Date: 2006-11-12 00:32:43 -0800 (Sun, 12 Nov 2006) Log Message: ----------- Added LeaveOnEnterKey property Modified Paths: -------------- trunk/jvcl/run/JvDBGrid.pas Modified: trunk/jvcl/run/JvDBGrid.pas =================================================================== --- trunk/jvcl/run/JvDBGrid.pas 2006-11-12 08:31:50 UTC (rev 11011) +++ trunk/jvcl/run/JvDBGrid.pas 2006-11-12 08:32:43 UTC (rev 11012) @@ -234,6 +234,7 @@ FShowTitleHint: Boolean; FSortedField: string; FPostOnEnterKey: Boolean; + FLeaveOnEnterKey: Boolean; FSelectColumn: TSelectColumn; FTitleArrow: Boolean; FTitlePopup: TPopupMenu; @@ -484,6 +485,7 @@ property AlternateRowColor: TColor read FAlternateRowColor write SetAlternateRowColor default clNone; property AlternateRowFontColor: TColor read FAlternateRowFontColor write SetAlternateRowFontColor default clNone; property PostOnEnterKey: Boolean read FPostOnEnterKey write FPostOnEnterKey default False; + property LeaveOnEnterKey: Boolean read FLeaveOnEnterKey write FLeaveOnEnterKey default True; property SelectColumn: TSelectColumn read FSelectColumn write FSelectColumn default scDataBase; property SortedField: string read FSortedField write SetSortedField; property ShowTitleHint: Boolean read FShowTitleHint write FShowTitleHint default False; @@ -935,6 +937,7 @@ FSelectColumn := scDataBase; FTitleArrow := False; FPostOnEnterKey := False; + FLeaveOnEnterKey := True; FAutoSizeColumnIndex := JvGridResizeProportionally; FSelectColumnsDialogStrings := TJvSelectDialogColumnStrings.Create; // Note to users: the second line may not compile on non western european @@ -2363,7 +2366,7 @@ end; begin - if (Key = Cr) and PostOnEnterKey and not ReadOnly then + if (Key = Cr) and (PostOnEnterKey or LeaveOnEnterKey) and not ReadOnly then DataSource.DataSet.CheckBrowseMode; if not Assigned(FCurrentControl) then @@ -3950,10 +3953,11 @@ if not DoKeyPress(TWMChar(Message)) then with TWMKey(Message) do begin - if (CharCode = VK_RETURN) and PostOnEnterKey then + if (CharCode = VK_RETURN) and (PostOnEnterKey or LeaveOnEnterKey) then begin CloseControl; - DataSource.DataSet.CheckBrowseMode; + if PostOnEnterKey then + DataSource.DataSet.CheckBrowseMode; end else if CharCode = VK_TAB then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |