GO2cam Javascript API  6.11
Predefined dialogs

Functions

static GO2SXYZ GO2SDialogUtil::AskCoordinates ()
 
static String GO2SDialogUtil::AskDirectory (String startingDir="c:\\")
 
static Number GO2SDialogUtil::AskDouble (String title, String label, Number min=-DBL_MAX, Number max=DBL_MAX, Number init=0.0)
 
static Number GO2SDialogUtil::AskInt (String title, String label, Number min=-INT_MAX, Number max=INT_MAX, Number init=0)
 
static String GO2SDialogUtil::AskOpenFileName (String startingDir="c:\\", Array< String > extensions={ "All Files (.)" }, String text="Open a file")
 
static Boolean GO2SDialogUtil::AskQuestion (String message, String title="")
 
static String GO2SDialogUtil::AskSaveFileName (String startingDir="c:\\", Array< String > extensions={ "All Files (.)" }, String text="Save a file")
 
static String GO2SDialogUtil::AskText (String title, String label, String init="")
 
static void GO2SDialogUtil::CreateMessageBox (String message, String title="", GO2SEnum::GO2SMessageType type=GO2SEnum::GO2SMessageType::info)
 

Detailed Description

Methods to generate predefined dialogs.

Function Documentation

◆ AskCoordinates()

static GO2SXYZ GO2SDialogUtil::AskCoordinates ( )
static

Display a dialog box for the user to enter XYZ coordinates

console.log('entered coordinates: ' + xyz)
Helper containing utility methods for dialog.
Definition GO2SDialogUtil.hpp:17
static GO2SXYZ AskCoordinates()

◆ AskDirectory()

static String GO2SDialogUtil::AskDirectory ( String startingDir = "c:\\")
static

Open a dialog to select a directory

Returns
the directory path
Parameters
[in]startingDirstarting directory

◆ AskDouble()

static Number GO2SDialogUtil::AskDouble ( String title,
String label,
Number min = -DBL_MAX,
Number max = DBL_MAX,
Number init = 0.0 )
static

Generate a simple dialog box to get a Number value from the user

GO2SDialogUtil.AskDouble('Hole dimensioning','Hole diameter :')
static Number AskDouble(String title, String label, Number min=-DBL_MAX, Number max=DBL_MAX, Number init=0.0)
Parameters
[in]titletitle of the dialog box
[in]labellabel of the value
[in]minminimum value that can be set in the dialog
[in]maxmaximum value that can be set in the dialog
[in]initinitialisation value

◆ AskInt()

static Number GO2SDialogUtil::AskInt ( String title,
String label,
Number min = -INT_MAX,
Number max = INT_MAX,
Number init = 0 )
static

Generate a simple dialog box to get an integer value from the user

Parameters
[in]titletitle of the dialog box
[in]labellabel of the value
[in]minminimum value that can be set in the dialog
[in]maxmaximum value that can be set in the dialog
[in]initinitialisation value

◆ AskOpenFileName()

static String GO2SDialogUtil::AskOpenFileName ( String startingDir = "c:\\",
Array< String > extensions = { "All Files (.)" },
String text = "Open a file" )
static

Open a dialog to select a file path for opening

Returns
the complete file path
Parameters
[in]startingDirthe starting directory
[in]extensionsarray of file extensions, ex: ['Text files (.txt)', 'Opelist files (.opl)']
[in]texttext displayed in the dialog

◆ AskQuestion()

static Boolean GO2SDialogUtil::AskQuestion ( String message,
String title = "" )
static

Open a dialog box to ask a yes/no question to the user

GO2SDialogUtil.AskQuestion("Do you really want to quit ?", "Quit?");
static Boolean AskQuestion(String message, String title="")
Parameters
[in]messagethe message
[in]titletitle of the dialog box

◆ AskSaveFileName()

static String GO2SDialogUtil::AskSaveFileName ( String startingDir = "c:\\",
Array< String > extensions = { "All Files (.)" },
String text = "Save a file" )
static

Open a dialog to select a file path for saving (the file does not have to exist)

Returns
the complete file path
Parameters
[in]startingDirthe starting directory of the window
[in]extensionsarray of file extensions, ex: ['Text files (.txt)', 'Opelist files (.opl)']
[in]texttext displayed in the dialog

◆ AskText()

static String GO2SDialogUtil::AskText ( String title,
String label,
String init = "" )
static

Generate a simple dialog box to get a text from the user

Parameters
[in]titletitle of the dialog box
[in]labellabel of the text input
[in]initinitialisation value

◆ CreateMessageBox()

static void GO2SDialogUtil::CreateMessageBox ( String message,
String title = "",
GO2SEnum::GO2SMessageType type = GO2SEnum::GO2SMessageType::info )
static

Open a dialog box to send a messgae to the user

GO2SDialogUtil.CreateMessageBox("Information message");
GO2SDialogUtil.CreateMessageBox("Warning message", "", GO2SMessageType.warning);
static void CreateMessageBox(String message, String title="", GO2SEnum::GO2SMessageType type=GO2SEnum::GO2SMessageType::info)
Parameters
[in]messagethe message
[in]titletitle of the dialog box
[in]typetype of message See GO2SEnum::GO2SMessageType