MG: improved TScreen and ShowModal

git-svn-id: trunk@2954 -
This commit is contained in:
lazarus 2002-08-18 08:56:31 +00:00
parent db5b578e3b
commit 9c894eee04
2 changed files with 11 additions and 8 deletions

View File

@ -3441,10 +3441,11 @@ begin
inherited Create(AOwner); inherited Create(AOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
position := poScreenCenter; Position := poScreenCenter;
Width := 250; Width := 250;
Height := 100; Height := 100;
Caption := 'Goto'; Caption := 'Goto line';
BorderStyle:= bsDialog;
Label1 := TLabel.Create(self); Label1 := TLabel.Create(self);
with Label1 do with Label1 do

View File

@ -33,6 +33,7 @@ begin
FHintFont.Style := []; FHintFont.Style := [];
FHintFont.Size := 12; FHintFont.Size := 12;
FHintFont.Pitch := fpDefault; FHintFont.Pitch := fpDefault;
FSaveFocusedList := TList.Create;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -45,7 +46,11 @@ end;
Destructor TScreen.Destroy; Destructor TScreen.Destroy;
begin begin
FHintFont.Free; FHintFont.Free;
FHintFont:=nil;
FFormList.Free; FFormList.Free;
FFormList:=nil;
FSaveFocusedList.Free;
FSaveFocusedList:=nil;
inherited Destroy; inherited Destroy;
end; end;
{ {
@ -91,11 +96,8 @@ end;
This function is used by the Forms property. This function is used by the Forms property.
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
Function TScreen.GetForms(IIndex: Integer): TForm; Function TScreen.GetForms(IIndex: Integer): TForm;
var
FForm: TForm;
begin begin
FForm := TForm(FFormList.Items[IIndex]); Result := TForm(FFormList.Items[IIndex]);
Result := FForm;
end; end;
@ -108,7 +110,7 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
Function TScreen.GetWidth : Integer; Function TScreen.GetWidth : Integer;
begin begin
result := GetSystemMetrics(SM_CXSCREEN); Result := GetSystemMetrics(SM_CXSCREEN);
end; end;
@ -121,7 +123,7 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
Function TScreen.GetHeight : Integer; Function TScreen.GetHeight : Integer;
begin begin
result := GetSystemMetrics(SM_CYSCREEN); Result := GetSystemMetrics(SM_CYSCREEN);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------