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@1182 -
This commit is contained in:
lazarus 2002-02-09 01:48:03 +00:00
parent 5eccc76a33
commit 762a95214b
2 changed files with 82 additions and 17 deletions

View File

@ -616,6 +616,7 @@ type
property TabOrder : TTabOrder read GetTabOrder write SetTaborder;
public
FCompStyle : LongInt;
Function PerformTab : Boolean; Virtual;
// use overload to simulate default
procedure BeginDrag(Immediate: Boolean; Threshold: Integer); //overload;
procedure BeginDrag(Immediate: Boolean); //overload;
@ -1357,6 +1358,13 @@ end.
{ =============================================================================
$Log$
Revision 1.74 2002/09/29 15:08:37 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.73 2002/09/27 20:52:20 lazarus
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>

View File

@ -266,7 +266,6 @@ begin
exit;
FTabStop := Value;
TabOrder := -1;
end;
{------------------------------------------------------------------------------}
@ -291,7 +290,7 @@ end;
Function TControl.GetTabOrder : TTabOrder;
Begin
If Parent <> nil then
Result := Parent.FTabList.IndexOf(Self)
Result := ListIndexOf(Parent.FTabList, Self)
else
Result := -1;
end;
@ -312,28 +311,20 @@ var
CurentOrder,
OrderCount : Integer;
begin
If Parent = nil then
If (Parent = nil) or not CanTab then
exit;
CurentOrder := GetTabOrder;
If not CanTab then
begin
If CurentOrder >= 0 then
Parent.FTabList.Delete(CurentOrder);
exit;
end;
If CurentOrder >= 0 then begin
OrderCount := Parent.FTabList.Count;
If Value < 0 then
Value := 0;
If Value >= OrderCount then
OrderCount := ListCount(Parent.FTabList);
If (Value < 0) or (Value >= OrderCount) then
Value := OrderCount - 1;
If Value <> CurentOrder then begin
Parent.FTabList.Delete(CurentOrder);
Parent.FTabList.Insert(Value,Self);
end
ListRemove(Parent.FTabList, Self);
ListInsert(Parent.FTabList, Value,Self);
end;
end
else
Parent.FTabList.Insert(Parent.FTabList.Count,Self);
ListAdd(Parent.FTabList, Self);
end;
{------------------------------------------------------------------------------}
@ -480,6 +471,65 @@ begin
Result := Message.Result;
end;
Function TControl.PerformTab : Boolean;
Function TopLevelAncestor(TopControl : TControl) : 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
NFocus := nil;
OFocus := nil;
TopLevel := TopLevelAncestor(Self);
If TopLevel = nil then
exit;
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,False);
If NFocus = OFocus then begin
Result := True;
exit;
end;
If (NFocus <> nil) then begin
NFocus.SetFocus;
Result := NFocus.Focused;
end
else
If FirstFocus <> nil then begin
FirstFocus.SetFocus;
Result := FirstFocus.Focused;
end;
end;
{------------------------------------------------------------------------------}
{ TControl.GetClientOrigin
}
@ -1884,6 +1934,13 @@ end;
{ =============================================================================
$Log$
Revision 1.88 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.87 2002/09/27 20:52:23 lazarus
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>