Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

ButtonGroup property

Project: Message Dialogue Components.

Unit: PJMessageDialog.

Class: TPJVCLMsgDlg

Applies to: ~>3.0

type
  TPJMsgDlgButtonGroup = (
    bgAbortRetryIgnore, bgOK, bgOKCancel, bgRetryCancel, bgYesNo, bgYesNoCancel,
    bgUnknown, bgCancelTryContinue
  );

property ButtonGroup: TPJMsgDlgButtonGroup;

Description

The buttons which appear in the dialogue box depend on the value of this property and on the associated Buttons property.

When the value of ButtonGroup is changed the Buttons property is updated the to the set of buttons contained in the button group. Setting ButtonGroup to bgUnkown sets Buttons to the empty set. Conversely, when the Buttons property is changed ButtonGroup is set to any matching group, or to bgUnknown if the set of buttons in the Buttons property is not a valid button group.

Note: Normally, setting ButtonGroup to a value other than bgUnkown and then adding mbHelp to the resulting Buttons set causes ButtonGroup to change to bgUnknown. To prevent this include mdoGroupIgnoresHelp in the Options property. Setting this option means that mbHelp is ignored when trying to match Buttons to a valid button group and, in the case above, ButtonGroup will remain unchanged when mbHelp is added to Buttons.

Setting ButtonGroup also updates the DlgType property and vice versa. See the DlgType page for full details.

The possible values of ButtonGroup are as follows:

Value Buttons used
bgAbortRetryIgnore Abort, Retry and Ignore buttons.
bgOK A single OK button.
bgOKCancel An OK and a Cancel button.
bgRetryCancel A Retry and a Cancel button.
bgYesNo A Yes and a No button.
bgYesNoCancel Yes, No and Cancel buttons.
bgUnknown An unsupported or unknown group of buttons. This item should not be selected explicitly. If it is selected it has the same effect as bgOK.
bgCancelTryContinue Synonym for bgAbortRetryIgnore with same effect. (Note that in TPJWinMsgDlg bgCancelTryContinue behaves differently to bgAbortRetryIgnore.)

To include a help button in the dialogue box do one of two things:

  1. Set the HelpContext property to some non-zero value and include mdoAutoHelpBtn in the Options property, or
  2. Include the mbHelp button value in the Buttons property.

If a cancel button is included in the group whether it appears or not depends on whether the mdoInhibitCancel value is included in the Options property.

A value associated with the button that was clicked is returned from the Execute method.

The default value of the property is bgOK.