Turbo-BrainVoyager v3.2

GUI Functions


void tLogText(const char *text)

This function sends a line of text to the Log text field in the Plugin window of Turbo-BrainVoyager. The text is provided as a C string. This function is the only GUI function during real-time processing and should be used to provide information about (successful) processing in the plugin; it is also useful to help debugging plugin code.

void tMessageBox(const char *message)

This function displays a message box with text provided in the "message" C string. This function can not be used during real-time processing; the appropriate place to use it is the "executePreRun()" function.

int tGetIntegerInput(const char *instruction, int default_value, int min_val, int max_val)

Presents a dialog with the provided "instruction" text and an edit field in which the user can enter an integer value in the range "min_val" to "max_val". The edit field shows the provided "default_value" initially. When the user clicks the "Ok" button of the dialog, the entered value is returned. If the special value "min_val - 1" is returned, the user has clicked the "Cancel" button or pressed the "Escape" key. This function can not be used during real-time processing.

float tGetFloatInput(const char *instruction, float default_value, float min_val, float max_val)

Presents a dialog with the provided "instruction" text and an edit field in which the user can enter a float (real) value in the range "min_val" to "max_val". The edit field shows the provided "default_value" initially. When the user clicks the "Ok" button of the dialog, the entered value is returned. If the special value "min_val - 1" is returned, the user has clicked the "Cancel" button or pressed the "Escape" key. This function can not be used during real-time processing.

int tGetTextInput(const char *instruction, const char *default_text, char *return_text)

Presents a dialog with the provided "instruction" text and an edit field in which the user can enter a string, i.e. a file name. The edit field shows the provided "default_text" text initially. When the user clicks the "OK" button of the dialog, the entered text is returned in the "return_text" parameter. Note that you must provide enough space for the C string "return_text" (see example code for more information). The return value signals success (value "1") or failure ("0"). This function can not be used during real-time processing.

int tYesNoMessageBox(const char *cquestion)

Presents a dialog with the provided text "question" and with a "Yes" and a "No" button. The function returns value "1" if the user clicks "Yes" and value "0" otherwise. This function can not be used during real-time processing.

int tGetOpenFileName(const char *instruction, const char *default_folder_file, const char *type_of_files, char *return_filename)

Presents a standard "File Open" dialog with the provided "instruction" text. The contents of the folder provided in the "default_folder" parameter will be shown in the dialogs file browser initially. The "type_of_files" parameter can be used to filter the files in a folder with respect to a provided file type. You must use the syntax "<File Type> (*.<Extension>)" to specify a filter, i.e. "Protocol Files (*.prt)". When the user clicks the "Open" button of the dialog, the selected file name is returned in the "return_filename" parameter. Note that you must provide enough space for the C string "return_filename" (see example code for more information). The return value signals success (value "1") or failure ("0"), the latter indicating that the user has clicked the "Cancel" button. This function can not be used during real-time processing.

int tGetSaveFileName(const char *instruction, const char *default_folder_file, const char *type_of_files, char *return_filename)

Presents a standard "File Save" dialog with the provided "instruction" text. The contents of the folder provided in the "default_folder_file" parameter will be shown in the dialogs file browser initially. If not only a path but also a filename is provided, the filename will be used as the default name for the to-be-saved file. The "type_of_files" parameter can be used to filter the files in a folder with respect to a provided file type. You must use the syntax "<File Type> (*.<Extension>)" to specify a filter, i.e. "Protocol Files (*.prt)". When the user clicks the "Save" button of the dialog, the selected file name is returned in the "return_filename" parameter. Note that you must provide enough space for the C string "return_filename" (see example code for more information). The return value signals success (value "1") or failure ("0"), the latter indicating that the user has clicked the "Cancel" button. This function can not be used during real-time processing.


Copyright © 2014 Rainer Goebel. All rights reserved.