UserInterface Class
The UserInterface class allows interacting with PrestoPlot graphical user interface. For example, you can add buttons to toolbars to make some actions.
Public Functions
addGraphToolbarButton{ graph image tooltip script }
addMenuEntry{ label script }
addToolbarButton{ image tooltip script }
arrangeWindows{ mode }
loadImage{ filename }
showMessage{ title message }
Detailed Functions Descriptions
addGraphToolbarButton
addGraphToolbarButton{ graph image tooltip script }
Add a button in a graph toolbar. An icon will take place in the Plugins group.
Parameters :
-
graph: A Graph object where the button will be added. -
image: The image identifier to display in the button. -
tooltip: The tooltip text to display when mouse hovers. -
script: The code being executed when the user clicks on the button. The$graphvariable will be available to access to the Graph object.
addMenuEntry
addMenuEntry{ label script }
Add an entry in the Plugin menu.
Parameters :
-
label: The menu label -
script: The code being executed when menu is activated by the user.
addToolbarButton
addToolbarButton{ image tooltip script }
Add a button in the main PrestoPlot toolbar. The button will take place in the Plugins group.
Parameters :
-
image: The image identifier to display in the button. -
tooltip: The tooltip text to display when mouse hovers. -
script: The code being executed when the user clicks on the button.
arrangeWindows
arrangeWindows{ mode }
This function will arrange windows to quickly get a smart display.
Parameters :
-
mode: The way windows will be arranged :- TILE: Rearrange windows with equal size in rows and columns as a grid.
- HORIZONTALLY: Rearrange windows with equal size from top to bottom.
- VERTICALLY: Rearrange windows with equal size from left to right.
- CASCADE: Rearrange windows overlapping from the top left corner so that all window titles are visible.
- MAXIMIZE: Make windows as large as possible.
- MINIMIZE: Make all windows the size of a small part of the window title bar.
loadImage
loadImage{ filename }
Load an image file that can be used in the PrestoPlot user interface functions, like addToolbarButton.
Parameters :
filename: The image file name to convert (PNG, JPG, GIF).
Return : An identifier referencing the loaded image, that can be given to other functions.
showMessage
showMessage{ title message }
This function will simply display a message popup to the user. The code execution is suspended until the user closes the dialog.
Parameters :
-
title: The title of the displayed message. -
message: A message to be displayed to the user.