Browse Source

Updated whatsnew + added TaskDialogMsgBox example to CodeClasses.iss.

Martijn Laan 6 years ago
parent
commit
f4db50d1d4
2 changed files with 24 additions and 1 deletions
  1. 23 1
      Examples/CodeClasses.iss
  2. 1 0
      whatsnew.htm

+ 23 - 1
Examples/CodeClasses.iss

@@ -77,10 +77,23 @@ begin
   end;
 end;
 
+procedure TaskDialogButtonOnClick(Sender: TObject);
+begin
+  //TaskDialogMsgBox isn't a class but showing it anyway since it fits with the theme
+  case TaskDialogMsgBox('Choose A or B',
+                        'You can choose A or B.', 'You can choose A or B'#13#10#13#10'Do you choose A?',   
+                        mbInformation,
+                        MB_YESNOCANCEL, ['I choose A'#13#10'A will be chosen.', 'I choose B'#13#10'B will be chosen.'],
+                        IDYES, False) of
+    IDYES: MsgBox('You chose A.', mbInformation, MB_OK);
+    IDNO: MsgBox('You chose B.', mbInformation, MB_OK);
+  end;
+end;
+
 procedure CreateTheWizardPages;
 var
   Page: TWizardPage;
-  Button, FormButton: TNewButton;
+  Button, FormButton, TaskDialogButton: TNewButton;
   Panel: TPanel;
   CheckBox: TNewCheckBox;
   Edit: TNewEdit;
@@ -153,6 +166,15 @@ begin
   FormButton.OnClick := @FormButtonOnClick;
   FormButton.Parent := Page.Surface;
 
+  TaskDialogButton := TNewButton.Create(Page);
+  TaskDialogButton.Top := FormButton.Top;
+  TaskDialogButton.Left := FormButton.Left + FormButton.Width + ScaleX(8);
+  TaskDialogButton.Width := ScaleX(110);
+  TaskDialogButton.Height := ScaleY(23);
+  TaskDialogButton.Caption := 'TaskDialogMsgBox';
+  TaskDialogButton.OnClick := @TaskDialogButtonOnClick;
+  TaskDialogButton.Parent := Page.Surface;
+
   { TComboBox and others }
 
   Page := CreateCustomPage(Page.ID, 'Custom wizard page controls', 'TComboBox and others');

+ 1 - 0
whatsnew.htm

@@ -85,6 +85,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>Using event attributes it is now possible to have multiple implementations of the same event function in your script. This is especially useful in included scripts implementing an event function to avoid conflicts with the main script. See the help file for more information and the <i>CodeExample1.iss</i> example script for an example.</li>
   <li>[Setup] section directives <tt>ChangesAssociations</tt> and <tt>ChangesEnvironment</tt> may now be set to a boolean expression, which may contain calls to check functions.</li>
   <li>Added new special-purpose <i>HelpTextNote</i> message that can be used to specify one or more lines of text that are added to the list of parameters in the summary shown when passing /HELP on the command line. This message defaults to an empty string so make sure to provide a non-empty default for all languages from your main script if you want to use it.</li>
+  <li>Added new <tt>TaskDialogMsgBox</tt> support function which shows a task dialog if supported by the system and a regular message box otherwise. See the help file for more information and the <i>CodeExample1.iss</i> example script for an example. See the help file for more information and the <i>CodeClasses.iss</i> example script for an example.</li>
   <li>Added new <tt>SameStr</tt> and <tt>SameText</tt> support functions.</li>
   <li>Renamed the <tt>IsAdminLoggedOn</tt> support function to <tt>IsAdmin</tt>. The old name is still supported, but it is recommended to update your scripts to the new name.</li>
 </ul>