DockedFormEditor

From Lazarus wiki
Revision as of 21:58, 14 February 2021 by Michl (talk | contribs) (Anchors)

English (en) русский (ru)

The DockedFormEditor is a package for Lazarus IDE that docked a form next to source editor unit. This package is shipped with Lazarus version 2.1 upwards.

Why is it usefull?

If you don't like to search a form related to a unit, you can switch in the source editor pages. There you find the form docked as tab. Usefull is a combination of packages AnchorDockingDsgn with DockedFormEditor, if you don't like the default "separate windows" look of the Lazarus IDE and prefer a single window.

DockedFormEditor is the replacement and initially forked form Sparta_DockedFormEditor. If you used this package in the past, please switch to DockedFormEditor as all Sparta packages are now defined as deprecated and will be removed in a future version of Lazarus.

Installation

Uninstall any other docking managers (e.g., easydockmgrdsgn). Install this package (and maybe AnchorDockingDsgn) per MainMenu -> Package -> Install/Uninstall Packages... -> check the package dockedformeditor. Now recompile Lazarus IDE.

Layout

After installation there are the design tabs docked next to source editor unit:

DockedLayout1.png

Pages

Code

In the tab Code is the source editor, where you can implement the logic of your app.

DockedCode.png

Form

In the tab Form is the default form designer. Without this package it is a separate window.

DockedForm.png

Anchors

In the tab Anchors is a optional anchor designer. It's follows the WYSIWYG concept and your form react at runtime same as in designtime. It can be used simultaneously with default Anchor Editor:

  • You can snap a control border or point with the grips and anchor it to a next or parent control.
  • Sizing or positioning without anchoring are possible with mouse.
  • With <Ctrl> + mouse you can change the border around a control.
  • Constaints of a control are noted.
  • Per popup menu a control can simply fixed on paranet or this fixing can be removed.
  • All properties affected per Anchor Designer are shown in hint of control.

DockedAnchors.png

Options

There are some options, found after package installation, under MainMenu -> Tools -> Options ... -> Docked Form Editor. Next to some color definitions you find:

  • Tab position: defines the position of the tabs Code, Form, Anchors
  • Force Refreshing At Sizing: if the resizing eats to much time, this option can be deactivated
  • Capture Distance: this is the minimal distance in pixel to catch a control with mouse
  • Automatically treat Alings properties: the Anchor Designer can only work with Anchors, so Aligns are translated to Anchors when this option is activated
  • Automaticall treat BorderSpacing properties: allow Anchor designer to change all Borderings (Around, Left, Top, Right, Bottom) to fit in, if option is activated

Limits

  • Tested on Windows7, 10, Linux Mint Cinnamon with GTK2, QT4, QT5.
  • For now only one source editor window is allowed. Multiple windows are in work.
  • Undo mechanism for Anchor Editor is not implemented but in work.

Links