Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=My Program
- AppVerName=My Program version 1.5
- DefaultDirName={pf}\My Program
- [Files]
- Source: Leeme1.rtf; Flags: dontcopy
- Source: Leeme2.rtf; Flags: dontcopy
- Source: Leeme3.rtf; Flags: dontcopy
- Source: Button1.bmp; Flags: dontcopy
- Source: Button2.bmp; Flags: dontcopy
- Source: Button3.bmp; Flags: dontcopy
- Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: {app}; Flags: ignoreversion; Check: CheckedBox(0)
- Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.chm"; DestDir: {app}; Flags: ignoreversion; Check: CheckedBox(1)
- [Code]
- var
- Page: TWizardPage;
- ListBox: TNewCheckListBox;
- Memo: TRichEditViewer;
- CheckLabel: TLabel;
- MouseY: integer;
- BitmapImage: TBitmapImage;
- InfoBmp: array of TBitmap;
- function CheckedBox(ItemNumber: integer): Boolean;
- begin
- Result:= ListBox.Checked[ItemNumber];
- end;
- procedure CheckOnClick (Sender: TObject);
- begin
- if MouseY < ListBox.Items.Count then
- begin
- ListBox.Checked[MouseY]:= Not(ListBox.Checked[MouseY]);
- end;
- end;
- procedure CheckMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
- begin
- MouseY:= Y/ScaleY(16);
- if MouseY < ListBox.Items.Count then
- begin
- Memo.RTFText:= TStrings(ListBox.ItemObject[MouseY]).Text;
- BitmapImage.Bitmap:= InfoBmp[MouseY];
- end;
- end;
- procedure InitializeWizard();
- var
- i: integer;
- begin
- ExtractTemporaryFile('Leeme1.rtf');
- ExtractTemporaryFile('Leeme2.rtf');
- ExtractTemporaryFile('Leeme3.rtf');
- ExtractTemporaryFile('Button1.bmp');
- ExtractTemporaryFile('Button2.bmp');
- ExtractTemporaryFile('Button3.bmp');
- Page:=CreateCustomPage(wpWelcome, 'blabla1', 'blabla2, blabla 3')
- ListBox:= TNewCheckListBox.Create(Page);
- with ListBox do
- begin
- Left := 15
- Top := 0
- Width := 200
- Height := 149
- Parent := Page.Surface
- AddCheckBox('blabla', '', 0, True, True, True, True, TStringList.Create);
- AddCheckBox('blabla blabla', '', 1, True, True, False, True, TStringList.Create);
- AddCheckBox('blabla f blabla', '', 1, True, True, False, True, TStringList.Create);
- TStrings(ItemObject[0]).LoadFromFile(ExpandConstant('{tmp}\Leeme1.rtf'));
- TStrings(ItemObject[1]).LoadFromFile(ExpandConstant('{tmp}\Leeme2.rtf'));
- TStrings(ItemObject[2]).LoadFromFile(ExpandConstant('{tmp}\Leeme3.rtf'));
- end;
- Memo:= TRichEditViewer.Create(Page);
- with Memo do
- begin
- Left := ListBox.Left + ListBox.Width + 8;
- Top := ListBox.Top;
- Width := ListBox.Width;
- Height := ListBox.Height;
- Color := clBtnFace;
- Enabled := False;
- BorderStyle := bsNone;
- Parent := Page.Surface;
- end;
- CheckLabel:= TLabel.Create(Page);
- with CheckLabel do
- begin
- Width :=ListBox.Width;
- Height :=ListBox.Height;
- Autosize :=False;
- Transparent :=True;
- OnMouseMove :=@CheckMouseMove;
- OnClick :=@CheckOnClick;
- Parent :=ListBox;
- Cursor := 1;
- end;
- BitmapImage := TBitmapImage.Create(Page);
- with BitmapImage do
- begin
- AutoSize := True;
- Left := ListBox.Left;
- Top := ListBox.Top + ListBox.Height + 8;
- Width := ListBox.Width;
- Height := 32;
- Parent := Page.Surface;
- end;
- for i:=0 to ListBox.Items.Count - 1 do
- begin
- SetArrayLength(InfoBmp, i+1);
- InfoBmp[i]:= TBitmap.Create;
- end;
- InfoBmp[0].LoadFromFile(ExpandConstant('{tmp}\Button1.bmp'));
- InfoBmp[1].LoadFromFile(ExpandConstant('{tmp}\Button2.bmp'));
- InfoBmp[2].LoadFromFile(ExpandConstant('{tmp}\Button3.bmp'));
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement