Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide the main panel and show an image over the whole page?

Tags:

inno-setup

I have created a custom welcome page with an image on it but the main panel on the top remains to be displayed. For what I want to achieve see image below:

enter image description here

Here is the code:

[Code]
procedure InitializeWizard;
var
  BitmapFileName: string;
  BitmapImage: TBitmapImage;
  WelcomePage: TWizardPage;
begin
  WelcomePage := CreateCustomPage(wpWelcome, '', '');    

  BitmapFileName := ExpandConstant('{tmp}\DataNova_Logo.bmp');
  ExtractTemporaryFile(ExtractFileName(BitmapFileName));

  BitmapImage := TBitmapImage.Create(WelcomePage);
  BitmapImage.AutoSize := True;
  BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
  BitmapImage.Cursor := crHand;
  BitmapImage.Left := 10;
  BitmapImage.Top := 10;
  BitmapImage.Parent := WelcomePage.Surface;
end;

How to show the image over the whole page with the main panel hidden ?

like image 237
Sunil Sharma Avatar asked Jun 21 '12 16:06

Sunil Sharma


1 Answers

You need to hide the Bevel1, MainPanel and the InnerNotebook components when you switch to your welcome page and show them again when you leave it. As the opposite, the image you need to show only when you're showing your welcome page since it covers the whole page area. So the following code will do the trick:

[Code]
var
  WelcomePageID: Integer;
  BitmapImage: TBitmapImage;

procedure InitializeWizard;
var
  WelcomePage: TWizardPage;  
begin
  WelcomePage := CreateCustomPage(wpWelcome, '', '');
  WelcomePageID := WelcomePage.ID;
  BitmapImage := TBitmapImage.Create(WizardForm);
  BitmapImage.Bitmap.LoadFromFile('C:\Image.bmp');
  BitmapImage.Top := 0;
  BitmapImage.Left := 0;
  BitmapImage.AutoSize := True;
  BitmapImage.Cursor := crHand;
  BitmapImage.Visible := False;
  BitmapImage.Parent := WizardForm.InnerPage;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  BitmapImage.Visible := CurPageID = WelcomePageID;
  WizardForm.Bevel1.Visible := CurPageID <> WelcomePageID;
  WizardForm.MainPanel.Visible := CurPageID <> WelcomePageID;
  WizardForm.InnerNotebook.Visible := CurPageID <> WelcomePageID;
end;
like image 128
TLama Avatar answered Nov 15 '22 15:11

TLama