VS:AlertQuestion: Difference between revisions
m (1 revision) |
m (Clarified buttons) |
||
Line 36: | Line 36: | ||
INTEGER | INTEGER | ||
Specifies which button is to be made the default | Specifies which button is to be made the default | ||
0: the negative button is the default | 0: the negative(Cancel) button is the default | ||
1: the positive button is the default | 1: the positive(Ok) button is the default | ||
2: custom button A is the default | 2: custom button A is the default | ||
3: custom button B is the default | 3: custom button B is the default | ||
Line 67: | Line 67: | ||
<return> | <return> | ||
Return Values | Return Values | ||
0: the negative button was hit | 0: the negative(Cancel) button was hit | ||
1: the positive button was hit | 1: the positive(Ok) button was hit | ||
2: custom button A was hit | 2: custom button A was hit | ||
3: custom button B was hit</return> | 3: custom button B was hit</return> |
Latest revision as of 20:14, 17 January 2015
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Displays an alert dialog which alerts the user to a condition or situation that requires the user's decision and input before preceding; such as an impending action with potentially destructive or irreversible consequences. The message can be in the form of a question.
FUNCTION AlertQuestion(
question :STRING;
advice :STRING;
defaultButton :INTEGER;
OKOverrideText :STRING;
CancelOverrideText :STRING;
customButtonAText :STRING;
customButtonBText :STRING) : INTEGER;
def vs.AlertQuestion(question, advice, defaultButton, OKOverrideText, CancelOverrideText, customButtonAText, customButtonBText): return INTEGER
Parameters
question STRING The question to display advice STRING The text to be added in a smaller font under the main information/message defaultButton INTEGER Specifies which button is to be made the default OKOverrideText STRING Specifies a string to use in overriding the 'OK' string CancelOverrideText STRING Specifies a string to use in overriding the 'Cancel' string customButtonAText STRING Specifies a string to use for an optional custom button A customButtonBText STRING Specifies a string to use for a second optional custom button B
Return Value
Return Values
0: the negative(Cancel) button was hit 1: the positive(Ok) button was hit 2: custom button A was hit 3: custom button B was hit
Remarks
Examples of all of the messaging techniques:<pre>
AlertQuestion uses the exclamation icon, when really it should use the question icon.
Example
VectorScript
PROCEDURE Example; BEGIN AlrtDialog('AlrtDialog'); AlertInform('AlertInform', 'advice', FALSE); AlertCritical('AlertCritical', 'advice'); Message(YNDialog('YNDialog')); Message(AlertQuestion('question', 'advice', 1, 'ok', 'cancel', 'a', 'b')); END; RUN(Example);
Python
def Example(): vs.AlrtDialog('AlrtDialog') vs.AlertInform('AlertInform', 'advice', False) vs.AlertCritical('AlertCritical', 'advice') vs.Message(vs.YNDialog('YNDialog')) vs.Message(vs.AlertQuestion('question', 'advice', 1, 'ok', 'cancel', 'a', 'b')) Example()
Version
Availability: from VectorWorks12.0
See Also
VS Functions:
VS:AlertInform | VS:AlertCritical
[[VS:AlertInform]]
| [[VS:AlertCritical]]