mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 23:09:16 +02:00
handle tab key in ControlKeyDown in TCustomEdit and TCustomComboBox
git-svn-id: trunk@6933 -
This commit is contained in:
parent
e6ceebe441
commit
57990d6de7
10
lcl/forms.pp
10
lcl/forms.pp
@ -1012,11 +1012,11 @@ type
|
|||||||
procedure DoBeforeMouseMessage(CurMouseControl: TControl);
|
procedure DoBeforeMouseMessage(CurMouseControl: TControl);
|
||||||
function IsShortcut(var Message: TLMKey): boolean;
|
function IsShortcut(var Message: TLMKey): boolean;
|
||||||
public
|
public
|
||||||
procedure DoEscapeKey(AControl: TWinControl; Shift: TShiftState;
|
procedure DoEscapeKey(AControl: TWinControl; var Key: Word;
|
||||||
var Key: Word);
|
Shift: TShiftState);
|
||||||
procedure DoReturnKey(AControl: TWinControl; Shift: TShiftState;
|
procedure DoReturnKey(AControl: TWinControl; var Key: Word;
|
||||||
var Key: Word);
|
Shift: TShiftState);
|
||||||
procedure DoTabKey(AControl: TWinControl; Shift: TShiftState; var Key: Word);
|
procedure DoTabKey(AControl: TWinControl; var Key: Word;Shift: TShiftState);
|
||||||
property CaptureExceptions: boolean read FCaptureExceptions
|
property CaptureExceptions: boolean read FCaptureExceptions
|
||||||
write SetCaptureExceptions;
|
write SetCaptureExceptions;
|
||||||
property Handle: THandle read FHandle;
|
property Handle: THandle read FHandle;
|
||||||
|
@ -1214,9 +1214,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// handle special navigation keys
|
// handle special navigation keys
|
||||||
DoTabKey(AControl, Shift, Key);
|
DoTabKey(AControl, Key, Shift);
|
||||||
DoReturnKey(AControl, Shift, Key);
|
DoReturnKey(AControl, Key, Shift);
|
||||||
DoEscapeKey(AControl, Shift, Key);
|
DoEscapeKey(AControl, Key, Shift);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1306,8 +1306,8 @@ begin
|
|||||||
Result := FMainForm.IsShortcut(Message);
|
Result := FMainForm.IsShortcut(Message);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TApplication.DoEscapeKey(AControl: TWinControl; Shift: TShiftState;
|
procedure TApplication.DoEscapeKey(AControl: TWinControl; var Key: Word;
|
||||||
var Key: Word);
|
Shift: TShiftState);
|
||||||
var
|
var
|
||||||
Form: TCustomForm;
|
Form: TCustomForm;
|
||||||
begin
|
begin
|
||||||
@ -1326,8 +1326,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TApplication.DoReturnKey(AControl: TWinControl; Shift: TShiftState;
|
procedure TApplication.DoReturnKey(AControl: TWinControl; var Key: Word;
|
||||||
var Key: Word);
|
Shift: TShiftState);
|
||||||
var
|
var
|
||||||
Form: TCustomForm;
|
Form: TCustomForm;
|
||||||
begin
|
begin
|
||||||
@ -1345,8 +1345,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TApplication.DoTabKey(AControl: TWinControl; Shift: TShiftState;
|
procedure TApplication.DoTabKey(AControl: TWinControl; var Key: Word;
|
||||||
var Key: Word);
|
Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if (Key=VK_Tab) and ((Shift-[ssShift])=[])
|
if (Key=VK_Tab) and ((Shift-[ssShift])=[])
|
||||||
and (anoTabToSelectNext in Navigation)
|
and (anoTabToSelectNext in Navigation)
|
||||||
@ -1464,6 +1464,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.110 2005/03/10 09:02:11 mattias
|
||||||
|
handle tab key in ControlKeyDown in TCustomEdit and TCustomComboBox
|
||||||
|
|
||||||
Revision 1.109 2005/03/08 00:28:03 mattias
|
Revision 1.109 2005/03/08 00:28:03 mattias
|
||||||
implemented gtk2 AppMinimize
|
implemented gtk2 AppMinimize
|
||||||
|
|
||||||
|
@ -414,16 +414,22 @@ begin
|
|||||||
if not (Key in [VK_UP,VK_DOWN,VK_END,VK_HOME,VK_PRIOR,VK_NEXT,VK_TAB,
|
if not (Key in [VK_UP,VK_DOWN,VK_END,VK_HOME,VK_PRIOR,VK_NEXT,VK_TAB,
|
||||||
VK_RETURN])
|
VK_RETURN])
|
||||||
then begin
|
then begin
|
||||||
Key:=0;
|
Skip := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Skip then
|
if Skip then
|
||||||
Key := 0
|
Key := VK_UNKNOWN
|
||||||
else
|
else
|
||||||
inherited KeyDown(Key, Shift);
|
inherited KeyDown(Key, Shift);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomComboBox.ControlKeyDown(var Key: Word; Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Application<>nil then Application.DoTabKey(Self,Key,Shift);
|
||||||
|
inherited ControlKeyDown(Key, Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
function TCustomComboBox.SelectItem(const AnItem: String): Boolean;
|
function TCustomComboBox.SelectItem(const AnItem: String): Boolean;
|
||||||
|
|
||||||
@ -802,6 +808,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.58 2005/03/10 09:02:11 mattias
|
||||||
|
handle tab key in ControlKeyDown in TCustomEdit and TCustomComboBox
|
||||||
|
|
||||||
Revision 1.57 2005/03/07 18:46:36 mattias
|
Revision 1.57 2005/03/07 18:46:36 mattias
|
||||||
fixed unsetting ItemIndex on changing TComboBox.Text
|
fixed unsetting ItemIndex on changing TComboBox.Text
|
||||||
|
|
||||||
|
@ -314,6 +314,12 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomEdit.ControlKeyDown(var Key: Word; Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Application<>nil then Application.DoTabKey(Self,Key,Shift);
|
||||||
|
inherited ControlKeyDown(Key, Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomEdit.KeyUp(var Key: Word; Shift: TShiftState);
|
procedure TCustomEdit.KeyUp(var Key: Word; Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
inherited KeyUp(Key, Shift);
|
inherited KeyUp(Key, Shift);
|
||||||
@ -369,6 +375,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.39 2005/03/10 09:02:11 mattias
|
||||||
|
handle tab key in ControlKeyDown in TCustomEdit and TCustomComboBox
|
||||||
|
|
||||||
Revision 1.38 2005/03/08 10:32:47 mattias
|
Revision 1.38 2005/03/08 10:32:47 mattias
|
||||||
BorderStyle for TCustomEdit in win32 intf from Jesus
|
BorderStyle for TCustomEdit in win32 intf from Jesus
|
||||||
|
|
||||||
|
@ -219,6 +219,8 @@ type
|
|||||||
TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer;
|
TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer;
|
||||||
var Height: Integer) of object;
|
var Height: Integer) of object;
|
||||||
|
|
||||||
|
{ TCustomComboBox }
|
||||||
|
|
||||||
TCustomComboBox = class(TWinControl)
|
TCustomComboBox = class(TWinControl)
|
||||||
private
|
private
|
||||||
FAutoDropDown: Boolean;
|
FAutoDropDown: Boolean;
|
||||||
@ -283,6 +285,7 @@ type
|
|||||||
procedure SetStyle(Val: TComboBoxStyle); virtual;
|
procedure SetStyle(Val: TComboBoxStyle); virtual;
|
||||||
procedure RealSetText(const AValue: TCaption); override;
|
procedure RealSetText(const AValue: TCaption); override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
|
procedure ControlKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
|
|
||||||
property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8;
|
property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8;
|
||||||
property ItemHeight: Integer read GetItemHeight write SetItemHeight;
|
property ItemHeight: Integer read GetItemHeight write SetItemHeight;
|
||||||
@ -550,6 +553,8 @@ type
|
|||||||
TEditCharCase = (ecNormal, ecUppercase, ecLowerCase);
|
TEditCharCase = (ecNormal, ecUppercase, ecLowerCase);
|
||||||
TEchoMode = (emNormal, emNone, emPassword);
|
TEchoMode = (emNormal, emNone, emPassword);
|
||||||
|
|
||||||
|
{ TCustomEdit }
|
||||||
|
|
||||||
TCustomEdit = class(TWinControl)
|
TCustomEdit = class(TWinControl)
|
||||||
private
|
private
|
||||||
FCharCase: TEditCharCase;
|
FCharCase: TEditCharCase;
|
||||||
@ -582,6 +587,7 @@ type
|
|||||||
procedure SetSelText(const Val: string); virtual;
|
procedure SetSelText(const Val: string); virtual;
|
||||||
procedure RealSetText(const Value: TCaption); override;
|
procedure RealSetText(const Value: TCaption); override;
|
||||||
function ChildClassAllowed(ChildClass: TClass): boolean; override;
|
function ChildClassAllowed(ChildClass: TClass): boolean; override;
|
||||||
|
procedure ControlKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
|
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -1227,6 +1233,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.198 2005/03/10 09:02:11 mattias
|
||||||
|
handle tab key in ControlKeyDown in TCustomEdit and TCustomComboBox
|
||||||
|
|
||||||
Revision 1.197 2005/03/08 10:32:47 mattias
|
Revision 1.197 2005/03/08 10:32:47 mattias
|
||||||
BorderStyle for TCustomEdit in win32 intf from Jesus
|
BorderStyle for TCustomEdit in win32 intf from Jesus
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user