PushButton attributes (MSI)

Reference information
Project page Dialogs and Billboards
Related topics Working with attribute panes
External links External link Windows Installer documentation

Introduction

A PushButton control appears as a simulated 3D button that performs some action when pushed (or "clicked"). It contains a text label, bitmap, or icon image. To display a bitmap or icon image in a PushButton control, you must add the desired bitmap or icon on the Bitmaps or Icons project page, then select the control's Type and set the control's Text/Image attribute to the name of the desired bitmap or icon image.

TODO note Windows Installer can display bitmaps in Bitmap (.bmp), JPEG (.jpg) and Portable Network Graphics (.png) formats. The current version of Tarma ExpertInstall can only handle .bmp bitmap images. You can use the other types as well, but they won't be displayed in Tarma ExpertInstall. We intend to add support for JPEG and PNG images in a future release of Tarma Installer.

To perform an action, one or more control events must be defined for the PushButton control; these events are executed when the user clicks on the PushButton control. In particular, you must use control events to link one dialog to the next or previous in the Windows Installer user interface.

Tarma note Tarma Installer's equivalent PushButton control performs a default action if no explicit actions are defined. As a result, common actions such as "Next", "Back", etc. do not require explicit actions. Furthermore, the actual dialog sequence is defined in a separate action sequence. Tarma's design makes it easier to reuse a given dialog box in different contexts; with the Windows Installer PushButton controls this is generally not possible because they are tied to a specific dialog sequence. This is the main reason why a Windows Installer requires more separate (even if similar in layout) dialog boxes for its user interface than the equivalent Tarma Installer.

Attributes

This pane contains the following attributes and options.

Attribute Description
Control name Enter the name of the control. This name has no special significance, but it must be unique among all controls of its parent dialog or billboard.
Type

Select the desired PushButton type from the drop-down list:

  • Text - Displays a text string on the button
  • Bitmap - Displays a bitmap image on the button
  • Icon - Displays an icon image on the button
Text/Image

Depending on the Type selection, enter one of the following:

  • Text - Enter the text string to display
  • Bitmap - Enter the name of the bitmap image to display in the control, or click ... (browse) to open the Select Bitmap Image dialog that allows you to select a bitmap from the project's bitmaps.
  • Icon - Enter the name of the icon image to display in the control, or click ... (browse) to open the Select Icon dialog that allows you to select an icon from the project's icons.
Size

Select the desired icon size from the drop-down list. This option only applies if Type is set to Icon.

Note: If the selected image size is not present in the icon file, then the system scales one of the other icon images to the desired size. The resulting image may be less than satisfactory; in that case, you should edit the original icon file and add an image of the required size.

Help text Enter text for display by screen readers. This text is not normally visible, but it can be read by screen reader software such as used by visually impaired users.
Font

Select the font style for the text in the control by clicking ... (browse) to open the Select Font Style dialog.

Default button

Check this box to mark the PushButton control as the default button in its parent dialog; clear it for a non-default button. The default button in a dialog is indicated with a heavier border and responds to Enter key presses. At most one PushButton control in each dialog can set as the default button; you should generally use this for the most common action, for example "Next".

Cancel button

Check this box to mark the PushButton control as the Cancel button in its parent dialog; clear it for a non-Cancel button. The Cancel button in a dialog responds to Esc key presses and to the user clicking the dialog's Close button Close button. At most one PushButton control in each dialog can set as the Cancel button; you should reserve this for the button that terminates the installation or the current dialog box, usually the one that reads "Cancel" (or its localized equivalent).

Tip: For a Cancel button to terminate the installation, you must define an EndDialog control event for the button and set the event's Argument to Exit. However, it is considered good form to ask for confirmation first; the recommended way to do so is through the CancelDlg dialog box. To use that dialog box, define a SpawnDialog control event for the Cancel button with its Argument set to CancelDlg. The CancelDlg in turn performs the necessary actions to terminate or continue the installation, depending on the user's response.

Visible

Check this box to make the control initially visible; clear it to hide the control. You can change the visibility status of the control at installation time by using Control conditions.

Enabled

Check this box to enable the control initially; clear it to disable the control. An enabled control accepts user input; a disabled control does not and appears grayed out. You can change the enabled status of the control at installation time by using Control conditions.

Sunken Check this box to make the control appear sunken; clear it to display it flush with its parent dialog or billboard. A sunken control has a simulated 3D border.
Right align Check this box to align the control's text to the right; clear it to keep the text centered.
Fixed size

Check this box to display the bitmap image at its actual size; this may result in clipping or filling of it borders. Clear this box to stretch the bitmap image to fit the size of the control; this may result in a distorted image. This option only applies if Type is set to Bitmap.

Don't mirror Check this box to keep the control's orientation as it is and not mirror it for languages that use a right-to-left (RTL) order; clear it to mirror the control if the parent dialog is mirrored for RTL languages. This option only has effect for languages that use an RTL reading order, such as Arabic and Hebrew; for other languages it is ignored.