LCL navigation keys are now handled after interface handles keys

git-svn-id: trunk@5631 -
This commit is contained in:
mattias 2004-07-01 17:55:55 +00:00
parent 6fcb395bc3
commit 8b91f98ff6
2 changed files with 18 additions and 14 deletions

View File

@ -4270,7 +4270,6 @@ begin
SetBounds(4, 4, 342, 213);
Anchors:= [akLeft, akTop, akRight, akBottom];
Shape:= bsFrame;
Visible:= true;
end;
Memo := TMemo.Create(self);
@ -4279,7 +4278,6 @@ begin
SetBounds(12, 32, 326, 176);
Anchors:= [akLeft, akTop, akRight, akBottom];
// Scrollbars:= ssVertical; // GTK 1.x does not implement horizontal scrollbars for GtkText
Visible:= true;
Memo.OnChange:= @MemoChanged;
end;
@ -4288,7 +4286,6 @@ begin
Parent:= Self;
SetBounds(12, 12, 326, 17);
Caption:= '0 lines, 0 chars';
Visible := true;
end;
OKButton := TBitBtn.Create(Self);
@ -4298,7 +4295,6 @@ begin
Left := 192;
Top := 221;
Anchors:= [akRight, akBottom];
Visible := true;
end;
CancelButton := TBitBtn.Create(self);
@ -4308,7 +4304,6 @@ begin
Left := 271;
Top := 221;
Anchors:= [akRight, akBottom];
Visible := true;
end;
end;

View File

@ -2096,22 +2096,26 @@ begin
case Key of
VK_RETURN:
begin
if Form.DefaultButton <> nil then
if Form.DefaultButton <> nil then begin
(Form.DefaultButton as TButton).Click;
Key:=VK_UNKNOWN;
end;
end;
VK_ESCAPE:
begin
if Form.EscapeButton <> nil then
if Form.EscapeButton <> nil then begin
(Form.EscapeButton as TButton).Click;
Key:=VK_UNKNOWN;
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ TWinControl KeyPress }
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------
TWinControl KeyPress
------------------------------------------------------------------------------}
Procedure TWinControl.KeyPress(var Key: Char);
begin
if Assigned(FOnKeyPress) then FOnKeyPress(Self, Key);
@ -2197,9 +2201,6 @@ begin
if Application<>nil then
Application.NotifyKeyDownHandler(Self, CharCode, ShiftState);
if CharCode = VK_UNKNOWN then Exit;
// let controls handle the key
ControlKeyDown(CharCode, ShiftState);
end;
Result := False;
@ -3137,10 +3138,15 @@ Procedure TWinControl.WMKeyDown(Var Message: TLMKeyDown);
var
ShiftState: TShiftState;
begin
ShiftState := KeyDataToShiftState(Message.KeyData);
// let controls handle the key
ControlKeyDown(Message.CharCode, ShiftState);
if Message.CharCode=VK_UNKNOWN then exit;
//DebugLn('TWinControl.WMKeyDown ',Name,':',ClassName);
if not (csNoStdEvents in ControlStyle) then
begin
ShiftState := KeyDataToShiftState(Message.KeyData);
KeyDownAfterInterface(Message.CharCode, ShiftState);
// Note: Message.CharCode can now be different or even 0
end;
@ -3747,6 +3753,9 @@ end;
{ =============================================================================
$Log$
Revision 1.247 2004/07/01 17:55:55 mattias
LCL navigation keys are now handled after interface handles keys
Revision 1.246 2004/07/01 10:08:31 mattias
made key handling more flexible