The documentation how to use TMSFMXTaskDialog is very sparse. I figured out how to set most of the display options, such as selecting buttons, custom buttons, various text fields. However, a couple items I see no documentation and am confused what they do and how to use them. I am using C++, so I would like examples in C++ instead of Delphi.
In the built-in MessageDlg, it simply returns a value which is simple to check what button was clicked. How do I check what button was clicked in TMSFMXTaskDIalog and what value is returned for a specific button (including custom buttons)?
What are the various fields of InputSettings and how do I use them?
The Options CommandLink does not seem to do anything. What is it and how do I use it?
I figured out how to display a set of Radio Buttons, but how do I do the same for Check Boxes and how do I read out what the user checked/unchecked, and how to set default settings when the window first opens?
- Please note that unfortunately examples and demo applications are available for Delphi only.
- You can use the ButtonID parameter of the OnDialogButtonClick event to check which button was clicked in the TMSFMXTaskDialog. There is an example in the Product Manual PDF that shows how the common buttons can be identified. For custom buttons the ButtonID value is 100 for the first button in the CustomButtons list. The value is incremented with 1 for each following button.
- You can use the InputSettings.InputType property to select which type of input control is displayed in the dialog. The other properties in InputSettings can be used to configure the selected input control. For example if the ComboList InputType is selected you can set the items for the list using the Items property and the default selected item with the ItemIndex property.
- If CommandLinks is set to true the list of custom buttons is displayed as a column of links in the dialog instead of a row of buttons.
- You can use the ButtonID paramter of the OnDialogRadioClick event to check which radiobutton was selected. The index value of the first radio button is 200. The value is incremented with 1 for each following radiobutton. You can preset the default selected radiobutton by setting the RadioButtonResult property to the index value of the desired radiobutton.
Example:
TMSFMXTaskDialog1.RadioButtonResult := 200;
Unfortunately there's currently no built-in support to display a list of checkboxes in the dialog.