mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
ValEdit: KeyOptions: implement KeyAdd.
git-svn-id: trunk@40418 -
This commit is contained in:
parent
e06657740f
commit
730d773260
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, Controls, StdCtrls, SysUtils, Grids, LResources, Dialogs, LazUtf8, variants, LCLProc,
|
Classes, Controls, StdCtrls, SysUtils, Grids, LResources, Dialogs, LazUtf8, variants, LCLProc,
|
||||||
ContNrs;
|
LCLType, ContNrs;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -152,6 +152,7 @@ type
|
|||||||
function GetCells(ACol, ARow: Integer): string; override;
|
function GetCells(ACol, ARow: Integer): string; override;
|
||||||
function GetDefaultEditor(Column: Integer): TWinControl; override;
|
function GetDefaultEditor(Column: Integer): TWinControl; override;
|
||||||
function GetRowCount: Integer;
|
function GetRowCount: Integer;
|
||||||
|
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
|
||||||
procedure SetCells(ACol, ARow: Integer; const AValue: string); override;
|
procedure SetCells(ACol, ARow: Integer; const AValue: string); override;
|
||||||
procedure SetEditText(ACol, ARow: Longint; const Value: string); override;
|
procedure SetEditText(ACol, ARow: Longint; const Value: string); override;
|
||||||
procedure SetRowCount(AValue: Integer);
|
procedure SetRowCount(AValue: Integer);
|
||||||
@ -1049,6 +1050,24 @@ begin
|
|||||||
Result := inherited RowCount;
|
Result := inherited RowCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TValueListEditor.KeyDown(var Key: Word; Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
inherited KeyDown(Key, Shift);
|
||||||
|
if (KeyAdd in KeyOptions) then
|
||||||
|
begin
|
||||||
|
if (Key = VK_INSERT) and (Shift = []) then
|
||||||
|
begin
|
||||||
|
//Insert a row in the current position
|
||||||
|
InsertRow('', '', False);
|
||||||
|
Key := 0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if (KeyDelete in KeyOptions) then
|
||||||
|
begin
|
||||||
|
//ToDo: delete a row if user presses Delete, need to find out (blackbox Delphi) when this should happen
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TValueListEditor.SetCells(ACol, ARow: Integer; const AValue: string);
|
procedure TValueListEditor.SetCells(ACol, ARow: Integer; const AValue: string);
|
||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user