mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:40:56 +02:00
LCL: TCustomRadioGroup, TCustomCheckBoxGroup - propagate OnKeyDown, OnKeyUp, OnKeyPress, OnUTF8KeyPress from TRadioButton/TCheckBox to our groupBox (parent).
git-svn-id: trunk@29958 -
This commit is contained in:
parent
d981b42d5c
commit
67ed6805ce
@ -799,6 +799,9 @@ type
|
|||||||
procedure ItemEnter(Sender: TObject);
|
procedure ItemEnter(Sender: TObject);
|
||||||
procedure ItemExit(Sender: TObject);
|
procedure ItemExit(Sender: TObject);
|
||||||
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure ItemKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure ItemKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure ItemUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char);
|
||||||
procedure ItemResize(Sender: TObject);
|
procedure ItemResize(Sender: TObject);
|
||||||
procedure ItemsChanged(Sender: TObject);
|
procedure ItemsChanged(Sender: TObject);
|
||||||
procedure SetAutoFill(const AValue: Boolean);
|
procedure SetAutoFill(const AValue: Boolean);
|
||||||
@ -906,6 +909,10 @@ type
|
|||||||
procedure Clicked(Sender: TObject);
|
procedure Clicked(Sender: TObject);
|
||||||
procedure DoClick(Index: integer);
|
procedure DoClick(Index: integer);
|
||||||
procedure ItemsChanged (Sender : TObject);
|
procedure ItemsChanged (Sender : TObject);
|
||||||
|
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure ItemKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure ItemKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure ItemUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char);
|
||||||
procedure RaiseIndexOutOfBounds(Index: integer );
|
procedure RaiseIndexOutOfBounds(Index: integer );
|
||||||
procedure SetAutoFill(const AValue: boolean);
|
procedure SetAutoFill(const AValue: boolean);
|
||||||
procedure SetChecked(Index: integer; const AValue: boolean);
|
procedure SetChecked(Index: integer; const AValue: boolean);
|
||||||
|
@ -57,6 +57,32 @@ begin
|
|||||||
OwnerFormDesignerModified(Self);
|
OwnerFormDesignerModified(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCheckGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Key <> 0 then
|
||||||
|
KeyDown(Key, Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCheckGroup.ItemKeyUp(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Key <> 0 then
|
||||||
|
KeyUp(Key, Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCheckGroup.ItemKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key <> #0 then
|
||||||
|
KeyPress(Key);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCheckGroup.ItemUTF8KeyPress(Sender: TObject;
|
||||||
|
var UTF8Key: TUTF8Char);
|
||||||
|
begin
|
||||||
|
UTF8KeyPress(UTF8Key);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCheckGroup.RaiseIndexOutOfBounds(Index: integer ) ;
|
procedure TCustomCheckGroup.RaiseIndexOutOfBounds(Index: integer ) ;
|
||||||
begin
|
begin
|
||||||
raise Exception.CreateFmt(rsIndexOutOfBounds,
|
raise Exception.CreateFmt(rsIndexOutOfBounds,
|
||||||
@ -121,6 +147,10 @@ begin
|
|||||||
BorderSpacing.CellAlignVertical:=ccaCenter;
|
BorderSpacing.CellAlignVertical:=ccaCenter;
|
||||||
Parent := Self;
|
Parent := Self;
|
||||||
OnClick :=@Self.Clicked;
|
OnClick :=@Self.Clicked;
|
||||||
|
OnKeyDown :=@Self.ItemKeyDown;
|
||||||
|
OnKeyUp := @Self.ItemKeyUp;
|
||||||
|
OnKeyPress := @Self.ItemKeyPress;
|
||||||
|
OnUTF8KeyPress := @Self.ItemUTF8KeyPress;
|
||||||
ParentFont := true;
|
ParentFont := true;
|
||||||
ControlStyle := ControlStyle + [csNoDesignSelectable];
|
ControlStyle := ControlStyle + [csNoDesignSelectable];
|
||||||
end;
|
end;
|
||||||
|
@ -156,6 +156,9 @@ begin
|
|||||||
OnEnter :=@Self.ItemEnter;
|
OnEnter :=@Self.ItemEnter;
|
||||||
OnExit :=@Self.ItemExit;
|
OnExit :=@Self.ItemExit;
|
||||||
OnKeyDown :=@Self.ItemKeyDown;
|
OnKeyDown :=@Self.ItemKeyDown;
|
||||||
|
OnKeyUp := @Self.ItemKeyUp;
|
||||||
|
OnKeyPress := @Self.ItemKeyPress;
|
||||||
|
OnUTF8KeyPress := @Self.ItemUTF8KeyPress;
|
||||||
OnResize := @Self.ItemResize;
|
OnResize := @Self.ItemResize;
|
||||||
ParentFont := True;
|
ParentFont := True;
|
||||||
BorderSpacing.CellAlignHorizontal:=ccaLeftTop;
|
BorderSpacing.CellAlignHorizontal:=ccaLeftTop;
|
||||||
@ -273,6 +276,27 @@ begin
|
|||||||
VK_DOWN: MoveSelection(0,1);
|
VK_DOWN: MoveSelection(0,1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
if Key <> 0 then
|
||||||
|
KeyDown(Key, Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRadioGroup.ItemKeyUp(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Key <> 0 then
|
||||||
|
KeyUp(Key, Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRadioGroup.ItemKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key <> #0 then
|
||||||
|
KeyPress(Key);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRadioGroup.ItemUTF8KeyPress(Sender: TObject;
|
||||||
|
var UTF8Key: TUTF8Char);
|
||||||
|
begin
|
||||||
|
UTF8KeyPress(UTF8Key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user