As suggested by @Vanuan. and already implemented in new experimental BIM Wall: 1084a4b0a9
Draft: updated Draft Edit
thanks to the suggestions by @Vanuan
Draft: further bugfixing and improvements in Draft_Edit
Draft: moved Draft_Edit preview code into respective GuiTools
This includes `gui_utils`, `init_draft_statusbar`, `init_tools`,
`messages`, `todo`, `translate`, `utils`.
These are added to the `draftutils` Doxygen group
so that the functions contained in each module are listed
appropriately in the automatically generated documentation.
These functions were previously in `draftutils.utils`,
and are related to grouping objects and finding objects
inside groups. These include `get_group_names`, `ungroup`,
`get_windows`, `get_group_contents`, `get_movable_children`.
These are imported in the main `Draft.py` module, so compatibility
is retained.
Modules which use these functions are updated; these include
Gui Commands like `Move`, `Rotate`, `Scale`, `AddToGroup`,
as well as objects like `DrawingView` and `Shape2DView`,
and `ViewProviderClone`.
The code inside the `importDXF` module is also updated.
The Arch Workbench uses many of these functions
but it does so from the `Draft` namespace, so these edits
don't change the situation for these commands.
The old `convertDraftTexts` function was moved from the `Draft.py`
module to the `draftutils.utils` module; however, here it is
not possible to use because the `makeText` function
is not accessible. Therefore, the function is moved to
`draftmake.make_text`.
These style properties are used by `ViewProviderDraftAnnotation`
and by the Gui Command `Draft_AnnotationStyleEditor`.
Therefore, they are moved from `draftguitools.gui_annotationstyleeditor`
module to the `draftutils.utils` module, so that they
are in a central location where they won't cause circular
dependencies.
Also add `find_doc` to be able to test the existence of an
active document before searching for the object.
These can be used in the make functions of most modifier commands.
Use the value of the parameters `Draft_array_fuse`
and `Draft_array_Link` to set the default value
of the `Fuse` and `Link array` checkboxes in the task panels.
These default to `False` and `True`, respectively.
Whenever the user toggles a checkbox
the new value of the parameter is stored so that when
the command is used again the last state of the checkbox
is remembered.
Small spacing fixes like imports in separate lines
for more clarity, and the position of the license.
Also use the new `messages` module to provide the functions
to print text to the console.
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.
The following is a list of functions and attributes that were moved:
`stringencodecoin`, `arrowtypes`, `typecheck`,
`getParamType`, `getParam`, `setParam`, `precision`,
`tolerance`, `epsilon`, `getRealName`, `getType`,
`getObjectsOfType`, `isClone`, `getGroupNames`,
`ungroup`, `shapify`, `getGroupContents`,
`printShape`, `compareObjects`, `loadSvgPatterns`,
`svgpatterns`, `getMovableChildren`, `getWindows`,
`utf8_decode`.
Moreover, many of these functions were renamed
to comply better with PEP8 guidelines, particularly
the use of `snake_case`. For example, `getGroupNames`
is now `get_group_names`; `getMovableChildren`
is now `get_movable_children`.
Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.