.. meta:: :description: Extensions Property Panels Property Panels =============== This section explains how to create and edit Property Panels. Usage ----- A property panel is a group of information to display based on the current selection. .. _filesLocationPropertyPanelExtension: 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 :ref:`extensionFiles` for more information on the purpose of each file. File creation ------------- To create a property panel, start the application, start the :mod:`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. File edition ------------ **Design the UI** Design the UI in the generated file *mainform.ui*. See :ref:`howtodevelopui` 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. Demos ----- Source code example: #. Download the :download:`compressed file `; #. Extract these files into a :ref:`property panel extension folder `; #. Start the application; #. Draw an annotation (points, ruler, angle or path); #. 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; #. 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.