procedure TAdVCLComponentWindow.SetupDisplay(AProps: TAdDisplayProperties);
var
form: TForm;
begin
if (FControl
is TForm)
then
form := TForm(FControl)
else
form :=
nil;
if form <>
nil then
begin
form.Color := 0;
form.BorderIcons := [biSystemMenu];
form.Caption := Title;
if AProps.Mode = dmWindowed
then
begin
form.BorderStyle := bsSingle;
form.ClientWidth := AProps.Width;
form.ClientHeight := AProps.Height;
form.Top := (Screen.Height - AProps.Height)
div 2;
form.Left := (Screen.Width - AProps.Width)
div 2;
end else
if (AProps.Mode = dmScreenRes)
or (AProps.Mode = dmFullscreen)
then
begin
if AProps.Mode = dmFullScreen
then
begin
ChangeResolution(AProps.Width, AProps.Height, ord(AProps.BitDepth));
end;
form.BorderStyle := bsNone;
form.Width := Screen.Width;
form.Height := Screen.Height;
form.Top := 0;
form.Left := 0;
end;
//Actualize handle - it may have changed because of the changes in form.BorderStyle
//and form.BorderIcons.
//This only applies to Delphi 2005 and earlier
FHandle := form.Handle;
end;
end;