.. meta:: :description: Extensions Plugin Plugins ======= This section explains how to create and edit plugins. .. _filesLocationPluginExtension: Files location -------------- To be recognized by the application, plugins should be located in one of these folders: - %LocalAppData%/ORS/Dragonfly(*version*)/pythonUserExtensions/Plugins (available for the current user) - %ProgramData%/ORS/Dragonfly(*version*)/pythonAllUsersExtensions/Plugins (available for all users) - %ProgramData%/ORS/Dragonfly(*version*)/python/OrsPythonPlugins (distributed with the application) .. note:: All the mandatory files defining a plugin should be contained in a folder having the same name as the plugin implementation file and the implementation class. For example, a simple plugin named ``ASimplePlugin`` would be constituted of these files: - %LocalAppData%/ORS/Dragonfly(*version*)/pythonUserExtensions/Plugins/ASimplePlugin/__init__.py - %LocalAppData%/ORS/Dragonfly(*version*)/pythonUserExtensions/Plugins/ASimplePlugin/ASimplePlugin.py See :ref:`extensionFiles` for more information on the purpose of each file. File creation ------------- To create a plugin, start the application, start the :mod:`OrsPythonPlugins.OrsPluginGenerator.OrsPluginGenerator` (found in *Developer/Python Plugin Generator*), fill in the required fields in the different tabs and press the button *Create plugin*. See :ref:`pluginElements` for more information on the elements of a plugin. File edition ------------ **Design the UI** If a UI is used, design it in the generated *.ui* file(s). See :ref:`howtodevelopui` for more information. **Develop the code** Open the implementation file (the Python file having the name of the plugin) in a text editor. Fill in the required methods. Demos ----- - :ref:`Interface methods basic structure ` - :ref:`Interface methods input as list ` - :ref:`Interface methods multiple outputs ` - :ref:`Top level menu item ` - :ref:`Static contextual menu item ` - :ref:`Static contextual menu item ` - :ref:`Dynamic contextual menu item ` - :ref:`Association of menu items to actions ` - :ref:`Class action ` - :ref:`Instance action ` - :ref:`State-dependent action ` - :ref:`Cursors ` - :ref:`Method handleChanged ` - :ref:`Method handleTriggered ` - :ref:`Temporary actions ` - :ref:`Temporary actions external state ` - :ref:`Interest on entities defined by the application ` - :ref:`Interest on user defined entities ` - :ref:`Mouse handlers state activation ` - :ref:`Mouse handlers annotations ` - :ref:`Instance callbacks ` - :ref:`Class callbacks ` - :ref:`Global callbacks ` - :ref:`Dirty signature flags ` - :ref:`Progress bars ` - :ref:`Promoting widgets ` - :ref:`How to develop a User Interface (video tutorial) `