Skip to content

Commit

Permalink
Finish updating Setup.WizardForm.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanrussell authored Dec 15, 2024
1 parent 9d52a24 commit c29c12e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
6 changes: 2 additions & 4 deletions Projects/Src/Setup.WizardForm.dfm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
object WizardForm: TWizardForm
Left = 191
Top = 139
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'WizardForm'
ClientHeight = 360
ClientWidth = 497
Expand All @@ -12,14 +12,12 @@ object WizardForm: TWizardForm
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Scaled = False
OnClose = FormClose
OnResize = FormResize
DesignSize = (
497
360)
PixelsPerInch = 96
TextHeight = 13
object FBevel: TBevel
Left = 0
Expand Down
36 changes: 6 additions & 30 deletions Projects/Src/Setup.WizardForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,9 @@ constructor TWizardForm.Create(AOwner: TComponent);
SystemMenu: HMENU;
P: String;
I, DefaultSetupTypeIndex: Integer;
DfmDefault, IgnoreInitComponents: Boolean;
IgnoreInitComponents: Boolean;
TypeEntry: PSetupTypeEntry;
ComponentEntry: PSetupComponentEntry;
SaveClientWidth, SaveClientHeight: Integer;
begin
inherited;

Expand Down Expand Up @@ -791,34 +790,17 @@ constructor TWizardForm.Create(AOwner: TComponent);
WelcomeLabel1.Font.Style := [fsBold];
PageNameLabel.Font.Style := [fsBold];

if shWindowVisible in SetupHeader.Options then
Caption := SetupMessages[msgSetupAppTitle]
else if shDisableWelcomePage in SetupHeader.Options then
if shDisableWelcomePage in SetupHeader.Options then
Caption := FmtSetupMessage1(msgSetupWindowTitle, ExpandedAppVerName)
else
Caption := FmtSetupMessage1(msgSetupWindowTitle, ExpandedAppName);

{ Set BorderStyle and BorderIcons:
-WindowVisible + WizardResizable = sizeable
-not WindowVisible + WizardResizable = sizeable + minimize
-WindowVisible + not WizardResizable = dialog = .dfm default = do nothing
-not WindowVisible + not WizardResizable = single + minimize }
DfmDefault := (shWindowVisible in SetupHeader.Options) and not (shWizardResizable in SetupHeader.Options);
if not DfmDefault then begin
{ Save ClientWidth/ClientHeight and restore them after changing BorderStyle. }
SaveClientWidth := ClientWidth;
SaveClientHeight := ClientHeight;
if not(shWindowVisible in SetupHeader.Options) then
BorderIcons := BorderIcons + [biMinimize];
if not(shWizardResizable in SetupHeader.Options) then
BorderStyle := bsSingle
else
BorderStyle := bsSizeable;
if shWizardResizable in SetupHeader.Options then begin
const SaveClientWidth = ClientWidth;
const SaveClientHeight = ClientHeight;
BorderStyle := bsSizeable;
ClientWidth := SaveClientWidth;
ClientHeight := SaveClientHeight;
end;

if shWizardResizable in SetupHeader.Options then begin
EnableAnchorOuterPagesOnResize := True;
{ Do not allow user to resize it smaller than 100% nor larger than 150%. }
Constraints.MinHeight := Height;
Expand Down Expand Up @@ -2695,12 +2677,6 @@ procedure TWizardForm.NoIconsCheckClick(Sender: TObject);

procedure TWizardForm.WMSysCommand(var Message: TWMSysCommand);
begin
if Message.CmdType and $FFF0 = SC_MINIMIZE then
{ A minimize button is shown on the wizard form when (shWindowVisible in
SetupHeader.Options). When it is clicked we want to minimize the whole
application. }
Application.Minimize
else
if Message.CmdType = 9999 then
MainForm.ShowAboutBox
else
Expand Down

0 comments on commit c29c12e

Please sign in to comment.