Properties and events of the panel
Property sheet
The property sheet of a panel opens when a panel is opened. In the property sheet, you can edit the panel properties.
The following figure shows the Standard tab of a panel.
The following table lists and describes the properties of panels.
Entry in the Property Sheet | Description | |||||||||||||||
Name | The Panel name is a unique name identifying the panel and is shown in the window header after it has been saved. You must assign panel names if you want to address panels in scripts. | |||||||||||||||
Typename |
The Typename, as well as the panel name, can be used for a more detailed definition of selectors in stylesheets. Moreover, it is possible to set/get the type name during runtime by using setValue/getValue (e.g. setValue(myModuleName() + "." + myPanelName() + ":", "type", "paneltype1" );). Note If the type attribute is changed during runtime the stylesheet property must be reapplied (see setApplicationProperty()). Only ASCII characters are allowed for defining the type name. |
|||||||||||||||
RefPoin tX, RefPoint Y | The position of the panel is specified by the coordinates. This is important when a panel will be used as a reference by another panel (see chapter Properties of references and override). | |||||||||||||||
Size X, Y |
The height and width of a panel (Pixel) (available via CTRL) - size(width, height) Note Although, with Qt5 the maximum possible size of a panel is QSize(16777215,16777215) pixels, but it is recommended not to exceed the size 32,000 x 32,000 pixels, because only then every pixel is displayed correctly. However, it is also discouraged from creating panels with this size, if a not high-performance graphics card is used. Under Windows, it can lead also to a too high GDI resource consumption. Thus, it is recommended to create more small panels than one big one. |
|||||||||||||||
Layout Bottom/Left/ Right/Top Margin | Defines the space between the layout and the panel borders. | |||||||||||||||
Layout Spacing | Defines the space between the layouts. | |||||||||||||||
Layout Type |
Enables the layout management and defines the layout type. There are two different types:
For further details refer to the chapter Layout management. |
|||||||||||||||
Active layer |
Shows the visible layers. Clicking on this field opens the Layers Sheet (see also The Layer window (Layer settings) ). |
|||||||||||||||
Keep in memory |
The panel remains in cache. With the Keep in memory property you can choose whether the panel should be held in cache. Since it is stored there by default, you can reduce memory usage by selecting No. (available via CTRL) - keepInMemory(bool) Note If you use references and change these in a panel with the default setting "Cache Panel", you have to restart the UI to actualize the chances. |
|||||||||||||||
LangChange redraw only |
Defines the handling of the panel when you switch the language. TRUE: The switching will be executed by "redrawing" all static panel texts and by executing the "LangChanged". Use this option with new panels that have no "Initialize" scripts for setting a specific text to defined objects. FALSE: The "Redraw only" option. Additionally, all childpanels will be closed, all CTRL scripts stopped (also the script with the switchLang() function) and all "Initialize" executed. This option is activated by default and should be used with older panels that transfer texts to objects at the initialization. |
|||||||||||||||
layoutEnabled | Gets or sets if the panel has the layout handling enabled or disabled (available via CTRL) - layoutEnabled(bool) | |||||||||||||||
Maximum Size | Gets or sets the maximum size of the panel (available via CTRL) - maximumSize(width, height) | |||||||||||||||
mapFromGlobal | Allows to convert the global coordinates into panel relative coordinates. Panel coordinates are based on the upper left corner (0,0) of the panel and do not take into account if the panel is zoomed or original size. (available via CTRL) - mapFromGlobal(int gx, int gy, int &x, int &y); | |||||||||||||||
mapToGlobal | Allows to convert the panel relative coordinates into global coordinates. Panel coordinates are based on the upper left corner (0,0) of the panel and do not take into account if the panel is zoomed or original size. (available via CTRL) - mapToGlobal(int x, int y, int &gx, int &gy); | |||||||||||||||
Minimum Size | Gets or sets the minimum size of the panel (available via CTRL) - minimumSize(width, height) | |||||||||||||||
moduleName | Gets the name of the current module (like myModuleName()) (read-only; available via CTRL) - moduleName(string) | |||||||||||||||
namePath |
Returns the path to the panel reference based of the location of the top parent panel. (read-only; available via CTRL) - namePath() Only available for panel references. |
|||||||||||||||
panel |
Gets a pointer to the stated panel (read-only; available via CTRL) - panel(string panelName, shape &panel) Not available for panel references. |
|||||||||||||||
Panel Background |
The background color and/or image of a panel. You can design the panel to have a color background (the color selector is opened) and/or an image. All newly selected background images are always shared (located in ../pictures directory or the subdirectory). Note
|
|||||||||||||||
Panel File Name | Relative path to the panel inside of the file system. (available via CTRL) - panelFileName(string) | |||||||||||||||
parentPanel | Gets a pointer to the parent panel of the current panel when inside an embedded module, else an invalid 0-pointer is returned (read-only; available via CTRL) - parentPanel(shape) | |||||||||||||||
parentShape | Gets the pointer to the embedded module shape if the current panel is inside an embedded module, else 0 is returned. (read-only; available via CTRL) - parentShape(shape) | |||||||||||||||
Reference file | Instead of using the default configuration panel for setting $ parameters when inserting references, you can use your own panel. A panel is linked as a configuration panel by entering the panel name next to the property "Reference file" in the Property Sheet of the reference panel, for example, "para/ refpanel.pnl" or version panels: objects_parampanels/STD_ACTIVEX/CircularAnalog_para.pnl. | |||||||||||||||
rootPanel | Gets a pointer to the root panel of the current panel. If no root panel is available the current panel is returned. (read-only; available via CTRL) - rootPanel(shape) | |||||||||||||||
Runtime selection | Panel attribute "Runtime Selection" to turn on (default = off). The option to activate the selection of primitive shapes in a vision module. For more information see Multiselection at run time. | |||||||||||||||
Send Mouseclick |
If the Send click property has been set to Yes, then the x and y position of a mouse-click in the panel will be sent to data point elements of the UI manager being used. In addition to the X and Y coordinates, also the associated module and panel are saved in the data point. Thus, for example, the coordinates of the last mouse click can be queried. Default: No. |
|||||||||||||||
Start Init-Script in Ref |
Starting the script EventInitialize. Starts the Initialize and the Terminate script, if the panel is used as reference. the default is Yes. |
|||||||||||||||
startInitScriptMode |
Start mode of scripts The startInitScriptMode attribute affects all shapes of the own panel. If you use references in your panel, the start behavior of the shapes within a reference is affected by its own startInitScriptMode attribute. All Objects: (default): the panel starts all "Initialize" scripts when you open it. Whether the object is located within the display or on a visible layer is not considered. Visible Objects: When you open a panel, the panel only executes the scripts of objects located within the display and on a visible layer. The further panel area with its objects is built first at runtime via scrolling to left/right/up/down. The area is built having regard to the cluttering settings for the different layers. The panel executes the "Initialize" scripts configured for different objects first when the object is located within the display and on a visible layer. See also chapter: Cluttering/Decluttering. Within the references the system also executes scripts of shapes that are invisible. If you set the startInitScriptMode of a reference to AllObjects and the startInitScriptMode of the main panel to Visible Objects, the system executes the scripts of all visible references. Within the references, however, the system also executes the scripts of objects that are invisible. The following table illustrates the behavior:
|
|||||||||||||||
initAllShapes | The write-only attribute allows to trigger all shape initialization scripts (if not yet started) even if the shapes are currently not visible and the startInitScriptMode has been set to "only visible shapes". (available via CTRL) - initAllShapes() | |||||||||||||||
Start Zoomfactor | Zoom factor that will be used when a panel is opened. | |||||||||||||||
ZoomPoint X, Y |
x position of a panel when the panel is opened. y position of a panel when the panel is opened. |
|||||||||||||||
updatesEnabled | Allows to deactivate the graphical updates of the panel to get a smooth drawing experience for the panel content. (Available via CTRL) - self.updatesEnabled(bool) | |||||||||||||||
windowFlags |
Gets or sets specific flags that define the behavior of the panel. Multiple flags can be set by using the pipe symbole ("|") (Available via CTRL) - windowFlags(string) Following flags are available:
|
|||||||||||||||
windowFrameGeometry |
This property holds the geometry of the window including the window frame. Can be used to move or resize the panel during run-time (available via CTRL) - windowFrameGeometry(x, y, w, h). Note
|
|||||||||||||||
windowGeometry |
This property holds the geometry of the window excluding the window frame. Can be used to move or resize the panel during run-time (available via CTRL) - windowGeometry(x, y, w, h). Note
|
|||||||||||||||
Window Icon |
Defines an icon which is displayed on the left side of a panel's title bar at runtime. You have to type in the icon name, e.g. myIcon.jpg. The icon must be located in the /pictures directory. In case that a empty string is given, the default icon is shown. |
|||||||||||||||
windowOpacity |
This property allows to define the opacity of the complete top level window (module or child panel). The valid range for the property is between 0.0 (completely transparent) and 1.0 (completely opaque). The default value is 1.0. (available via CTRL) - windowOpacity(float) Note
|
|||||||||||||||
windowState |
This property can be used to set the window state (available via CTRL) - windowState(string) Following states can be set:
Note
|
|||||||||||||||
windowVisible |
The attribute allows to get or set the visibility of the panel. (available via CTRL) - windowVisible(bool) Note This property is not available when the panel is used inside an embedded module |
|||||||||||||||
writeToFile |
The attribute allows to save a panel via script. (Available via CTRL) - writeToFile(string fileName, string format) Notes The "fileName" parameter corresponds to the name of the panel including the relative path in which the panel should be saved. The relative path is based on the project folder proj_path/panels/. The "format" parameter defines which panel format should be used to save the panel. The values "PNL", "XML" or an emtpy string can be used. Using an empty string indicates that the default panel format of the project is used, see defaultPanelFormat. It is to consider that properties of objects are not stored within the panel if "writeToFile" is used. They must be set using corresponding public functions within the "initialize" script of the object. |
|||||||||||||||
Restore Module Size |
If enabled (=TRUE) the size of the module is not adapted to fit the panel but instead the size values of the PVSS00ui.ini file are used (if available). The property must be set in the panel to which the module is added (e.g. by using moduleAddDockModule()). |
If a panel with a transparent background image is opened in several subsequent VISION modules, the background image might be displayed black or not at all.
If you use references and change these in a panel with the default setting "Cache", you have to restart the UI to update the changes.
scriptable Properties
These Attributes can be used in a Script to adress a Panel.
Property | Description |
selection |
List of all shapes and groups selected in the panel. read & write access |
shapes |
Returns all list pf pointers to all shapes within a panel, with the exeption of Panel-References read only |
groups |
Returns a list of pointers to all groups and toplevel Panel-References read only |
Events
The following events are available for panels:
Events | Action |
Initialize | When a panel is opened. |
Clicked |
Left-click or other available buttons. The exception is the right click, which has its own event. The button being used is specified in the mapping "event", which is passed to the script. Note: To use the middle mouse button to activate scripts, panning must be deactivated with [ui] middleMousePanning. |
Close | When clicking close in the title bar "x" or using the close panel option of the panel menu, you can configure a CTRL script to save your data. The script will be executed, but neither the panel nor the module are closed. To close the panel, you have to execute a PanelOff("PanelName") in the "Close" script. EventClose should prevent an accidental close of the module, and therefore could open a child panel with an "are you sure" dialog e.g. |
DoubleClicked | Left-double-click |
DragDrop | This event will be started when the user drops the information onto a panel and the panel notified the system before to accept the dropped media with dropAccept(). The passed arguments are the same as in the DragEnter event. See below. |
DragEnter |
This event will only be started when the panel accepts drops and has not been disabled. The panel must decide if it is prepared to accept the dropped information. If it is prepared, it must call the new CTRL function:
For more information see Drag & Drop at runtime. |
GestureTriggered |
This event is triggered via a swipe gesture e (a move with 1 or 2 fingers). The swipe gesture only works when the panel in the module is not larger than the viewport so that no scrollbars are needed (you see the complete panel). Otherwise a swiping move does panning (but this does not trigger the gesture script. This event is also available for the embedded module. If you use the event for both - the panel and the embedded module in a panel, the gesture of the embedded module is triggered when you swipe the embedded module. When you swipe the panel (outside the embedded module), the gesture of the panel is triggered. If the embedded module also contains a panel and the event "GestureTriggered", both the event of the embedded module and of the panel that is loaded in the module, are triggered. The script has the following arguments: main(string type, mapping data) type = "swipe" The mapping data has the following key/value pairs:
The values for "horizontal" and "vertical" are calculated out of the angle internally, if you, for example, move to the right but slightly up, the value of the horizontal will be "right" but the value of the up will still be "none") type = "scrollToPanel" The mapping data has the following key/value pairs:
|
LangChanged | If the language is changed at runtime |
RightMousePressed | Right-click |
ScopeLib |
In this script of the attribute-editor, you declare functions and (script-global) variables that are used by all objects of the panel (except panel references). The panel global variables exists only once and can be changed by all scripts. Note Inside the GEDI the initialization of the ScopeLib is only performed if at leas one #property has been defined. |
Terminate |
When terminating with panelOff() or a close button, the panel closes immediately. It is only possible to execute a last dpSet(), for example, to free a lock. The call of the function LogoutDialog() triggers the "Terminate" Event. |
Zoom |
When zooming. "Zoom" is not possible for default panels of the version. Syntax: main (string moduleName, string panelName). |
If a reference exists twice, there will also be two variables.