Functions | |
void | TecUtilInterfaceSuspend (Boolean_t DoSuspend) |
Suspends or un-suspends updates to the interface only (not including the status line). | |
void | TecUtilDialogAllowDoubleClickLaunch (Dialog_e Dialog, Boolean_t DoAllow) |
Enables or disables a dialog's ability to be launched via a context sensitive double click. | |
Boolean_t | TecUtilDialogLaunch (Dialog_e DialogToLaunch) |
Launch a Tecplot interface dialog. | |
Boolean_t | TecUtilDialogDrop (Dialog_e DialogToDrop) |
Drop a Tecplot interface dialog. | |
Boolean_t | TecUtilInterfaceWinAddPreMsgFn (PreTranslateMessage_pf PreTranslateMessageProc) |
Add a PreTranslateMessage function to Tecplot's message loop so that modeless dialogs messages can be dispatched correctly. | |
Boolean_t | TecUtilDialogGetFolderName (const char *Title, char **FolderName) |
Launch a dialog to prompt the user for a folder name. | |
Boolean_t | TecUtilDialogGetFolderNameX (ArgList_pa ArgList) |
Launch a dialog to prompt the user for a folder name. | |
Boolean_t | TecUtilDialogGetFileName (SelectFileOption_e DialogOption, char **FileName, const char *FileTypeName, const char *DefaultFileName, const char *DefaultFilter) |
Launch a dialog to prompt the user for a file name. | |
Boolean_t | TecUtilDialogGetFileNames (SelectFileOption_e DialogOption, StringList_pa *FileNames, const char *FileTypeName, StringList_pa DefaultFileNames, const char *DefaultFilter) |
Launch a dialog to prompt the user for one or more file names. | |
Boolean_t | TecUtilDialogGetFileNamesX (ArgList_pa ArgList) |
Launch a dialog to prompt the user for one or more file names. | |
void | TecUtilSidebarAutoSensitivity (Boolean_t DoAuto) |
| |
void | TecUtilSidebarSetSensitivity (MouseButtonMode_e MouseMode, Boolean_t IsSensitive) |
| |
void | TecUtilToolbarActivate (Boolean_t Activate) |
Specifies whether to show the Tecplot toolbar or not. | |
void | TecUtilMenuActivate (Boolean_t Activate) |
Specifies whether to show the Tecplot menu or not. | |
Boolean_t | TecUtilMenuAddOption (const char *MenuPath, const char *MenuLabel, char Mnemonic, DynamicMenuCallback_pf MenuOptionCallback) |
Create a simple menu option in Tecplot's main menu. | |
Boolean_t | TecUtilMenuAddSeparator (const char *MenuPath) |
Adds menu separator to the end of the specified parent menu. | |
void | TecUtilMenuAddStatusLineHelp (Menu_pa MenuItem, const char *StatusLineHelp) |
Registers a character string to be displayed on the status line for a menu item. | |
Boolean_t | TecUtilMenuSetSensitivity (const char *MenuPath, const char *MenuLabel, Boolean_t IsSensitive) |
| |
Menu_pa | TecUtilMenuGetMain (void) |
Gets the menu handle for Tecplot's main menu. | |
Menu_pa | TecUtilMenuGetStandard (StandardMenu_e StandardMenu) |
Gets the menu handle for a top-level standard Tecplot menu. | |
Menu_pa | TecUtilMenuInsertSubMenu (Menu_pa ParentMenu, int InsertPos, const char *SubMenuLabel) |
Inserts a submenu into a menu. | |
Menu_pa | TecUtilMenuInsertOption (Menu_pa ParentMenu, int InsertPos, const char *OptionLabel, MenuActivateCallback_pf ActivateCallback, ArbParam_t ActivateClientData) |
Inserts a menu option into a menu. | |
Menu_pa | TecUtilMenuInsertToggle (Menu_pa ParentMenu, int InsertPos, const char *ToggleLabel, MenuActivateCallback_pf ActivateCallback, ArbParam_t ActivateClientData, MenuGetToggleStateCallback_pf GetToggleStateCallback, ArbParam_t GetToggleStateClientData) |
Inserts a menu toggle into a menu. | |
Menu_pa | TecUtilMenuInsertSeparator (Menu_pa ParentMenu, int InsertPos) |
Inserts a separator into a menu. | |
void | TecUtilMenuInsertStandard (Menu_pa ParentMenu, int InsertPos, StandardMenu_e StandardMenu) |
Inserts a standard Tecplot menu into another menu as a submenu. | |
void | TecUtilMenuRegisterSensitivityCallback (Menu_pa MenuItem, MenuGetSensitivityCallback_pf GetSensitivityCallback, ArbParam_t GetSensitivityClientData) |
Registers a function that will determine the sensitivity of a menu item (i.e., whether the item is enabled for user input or grayed out). | |
void | TecUtilMenuDelete (Menu_pa *MenuItemPtr) |
Deletes a menu item. | |
void | TecUtilMenuClearAll (void) |
Remove all menus, submenus, and menu items from the Tecplot menu bar. | |
void | TecUtilDialogErrMsg (const char *Message) |
Launch a dialog with an error message. | |
void | TecUtilDialogLaunchPercentDone (const char *Label, Boolean_t ShowTheScale) |
Launch the Percent Done dialog. | |
void | TecUtilDialogSetPercentDoneText (const char *Text) |
Update the text in the Percent Done dialog. | |
Boolean_t | TecUtilDialogCheckPercentDone (int PercentDone) |
Set the current value of the Percent Done dialog and check to see if the user has clicked Cancel. | |
void | TecUtilDialogDropPercentDone (void) |
Drop the Percent Done dialog. | |
char * | TecUtilLastErrorMessage (void) |
Returns the last recorded error message by Tecplot. | |
void | TecUtilLastErrorMessageClear (void) |
Clears the last error message queue such that immediately calling TecUtilLastErrorMessage() will return NULL. | |
Boolean_t | TecUtilDialogMessageBox (const char *Message, MessageBoxType_e MessageBoxType) |
Display a message to the user and, if desired, prompt for yes or no input. | |
Boolean_t | TecUtilDialogGetIndexRange (LgIndex_t MaxRangeValue, LgIndex_t *Min, LgIndex_t *Max, LgIndex_t *Skip) |
Launch a dialog that prompts the user for the minimum, maximum, and skip values of a range. | |
Boolean_t | TecUtilDialogGetVariables (const char *Instructions, const char *TextField1Label, const char *TextField2Label, const char *TextField3Label, EntIndex_t *Var1, EntIndex_t *Var2, EntIndex_t *Var3) |
Launch a dialog that prompts the user for one, two, or three variables. | |
Boolean_t | TecUtilDialogGetColor (Boolean_t AllowMultiColor, ColorIndex_t *Color) |
Launch a dialog that prompts the user for a color or for a multi-color setting. | |
Boolean_t | TecUtilDialogGetSimpleText (const char *Instructions, const char *DefaultText, char **Text) |
Launch a dialog to prompt the user to input into a simple text field. | |
void | TecUtilInterfaceGetDotsPerInch (double *VDotsPerInch, double *HDotsPerInch) |
| |
void | TecUtilDialogSetLaunchPosition (Widget W, int DialogWidth, int DialogHeight, AnchorAlignment_e DialogAnchor, LgIndex_t IOffset, LgIndex_t JOffset) |
|
Enables or disables a dialog's ability to be launched via a context sensitive double click.
Dialog | Dialog to enable or disable double click launching. | |
DoAllow | If the dialog can be launched via a double click this control whether this ability is enabled or disabled. |
Results = TecUtil.DialogAllowDoubleClickLaunch(Dialog, DoAllow) Input: Dialog Dialog_e (defined in TecVals.py) DoAllow boolean Output: Results[0] ReturnVal NONE
Boolean_t TecUtilDialogCheckPercentDone | ( | int | PercentDone | ) |
Set the current value of the Percent Done dialog and check to see if the user has clicked Cancel.
PercentDone | Value to which Percent Done dialog is to be set. If the TecUtilDialogLaunchPercentDone() call had ShowTheScale set to FALSE, then this parameter is ignored. |
INTEGER*4 FUNCTION TecUtilDialogCheckPercentDone(PercentDone) INTEGER*4 PercentDone
Python Syntax:
Results = TecUtil.DialogCheckPercentDone(PercentDone) Input: PercentDone int Output: Results[0] ReturnVal boolean
Launch, check, and destroy Percent Done dialog.
TecUtilDialogLaunchPercentDone("Calculate",TRUE); // do some processing if (!TecUtilDialogCheckPercentDone(35)) { // user pressed cancel button } else { // do some more processing } // finished processing TecUtilDialogDropPercentDone();
Drop a Tecplot interface dialog.
DialogToDrop | To remove Dialog from the screen. See Dialog in GLOBAL.h (or FGLUE.INC) for possible values. |
INTEGER*4 FUNCTION TecUtilDialogDrop(DialogToDrop) INTEGER*4 DialogToDrop
Python Syntax:
Results = TecUtil.DialogDrop(DialogToDrop) Input: DialogToDrop Dialog_e (defined in TecVals.py) Output: Results[0] ReturnVal boolean
Drop the Color Map dialog:
void TecUtilDialogDropPercentDone | ( | void | ) |
Fortran Syntax:
SUBROUTINE TecUtilDialogDropPercentDone()
Python Syntax:
Results = TecUtil.DialogDropPercentDone() Output: Results[0] ReturnVal NONE
void TecUtilDialogErrMsg | ( | const char * | Message | ) |
Launch a dialog with an error message.
This function is Thread Safe.
Message | String containing the error message. |
SUBROUTINE TecUtilDialogErrMsg(Message) CHARACTER*(*) Message
Python Syntax:
Results = TecUtil.DialogErrMsg(Message)
Input:
Message string
Output:
Results[0] ReturnVal NONE
Display an error message:
TecUtilDialogErrMsg("File not found.");
Boolean_t TecUtilDialogGetColor | ( | Boolean_t | AllowMultiColor, | |
ColorIndex_t * | Color | |||
) |
Launch a dialog that prompts the user for a color or for a multi-color setting.
AllowMultiColor | Set to TRUE if you wish to allow the user to select RGB or multi-color. | |
Color | The returned color value. If AllowMultiColor is FALSE then this is in the range between Black_C and Custom56_C (See GLOBAL.h). If AllowMultiColor is TRUE then the following constants may also be returned: |
MultiColor_C The user selected the first "MultiColor" option which implies they want the object colored by the contour variable used by contour group 1. MultiColor2_C The user selected the "C2" button which implies they want the object colored by the contour variable used by contour group 2. MultiColor3_C The user selected the "C3" button which implies they want the object colored by the contour variable used by contour group 3. MultiColor4_C The user selected the "C4" button which implies they want the object colored by the contour variable used by contour group 4. MultiColor5_C The user selected the "C5" button which implies they want the object colored by the contour variable used by contour group 5. MultiColor6_C The user selected the "C6" button which implies they want the object colored by the contour variable used by contour group 6. MultiColor7_C The user selected the "C7" button which implies they want the object colored by the contour variable used by contour group 7. MultiColor8_C The user selected the "C8" button which implies they want the object colored by the contour variable used by contour group 8. RGBColor_C The user selected the "RGB" button which implies they want the object colored by RGB.
INTEGER*4 FUNCTION TecUtilDialogGetColor( & AllowMultiColor, & Color) INTEGER*4 AllowMultiColor INTEGER*4 Color
Python Syntax:
Results = TecUtil.DialogGetColor(AllowMultiColor) Input: AllowMultiColor boolean Output: Results[0] ReturnVal boolean Results[1] Color TecVals color constant
Prompt the user for a basic color (no multi-color options):
ColorIndex_t Color; if (TecUtilDialogGetColor(FALSE, // AllowMultiColor &Color)) { // Do something with Color. }
Boolean_t TecUtilDialogGetFileName | ( | SelectFileOption_e | DialogOption, | |
char ** | FileName, | |||
const char * | FileTypeName, | |||
const char * | DefaultFileName, | |||
const char * | DefaultFilter | |||
) |
Launch a dialog to prompt the user for a file name.
DialogOption | Choose the mode of operation for the dialog. The possible values are: SelectFileOption_ReadSingleFile (allows you to read a file). SelectFileOption_WriteFile (allows you to bring up single file selection dialog to choose a file to write to). | |
FileName | Returns an allocated string containing the name of the file selected or NULL if one was not selected. If TecUtilDialogGetFileName() returns TRUE, you must call TecUtilStringDealloc() when it is no longer needed. | |
FileTypeName | A string describing the file type. Example: "Text file." Must not be NULL. | |
DefaultFileName | The initial file name. May be NULL. A full or partial path may be supplied to indicate the folder to be initially displayed in the browse dialog. If a partial path is used, it is relative to the folder most recently used in a Tecplot file or folder browser dialog. | |
DefaultFilter | The default filter (that is, extension). Example: "*.txt." May be NULL |
FileTypeName Pointer must be a valid address and non-NULL.
DefaultFileName Pointer must be a valid address or NULL.
DefaultFilter Pointer must be a valid address or NULL.
INTEGER*4 FUNCTION TecUtilDialogGetFileName( & DialogOption, & FileName, & FileNameLength, & FileTypeName, & DefaultFileName, & DefaultFilter) INTEGER*4 DialogOption CHARACTER*(*) FileName INTEGER*4 FileNameLength CHARACTER*(*) FileTypeName CHARACTER*(*) DefaultFileName CHARACTER*(*) DefaultFilter
Python Syntax:
Results = TecUtil.DialogGetFileName(DialogOption, FileTypeName, DefaultFileName, DefaultFilter) Input: DialogOption SelectFileOption_e (defined in TecVals.py) FileTypeName string DefaultFileName string DefaultFilter string Output: Results[0] ReturnVal boolean Results[1] FileName string
Prompt the user for a single file to read:
char *FileName; if (TecUtilDialogGetFileName(SelectFileOption_ReadSingleFile, &FileName, "Text Files", "myfile.txt", "*.txt")) { . . . do something with FileName . . . // free Tecplot's copy TecUtilStringDealloc(&FileName); }
Boolean_t TecUtilDialogGetFileNames | ( | SelectFileOption_e | DialogOption, | |
StringList_pa * | FileNames, | |||
const char * | FileTypeName, | |||
StringList_pa | DefaultFileNames, | |||
const char * | DefaultFilter | |||
) |
Launch a dialog to prompt the user for one or more file names.
It is assumed that the files selected will be opened only for reading. Use TecUtilGetFileName() to open a file for writing.
DialogOption | Choose the mode of operation for the dialog. The possible values are: SelectFileOption_ReadMultiFile (brings up the multi-file section dialog), SelectFileOption_AllowMultiFileRead (brings up single file section to start with but includes a button the user can press to get a multi-file selection dialog) | |
FileNames | Returns an allocated string list containing the names of the files selected or NULL if none were selected. If TecUtilDialogGetFileNames() returns TRUE, you must call TecUtilStringDealloc() when it is no longer needed. | |
FileTypeName | A string describing the file type. Example: "Text file." Must not be NULL. | |
DefaultFileNames | A string list containing the default file name(s). May be NULL. Full or partial paths may be supplied to indicate the folder to be initially displayed in the browse dialog. All the files should be in the same folder. If a partial path is used, it is relative to the folder most recently used in a Tecplot file or folder browser dialog. | |
DefaultFilter | The default filter (that is, extension). Example: "*.txt." May be NULL |
DefaultFilter Pointer must be a valid address or NULL.
INTEGER*4 FUNCTION TecUtilDialogGetFileNames( & DialogOption, & FileNamesPtr, & FileTypeName, & DefaultFileNamesPtr, & DefaultFilter) INTEGER*4 DialogOption POINTER (FileNamesPtr, FileNames) CHARACTER*(*) FileTypeName POINTER (DefaultFileNamesPtr, DefaultFileNames) CHARACTER*(*) DefaultFilter
Python Syntax:
Results = TecUtil.DialogGetFileNames(DialogOption, FileTypeName, DefaultFileNames, DefaultFilter) Input: DialogOption SelectFileOption_e (defined in TecVals.py) FileTypeName string DefaultFileNames sequence of strings DefaultFilter string Output: Results[0] ReturnVal boolean Results[1] FileNames sequence of strings
Prompt the user for one or more files to read:
StringList_pa FileNames; StringList_pa DefaultFileNames = TecUtilStringListAlloc(); TecUtilStringListAppendString(DefaultFileNames,"myfile.txt"); if (TecUtilDialogGetFileNames(SelectFileOption_ReadMultiFile, &FileNames, "Text Files", DefaultFileNames, "*.txt")) { // get the first file name char *FName = TecUtilStringListGetString(FileNames,1); ... do something with FName... TecUtilStringDealloc(&FName); // and free Tecplot's copy . . . do some more things with FileNames . . . TecUtilStringListDealloc(FileNames);// done with file name list } TecUtilStringListDealloc(&DefaultFileNames); // done with file name list
Boolean_t TecUtilDialogGetFileNamesX | ( | ArgList_pa | ArgList | ) |
Launch a dialog to prompt the user for one or more file names.
It is assumed that the files selected will be opened only for reading. Use TecUtilGetFileName() to open a file for writing.
ArgList | Set of Arglist entries. This is built using calls to TecUtilArgListAppendXXXX functions. Arglist Values SV_FILESELECTDIALOGTYPE
SV_FILESELECTDIALOGDEFAULTFILENAMES
SV_FILESELECTDIALOGFILTEREXTENSIONS
SV_FILESELECTDIALOGFILTERTITLES
SV_FILESELECTDIALOGDEFAULTFILTERINDEX
SV_FILESELECTDIALOGRETURNFILENAMES
SV_FILESELECTDIALOGRETURNFILTERINDEX
|
INTEGER*4 FUNCTION TecUtilDialogGetFileNamesX(ArgListPtr) POINTER (ArgListPtr, ArgList)
Python Syntax:
This function is not supported in Python.
StringList_pa ReturnFiles = NULL; int ReturnFilterIndex = 0; bool Result = TRUE; ArgList_pa argList = TecUtilArgListAlloc(); TecUtilArgListAppendInt(argList, SV_FILESELECTDIALOGTYPE, SelectFileOption); TecUtilArgListAppendStringList(argList, SV_FILESELECTDIALOGDEFAULTFILENAMES, DefaultFileNames); TecUtilArgListAppendStringList(argList, SV_FILESELECTDIALOGFILTEREXTENSIONS, FilterExtensions); TecUtilArgListAppendStringList(argList, SV_FILESELECTDIALOGFILTERTITLES, FilterTitles); TecUtilArgListAppendInt(argList, SV_FILESELECTDIALOGDEFAULTFILTERINDEX, DefaultFilterIndex); TecUtilArgListAppendArbParamPtr(argList, SV_FILESELECTDIALOGRETURNFILENAMES, (ArbParam_t *)ReturnFiles); TecUtilArgListAppendArbParamPtr(argList, SV_FILESELECTDIALOGRETURNFILTERINDEX, (ArbParam_t *)ReturnFilterIndex); Result = TecUtilDialogGetFileNamesX(argList); TecUtilArgListDealloc(&argList); if (Result) TecUtilStringListDealloc(&ReturnFiles);
Boolean_t TecUtilDialogGetFolderName | ( | const char * | Title, | |
char ** | FolderName | |||
) |
Launch a dialog to prompt the user for a folder name.
Title | Zero-terminated string that is displayed above the tree view control in the dialog box. This string can be used to specify instructions to the user. | |
FolderName | Returns an allocated string containing the name of the folder selected or NULL if one was not selected. If TecUtilDialogGetFolderName() returns TRUE, you must call TecUtilStringDealloc() when it is no longer needed. |
FolderName Pointer must be a valid address and non-NULL.
INTEGER*4 FUNCTION TecUtilDialogGetFolderName( & Title, & FolderName) CHARACTER*(*) Title CHARACTER*(*) FileName
Python Syntax:
Results = TecUtil.DialogGetFolderName(Title) Input: Title string Output: Results[0] ReturnVal boolean Results[1] FolderName string
Prompt the user for a single folder to read:
char *FolderName; if (TecUtilDialogGetFolderName("Please select a folder", &FolderName)) { . . . do something with FolderName . . . // free Tecplot's copy TecUtilStringDealloc(&FolderName); }
Boolean_t TecUtilDialogGetFolderNameX | ( | ArgList_pa | ArgList | ) |
Launch a dialog to prompt the user for a folder name.
ArgList | Set of Arglist entries. This is built using calls to TecUtilArgListAppendXXXX functions. Arglist Values SV_FILESELECTDIALOGRETURNFILENAMES
SV_DIALOGTITLE
SV_DEFAULTFNAME
|
INTEGER*4 FUNCTION TecUtilDialogGetFolderNameX(ArgListPtr) POINTER (ArgListPtr, ArgList)
Python Syntax:
Results = TecUtil.DialogGetFolderNameX(ArgList)
Input:
ArgList dictionary
Output:
Results[0] ReturnVal boolean
char* FolderName = NULL; Boolean_t FolderSelected = FALSE; ArgList_pa ArgList = TecUtilArgListAlloc(); TecUtilArgListAppendArbParamPtr(ArgList, SV_FILESELECTDIALOGRETURNFILENAMES, (ArbParam_t*)&FolderName); TecUtilArgListAppendString (ArgList, SV_DIALOGTITLE, "Select a folder"); TecUtilArgListAppendString (ArgList, SV_DEFAULTFNAME, "/usr/data/"); FolderSelected = TecUtilDialogGetFileNamesX(ArgList); if (FolderSelected) { . . . do something with FolderName . . . // free the string Tecplot allocated TecUtilStringDealloc(&FolderName); } TecUtilArgListDealloc(&ArgList);
Boolean_t TecUtilDialogGetIndexRange | ( | LgIndex_t | MaxRangeValue, | |
LgIndex_t * | Min, | |||
LgIndex_t * | Max, | |||
LgIndex_t * | Skip | |||
) |
Launch a dialog that prompts the user for the minimum, maximum, and skip values of a range.
MaxRangeValue | Maximum value for the range. Currently, this value is displayed at the top of the Enter Index Range dialog and also used to interpret zero and negative values for the other parameters, but it does not limit what values the user can enter. You must check the values of the other parameters upon return and check their validity in your code. A value of zero for MaxRangeValue will turn off the maximum value processing | |
Min | The value passed in is the default value displayed in the minimum text field. Upon return, this value holds the user-specified minimum value. If MaxRangeValue is not zero, a Min of zero is interpreted as MaxRangeValue, and negative values of Min are interpreted as subtracted from MaxRangeValue | |
Max | The value passed in is the default value displayed in the maximum text field. Upon return, this value holds the user-specified maximum value. Zero and negative values are interpreted as with Min above | |
Skip | The value passed in is the default value displayed in the skip text field. Upon return, this value holds the user-specified skip value. Zero and negative values are interpreted as with Min above |
Max Pointer must be a valid address and non-NULL.
Skip Pointer must be a valid address and non-NULL.
INTEGER*4 FUNCTION TecUtilDialogGetIndexRange( & MaxRangeValue, & Min, & Max, & Skip) INTEGER*4 MaxRangeValue INTEGER*4 Min INTEGER*4 Max INTEGER*4 Skip
Python Syntax:
Results = TecUtil.DialogGetIndexRange(MaxRangeValue) Input: MaxRangeValue int Output: Results[0] ReturnVal boolean Results[1] Min int Results[2] Max int Results[3] Skip int
Launch a dialog that prompts the user for the minimum, maximum, and skip values of a range:
LgIndex_t Min = 0, Max = 100, Skip = 1; TecUtilDialogGetIndexRange(100,&Min,&Max,&Skip); // values returned in Min,Max, and skip
Boolean_t TecUtilDialogGetSimpleText | ( | const char * | Instructions, | |
const char * | DefaultText, | |||
char ** | Text | |||
) |
Launch a dialog to prompt the user to input into a simple text field.
Instructions | String containing the instructions for the user. Tecplot will wrap the instructions for you. However, if you include a newline in the string it will force a new line. Under Windows you are limited to three lines of text | |
DefaultText | Set DefaultText to NULL if you want the default text to be blank, otherwise pass a default string. If you pass DefaultText you must deallocate Text no matter what the return value is. | |
Text | The resulting text string is placed here. |
DefaultText Pointer must be a valid address or NULL.
Text Pointer must be a valid address and non-NULL.
INTEGER*4 FUNCTION TecUtilDialogGetSimpleText( & Instructions, & DefaultText, & Text, & TextLength) CHARACTER*(*) Instructions CHARACTER*(*) DefaultText CHARACTER*(*) Text INTEGER*4 TextLength
Python Syntax:
Results = TecUtil.DialogGetSimpleText(Instructions, DefaultText) Input: Instructions string DefaultText string Output: Results[0] ReturnVal boolean Results[1] Text string
Prompt the user for text:
char *Text = NULL; if (TecUtilDialogGetSimpleText("Enter your name","Fred",&Text)) { // Do somthing with Text } if ( Text ) TecUtilStringDealloc(&Text);
Boolean_t TecUtilDialogGetVariables | ( | const char * | Instructions, | |
const char * | TextField1Label, | |||
const char * | TextField2Label, | |||
const char * | TextField3Label, | |||
EntIndex_t * | Var1, | |||
EntIndex_t * | Var2, | |||
EntIndex_t * | Var3 | |||
) |
Launch a dialog that prompts the user for one, two, or three variables.
Instructions | Character string displayed at the top of the dialog. Must not be NULL | |
TextField1Label | Character string displayed to the left of the first variable's selection menu. May be NULL | |
TextField2Label | Character string displayed to the left of the second variable's selection menu. Only used if Var2 is not NULL. May be NULL | |
TextField3Label | Character string displayed to the left of the third variable's selection menu. Only used if Var3 is not NULL. May be NULL. | |
Var1 | Value passed in is the default value displayed in the first variable's selection menu. Must not be NULL, and must be a valid variable number. Upon return, this value holds the user-selected first variable value | |
Var2 | Value passed in is the default value displayed in the second variable's selection menu. Use NULL to prompt for only one variable. May be NULL, but if not NULL, must be a valid variable number. Upon return, this value holds the user-selected second variable value | |
Var3 | Value passed in is the default value displayed in the third variable's selection menu. Use NULL to prompt for only one or two variables. May be NULL, but if not NULL, must be a valid variable number. Upon return, this value holds the user-selected third variable value. |
TextField1Label Pointer must be a valid address or NULL.
TextField2Label Pointer must be a valid address or NULL.
TextField3Label Pointer must be a valid address or NULL.
Var1 Pointer must be a valid address and non-NULL.
Var2 Pointer must be a valid address or NULL.
Var3 Pointer must be a valid address or NULL.
INTEGER*4 FUNCTION TecUtilDialogGetVariables( & Instructions, & TextField1Label, & TextField2Label, & TextField3Label, & Var1, & Var2, & Var3) CHARACTER*(*) Instructions CHARACTER*(*) TextField1Label CHARACTER*(*) TextField2Label CHARACTER*(*) TextField3Label INTEGER*4 Var1 INTEGER*4 Var2 INTEGER*4 Var3
Python Syntax:
This function is not supported in Python.
Prompt the user for two variables:
EntIndex_t Var1 = 1,Var2 = 1; if (TecUtilDialogGetVariables("Enter the values for V1 and V2:", "V1:", "V2:", NULL, &Var1, &Var2, NULL) { // values successfully entered }
FORTRAN Example.
INTEGER*4 IErr INTEGER*4 Var1 INTEGER*4 Var2 POINTER (NullPntr, Null) INTEGER*4 Null NullPntr = 0 Call TecUtilLockStart(AddOnID) Var1 = 1 Var2 = 1 IErr = TecUtilDialogGetVariables( & 'Get some variables'//char(0), & 'label 1'//char(0), & 'label 2'//char(0), & char(0), & Var1, & Var2, & Null) .... do something with Var1 and Var2 ..... Call TecUtilLockFinish(AddOnID)
Launch a Tecplot interface dialog.
DialogToLaunch | Dialog to launch. See Dialog_e for list of dialogs that you may launch. |
INTEGER*4 FUNCTION TecUtilDialogLaunch(DialogToLaunch) INTEGER*4 DialogToLaunch
Python Syntax:
Results = TecUtil.DialogLaunch(DialogToLaunch) Input: DialogToLaunch Dialog_e (defined in TecVals.py) Output: Results[0] ReturnVal boolean
Launch the Color Map dialog:
void TecUtilDialogLaunchPercentDone | ( | const char * | Label, | |
Boolean_t | ShowTheScale | |||
) |
Launch the Percent Done dialog.
Label | Text to describe the action about to be performed. | |
ShowTheScale | Set to TRUE if you want the scale to be used, otherwise set to FALSE |
SUBROUTINE TecUtilDialogLaunchPercentDone( & Label, & ShowTheScale) CHARACTER*(*) Label INTEGER*4 ShowTheScale
Python Syntax:
Results = TecUtil.DialogLaunchPercentDone(Label, ShowTheScale) Input: Label string ShowTheScale boolean Output: Results[0] ReturnVal NONE
Boolean_t TecUtilDialogMessageBox | ( | const char * | Message, | |
MessageBoxType_e | MessageBoxType | |||
) |
Display a message to the user and, if desired, prompt for yes or no input.
Message | Character string to display at the top of the dialog. Must not be NULL | |
MessageBoxType | The possible values are: Buttons Included:MessageBoxType_Error : OKMessageBox_Warning : OKMessageBox_Information : OKMessageBox_Question : OK, CancelMessageBox_YesNo : Yes, No |
INTEGER*4 FUNCTION TecUtilDialogMessageBox( & Message, & MessageBoxType) CHARACTER*(*) Message INTEGER*4 MessageBoxType
Python Syntax:
Results = TecUtil.DialogMessageBox(Message, MessageBoxType) Input: Message string MessageBoxType MessageBoxType_e (defined in TecVals.py) Output: Results[0] ReturnVal boolean
Prompt the user for a response to a question:
if (TecUtilDialogMessageBox("Do you like green eggs and ham?", MessageBoxType_Question)) { // do something here... }
void TecUtilDialogSetLaunchPosition | ( | Widget | W, | |
int | DialogWidth, | |||
int | DialogHeight, | |||
AnchorAlignment_e | DialogAnchor, | |||
LgIndex_t | IOffset, | |||
LgIndex_t | JOffset | |||
) |
void TecUtilDialogSetPercentDoneText | ( | const char * | Text | ) |
Update the text in the Percent Done dialog.
Text | Text to display in the percent done dialog. |
SUBROUTINE TecUtilDialogSetPercentDoneText(Text) CHARACTER*(*) Text
Python Syntax:
Results = TecUtil.DialogSetPercentDoneText(Text)
Input:
Text string
Output:
Results[0] ReturnVal NONE
Update the text in the Percent Done dialog to say "Phase II."
TecUtilDialogSetPercentDoneText("Phase II");
void TecUtilInterfaceGetDotsPerInch | ( | double * | VDotsPerInch, | |
double * | HDotsPerInch | |||
) |
Get the number of pixels per inch in the vertical and horizontal directions on the screen.
VDotsPerInch | The number of pixels per inch in the vertical direction | |
HDotsPerInch | The number of pixels per inch in the horizontal direction. |
HDotsPerInch Pointer must be a valid address and non-NULL.
SUBROUTINE TecUtilInterfaceGetDotsPerInch( & VDotsPerInch, & HDotsPerInch) REAL*8 VDotsPerInch REAL*8 HDotsPerInch
Python Syntax:
Results = TecUtil.InterfaceGetDotsPerInch() Output: Results[0] VDotsPerInch double Results[1] HDotsPerInch double
Get the pixels per inch values:
double VertPixels, HorzPixels; TecUtilInterfaceGetDotsPerInch(&VertPixels, &HorzPixels);
void TecUtilInterfaceSuspend | ( | Boolean_t | DoSuspend | ) |
Suspends or un-suspends updates to the interface only (not including the status line).
Updates to the work area and status line are still preformed unless suspended via a call to TecUtilDrawGraphics(), TecUtilWorkAreaSuspend() or TecUtilStatusSuspend().
DoSuspend | Indicates if Tecplot should suspend or un-suspend making updates to the interface. |
Results = TecUtil.InterfaceSuspend(DoSuspend)
Input:
DoSuspend boolean
Output:
Results[0] ReturnVal NONE
Boolean_t TecUtilInterfaceWinAddPreMsgFn | ( | PreTranslateMessage_pf | PreTranslateMessageProc | ) |
Add a PreTranslateMessage function to Tecplot's message loop so that modeless dialogs messages can be dispatched correctly.
See the ADK User's Manual for information on using TecUtilInterfaceWinAddPreMsgFn(). This function is only available under Windows.
PreTranslateMessageProc | Function to call to pretranslate messages. The PreTranslateMessage function you provide will have the following syntax: Boolean_t PreTranslateMessage(MSG *pMsg)Where pMsg is the message to preprocess |
This function is not supported in Python.
Install a PreTranslateMessage function for modeless dialogs for an add-on written in MFC:
Boolean_t PreTranslateMessage(MSG *pMsg) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); return AfxGetApp()->PreTranslateMessage(pMsg); } . . . // In InitTecAddon Function TecUtilInterfaceWinAddPreMsgFn(PreTranslateMessage);
char* TecUtilLastErrorMessage | ( | void | ) |
Returns the last recorded error message by Tecplot.
The operation does not modify Tecplot's internal state.
Results = TecUtil.LastErrorMessage()
Output:
Results[0] ReturnVal string
void TecUtilLastErrorMessageClear | ( | void | ) |
Clears the last error message queue such that immediately calling TecUtilLastErrorMessage() will return NULL.
If you intend on calling TecUtilLastErrorMessage() after calling another TecUtil function you should call TecUtilLastErrorMessageClear() prior to making the TecUtil call.
{ TecUtilLastErrorMessageClear(); Boolean_t isOk = TecUtilDataSetDeleteZone(zoneList); if (!isOk) { char* errorMessage = TecUtilLastErrorMessage(); if (errorMessage != 0) { ... } } }
Results = TecUtil.LastErrorMessageClear() Output: Results[0] ReturnVal NONE
void TecUtilMenuActivate | ( | Boolean_t | Activate | ) |
Specifies whether to show the Tecplot menu or not.
Activate | Set to TRUE to show the menu, FALSE to hide it |
SUBROUTINE TecUtilMenuActivate( & Activate) INTEGER*4 Activate
Python Syntax:
This function is not supported in Python.
Boolean_t TecUtilMenuAddOption | ( | const char * | MenuPath, | |
const char * | MenuLabel, | |||
char | Mnemonic, | |||
DynamicMenuCallback_pf | MenuOptionCallback | |||
) |
Create a simple menu option in Tecplot's main menu.
For more options when adding menu options use TecUtilMenuInsertOption() instead.
MenuPath | This is used to specify where you want your menu option placed in Tecplot's menu structure. You cannot put menu options in the File, View, or Plot menus unless you first call TecUtilMenuClearAll(). Use the newline character ('\n') to create options in sub-menu. Each sub-menu may have a mnemonic specified by putting a '&' in front of the desired letter. The mnemonic is used only if the sub-menu does not already exist, and thus is created by this call. (A mnemonic is a keyboard short-cut to access the menu.) | |
MenuLabel | Text to put on the menu option. You may specify a mnemonic for the option by putting a '&' in front of the desired letter. If you want to specify a '&' in the menu option itself, use "&&". (A mnemonic is a keyboard short-cut to access the menu.) You may specify an accelerator key by separating it from the MenuLabel with a tab ('\t'). An accelerator key is a key that can be used from within Tecplot to perform the function without going through the menu system. Accelerators should be of the form "Ctrl+L" or "Shift+L" or "Alt+L" or a combination such as "Ctrl+Shift+L" where "L" can be any letter or number. | |
Mnemonic | Should be set to TECUTILAUTOMNEMONIC. (If set to any other value, Mnemonic is assumed to be the character in MenuLabel that should be used as a mnemonic, and Tecplot will change the string accordingly. If set to '\0', the MenuLabel string is used unaltered.) | |
MenuOptionCallback | Function you create which will be called when the new menu option is selected. See DynamicMenuCallback_pf. |
INTEGER*4 FUNCTION TecUtilMenuAddOption( & MenuPath, & MenuLabel, & Mnemonic, & MenuOptionCallback) CHARACTER*(*) MenuPath CHARACTER*(*) MenuLabel CHARACTER*(*) Mnemonic EXTERNAL MenuOptionCallback
Python Syntax:
This function is not supported in Python.
Add an option to the Tools menu in Tecplot called "Banana." When selected, have Tecplot call the function BananaCallback.
First create the BananaCallback function:
void BananaCallback(void) { // code executed when "Banana" is selected in the // "Tools" menu. }
In the initialization code for the add-on add:
IsOk = TecUtilMenuAddOption("Tools", "&Banana", TECUTILAUTOMNEMONIC, BananaCallback);
To put the menu item in a sub-menu of Tools called "Fruit" use:
IsOk = TecUtilMenuAddOption("Tools\n&Fruit", "&Banana", TECUTILAUTOMNEMONIC, BananaCallback);
The sub-menu "Fruit" of "Tools" will be created if necessary, and if it is created, it will be given a mnemonic of 'F'.
To install an accelerator of Shift+B for this option, use:
IsOk = TecUtilMenuAddOption("Tools\n&Fruit", "&Banana\tShift+B", TECUTILAUTOMNEMONIC, BananaCallback);
The user can then invoke the BananaCallback without using the menu system. Hitting Shift+B in the work area of Tecplot will call BananaCallback.
Boolean_t TecUtilMenuAddSeparator | ( | const char * | MenuPath | ) |
Adds menu separator to the end of the specified parent menu.
For more options when adding separators use TecUtilMenuInsertSeparator() instead.
MenuPath | Specify the path to where the separator should be placed. |
INTEGER*4 FUNCTION TecUtilMenuAddSeparator(MenuPath) CHARACTER*(*) MenuPath
Python Syntax:
This function is not supported in Python.
void TecUtilMenuAddStatusLineHelp | ( | Menu_pa | MenuItem, | |
const char * | StatusLineHelp | |||
) |
Registers a character string to be displayed on the status line for a menu item.
If called again on the same menu item, the new string replaces the old one.
MenuItem | Specify the menu item for which to register status line help. This item can be an option, toggle, or submenu, but it cannot be a separator. | |
StatusLineHelp | Specify the text shown on the status line for a menu item. |
SUBROUTINE TecUtilMenuAddStatusLineHelp( & MenuItemPtr, & StatusLineHelp) POINTER (MenuItemPtr, MenuItem) CHARACTER*(*) StatusLineHelp
Python Syntax:
This function is not supported in Python.
Set the status line help for an existing menu item.
extern Menu_pa DoSomething1Option; // created elsewhere TecUtilMenuAddStatusLineHelp(DoSomething1Option, "Do Something New");
void TecUtilMenuClearAll | ( | void | ) |
Remove all menus, submenus, and menu items from the Tecplot menu bar.
This will clear menu items added by other add-ons, making those add-ons inaccessible. The add-on containing this call should either be the only add-on loaded into Tecplot, or it should be loaded into Tecplot first and it should clear the menus during initialization before the other add-ons are loaded. For more control over which menu items are deleted, use TecUtilMenuDelete() instead.
SUBROUTINE TecUtilMenuClearAll()
Python Syntax:
This function is not supported in Python.
To wipe out Tecplot's standard menu and replace it with a single option called "Banana" which is located under a menu called "Go":
TecUtilMenuClearAll(): IsOk = TecUtilMenuAddOption("&Go", "Banana", 'B', BananaCallBack);
void TecUtilMenuDelete | ( | Menu_pa * | MenuItemPtr | ) |
If that menu item is a submenu, all of its sub menu items are deleted as well. Deleting submenus can delete the menu items of other add-ons and may make those add-ons inaccessible.
MenuItemPtr | Specify a pointer to the menu item to delete. This item can be an option, toggle, submenu, or separator. |
SUBROUTINE TecUtilMenuDelete(MenuItemPtr) POINTER (MenuItemPtr, MenuItem)
Python Syntax:
This function is not supported in Python.
To delete the File menu.
Menu_pa FileMenu = TecUtilMenuGetStandard(StandardMenu_File); TecUtilMenuDelete(&FileMenu);
This code does the same thing using as TecUtilMenuClearAll(). The main menu always exists, so TecUtilMenuDelete() on the main menu only deletes the submenus of the main menu.
Menu_pa MainMenu = TecUtilMenuGetMain(); TecUtilMenuDelete(&MainMenu); // main menu is still around, so add an item to it TecUtilMenuInsertOption(MainMenu, MENU_POSITION_FIRST, "Do Something &1\tAlt+1", DoSomethingCallback, 1);
Menu_pa TecUtilMenuGetMain | ( | void | ) |
Gets the menu handle for Tecplot's main menu.
This handle may then be used with other functions such as TecUtilMenuInsertSubMenu().
SUBROUTINE TecUtilMenuGetMain(ResultPtr) POINTER (ResultPtr, Result)
Python Syntax:
This function is not supported in Python.
Menu_pa TecUtilMenuGetStandard | ( | StandardMenu_e | StandardMenu | ) |
Gets the menu handle for a top-level standard Tecplot menu.
This handle may then be used with other functions such as TecUtilMenuInsertOption().
StandardMenu | Specify the top-level menu for which to get the handle. |
Fortran Syntax:
SUBROUTINE TecUtilMenuGetStandard( & StandardMenu, & ResultPtr) INTEGER*4 StandardMenu POINTER (ResultPtr, Result)
Python Syntax:
This function is not supported in Python.
Menu_pa TecUtilMenuInsertOption | ( | Menu_pa | ParentMenu, | |
int | InsertPos, | |||
const char * | OptionLabel, | |||
MenuActivateCallback_pf | ActivateCallback, | |||
ArbParam_t | ActivateClientData | |||
) |
Inserts a menu option into a menu.
A menu option performs some action when selected in the menu system.
ParentMenu | Specify the menu in which to insert the new option. | |
InsertPos | Specify the position in the parent menu for the new option. MENU_POSITION_FIRST will put the new option first in the parent menu. MENU_POSITION_LAST will put the new option last in the parent menu. | |
OptionLabel | Specify the text for the new option. You may specify a mnemonic for the option by putting a '&' in front of the desired letter. If you want to specify a '&' in the menu option itself, use "&&". (A mnemonic is a keyboard short-cut to access the menu.) You may specify an accelerator key at the end of the label by separating it from the rest with a tab ('\t'). An accelerator key is a key that can be used from within Tecplot to activate the optionwithout going through the menu system. Accelerators should be of the form "Ctrl+L" or "Shift+L" or "Alt+L" or a combination such as "Ctrl+Shift+L" where "L" can be any letter or number. | |
ActivateCallback | Specify callback function to call when new menu option is activated. | |
ActivateClientData | Specify data to send to ActivateCallback when called for this new menu option. |
C C Note: Only one menu option callback function can active for each FORTRAN add-on. C Registering another menu option callback function overwrites the first. C You may use ClientData to differentiate between different menu options. C SUBROUTINE TecUtilMenuInsertOption( & ParentMenuPtr, & InsertPos, & OptionLabel, & ActivateCallback, & ActivateClientDataPtr, & ResultPtr) POINTER (ParentMenuPtr, ParentMenu) INTEGER*4 InsertPos CHARACTER*(*) OptionLabel EXTERNAL ActivateCallback POINTER (ActivateClientDataPtr, ActivateClientData) POINTER (ResultPtr, Result)
Python Syntax:
This function is not supported in Python.
Insert into the Tools menu two new options called "Do Something 1" and "Do Something 2". These menu options will appear as the first two options in the Tools menu.
First create a DoSomethingCallback function:
void DoSomethingCallback(ArbParam_t ClientData) { // code executed when one of the "Do Something" options is selected in the // "Tools" menu. ClientData will be 1 for the "Do Something 1" menu option, // and ClientData will be 2 for the "Do Something 2" menu option. }
Elsewhere (probably in the initialization of the add-on) add the menu items to the "Tools" menu.
Menu_pa ToolsMenu, DoSomething1Option, DoSomething2Option; ToolsMenu = TecUtilMenuGetStandard(StandardMenu_Tools); DoSomething1Option = TecUtilMenuInsertOption(ToolsMenu, MENU_POSITION_FIRST, "Do Something 1", DoSomethingCallback, 1); DoSomething2Option = TecUtilMenuInsertOption(ToolsMenu, 2, // second item in menu "Do Something 2", DoSomethingCallback, 2);
To assign keyboard short-cuts to the menu options, use the following code instead. "Do Something 1" has a keyboard short-cut of '1'. That is, it can be accessed quickly while in the "Tools" menu by simply pressing one. Likewise "Do Something 2" has a keyboard short-cut of '2'.
DoSomething1Option = TecUtilMenuInsertOption(ToolsMenu, MENU_POSITION_FIRST, "Do Something &1", DoSomethingCallback, 1); DoSomething2Option = TecUtilMenuInsertOption(ToolsMenu, 2, // second item in menu "Do Something &2", DoSomethingCallback, 2);
DoSomething1Option = TecUtilMenuInsertOption(ToolsMenu, MENU_POSITION_FIRST, "Do Something &1\tAlt+1", DoSomethingCallback, 1); DoSomething2Option = TecUtilMenuInsertOption(ToolsMenu, 2, // second item in menu "Do Something &2\tAlt+2", DoSomethingCallback, 2);
Inserts a separator into a menu.
A separator is a line displayed between menu items, it cannot be selected from the menu system.
ParentMenu | Specify the menu in which to insert the new separator. | |
InsertPos | Specify the position in the parent menu for the new separator. MENU_POSITION_FIRST will put the new separator first in the parent menu. MENU_POSITION_LAST will put the new separator last in the parent menu. |
SUBROUTINE TecUtilMenuInsertSeparator( & ParentMenuPtr, & InsertPos, & ResultPtr) POINTER (ParentMenuPtr, ParentMenu) INTEGER*4 InsertPos POINTER (ResultPtr, Result)
Python Syntax:
This function is not supported in Python.
First create a DoSomethingCallback function:
void DoSomethingCallback(ArbParam_t ClientData) { // code executed when one of the "Do Something" options is selected in the // "Tools" menu. ClientData will be 1 for the "Do Something 1" menu option, // and ClientData will be 2 for the "Do Something 2" menu option. }
Add some options to the top of the "Tools" menu and then separate them from the rest of that menu by including a separator.
Menu_pa ToolsMenu, DoSomething1Option, DoSomething2Option, Separator; ToolsMenu = TecUtilMenuGetStandard(StandardMenu_Tools); DoSomething1Option = TecUtilMenuInsertOption(ToolsMenu, MENU_POSITION_FIRST, "Do Something 1", DoSomethingCallback, 1); DoSomething2Option = TecUtilMenuInsertOption(ToolsMenu, 2, // second item in menu "Do Something 2", DoSomethingCallback, 2); Separator = TecUtilMenuItemInsertSeparator(ToolsMenu, 3); // third item in the menu
void TecUtilMenuInsertStandard | ( | Menu_pa | ParentMenu, | |
int | InsertPos, | |||
StandardMenu_e | StandardMenu | |||
) |
Inserts a standard Tecplot menu into another menu as a submenu.
ParentMenu | Specify the menu in which to insert the standard menu. | |
InsertPos | Specify the position in the parent menu for the standard menu. MENU_POSITION_FIRST will put the standard menu first in the parent menu. MENU_POSITION_LAST will put the standard menu last in the parent menu. | |
StandardMenu | Specify the top-level menu for which to get the handle. This menu cannot exist already in Tecplot. |
SUBROUTINE TecUtilMenuInsertStandard( & ParentMenuPtr, & InsertPos, & ResultPtr) POINTER (ParentMenuPtr, ParentMenu) INTEGER*4 InsertPos INTEGER*4 StandardMenu
Python Syntax:
This function is not supported in Python.
Move the Edit menu to be the first menu in the system. First delete the Edit menu if it exists, then readd it to the menu system as the first item in the main menu.
Menu_pa MainMenu, EditMenu; MainMenu = TecUtilMenuGetMain(); EditMenu = TecUtilMenuGetStandard(StandardMenu_Edit); if ( EditMenu != NULL ) TecUtilMenuDelete(&EditMenu); TecUtilMenuInsertStandard(MainMenu, MENU_POSITION_FIRST, StandardMenu_Edit);
Inserts a submenu into a menu.
A submenu displays other menu items when it is selected in the menu system.
ParentMenu | Specify the menu in which to insert the new submenu. | |
InsertPos | Specify the position in the parent menu for the new submenu. MENU_POSITION_FIRST will put the new submenu first in the parent menu. MENU_POSITION_LAST will put the new submenu last in the parent menu. | |
SubMenuLabel | Specify the text for the new submenu. You may specify a mnemonic for the submenu option by putting a '&' in front of the desired letter. If you want to specify a '&' in the submenu itself, use "&&". (A mnemonic is a keyboard short-cut to access the menu.) |
Fortran Syntax:
SUBROUTINE TecUtilMenuInsertSubMenu( & ParentMenuPtr, & InsertPos, & SubMenuLabel, & ResultPtr) POINTER (ParentMenuPtr, ParentMenu) INTEGER*4 InsertPos CHARACTER*(*) SubMenuLabel POINTER (ResultPtr, Result)
Python Syntax:
This function is not supported in Python.
Insert a submenu in the main menu called "Extras". This submenu will appear first in the main menu. This submenu has a keyboard short-cut of "X". That is, the user can activate this submenu by simply pressing the letter "X" while in the main menu. Since the option is in the main menu, "Alt+X" will work on some systems as well.
Menu_pa MainMenu = TecUtilMenuGetMain(); IsOk = TecUtilMenuInsertSubMenu(MainMenu, MENU_POSITION_FIRST, "E&xtras");
Menu_pa TecUtilMenuInsertToggle | ( | Menu_pa | ParentMenu, | |
int | InsertPos, | |||
const char * | ToggleLabel, | |||
MenuActivateCallback_pf | ActivateCallback, | |||
ArbParam_t | ActivateClientData, | |||
MenuGetToggleStateCallback_pf | GetToggleStateCallback, | |||
ArbParam_t | GetToggleStateClientData | |||
) |
Inserts a menu toggle into a menu.
Like a menu option, a menu toggle performs some action when selected in the menu system, but a menu toggle also displays an on/off state.
ParentMenu | Specify the menu in which to insert the new toggle. | |
InsertPos | Specify the position in the parent menu for the new toggle. MENU_POSITION_FIRST will put the new toggle first in the parent menu. MENU_POSITION_LAST will put the new toggle last in the parent menu. | |
ToggleLabel | Specify the text for the new toggle. You may specify a mnemonic for the toggle by putting a '&' in front of the desired letter. If you want to specify a '&' in the menu toggle itself, use "&&". (A mnemonic is a keyboard short-cut to access the menu.) You may specify an accelerator key at the end of the label by separating it from the rest with a tab ('\t'). An accelerator key is a key that can be used from within Tecplot to activate the menu toggle without going through the menu system. Accelerators should be of the form "Ctrl+L" or "Shift+L" or "Alt+L" or a combination such as "Ctrl+Shift+L" where "L" can be any letter or number. | |
ActivateCallback | Specify callback function to call when new menu toggle is activated (either to turn it on or to turn it off). | |
ActivateClientData | Specify data to send to ActivateCallback when called for this new menu toggle. | |
GetToggleStateCallback | Specify callback function that will return the current state of the new menu toggle. This callback is called whenever Tecplot needs to know the checked/unchecked stated of the toggle. If the callback returns TRUE, the toggle is checked. If the callback returns FALSE, the toggle is unchecked. | |
GetToggleStateClientData | Specify data to send to GetToggleStateCallback when called for this new menu toggle. |
C C Note: Only one menu toggle activate callback function can active for each FORTRAN add-on. C Registering another menu toggle activate callback function overwrites the first. C You may use ClientData to differentiate between different menu toggles. C Likewise, only one menu toggle get-state callback can be active for each FORTRAN add-on. C SUBROUTINE TecUtilMenuInsertToggle( & ParentMenuPtr, & InsertPos, & ToggleLabel, & ActivateCallback, & ActivateClientDataPtr, & GetToggleStateCallback, & GetToggleStateClientDataPtr, & ResultPtr) POINTER (ParentMenuPtr, ParentMenu) INTEGER*4 InsertPos CHARACTER*(*) ToggleLabel EXTERNAL ActivateCallback POINTER (ActivateClientDataPtr, ActivateClientData) EXTERNAL GetToggleStateCallback POINTER (GetToggleStateClientDataPtr, GetToggleStateClientData) POINTER (ResultPtr, Result)
Python Syntax:
This function is not supported in Python.
Insert into the Tools menu a toggle menu item called "Simple Toggle". This toggle will appear last in the Tools menu.
First create a SimpleToggleActivate callback function. This is called whenever the toggle is selected.
// global variable to track the state of the toggle static Boolean_t SimpleToggleState = TRUE; // checked by default void SimpleToggleActivate(ArbParam_t ClientData) { // code executed when the "Simple Toggle" is selected in the // "Tools" menu. ClientData will be 0 because that is what was // past in the call to TeCUtilMenuInsertToggle() below. // // For this simple case, we just invert a global variable. // SimpleToggleState = !SimpleToggleState; }
Next create a SimpleToggleActivate callback function. This is called whenever the state of the toggle is needed.
Boolean_t GetSimpleToggleState(ArbParam_t ClientData) { // code executed whenever the state of the "Simple Toggle" is needed. // ClientData will be 1 because that is what was past in the call // to TeCUtilMenuInsertToggle() below. // // For this simple case, we just look at the value of a global variable. // return SimpleToggleState; }
Elsewhere (probably in the initialization of the add-on) add the toggle to the "Tools" menu.
Menu_pa ToolsMenu, SimpleToggle; ToolsMenu = TecUtilMenuGetStandard(StandardMenu_Tools); SimpleToggle = TecUtilMenuInsertToggle(ToolsMenu, MENU_POSITION_FIRST, "Simple Toggle", SimpleToggleActivate, 0, //ActivateClientData GetSimpleToggleState, 1); //GetToggleStateClientData
void TecUtilMenuRegisterSensitivityCallback | ( | Menu_pa | MenuItem, | |
MenuGetSensitivityCallback_pf | GetSensitivityCallback, | |||
ArbParam_t | GetSensitivityClientData | |||
) |
Registers a function that will determine the sensitivity of a menu item (i.e., whether the item is enabled for user input or grayed out).
If this function is not used for a particular menu item, the item will always be available. If called again on the same menu item, the new function replaces the old one.
MenuItem | Specify the menu item for which to register a sensitivity function. This item can be a option, toggle, or submenu, but it cannot be a separator. | |
GetSensitivityCallback | Specify callback function to call to determine the sensitivity of the menu item. This function returns TRUE if the menu is sensitive, and FALSE if the menu is insensive (gray). | |
GetSensitivityClientData | Specify data to send to GetSensitivityCallback when called for the specified menu item. |
C C Note: Only one menu sensitivity callback function can active for each FORTRAN add-on. C Registering another menu sensitivity callback callback function overwrites the first. C You may use ClientData to differentiate between different menu items. C SUBROUTINE TecUtilMenuRegisterSensitivityCallback( & MenuItemPtr, & InsertPos, & ToggleLabel, & ActivateCallback, & ActivateClientDataPtr, & GetToggleStateCallback, & GetToggleStateClientDataPtr, & ResultPtr) POINTER (MenuItemPtr, MenuItem) EXTERNAL GetSensitivityCallback POINTER (GetSensitivityClientDataPtr, GetSensitivityClientData)
Python Syntax:
This function is not supported in Python.
Set the sensitivities of two menu items. The first will be available only when the frame is 3D. The second will be available only when the frame is a polar line plot.
First create a sensitivity callback function. This one uses the ClientData parameter to check different plot types.
Boolean_t CheckIfCurrentFrameIsOfType(ArbParam_t ClientData) { PlotType_e PlotType = (PlotType_e)ClientData; return TecUtilFrameGetPlotType()==PlotType; }
Then add the sensitivity callback to the menu item. Usually this is done when the item is created.
extern Menu_pa DoSomething1Option, DoSomething2Option; // created elsewhere TecUtilMenuRegisterSensitivityCallback(DoSomething1Option, CheckIfCurrentFrameIsOfType, (ArbParam_t)PlotType_Cartesian3D); TecUtilMenuRegisterSensitivityCallback(DoSomething2Option, CheckIfCurrentFrameIsOfType, (ArbParam_t)PlotType_PolarLine);
Boolean_t TecUtilMenuSetSensitivity | ( | const char * | MenuPath, | |
const char * | MenuLabel, | |||
Boolean_t | IsSensitive | |||
) |
Python Syntax:
This function is not supported in Python.
void TecUtilSidebarAutoSensitivity | ( | Boolean_t | DoAuto | ) |
Python Syntax:
Results = TecUtil.SidebarAutoSensitivity(DoAuto)
Input:
DoAuto boolean
Output:
Results[0] ReturnVal NONE
void TecUtilSidebarSetSensitivity | ( | MouseButtonMode_e | MouseMode, | |
Boolean_t | IsSensitive | |||
) |
Python Syntax:
Results = TecUtil.SidebarSetSensitivity(MouseMode, IsSensitive) Input: MouseMode MouseButtonMode_e (defined in TecVals.py) IsSensitive boolean Output: Results[0] ReturnVal NONE
void TecUtilToolbarActivate | ( | Boolean_t | Activate | ) |
Specifies whether to show the Tecplot toolbar or not.
Activate | Set to TRUE to show the toolbar, FALSE to hide it |
SUBROUTINE TecUtilToolbarActivate( & Activate) INTEGER*4 Activate
Python Syntax:
Results = TecUtil.ToolbarActivate(Activate)
Input:
Activate boolean
Output:
Results[0] ReturnVal NONE