Files
create/src/Mod/Draft/draftguitools
Roy-043 308391a806 Draft: Update gui_selectplane.py
Related issue:
#5603

Previous PR:
#11010

* This PR implements the new PlaneGui class for the Draft_SelectPlane command.
* As mentioned in the previous PR, almost all working plane related code has been removed from gui_selectplane.py.
* The task panel has a new button "Next" to switch to the next working plane in the history.
* Both the "Previous" and "Next" buttons are only enabled if there is a corresponding step in the history.
* PlaneGui stores a working plane per 3D view, but the other commands have to be updated before that system is fully functional.
* Code to update the toolbar when switching to a different view will be added later.
2023-10-17 15:05:28 +02:00
..
2022-01-10 15:12:09 +01:00
2023-10-09 14:01:21 +02:00

General

2020 May

These files define the "GuiCommands", that is, classes called in a graphical way through either buttons, menu entries, or context actions. They don't define the graphical interfaces themselves, but set up the interactions that allow running Python functions when graphical data is provided, for example, when points or objects are selected in the 3D view.

There is no need to check for the existence of the graphical interface (GUI) when loading these classes as these classes only work with the GUI so we must assume the interface is already available. These command classes are normally loaded by InitGui.py during the initialization of the workbench.

These tools were previously defined in the DraftTools.py module, which was very large. Now DraftTools.py is an auxiliary module which just loads the individual tool classes; therefore, importing DraftTools.py in InitGui.py is sufficient to make all commands of the Draft Workbench accessible to the system. Then the toolbars can be defined with the command names.

The classes defined here internally use the public functions provided by Draft.py, which are ultimately defined in the modules under draftutils/, draftfunctions/, and draftmake/.

Those GUI commands that launch a "task panel" set up the respective widgets in two different ways typically.

  • "Old" commands set up the task panel from the DraftGui.py module.
  • "New" commands call the respective class from a module in drafttaskpanels/, which itself loads a .ui file (created with Qt Designer) from Resources/ui/.

For more information see the thread: [Discussion] Splitting Draft tools into their own modules

To do

In the future each tool should have its own individual task panel file, and its own .ui file.

This should be done by breaking DraftGui.py, creating many .ui files, and making sure these GUI commands use them properly.