mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-24 23:48:29 +02:00
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
Patch includes: -fixes Problems with hiding modal forms -temporarily fixes TCustomForm.BorderStyle in bsNone -temporarily fixes problems with improper tabbing in TSynEdit git-svn-id: trunk@1200 -
This commit is contained in:
parent
53255e3f75
commit
c56c9dbed9
@ -776,7 +776,7 @@ begin
|
|||||||
Repeat
|
Repeat
|
||||||
If GoForward then
|
If GoForward then
|
||||||
Inc(I);
|
Inc(I);
|
||||||
If List[I] <> nil then begin
|
If (I < List.Count) and (List[I] <> nil) then begin
|
||||||
Next := TControl(List[I]);
|
Next := TControl(List[I]);
|
||||||
If ((Not CheckTabStop or Next.TabStop) and
|
If ((Not CheckTabStop or Next.TabStop) and
|
||||||
(not CheckParent or (Next.Parent = Self)))
|
(not CheckParent or (Next.Parent = Self)))
|
||||||
@ -784,7 +784,7 @@ begin
|
|||||||
then
|
then
|
||||||
Result := Next;
|
Result := Next;
|
||||||
end;
|
end;
|
||||||
until (Result <> nil) or (I = J) or ((I + 1)>= List.Count);
|
until (Result <> nil) or (I = J) or (I >= List.Count);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
List.Free;
|
List.Free;
|
||||||
@ -802,7 +802,7 @@ begin
|
|||||||
If FTabList <> nil then
|
If FTabList <> nil then
|
||||||
For I := 0 to FTabList.Count - 1 do begin
|
For I := 0 to FTabList.Count - 1 do begin
|
||||||
Control := TControl(FTabList[I]);
|
Control := TControl(FTabList[I]);
|
||||||
If Control.CanTab then
|
If Control.CanTab and Control.TabStop then
|
||||||
List.Add(Control);
|
List.Add(Control);
|
||||||
If Control is TWinControl then
|
If Control is TWinControl then
|
||||||
TWinControl(Control).GetTabOrderList(List);
|
TWinControl(Control).GetTabOrderList(List);
|
||||||
@ -1455,6 +1455,12 @@ begin
|
|||||||
ListAdd(FControls, AControl);
|
ListAdd(FControls, AControl);
|
||||||
|
|
||||||
AControl.FParent := Self;
|
AControl.FParent := Self;
|
||||||
|
|
||||||
|
If (csDesigning in ComponentState) and not
|
||||||
|
(csLoading in ComponentState)
|
||||||
|
then
|
||||||
|
If AControl.CanTab then
|
||||||
|
AControl.TabStop := True;
|
||||||
end;
|
end;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
@ -2028,60 +2034,9 @@ end;
|
|||||||
event handler.
|
event handler.
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Procedure TWinControl.WMKeyDown(Var Message : TLMKeyDown);
|
Procedure TWinControl.WMKeyDown(Var Message : TLMKeyDown);
|
||||||
|
|
||||||
Function TopLevelAncestor(TopControl : TWinControl) : TWinControl;
|
|
||||||
begin
|
|
||||||
Result := nil;
|
|
||||||
|
|
||||||
If TopControl = nil then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
If TopControl is TForm then
|
|
||||||
Result := TForm(TopControl)
|
|
||||||
else
|
|
||||||
Result := TopLevelAncestor(TopControl.Parent);
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
|
||||||
I : Integer;
|
|
||||||
List : TList;
|
|
||||||
FirstFocus, OFocus, NFocus : TControl;
|
|
||||||
TopLevel : TWinControl;
|
|
||||||
begin
|
begin
|
||||||
Assert(False, Format('Trace:[TWinControl.WMKeyDown] %s', [ClassName]));
|
Assert(False, Format('Trace:[TWinControl.WMKeyDown] %s', [ClassName]));
|
||||||
if not DoKeyDown(Message) then {inherited} ; // there is nothing to inherit
|
if not DoKeyDown(Message) then {inherited} ; // there is nothing to inherit
|
||||||
NFocus := nil;
|
|
||||||
OFocus := nil;
|
|
||||||
TopLevel := TopLevelAncestor(Self);
|
|
||||||
If TopLevel = nil then
|
|
||||||
exit;
|
|
||||||
Case Message.CharCode of
|
|
||||||
VK_Tab : begin
|
|
||||||
try
|
|
||||||
List := TList.Create;
|
|
||||||
TopLevel.GetTabOrderList(List);
|
|
||||||
FirstFocus := nil;
|
|
||||||
For I := 0 to List.Count - 1 do
|
|
||||||
If List[I] <> nil then begin
|
|
||||||
If I = 0 then
|
|
||||||
FirstFocus := TControl(List[I]);
|
|
||||||
If TControl(List[I]).Focused then begin
|
|
||||||
OFocus := TControl(List[I]);
|
|
||||||
Break;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Finally
|
|
||||||
List.Free;
|
|
||||||
end;
|
|
||||||
NFocus := TopLevel.FindNextControl(OFocus,True,True,True);
|
|
||||||
If (NFocus <> nil) and (NFocus <> OFocus) then
|
|
||||||
NFocus.SetFocus
|
|
||||||
else
|
|
||||||
If FirstFocus <> nil then
|
|
||||||
FirstFocus.SetFocus;
|
|
||||||
Message.CharCode := 0;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -2500,6 +2455,13 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.89 2002/09/29 15:08:38 lazarus
|
||||||
|
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
|
||||||
|
Patch includes:
|
||||||
|
-fixes Problems with hiding modal forms
|
||||||
|
-temporarily fixes TCustomForm.BorderStyle in bsNone
|
||||||
|
-temporarily fixes problems with improper tabbing in TSynEdit
|
||||||
|
|
||||||
Revision 1.88 2002/09/27 20:52:23 lazarus
|
Revision 1.88 2002/09/27 20:52:23 lazarus
|
||||||
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
|
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user