Extensions Reference

Extensions Reference > exDialogs


dlgTextPrompt

bool dlgTextPrompt(string Title, string Frame, string Prompt,
                   string DefaultValue, int XPos, int YPos, bool ShowCancel);

 

Displays a custom text entry dialog

The DLGTEXTPROMPT function displays a customizable dialog that prompts the user to enter a string of text in an edit box. Most aspects of the dialog are customizable. The purpose of this function is to provide a method for plugins to receive lengthy user input that would otherwise be hard to process in the SSE handler framework.

 

Parameters

Title

The title of the dialog.

Frame

The text to use as the frame title inside the dialog. Providing a zero length string for this parameter hides the frame.

Prompt

The text string to display above the edit box. This should be used for an explanatory prompt of what the user should enter.

DefaultValue

A text string to use as the default value for the edit box. A zero length string may be supplied to display no default.

XPos

The X pixel position on-screen to show the dialog at. Specify -1 to show the dialog in its default position.

YPos

The Y pixel position on-screen to show the dialog at. Specify -1 to show the dialog in its default position.

ShowCancel

True if the "Cancel" button should be shown, False to only show the "OK" button.

 

Return Value

True if the user closes the dialog using the OK button, otherwise False.

 

Example Code

string DisplayText = "Default text";

// Open the prompt dialog with the specified options
if(dlgTextPrompt("The Title", "The Frame", "Enter some text",
                 DisplayText, -1, -1, True) == True)
{
    // Retrieve the text entered into the dialog
    DisplayText = dlgTextPromptGetText();
}