LibreCAD 3 GUI Revamp – GSoC 2020 Phase 3

Hello!

With the last coding period of GSoC coming to an end, here’s what has been worked on in the last coding period.

Context Menu

A context menu has been added which allows the user to easily access some operations as well as switch between different input methods while creating an entity. The context menu can be accessed by right clicking.

The context menu has three modes, active, inactive and selected.

Inactive
Selected
Active

The user can undo,redo or start any tool through the inactive menu (when no entity is selected and no operation is in progress), while during selected mode the user can modify and copy the entity. In active mode (when an operation is in progress) the user can switch to a different method of input if required and can PAN or cancel the operation.

Context menu transitions can be easily specified in the lua operations by mentioning it in the operation properties

context_transitions = {
        setSecondPoint = {"LineWithPointAngleLength", "HorizontalLine", "VerticalLine"},
        LineWithPointAngleLength = {"setSecondPoint", "HorizontalLine", "VerticalLine"},
        HorizontalLine = {"setSecondPoint", "LineWithPointAngleLength", "VerticalLine"},
        VerticalLine = {"setSecondPoint", "LineWithPointAngleLength", "HorizontalLine"},
        LineParallelToLine = {"LineOrthogonalToLine"},
        LineOrthogonalToLine = {"LineParallelToLine"},
        ...
    }

Dock Positioning

Added dock position data in the ui_settings so that the dock configuration (along with width percentage) can be saved and loaded as desired.

The widget title bar has been updated to properly switch between horizontal and vertical titlebar depending on the dock position of the widget.

UI settings class has also been updated to make it easier to add more configurations in the future.

Copying Entities

Copying and pasting of entities and dimensions has been added between the same window or multiple windows. Entities can be copied/pasted by using the copy/paste option from the context menu or by using the keyboard shortcuts Ctrl-C and Ctrl-V

The entity properties data is transferred by serializing it into json format and then passing it to the required window, where it is deserialized and reconstructed from the properties.

Arc Operations

Some of the remaining missing arc operations has been added (StartCenterEnd, StartCenterAngle, StartCenterLength, StartEndAngle, StartEndRadius, StartEndCenter, CenterStartEnd, CenterStartAngle, CenterStartLength). Context menu options to switch between the input modes has also been added for these arc operations.

Text Operations

Text operations lua file and text dialog has been added to allow the user to create text entities. User can use either the lua operation (through toolbar or menu) to enter the text with the insertion point, height and angle. If the user requires more control over the font and other properties, text dialog can be used to add the text entity.

I had a lot of fun this summer and would again like to extend my thanks to my mentors and the community for helping me with my project, helping me learn and guiding and helping me with every doubt or issue that I had.

Akhil Nair

Dev Log

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.