10. Property Panels

This section explains how to create and edit Property Panels.

10.1. Usage

A property panel is a group of information to display based on the current selection.

10.2. Files location

To be recognized by the application, property panels should be located in one of these folders:

  • %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/PythonPluginExtensions/OrsObjectPropertiesList/OrsPropertyPanels (available for the current user)
  • %ProgramData%/ORS/Dragonfly(version)/pythonAllUsersExtensions/PythonPluginExtensions/OrsObjectPropertiesList/OrsPropertyPanels (available for all users)
  • %ProgramData%/ORS/Dragonfly(version)/python/OrsPythonPlugins/OrsObjectPropertiesList/OrsPropertyPanels (distributed with the application)

Note

All the mandatory files defining a property panel should be contained in a folder having the same name as the property panel implementation file and the implementation class. For example, a property panel named APropertyPanel would be constituted of these files:

  • %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/PythonPluginExtensions/OrsObjectPropertiesList/OrsPropertyPanels/APropertyPanel/__init__.py
  • %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/PythonPluginExtensions/OrsObjectPropertiesList/OrsPropertyPanels/APropertyPanel/APropertyPanel.py
  • %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/PythonPluginExtensions/OrsObjectPropertiesList/OrsPropertyPanels/APropertyPanel/ui_mainform.py

See Extension files for more information on the purpose of each file.

10.3. File creation

To create a property panel, start the application, start the OrsPythonPlugins.OrsGenericPropertyPanelGenerator.OrsGenericPropertyPanelGenerator (found in Developer/Generic Property Panel Generator), fill in the required fields and press the button Create property panel.

By default, the panel will be displayed when a single object is selected among the specified Managed classes.

10.4. File edition

Design the UI

Design the UI in the generated file mainform.ui.

See How to develop a User Interface for more information.

Develop the code

Open the implementation file (the Python file having the name of the property panel) in a text editor. Fill in the required methods.

10.5. Demos

Source code example:

  1. Download the compressed file;
  2. Extract these files into a property panel extension folder;
  3. Start the application;
  4. Draw an annotation (points, ruler, angle or path);
  5. When selecting an annotation, the property panel is shown. It contains the control points positions of the annotation. The positions of the control points are updated when the annotation is modified;
  6. Double-click on a cell of the table to set the position of a control point. The position of the control point is updated on the views.