Sign in Join
FPDoc Onlineexperiment

TWindowMagnetManager class

In unit Forms

Implements a manager for form and screen snapping behavior in an application.

Declaration

pascal
TWindowMagnetManager = class

Description

TWindowMagnetManager is a class used to manage magnetic window snapping behavior for windows in an application. TWindowMagnetManager is the type used to implement the MagnetManager property in TScreen. It provides properties, methods, and members needed to:

  • Track the position for a window on the screen.
  • Adjust the window position when it reaches the snapping threshold for an edge on another form or the screen.
  • Snap a specific form to an adjusted window position.

The Enabled property determines whether the magnetic window manager is enabled or disabled in the global Screen instance.

Use of TWindowMagnetManager depends on the LM_WINDOWPOSCHANGING message dispatched when the position for a form (window) is changed. In the current LCL release, the LM_WINDOWPOSCHANGING message is dispatched for the Windows platform only. None of the other widgetsets check for or apply the message.

Added in LCL version 3.0.

Properties

EnabledpublicEnables or disables form and/or screen snapping behavior using the manager class.

Methods

SnapToSidesprotectedPerforms actions needed to resize or reposition a form to another form or an edge on the screen.
SnapToMonitorprotectedSnaps a window to an edge on the monitor.
SnapToFormsprotectedSnaps a form to an edge on another form in the application which is a valid snap target.
CreatepublicConstructor for the class instance.
SnapFormpublicSnaps the specified form to the nearest snap target.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.