Skip to content

Latest commit

 

History

History
127 lines (110 loc) · 4.82 KB

AlertQuestionDontShowAgain.md

File metadata and controls

127 lines (110 loc) · 4.82 KB

AlertQuestionDontShowAgain

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 with the option to always do the selected action and not show the dialog again. The message should be in the form of a question.

The parameter 'arrOptions' is of type ARRAY [1..3] OF STRING;
arrOpt[1] - Saved setting category to save checkbox value
arrOpt[2] - Saved setting item to save checkbox value
arrOpt[3] - Specify a string to use in overriding the default 'Always do the selection action' checkbox string

FUNCTION AlertQuestionDontShowAgain(
				question           : STRING;
				advice             : STRING;
				defaultButton      : INTEGER;
				OKOverrideText     : STRING;
				CancelOverrideText : STRING;
				customButtonAText  : STRING;
				customButtonBText  : STRING;
				arrOptions         : ARRAY): INTEGER;
def vs.AlertQuestionDontShowAgain(question, advice, defaultButton, OKOverrideText, CancelOverrideText, customButtonAText, customButtonBText, arrOptions):
    return INTEGER

Parameters

Name Type Description
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
arrOptions ARRAY ARRAY [1..3] OF STRING;

Remarks

Created by TTF 1/9/2009

Examples

VectorScript

PROCEDURE Example;
VAR
	result :INTEGER;
	arrayText : ARRAY[1..3] OF STRING;

BEGIN
	arrayText[1] := 'DontShowDialogAgainCategory';
	arrayText[2] := 'DontShowDialogAgainItem'; {Should be unique for every AlertQuestionDontShowAgain}
	arrayText[3] := '';

	result := AlertQuestionDontShowAgain('Do you want to continue?', '', 0, 'Yes', 'No', '', '', arrayText);
END;
RUN(Example);

Python

def Example():
	arrayText = (   'DontShowDialogAgainCategory',
			'DontShowDialogAgainItem', #{Should be unique for every AlertQuestionDontShowAgain}
			'')

        # python uses a tuple
	vs.AlertQuestionDontShowAgain('Do you want to continue?', '', 0, 'Yes', 'No', '', '', arrayText);
Example()
{ create stakes where we still have temporary loci. }
IF ( gMakeStakes ) THEN BEGIN
	StakePrefsResult := AlertQuestionDontShowAgain( GetPluginString( 3021 ), GetPluginString( 3022 ), 0, GetPluginString( 3024 ), GetPlugInString( 3025 ), '', '', arrOptions );
	IF ( StakePrefsResult = 0 ) THEN
		showStakePrefs := FALSE;
	IF ( StakePrefsResult = 1 ) THEN
		showStakePrefs := TRUE;

BEGIN
arrayText[1] := 'Spotlight';
arrayText[2] := 'ConvertOthersToLPO';
arrayText[3] := '';
Result := AlertQuestionDontShowAgain(GetPlugInString(3011),GetPlugInString(3012),1,GetPlugInString(3013),GetPlugInString(3014),'','',arrayText );
ConvertOthers := Result=1;
END;

IF AlertQuestionDontShowAgain(GetPlugInString(9000), '', 0, GetPlugInString(9001), GetPlugInString(9002), '', '', arrayText) = 1 THEN
BEGIN
SetPref(9871, TRUE);
Is3dView := GetProjection(ActLayer)<>6;
RunTempTool(TempToolCallback, TRUE);
SetPref(9871, FALSE);
cen_pt.x := tempX;
import vs

# 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.
question = 'Example'
advice = 'Example'
defaultButton = 1
OKOverrideText = 'Example text'
CancelOverrideText = 'Example text'
customButtonAText = 'Example text'
customButtonBText = 'Example text'
arrOptions = []

resultN = vs.AlertQuestionDontShowAgain(question, advice, defaultButton, OKOverrideText, CancelOverrideText, customButtonAText, customButtonBText, arrOptions)
vs.Message('AlertQuestionDontShowAgain returned: ' + str(resultN))

See Also

VS Functions: AlertInform | AlertQuestion | AlertCritical | AlertInformDontShowAgain

Version

Availability: from Vectorworks 2010

Category