Implements Forms, which are the basis for the Lazarus Graphical User Interface

forms.pp contains classes, types, and routines used to implement forms, which are used as the basis a graphical user interface in the Lazarus Component Library (LCL).

The following components are added to the Lazarus IDE component palette:

Standard Tab

  • TFrame

Additional Tab

  • TScrollBox
  • TApplicationProperties

The unit also includes the TApplication and TScreen classes used in the Application and Screen singletons.

The type of a procedure that takes no arguments The type of a method that takes no arguments Represents the Position and Size of a Form on Screen

TPosition is an enumerated type with values that describe the policy used to position and size a form instance in an application. TPosition is the type used to implement the Position property in TCustomForm. TPosition is used in the implementation of the MoveToDefaultPosition method in TCustomForm.

The Form appears exactly as it is positioned and sized in the Form Designer. The window manager decides how the form is to appear, in a default position and size. Keeps the designed form size, but position determined by windowmanager. Keeps the designed form position, but size determined by windowmanager. Centers the form on screen. Centers the form on the desktop (not recommended, use poScreenCenter). Centers the form on the Main Form Centers the form on its Owner form Represents the actual State of the window on the screen

The actual meaning of each value depends on the platform:

Windows and Mac OS X
These operating systems support all values.
X11
The window state is a hint sent to the Window Manager, so more primitive Window Managers might ignore these hints.
Windows CE
In Windows CE platforms where Application.ApplicationType = atKeyPadDevice or atPDA (like in Windows Phone, PocketPC and Windows Mobile), wsMinimized and wsNormal are understood as wsMaximized, which is the normal state for windows in this platform. An exception are windows with BorderStyle=bsDialog or bsNone, which are allowed to have a custom position and size. For more information please read the Lazarus Wiki article.
Android
In this platform windows are always fullscreen.
Neither maximized nor minimized The window is minimized and is not shown in the screen, but only in the taskbar The window appears maximized. The exact behavior is up to the window manager, but usually the window appear occupying all of the work area of a monitor. The window appears in full screen mode, when allowed by the platform. It will, for example, attempt to appear on the top of taskbars and other static platform user interface elements. What should happen when a form is closed TCustomForm.OnClose Do nothing The form is hidden The form is destroyed The form is minimized Represents a standard action used to get a Hint value

TCustomHintAction is a TCustomAction descendant. TCustomHintAction publishes the Hint property available in the ancestor. TCustomHintAction is the base class for THintAction defined in the StdActns unit.

TCustomHintAction is used in TApplication when setting the value for its Hint property and its OnHint event handler has not been assigned. TCustomHintAction is also used in the ExecuteAction method in TStatusBar when its AutoHint property is enabled.

TStatusBar.ExecuteAction THintAction
The text used for the Hint The orientation of a ScrollBar Horizontal scrollbar Vertical scrollbar The range of scrollbar increments Scrollbar style flags Default Not used in the current LCL version. Scrollbar appears flat Not used in the current LCL version. Scrollbar sends HotTrack messages Not used in the current LCL version. Exception class raised in Type for a scrollbar in TScrollingWinControl

Scrollable controls supply their own integrated scrollbars, one for horizontal and one for vertical scrolling. This class allows access to (one of) these integrated scrollbars.

A scrollable control has both a physical (visible) client size, and a logical (virtual) client size.

The Range property reflects the total virtual client size, in pixels.

The Page property corresponds to physical (visible) client size, in pixels, excluding the scrollbars. It also determines the size of the slider, relative to the total Range.

The Position property reflects the virtual origin of the visible client area, equivalent to the top coordinate of the slider. The Position can be changed by the user or by code.

Scrollbars usually appear only when Range is higher than Page, i.e. when not the entire content can be shown at the same time. See the ScrollBar property of the scrolling control for details.

The virtual scroll range (FRange - ClientSize), at least zero (never negative) The associated The Handle for the associated The handle for the associated control The AutoScroll state for the associated TScrollingWinControl control GetAutoScroll is not used as the read access specifier for the AutoScroll property. It is used in methods to ensure that the class reflects the current state for its associated control. True when the Control for the class instance has set its AutoScroll property True when the associated has a handle allocated Determines the scrollbar Range, using the physical and virtual size for the associated control Notifies the associated Control of changes Checks and updates the new range for scrollbars in the Control Handler for the ScrollBar movement messages Message examined in the method New value for the property New value for the property New value for the property New value for the property New value for the property New value for the property New value for the property New value for the property Updates the state and position for the scroll bar in the associated Control

UpdateScrollBar is a procedure used to update the state and position for the scroll bar in the associated Control.

When Control is a TScrollingWinControl instance, TScrollInfo is captured using the Range, Position, and Page properties. The scroll bar information is applied to the associated control by calling SetScrollInfo.

Please note: TScrollInfo values are not applied when a handle has not been allocated for the control, or when Control is not a TScrollingWinControl class instance.

UpdateScrollBar calls SetPosition to apply the current value in Position to a visible scroll bar in the class instance. When Control is a TScrollingWinControl instance, the Smooth property is used to determine if Increment needs to be adjusted to a value that is 10% of the Page size for the control.

UpdateScrollBar is used in the implementation of the ControlUpdateScrollBars method.

Renders scroll information invalid for the control

InvalidateScrollInfo is used to mark the current TScrollInfo in the control as invalid. This occurs when a new value is assigned to the Position property, and when ScrollHandler applies position information found in TLMScroll messages. Calling InvalidateScrollInfo results in TScrollInfo being updated and applied for scrolling window controls in the UpdateScrollBar method.

TLMScroll
Get the horizontal scrollbar for the Control TControlScrollBar instance representing the scrollbar Get the vertical scrollbar for the Control Scrollbar for the control, or Nil when not a TScrollingWinControl descendant Determines whether a scrollbar is required True when Visible, and Range is larger than the Page size Constructor for the class instance

Create is the constructor for the class instance, and calls the inherited constructor on entry.

Create sets the Control and Kind properties to the values specified in the AControl and AKind arguments. Create sets the default values for properties, including:

Page
Set to 80.
Increment
Set to 8.
Position and Range
Set to 0 (zero).
Smooth and Tracking
Set to False.
Visible
Set to True.
TObject.Create
The windowed control in which the scroll bar is found The scrollbar orientation If Source is a TControlScrollBar, copies properties to itself, else performs inherited Assign

Assigns the contents of the source object to the current object; in particular finds the Increment, Position, Range and whether smooth scrolling is to be feature and whether the scroll bar is visible.

TPersistent.Assign
TControlScrollBar instance with the values copied in the method Determines the current widget state True if scrollbar is visible The scroll Position, zero if not Visible The scroll Position, zero if not Visible Get the ScrollBar with the opposite orientation (horz/vert) for the current instance TControlScrollBar instance for the opposite orientation Gets the size for the scroll bar based on the client area in the associated control

ClientSize is an Integer function used to get the size from the client area in the associated control. ClientSize uses the value in Kind to determine whether the height or width for the associated control is used as the return value. For example:

sbVertical
Returns the client width from the associated control.
sbHorizontal
Returns the client height from the associated control.

ClientSize is used in methods like ClientSizeWithBar and ClientSizeWithoutBar to get the size for the scroll bar adjusted for scroll bar spacing returned from GetSystemMetrics.

Size from the client area in the associated control Calculates the size of the associated control when the scroll bar is Visible

ClientSizeWithBar is an Integer function used to calculate the client area for the associated control when the scroll bar is Visible. The return value contains the calculated value from ClientSize. If the scroll bar is not Visible, additional spacing (for the SM_SWSCROLLBARSPACING system metric) between the scroll bar and its associated control is removed from the return value.

ClientSizeWithBar is used in the implementation of the ComputeScrollbars method in TScrollingWinControl when the Range for the scroll bar would exceed the space available on the control, and in the GetPreferredSizeClientFrame method.

Size for the client area after adjusting for a visible scroll bar Calculates the size of the associated control when the scroll bar is not Visible

ClientSizeWithoutBar is an Integer function used to calculate the client area for the associated control when the scroll bar is Visible. The return value contains the calculated value from ClientSize. If the scroll bar is Visible, additional spacing (for the SM_SWSCROLLBARSPACING system metric) between the scroll bar and its associated control is added to the return value.

ClientSizeWithoutBar is used in the implementation of the ComputeScrollbars and GetPreferredSizeClientFrame methods in TScrollingWinControl.

Size for the client area after adjusting for a hidden scroll bar The small Position increment, applicable to the scrollbar arrows

Increment is a TScrollBarInc property which indicates the amount the client area in the associated control is scrolled when the Up or Down navigation arrows on the scroll bar are clicked. The default value is 8.

The value in Increment may be automatically recalculated in the UpdateScrollBar method if the Smooth property is enabled, and the associated control is a TScrollingWinControl descendant. This is done to ensure that Increment contains 10% of the value for the Page property.

Increment is used in the ScrollHandler method when updating the Position property for scroll bar messages received in the control.

The orientation for the scroll bar: horizontal or vertical

Kind is a read-only TScrollBarKind property which indicates the orientation for the scroll bar. The value for Kind is passed as an argument to the Create constructor, and stored in the property. The value in Kind is used in methods which update properties or state for the control, such as:

  • Position
  • Range
  • Page
  • Tracking
  • Size
  • ClientSize
  • ControlSize
  • IsScrollBarVisible
  • GetOtherScrollBar
  • UpdateScrollBar
The slider size, position increment applicable to the scrollbar area beneath the slider

The amount by which the scroll indicator moves if the cursor selects the scroll bar above, below or on either side of the scroll indicator. The default value is 80.

Position of the slider, 0..Range-Page

The Position reflects the top coordinate of the slider, which is Range-Page when the slider is at the bottom of the bar.

Enables smooth scrolling, with automatic adjustment of Increment and Page

Smooth is a Boolean property that indicates if the associated control is scrolled using an Increment value computed to be 10% of the Page size for the scroll bar. Set Smooth to True when the scroll bar should use a scrolling increment based on the size of the client area in the associated control. When Smooth is set to False, the Increment property determines the size for the scroll operation when the Up or Down arrows are clicked.

Smooth is used in the UpdateScrollBar method, and when set to True causes the value in Increment to be recalculated using the proportional size value. Smooth is relevant when the associated control is descended from TScrollingWinControl.

The default value for the property is False.

The virtual size of the Parent Control The adjustable size of the scroll bar

The length of the bar is the Width (or Height) of the Parent Control, the Size is the other (free) coordinate.

Gives feedback while the slider is dragged

When it takes an significant amount of time, to repaint the parent control at a new position, Tracking should be False to prevent flicker; then the control is updated only when the slider is released.

Hides the scrollbar when False (default True)

The scrollbar widget is visible only if (Visible=True) and (Range>Page).

Set Visible to False to disallow the user to scroll the content, while the content still can be scrolled by code.

Use IsScrollBarVisible to get the current visible state of the widget.

Class of a windowed control with incorporated scroll bars

This class introduces a logical (virtual) client area, part of which is visible in the physical (visible) client area. ScrollBars allow the user to scroll through the logical client area.

Prevents recursive updates, True while an update is already in progress Also calculates sizes for the scrollbars if required TWinControl.AlignControls Indicates if automatic scrolling is enabled for the control

AutoScrollEnabled is a Boolean function which indicates if automatic scrolling is enabled for the control. The return value is True when the control is NOT automatically resized, or used as a docksite by an active docking manager.

Use the AutoSize property to enabled or disable automatic control resizing. Set the UseDockManager property to False to disable use of the DockSite for the control.

True when not automatically resized or used as a dock site Sets or resets the ranges used for scrollbars in the control Used in the implementation of the ComputeScrollbars method. The virtual origin of the physical client area TControl.GetClientScrollOffset The ScrollBar Positions, or (0,0) if no scrollbars in use Returns the full virtual ClientRect. TControl.GetLogicalClientRect Also updates scrollbars if needed TControl.DoOnResize Calculates the size of the client area for the control excluding visible scroll bars TControl.Height TControl.Width TControl.ClientHeight TControl.ClientWidth Width of the client area Height of the client area Performs actions needed to handle WMSize messages

WMSize is a procedure used to perform actions needed to handle WMSize messages for the control. WMSize calls the inherited WMSize method to set the bounds for the control, optionally using the bounds from the parent control.

WMSize provides support for setting the window state based on size messages that originate in the LCL interface, and calls Resizing to realize the new window state.

Message examined in the method Delegates scroll messages to the horizontal ScrollBar Delegates scroll messages to the vertical ScrollBar Updates Page, AutoRange, IsScrollBarVisible, returns True on changes True when something has changed Also initializes the scroll bars TWinControl.Loaded Performs actions needed when the control processes the WMSize message

Resizing is an empty implementation in TScrollingWinControl. It must be implemented in descendent form or control classes.

Allows ScrollBars to be displayed only when needed (when True) New value for the property Owner of the class instance Destructor for the class instance

Destroy is the overridden destructor for the class instance. Destroy frees resources allocated for the HorzScrollBar and VertScrollBar properties. Destroy calls the inherited destructor prior to exiting from the method.

Initializes or updates the ScrollBars for the control Ignores recursive calls. Tells the widget to scroll the client area relative The still visible part doesn't deserve a repaint (optimization). Control which provides the bounds adjusted in the method The horizontal scroll bar (LCL control) The vertical scroll bar (LCL control) Implements a windowed control with scroll bars

TScrollBox is a TScrollingWinControl descendant that implements a windowed control with scroll bars. TScrollBox sets the visibility for properties inherited from the ancestor class. TScrollBox includes an overridden constructor which sets the default values for properties in the class instance.

Owner of the class instance Provides a designer surface for scaling and layout of its child controls

TCustomDesignControl is a TScrollingWinControl descendant which provides a designer surface used for scaling and layout of its child controls.

Properties are provided to set the display density (Pixels Per Inch) for design-time and run-time usage, and to Scale child controls. Methods are also provided to use TLayoutAdjustmentPolicy to layout and to re-size the child controls.

An overridden Loaded method is provided to adjust the design-time PPI (when scaling is enabled in the application).

TCustomDesignControl is used as the ancestor for TCustomFrame and TCustomForm.

Sets the value for the DesignTimePPI property New value for the property Sets the value for the Scaled property New value for the property Applies size and layout changes to the design surface and its Parent control

DoAutoAdjustLayout is a procedure used to perform actions needed to apply size and layout changes to the design surface and its Parent control.

DoAutoAdjustLayout adjusts the height and width for the design surface by the specified scaling factors. Similarly, the BorderSpacing and Constraints in the control are adjusted using the scaling factors. Finally, the SetBounds method is called to apply the new values for Height and Width to the design surface.

No actions are performed in the method when the Parent property has not been assigned (contains Nil). In addition, no actions are performed when AMode omits the lapAutoAdjustWithoutHorizontalScrolling and lapAutoAdjustForDPI enumeration values.
TControl.AutoAdjustLayout TControl.Constraints TControl.BorderSpacing TControl.Parent
TLayoutAdjustmentPolicy applied in the method Horizontal scaling factor applied in the method Vertical scaling factor applied in the method Constructor for the class instance

Create is the overridden constructor for the class instance. Create calls the inherited method using the value in TheOwner as the the owner of the class instance. Create sets the default values for the following properties:

  • Scaled
  • DesignTimePPI
  • PixelsPerInch

When scaling is enabled in the Application, the value in DesignTimePPI is used as the PixelsPerInch setting in the Font property.

TControl.Font
Owner of the class instance Applies a new display density (Pixels Per Inch) for a layout policy to the control

AutoAdjustLayout is used to set the value in the PixelsPerInch property to the value specified in AToPPI for the lapAutoAdjustForDPI layout policy. AutoAdjustLayout calls the inherited method.

No additional actions are performed in the method when AMode contains a value other than lapAutoAdjustForDPI.
Layout policy to use for the design surface Original display density setting New display density setting Original form width New form width Design-time Pixels Per Inch for the designer surface

DesignTimePPI is an Integer property that contains the display density (or Pixels Per Inch) used on the designer surface. The default value for the property is 96.

The property value is normally set when the component is loaded using the LCL streaming mechanism. It can be assigned at design-time to the value in ADesignTimePPI only when the new value matches the display density for the current Screen where the designer surface is used. The value can be changed at run-time, but the programmer must ensure that the value is valid for the intended usage.

An EInvalidOperation exception is raised if an invalid value is specified at design-time.

When scaling is enabled in the Application, the value in DesignTimePPI is assigned to the Font for the designer surface.

Use PixelsPerInch to access the run-time display density for the designer surface.

TControl.Font
Run-time Pixels Per Inch for the designer surface Indicates if the design surface is scaled to reflect changes in display density (Pixels Per Inch) The base type for TFrame

TCustomFrame is a TCustomDesignControl descendant which implements the base class for TFrame. A Frame is a named container for related components. Groups of controls can be place on a frame, and re-used in your applications.

A Frame has behavior very similar to a Form. Their unique ability is that they can be embedded into forms or other frames in the designer. Like forms, they are stored in two separate files: the code is stored in a .pas unit file, and the design is stored in a .lfm file.

Frames can be created and designed in the Lazarus IDE by creating a new Frame module, and using the unit in your application. An existing frame can be added using the TFrame component on the Standard tab in the Lazarus IDE; you will be prompted for the TFrame class to use for the component.

Frames can also be created entirely in code at run-time. They do not have to be installed in the Lazarus IDE. One drawback is that complex inheritance hierarchies for TFrame classes can be problematic; they do not propagate changes to all derived frames in a multi-level inheritance tree.

Adds the specified list of Actions to the Parent form for the frame class Please note: No actions are performed in the method when a Parent form has not been assigned for the class instance. List of Actions added in the method Removes the specified list of Actions from the Parent form Please note: No actions are performed in the method when a Parent form has not been assigned for the class instance. List of Actions removed in the method Implements reading the Left property for the designer surface Implements reading the Right property for the designer surface Implements writing the Left property for the designer surface Implements writing the Top property for the designer surface Invokes Proc for all Controls and also for all Components without a Parent TWinControl.GetChildren The callback method Components are enumerated only if Root=Self Also handles add/remove of ActionLists TComponent.Notification TControl.Notification Component for the notification Operation for the notification Sets the value for the Color property

SetColor is an overridden method in TCustomFrame used to set the value for the Color property. It calls the inherited method on entry.

When the Color property contains a value other than clDefault, the ParentBackground property is set to False.

TControl.Color
New value for the property Sets the value for the Parent property Also updates the ActionLists, and performs automatic layout adjustments when needed. TControl.Parent TControl.SetParent Value assigned to the Parent property Sets the value for the ParentBackground property New value for the property Handles the CM_PARENTCOLORCHANGED message for the control TControl.CMParentColorChanged Control message handled in the method Constructor for the class instance

Create is the overridden constructor for the class instance. Create calls the inherited method using AOwner as the owner for the class instance. Create sets the ControlStyle property to the following enumeration values:

  • csAcceptsControls
  • csCaptureMouse
  • csClickEvents
  • csSetCaption
  • csDoubleClicks
  • csParentBackground

Create uses the default size for its class type to set the initial bounds for the control.

Raises an EResNotFound exception at run-time if the ClassType for the class instance is not derived from TFrame. TComponent.Create
Owner of the class instance Indicates if the control uses the background from the parent

The write access specifier is overridden in TCustomFrame. It calls the inherited method on entry.

If the new property value is True and ParentColor is True, the color assigned to the Parent control is stored in the Color property. Otherwise, Color is set to the value clDefault. The UpdateOpaque method is called to adjust the control style flags for the control.

The default value for the property is True.

TWinControl.ParentBackground TControl.Color TControl.Parent
Frames can be designed like Forms and used like custom controls, without much coding or installation in the IDE.

TFrame is a TCustomFrame descendant which implements a named container for related components. Groups of controls can be place on a frame, and re-used in your applications.

A Frame has behavior very similar to a Form. Their unique ability is that they can be embedded into forms or other frames in the designer. Like forms, they are stored in two separate files: the code is stored in a .pas unit file, and the design is stored in a .lfm file.

Frames can be created and designed in the Lazarus IDE by creating a new Frame module, and using the unit in your application. An existing frame can be added using the TFrame component on the Standard tab in the Lazarus IDE; you will be prompted for the TFrame class to use for the component.

Frames can also be created entirely in code at run-time. They do not have to be installed in the Lazarus IDE. One drawback is that complex inheritance hierarchies for TFrame classes can be problematic; they do not propagate changes to all derived frames in the entire inheritance tree.

TFrame contains a new property which indicates the LCL (Lazarus Component Library) version number used in the container. An overridden constructor is also introduced to initialize the value in the LCLVersion property. TFrame sets the visibility for properties defines in ancestor classes.

Owner of the class instance Represents a visual element in a window title bar; depends on window manager support
biSystemMenu
The form has a System menu (Maybe not all windowmanager supports this)
biMinimize
The form has an minimize button
biMaximize
The form has a maximize button
biHelp
When you click this button a Question Cursor appears, and the help routines are called if you click on an control
Window has a system menu Window has an Minimize button Window has an Maximize button Window has an Help button The preferred monitor for showing a form

When a form is not assigned to a specific monitor, assume the following display context:

dmDesktop
No attempt to choose specific monitor
dmPrimary
On the primary monitor
dmMainForm
On the same monitor as the main form; if there is no main form then use dmPrimary behavior
dmActiveForm
On the same monitor as the currently active form; if there is no active form then use dmMainForm behavior
Place the form on the full desktop Place the form on the primary monitor Place the form on the same monitor as the main form. If there is no such form then use the primary monitor. Place the form on the same monitor as the currently active form. If there is no such form then use the primary monitor. Form state flags

The form states are:

fsCreating
initializing (form streaming)
fsVisible
form should be shown
fsShowing
form handling WM_SHOWWINDOW message
fsModal
form is modal
fsCreatedMDIChild
not yet implemented
fsBorderStyleChanged
border style changed before window handle creation
fsFormStyleChanged
form style is changed before window handle creation
fsFirstShow
form is shown for the first time
fsDisableAutoSize
disable autosize
initializing (form streaming) form should be shown form handling WM_SHOWWINDOW message form is modal not yet implemented border style changed before window handle creation form style is changed before window handle creation form is shown for the first time disable autosize The set of form state flags Dummy type for the values that can be returned as a modal result

Even though the type is defined as an integer, only the defined constant values should be used (mrOK, mrCancel, et. al.).

TForm Notification handler types Notified on first form Show Notified on form Close Notified after form Create How a form is represented in the TaskBar Uses the default rules from the platform for showing the form in the TaskBar Always show the form in the TaskBar Never show the form in the TaskBar Defines the handling performed for a parent window in forms and dialogs

TPopupMode is an enumerated type with values that specify how the parent is determined for a form or dialog. TPopupMode is the type used for the PopupMode property in TCustomForm.

modal: popup to active form or if not available, to main form; non-modal: no window parent

For modal windows, the handle has to be recreated in ShowModal. If this is not wanted, please use explicitly pmAuto before calling ShowModal.

modal and non-modal: popup to active form or if not available, to main form modal and non-modal: popup to PopupParent or if not available, to main form Type used for an OnClose event handler in a form

Closing a form can have several meanings:

caNone
Do nothing (don't close).
caHide
Hide the form (default for modal forms).
caFree
Destroy the form.
caMinimize
Minimize the form (MDI child default).

The handler can set CloseAction to the desired value for the action.

The form that received an Close request Set this to caNone, to prevent the form from closing Specifies an OnCloseQuery handler event handler

TCloseQueryEvent is an object procedure type which specifies the event handler signalled to determine if a form can be closed.

TCloseQueryEvent is the type used to implement the OnCloseQuery property in TCustomForm. An application must implement an object procedure using the signature for the event handler to allow responding to the notification.

The form that received an Close request Set to False to deny closing Type used for an OnDropFiles event handler

TDropFilesEvent is an object procedure which specifies an event handler triggered when files are dropped on a drag and drop-enabled control.

TDropFilesEvent is the type used to implement the OnDropFiles property in TCustomForm and TApplication. Applications must implement a procedure using the signature for the event handler, and assign it to the property.

The control that received the dropped files The list of the dropped files Type used for an OnHelp event handler

THelpEvent is an object function which specifies an event handler signalled when Help is requested in an application or form. THelpEvent is the type used to implement the OnHelp event handler in TCustomForm and TApplication. Applications must implement a function using the signature for the event handler, and assign it to the property.

Indicates if the help request is satisfied by the event handler; False causes the default help handler for the application to be used Help command type requested; either HELP_CONTEXT or HELP_COMMAND Context data for the help request False suppresses help display Type used for an OnShortcut event handler

A shortcut handler is invoked when a key is pressed, before any other processing. It can interpret the key as an shortcut and act accordingly. In this case, Handled should be set to True to prevent further processing of the key.

The key event message Set Handled to True to prevent further processing of the key Specifies an event handler signalled when a modal message dialog is completed

TModalDialogFinished is an object procedure which specifies an event handler signalled when a modal message dialog is completed. The AResult argument contains the modal result constant returned from the message dialog.

TModalDialogFinished is the type used to implement the TCustomForm.OnShowModalFinished and TApplication.OnMessageDialogFinished properties.

TObject instance for the event notification Modal result value from the dialog The base type for TForm classes

TCustomForm is a TCustomDesignControl descendant that implements the base type for TForm classes.

Forms represent a window or a dialog used as the user interface for a GUI application. It is a container where visual components (such as buttons, labels, edit fields, images, etc.) can be placed. It is also a designer surface which provides design-time support for configuration and layout of the content placed on the form.

TCustomForm acts an abstraction layer which masks implementation-specific routines required for the various widget sets supported in the Lazarus Component Library (LCL). Methods and properties are provided which interact with the underlying Operating System or platform, and provide a common API for form-related operations.

Lists of installed Form notification handlers Used to track Focus changes (Enter/Exit events) Tries to resolve stDefault in ShowInTaskBar using Application settings.

Calls ShowInTaskBar to get the visibility of an icon for the form.

When the return value is stDefault (or when called at design-time), the TaskBarBehavior property in Application is taken into consideration to get the actual return value. If the application displays a single button for the executable and its forms, the return value is set to stNever. If multiple buttons can be displayed in the task bar, the value stAlways is used. If the Application uses the value tbDefault, the value stDefault is retained in the return value.

Effect visibility for the form icon in the task bar Gets the value for the Monitor property Value for the property Indicates whether Form properties should be stored in the stream

IsForm is used as the storage specifier for selected properties in the class instance. Always returns True in TCustomForm.

True when the value for the various properties should be included in the LCL streaming mechanism Closes a modal form

CloseModal is a procedure which attempts to close a form that has been displayed by calling the ShowModal method.

CloseModal calls CloseQuery to determine the action performed in the method. When CloseQuery returns True, the close action is set to caHide and the OnClose event handler is signalled when assigned. Form handlers are notified of the close action.

When CloseQuery is False, the close action is used to determine how the request is handled. If the CloseAction is caNone, the value in ModalResult is set to 0 (zero). If the CloseAction is caFree, the Release method is called to allow the Application to free the form component.

If an exception occurs in the method, the value in ModalResult is set to 0 (zero) and the Application.HandleException method is called.

Please note: CloseModal does not forward the action to the widget set class; that is performed in the ShowModal method to ensure it is executed in the widget set class.
Destroys the form icons Loads the new form icons, and notifies the widget set and all forms Performs actions needed for delayed window move, resize, show, and activate messages

DelayedEvent is a mechanism used to reduce the number of move, resize, show, and activate messages that occur for forms and their child controls.

DelayedEvent discards duplicate calls to the method; only the most recent message is processed. It is used in conjunction with the QueueAsyncCall method in TApplication. DelayedEvent decrements an internal counter used to track the number of pending delayed event messages. When the counter reaches zero (0), the message is applied.

When WindowState is changed to wsNormal, the window origin or size is restored for the delayed event. For delayed OnChangeBounds and OnChangeBounds messages, the DoOnShow and/or Activate methods are called when the form is Active. If the form has not already been displayed and activated, the Activate, DoOnResize, or the DoOnChangeBounds method is called for the corresponding delayed message.

An integer pointer to the data for the event; not used in the current implementation Remembers the last focused control Called when the Focus changed

SetWindowFocus is a procedure used to ensure that the active control in the form instance has the inpout focus when the forms receives focus. At run-time, the control in ActiveControl (when assigned) is used as the active control. At design-time, the active control is the design surface for the current form instance.

No actions are performed in the method when a handle has not been allocated for the active control, or the control cannot be focused.

SetWindowFocus calls the SetFocus routine in LCLIntf to change the focus to the handle for the active control, and when successful calls the Perform method in the control to post the CM_UIACTIVATE control message.

SetWindowFocus is used in the implementation of the SetFocus and SetActive methods.

Sets the value for the WindowState property

SetWindowState sets the value for the WindowState property.

New value for the property Adds a form notification handler with the specified type and code

AddHandler is a procedure used to add a form notification handler to the list of handlers in the form instance.

HandlerType is a TFormHandlerType enumeration value that defines the situation(s) where the form handler can be executed. See TFormHandlerType for more information about values in the enumeration.

Handler is a TMethod record with pointers to the code and optional data executed when the handler is invoked.

AsFirst indicates if the handler should be inserted as the initial handler in the method list (when True), or appended to the end of the list (when False).

AddHandler calls RaiseGDBException to raise an exception when the pointer to the Code in Handler has not been assigned.

AddHandler ensures that a TMethodList exists for handlers using the value in HandlerType, and calls the Add method in the TMethodList to store the Handler at the position needed for AsFirst.

AddHandler is called from the implementation of more specialized methods like AddHandlerClose, AddHandlerCreate, and AddHandlerFirstShow.

Raises a catchable exception if the Code property has not been assigned for the TMethod instance in Handler. Raised with the message 'TCustomForm.AddHandler'.

TMethodList TMethod
Form handler type added in the method Code to execute for the form handler True if the new form handler becomes the first handler in the list of handlers Removes a form notification handler of the specified type Returns the first control in the form Tab order Called when the main menu has been changed Don't show a main menu for dialog forms, i.e. when BorderStyle=bsDialog (Delphi compatible). Notifies the widget set of the change Handles the LM_ACTIVATE message which activates or deactivates the form Handles the LM_CLOSEQUERY message used to close the window What does Result=0 mean? It means that WndProc should ignore the result because the message was already handled. FActionLists is a local variable holding lists of actions associated with the Form When a control is not Active, sets the Focus to the first control in the TabOrder for the form Notifies the OnActivate handler

Activate is a procedure used to signal the OnActivate event handler (if assigned) when the form is activated. Activate is called when the CM_Activate message is handled for the form.

Activate uses an internal member to determine whether the form is being displayed for the first time, or following a change of focus between forms. No actions are performed in the method when the form is being displayed for the first time and the WindowState property contains wsMaximized or wsFullScreen.

Use OnShow to respond to the event notification performed when the form is displayed for the first time.

Use OnChangeBounds or OnResize to respond to delayed changes to the form bounds (position) or resize events.

TControl.OnChangeBounds
An empty implementation in TCustomForm Can be implemented in a descendant to perform actions needed when the active form is changed. Just like Delphi VCL. Excludes borders from the given rectangle TWinControl.AdjustClientRect Locks form updates (AutoSize), until EndFormUpdate Nested calls are allowed (pairs of Begin/EndFormUpdate). Initializes parameters used to create the handle for the form instance

CreateParams is used to initialize parameters needed to create the handle for the form instance.

CreateParams is an overridden procedure in TCustomForm, and calls the inherited method on entry. CreateParams ensures that values in the Params argument are valid. This includes setting the realized parent form and window handle for a form which is not the main form in the application. Style flags are also updated to indicate how the form is displayed in the task bar.

TWinControl.CreateParams
Values examined and updated in the method Creates the widget, updates the widget-dependent properties. TWinControl.CreateWnd TScrollingWinControl.CreateWnd Called when the form looses the focus. Notifies the OnDeactivate handler Notifies the form close handlers Notifies the form create handlers Notifies the OnDestroy handler Notifies the OnHide handler Notifies the OnShow handler Unlocks form updates; used with BeginFormUpdate When the update counter reaches zero, FormEndUpdated is invoked to realize the pending changes. TWinControl.FormEndUpdated Placeholder for exception handlers in derived classes By default the Application exception handler is invoked. True when the exception was handled Placeholder for exception handlers in derived classes By default the Application exception handler is invoked. True when the exception was handled Placeholder for exception handlers in derived classes By default the Application exception handler is invoked. True when the exception was handled Initializes the widget, also for AlphaBlend and AllowDropFiles Also renews ActiveControl and Visible TComponent.Loaded Called when handles for child control are created in the form instance

ChildHandlesCreated is called after all handles for child controls are created. When this is a top-level form (Parent is Nil), the ParentFormHandleInitialized method is also called.

TWinControl.ChildHandlesCreated
Calls the user Alignment handler (AlignControls). Here: NOP for a top-level form. Performs actions needed when the form processes the WMSize message

Uses the value in State to determine the action required in the method. The LCL interface is used to determine if the window state is valid for the widget set. When allowed, the following methods are called for the corresponding TWindowState value:

wsMinimized
Calls the Minimize method in Application, or Restore if the Form is already minimized

If the value in WindowState has been changed, the method honors the value in the Position property if it was set to maximized at design-time.

When the OnWindowStateChange event handler has been assigned for the form, it is signalled for the current class instance.

Window state applied in the method Here: clip width and height of a top-level form to the monitor WorkArea Here: Moves a top-level form in front or back of all forms True for BringToFront Moves the form to its initial Position Called when the widget visibility (Showing) is changed. Updates (and realizes?) all properties affecting the visual representation for the form. TWinControl.UpdateShowing New value for the property If the the form is about to show, calculate its metrics Notifies the FirstShow handlers UpdateWindowState is an empty implementation in TCustomForm An empty implementation in the current LCL version. Notifies all VisibleChanging handlers Notifies all VisibleChanged handlers Handled messages include: Activate, SetFocus, KillFocus, Exit, Enter, Window Position Changing, and DrawItem Adds the specified list of actions to the ActionList for the form Removes an ActionList List of actions removed in the method Loads resources needed for the form Calls InitResourceComponent to load form resources for the current form instance. Raises an EResNotFound exception if RequireDerivedFormResource is set for the application, and a resource is not found for the form. Checked BeginDrag Allow form dragging only if it is docked into a site without a DockManager. why? Here: returns the Caption Handler for ActionExecute messages Handler for ActionUpdate messages Asks all applicable components to execute an action

First, the ActiveControl and the Form itself are asked to execute the action. Then, all child components are tried. The search stops as soon as the action is handled.

True when the action was handled Action to execute Tries all applicable components to update an action DoExecuteAction True when the action was updated Asks all components on the form to update their actions

UpdateActions is a procedure used to update actions assigned to components on the form instance. No actions are performed in the method at design-time, or when the Showing property is set to False in the form instance.

UpdateActions applies updates for an assigned Menu in the form instance. Items on the Menu update their actions when the menu item is visible. Finally, all controls on the form instance are recursively searched; controls which are action clients update their actions when they are visible.

Update actions is called for each of the custom forms when the application enters an idle state, and occurs after processing queued asynchronous calls and the OnIdle event handler in the application.

TWinControl.Showing TControl.InitiateAction
The Handle of the MDIForm client (container for MDI children) Owner for the class instance Creates a form without a resource Owner for the new class instance Here: ignored purpose? Destructor for the class instance

Destroy is the overridden destructor for the class instance.

Destroy ensures that unhandled queued asynchronous calls in the Application instance are removed for the form.

Destroy disables auto-sizing to prevent resize messages while the form is being freed. Destroy frees resources allocated for the form instance, including its Icon and any allocated icon handles. The form instance is removed from Screen, and its ActionLists are freed. Destroy frees all form handlers added to the class instance.

Destroy calls the inherited destructor prior to exiting from the method.

The Handle of the big form icon Closes the form

Close does not necessarily destroy the form. Modal forms only are hidden. When the MainForm is closed, the application terminates.

An OnCloseQuery handler can refuse to allow the form to close.

Asks the OnCloseQuery handler whether the form can close Updates ActiveControl if it is to be defocused The control that looses the focus True when the control is removed Ensures that the form is fully visible, and optionally brings it in front of all other forms Bring the form to front if True Gives focus to the specified control

FocusControl is a procedure used to give focus to the control specified in WinControl. FocusControl ensures that the ActiveControl property is updated when needed, and may raise an exception if WinControl cannot be focused. If the form instance was not already Active, the SetFocus method is called.

If the control or one of its parents is not visible or disabled, an exception will be raised (in SetFocus).
The control receiving the focus Indicates if the BeginFormUpdate method has been called without a corresponding EndFormUpdate method call

The method is used in TControl descendants to determine if the parent form for the control is already rendering changes to its content.

Returns True when the internal update counter for the form contains a positive non-zero value Makes a Bitmap image with the Form content The role(s) for the control in a modal form (default or cancel button) Gets the form that is the effective parent for the pop-up, dialog, or splash screen Form instance that is the parent for the pop-up form, or Nil for a splash screen Invokes the OnDropFiles handler of the form. This function is called by the LCL interface.

The drop files event will be invoked when the user drops one or more dragged files onto one of forms in the application. First this event should be fired for the target form (or main form if drop target is unknown), and then for the application instance.

Show help for control or menu item. This function is called by the LCL interface. TControl.ShowHelp Asks all applicable components to interpret a keystroke as a shortcut. Returns True when the specified Key and Message are active as a shortcut. True when the specified Key was handled as a shortcut. Extends or shrinks the form to a monitor The monitor to use, Nil means the design-time monitor If True then extend to the WorkArea for the monitor. Otherwise, clip the form to the monitor bounds. Returns True if AutoSize should be skipped or delayed because of a missing handle propagate back into TControl? Marks the form for destruction

Release is a procedure used to request destruction of the current form instance.

Release checks for a TApplication instance in the Application singleton. When it is assigned (contains a value other than Nil), its ReleaseComponent method is called to free the form instance by posting an asynchronous application message. When Application is not assigned, the Free method is called to destroy the form instance.

True when the form can receive focus

CanFocus is an overridden Boolean function which indicates if the form instance can receive focus. The return value is True when the form is Visible and Enabled, or the inherited CanFocus method returns True.

CanFocus is used in the implementation of various methods in the class, including: SetWindowFocus, UpdateShowing, SetActiveControl, and Loaded.

True when the form can receive focus in the application Handles focus switch to a control (enter/exit messages) False when the focused control cannot be changed The control that received the focus Sets the bounds for the restored control Temporarily goes into the normal (restored) window state, if required. Displays the form as a modal Dialog

Shows the form in a modal state and waits until it is closed by the user or by the program. Modal state means that neither the user nor the program can switch to another form already made visible before calling ShowModal.

The form must have Visible set to False when calling ShowModal. The call does not return until the form is closed. The application switches to modal state until ShowModal has completed.

ShowModal creates its own event loop using ProcessMessages.

Raises an EInvalidOperation exception if the form cannot be displayed as a modal form.

The modal result for the dialog Shows this form in front of all other forms Returns (and eventually creates) the Handle of the small Form or Application Icon. Invokes Proc for all Controls and also for all Components with no Parent TWinControl.GetChildren The callback method Components are enumerated only if Root is Self Always returns False in TCustomForm ? Here: always False Control with the key message for the method Key message from the child control Adds a handler for the first Show of the form Removes a handler for the first Show of the form Adds a handler for form Close Removes a handler for form Close Adds a handler for form Create Removes a handler for form Create Returns the currently active MDI child form A non-nil result is returned only when FormStyle contains fsMDIForm or fsMDIChild; otherwise Result is nil. Nil if the form is neither an MDI host nor child Nil if caller isn't an MDI type or handle isn't allocated -1 if caller isn't an MDI form or handle is not allocated Sets scaled to True and AutoAdjustLayout to current monitor PPI Contains True when the form has the focus Use active to check if the form has the focus Specifies the active control on the form Use this to get or set the active control on this form. Specifies the Default control for the Form The Default control reacts on the Enter key pressed. Specifies whether files can be dropped onto this form

AllowDropFiles is a Boolean property which indicates whether this form receives an OnDropFiles event when files are dropped on form during a drag-and-drop operation.

Allows the form to be drawn with translucency

AlphaBlend is a Boolean property which indicates if the form can be drawn with translucency. When set to True, the form is drawn with a degree of transparency and diffusion. This allows other forms (and their controls) which have a lower Z-Order value to be seen beneath the form. The default value for the property is False.

Use AlphaBlendValue to specify the degree of transparency and diffusion applied to the form content.

Changing the value in AlphaBlend causes the widgetset class to be notified of the property change at run-time when a handle has been allocated for the form instance. A change to the property value is not rendered at design-time.

AlphaBlend and AlphaBlendValue are used in the implementation of the InitializeWnd method, and passed as arguments to methods in the widgetset class when either of the values are changed.

Please note: AlphaBlend requires support from both the Desktop Environment (DE) and the hardware for the system; it may not work on all hardware, or platform / operating system combinations supported as Lazarus targets.
The translucence level for the form (0=transparent, 255=opaque)

AlphaBlendValue is a Byte property which indicates the level of translucency for the form when AlphaBlend is set to True. AlphaBlendValue must be in the range 0..255 (for the Byte data type), where 0 represents 100% transparency and 255 is for full opacity.

Changing the value for the property causes the widgetset class to be notified of the change in the property value at run-time when a handle has been allocated for the form.

Set AlphaBlend to True to enable translucency for the form.

AlphaBlend and AlphaBlendValue are used in the implementation of the InitializeWnd method, and passed as arguments to methods in the widgetset class when either of the values are changed.

Please note: AlphaBlend and AlphaBlendValue require support from both the Desktop Environment (DE) and the hardware for the system; it may not work on all hardware, or platform / operating system combinations supported as Lazarus targets.
Indicates if the form can automatically show or hide scroll bars

AutoScroll is a Boolean property which indicates if the form can automatically show or hide its scroll bars. Set AutoScroll to True to enable scroll bars when the form size is too small to display its content in its entirety. AutoScroll can only be True when the BorderStyle for the form is bsSizeable or bsSizeToolWin, and may be changed to False at run-time when setting the value in the BorderStyle property to another value.

Specifies the icons which appear in the title bar for the form

BorderIcons is a TBorderIcons property which contains valued from the TBorderIcon enumeration, and indicates the icons displayed in the title bar for the form instance. The default value for the property includes the following enumeration values:

  • biSystemMenu
  • biMinimize
  • biMaximize

See TBorderIcon for more information about the enumeration values and their usage.

Changing the value in BorderIcons causes the WidgetSetClass for the form instance to be notified of the new values in the property.

Values in BorderIcons may be automatically changed at run-time when a new value is assigned to the BorderStyle property; see DefaultBorderIcons for the icons used for a specific border style.

The border style affects the title bar, border and resize behavior of the form.

Use borderstyle to get or set the appearance of the form's border.

By default it is a sizeable window, but it could, for example, be a dialog form or a tool window, or could be non-sizeable.

This property is slightly different (has a different base type) from the TCustomControl.BorderStyle property. When the form is put into another control the window borders depend on the widget set. There are no borders under GTK.

TFormBorderStyle TBorderStyle TCustomControl.BorderStyle
The control associated with the Cancel action

Determines the control associated with the Cancel action (which exits from the modal form without changing anything). This is usually a button with the caption 'Cancel', but might be an 'Exit' button or anything else the application programmer decides. This control is selected either by explicitly clicking with the mouse, or by hitting the 'Esc' key.

The text displayed in the title bar for the form The background color for the form The form's background color. The control associated with the default action for this form

This is typically a button such as 'Accept' which is highlighted in some way on-screen to indicate that this is the default action, and is selected either by hitting 'Return' or 'Enter' or by selecting that control with the mouse.

The monitor on which the form is displayed

Possible values:

dmDesktop
No attempt to choose specific monitor.
dmPrimary
On the primary monitor.
dmMainForm
On the same monitor as the main form. If there is no main form then use dmPrimary behavior.
dmActiveForm
On the same monitor as the currently active form. If there is no active form use dmMainForm behavior.
The designer object when the form is in design state Value from ShowInTaskBar adjusted for the default taskbar behavior in the application State flags for the form

FormState is a read-only TFormState property which contains state flags enacted for the form instance. Values from the TFormStateType enumeration are included in, or excluded from, the set type when corresponding actions occur (or are resolved) for the form instance.

See TFormStateType for more information on the values and meanings in the enumeration.

FormState is updated when properties for the form instance are changed, and in methods which respond to window and control messages in the form instance.

Indicates the style for the form

Possible values:

fsNormal
Usual style.
fsStayOnTop
Form is positioned above all application's forms, except those which have fsStayOnTop style.
fsSystemStayOnTop
Form is positioned above all OS windows, except other OS top-level windows.
fsSplash
Form is border-less.
fsMDIForm
MDI parent form.
fsMDIChild
MDI child form.
TFormStyle
The name of the help file for the form

HelpFile is a String property which contains the name of the help file for the form instance. HelpFile can use a fully-qualified path to the help file if it is not locate in the same directory as the application which implements the form.

The value in HelpFile is used in TApplication when it retrieves the help file name from the active form in the application.

The Icon associated with this Form (in minimized state)

Icon is a TIcon property which contains the graphical icon for the form instance. Icon contains the image displayed on the task bar area when a form is minimized. If an Icon is not explicitly assigned for the form, the icon for the Application is used.

Assigning a new value to Icon causes existing icon handles to be freed, and the widgetset class is notified to re-create the icon handles.

TIcon
Allows the form to intercept keystrokes in child controls

KeyPreview is a Boolean property which controls whether the form can intercept key strokes from child controls. When KeyPreview is set to True, the form is allowed to receive KeyDown, KeyUp, and KeyPress events before they are received/applied to the ActiveControl in the form.

The default value for the property is False.

KeyPreview is used in the implementation of key handling methods in TWinControl. KeyPreview is often enabled for modal dialogs to allow the parent form to handle specific user interactions.

Provides indexed access to MDI child forms, when this is a MDI form

MDIChildren is a read-only indexed TCustomForm property which provides access to the child forms in a Multi-Document Interface (MDI) application. In an MDI application, one of the forms acts as the main form for the application, and is the container for its MDI child forms. In addition, an MDI child form can be nested in another MDI child form.

Please note: Historically, support for MDI is dependent on the underlying widgetset or platform. Some widgetsets provide better support for MDI than others. The consensus is that the QT/QT5 widgetsets offers the best level of support for MDI applications.

The form role is determined by the value in the FormStyle property. fsMDIForm is used for the main form, and fsMDIChild for the child forms. MDIChildren is relevant when the current form instance uses one of those MDI from style values.

The Integer Index value is used to access the MDI child forms for the current form instance by the ordinal for the requested form. The return value contains the TCustomForm instance at the specified position, as determined using the GetMDIChildren method in the widgetset class. The return value can be Nil when the current form does not use a FormStyle with the value fsMDIForm or fsMDIChild, or when a handle has not yet been allocated for the form instance. The return value is always Nil at design-time.

Use MDIChildCount to get the number MDI child forms for the form instance.

Use ActiveMDIChild to get the active MDI child form in the application.

Set the value in the FormStyle property to indicate that the class is used as a MDI form.

Ordinal position for the MDI Child form requested The main menu for the form instance

Menu is the TMainMenu instance assigned to the form.

Assigning a new value to Menu causes other forms on the Screen to be checked for a duplicate menu assignment. A singlular TMainMenu instance cannot be assigned to more than one form. An EInvalidOperation is raised if another form alreasy uses the menu instance. The UpdateMenu method is called when the new property value has been set.

TMainMenu
Specifies the return value for a form (or dialog) displayed modally

ModalResult is a TModalResult property which contains the value derived when the form is displayed modally. Setting a new value for the property causes the widgetset class to be notified when a handle has been allocated for the form.

The value in ModalResult is updated when the ShowModal method is called for the form instance. It may is updated in the CloseModal method when CloseQuery is False and CloseAction is caNone. Finally, it is set to mrCancel in the Close method when FormState contains the value fsModal.

See TModalResult for more information about the enumertation values and their meanings.

The Monitor where the form is shown

Monitor is a read-only TMonitor property which contains the monitor where the form was displayed. Monitor defaults to the TMonitor instance for the Parent form when it has been assigned.

When the parent form has not been assigned, and a handle exists for the form instance, the widgetset class is notified of the current coordinates for the form. The MonitorFromWindow method in the Screen singleton is called to locate the window closest to the the form (using its handle).

When neither a parent form nor a window handle are available, the MonitorFromPoint method in the Screen singleton is used to locate the form located at the Top and Left coordinates for the form instance.

Tracks changes in the focus for the active form or the last active control for the current form

LastActiveControl is a read-only TWinControl property used to track a change in the focus for the active form or the control on the current form instance. It is updated when changes are made to the ActiveControl property, or in the SetFocusedControl method.

Defines where popup menus are shown

PopupMode is a TPopupMode property which controls the display policy for pop-up forms. The default value for the property is pmNone. See TPopupMode for more information about the values and meanings in the enumeration.

Changing the value in PopupMode causes the value in PopupParent to be changed when the property is set to pmAuto or pmNone. At run-time, the widgetset class is notified of the change to the PopupParent property.

PopupMode is used in the implementation of the GetRealPopupParent and ShowModal methods.

?
Parent form which owns the current form instance when displayed as a pop-up window

PopupParent is a TCustomForm property which contains the parent form which owns the current form instance when displayed as a pop-up window.

Setting a new value for the property causes the existing pop-up parent form to be removed from the free notifications for the application. A new non-Nil pop-up parent is added to the free notification list, and its PopupMode property is set to pmExplicit.

At run-time, the widget set class is notified of the change in the PopupParent property. The notification is not performed at design-time.

Handler called when the form receives focus

This handler is called when the form receives focus for the first time at application start up, and then subsequently each time focus is changed from another window for the same application to this window.

For focus changes between different applications, the Application.OnActivate event handler is called instead.

TApplication.OnActivate
Handler called when the form is closed. It determines what happens to the form (destroy, hide...).

OnClose is a TCloseEvent property which represents the event handler signalled when a form calls its Close or CloseModal method.

OnClose is triggered from the DoClose method immediately before calling any internal form handlers registered for the fhtClose form handler action type. OnClose can be used to detemine the action performed in subsequent form handlers by setting the value in the CloseAction argument.

An application must implement and assign an object procedure using the signature for TCloseEvent to respond to the event notification.

Event handler signalled when trying to close a form

OnCloseQuery is a TCloseQueryEvent property which contains the event handler signalled to determine whether the form can be closed. Set the value in the CanClose argument to True to allow the form instance to be closed. The default value for CanClose is True.

Use OnCloseQuery to perform any actions or dialogs needed to confirm that the form can in fact be closed.

An application must implement and assign an object procedure using the signature in TCloseQueryEvent to respond to the event notification.

OnCloseQuery is signalled from the CloseQuery method, and occurs immediately after MDI child forms have called their CloseQuery methods.

Handler called when the form has been created

OnCreate is a TNotifyEvent property which implements an event handler signalled when a new form instance is created. OnCreate can be used to perform any action needed to configure the new form instance, or update the application where the form is used.

OnCreate is triggered from the DoCreate method (when assigned) before signalling any form handlers using the fhtCreate form handler action type. At this point, the initial coordinates for the form have been assigned, but are not realized until until DoCreate has been completed.

An application must implement and assign an object procedure using the signature for the handler to allow responding to the notification.

TNotifyEvent
Handler called when the form is deactivated (loses focus) OnDeactivate is a TNotifyEvent property which contains an event handler signalled when form is deactivated (loses focus). OnDeactivate is signalled from the Deactivate method (when assigned). Handler called when the form is destroyed

OnDestroy is a TNotifyEvent property signalled when the form instance is destroyed. OnDestroy is signalled from the DoDestroy method (when assigned) as one of the steps before destruction of the class instance. Before the event handler is triggered, the form has been hidden and the Menu from the main form in the Application has been unmerged.

Handler called when files have been dropped

OnDropFiles is a TDropFilesEvent event handler signalled when a File Drag notification is received from the LCL / widgetset interface.

The Sender argument contains the current form instance. The FileName argument contains an array with the file names for the drop operation.

Set AllowDropFiles to True to enable drog and drop operations, and execution of this event handler.

Handler called when Help is requested

OnHelp is a THelpEvent property which contains the event handler signalled when a Help command is executed for the form instance. Arguments to the event handler identify the command and the context used in the help request.

Command contains the help request type, and corresponds to the values used in the Windows WinHelp API.

Data is a PtrInt type which points the context information for the help request.

The CallHelp argument indicates if handler(s) in the Application instance should be called when the event handler in the form is completed. Set CallHelp to False when the help request has been satified in the event handler.

An application must implement and assign an object function using the signature for the handler to respond to the event notification.

Set the return value to True if the Help request was successfully executed.

The OnHelp event handler for the active form is signalled when the TApplication instance executes its DoOnHelp method. The arguments to the event handler contain the values intercepted in the WMHelp message processing for the application. If the OnHelp event handler has not been assigned for the active form, the OnHelp event handler in the Application singleton is signalled (when assigned).

Handler called when the form is being hidden

OnHide is a TNotifyEvent property that represents the event handler signalled when the form instance is hidden. OnHide is triggered (when assigned) in the DoHide method, and occurs when the CMShowingChanged control message is applied to the Showing property for the form instance.

TWinControl.Showing TNotifyEvent
Handler called when a key is pressed, before further handling of the key

OnShortcut is a TShortcutEvent property that represents the event handler signalled (when assigned) to detect and handle a shortcut key for the form instance. OnShortcut is called from the IsShortcut method used to examine keystroke events intercepted and forwarded by the Application.

The Msg argument contains the key event examined in the handler. Handled indicates that the key is handled by the event when set to True.

Handler called when the form becomes visible Event handler signalled when modal display of the form has been completed

OnShowModalFinished is a TModalDialogFinished property that implements the event handler signalled when modal display of the form has been completed. An application must implement an object procedure using the signature in TModalDialogFinished, and assign it to the property to respond to the event notification.

Is this a remnant? Not used in ShowModal or CloseModal. It does not appear to be used anywhere in the current LCL version.
Handler called when the form is minimized, maximized or restored

OnWindowStateChange is a TNotifyEvent property which represents the event handler signalled when the value for the WindowState property is changed. OnWindowStateChange is triggered (when assigned) from the Resizing method, and occurs when the WM_SIZE window message for the action is handled.

See TWindowState for details about the values and meanings in the enumeration.

The initial placement for the form

Position is a TPosition property which indicates the size and position policy used to display the form instance. The default value for the property is poDesigned, and indicates that the coordinates used in the form designer are used at run-time. See TPosition for the other values, and their meanings, available for the property.

Changing the value in Position causes the value in AutoSize to be updated when needed, and calls UpdateControlState. No additional actions are performed at design-time.

MoveToDefaultPosition is called when a handle exists for the form instance and it has not been displayed yet.

The Left coordinate for the form when it is restored (i.e. changes from minimized or maximized)

RestoredLeft is a read-only Integer property which contains the left coordinate for the form when its size is altered in WMSize or WMMove message handlers. The property value is applied when the aynchronous queued event handler for the form is executed, and calls the DoOnChangeBounds method.

TControl.DoOnChangeBounds TControl.Left
The Top coordinate for the form when it is restored (i.e. changes from minimized or maximized)

RestoredTop is a read-only Integer property which contains the top coordinate for the form when its size is altered in WMSize or WMMove message handlers. The property value is applied when the aynchronous queued event handler for the form is executed, and calls the DoOnChangeBounds method.

TControl.DoOnChangeBounds TControl.Left
The width of the form when it is resized

RestoredWidth is a read-only Integer property which contains the Width for the form when its size is altered in WMSize or WMMove message handlers. The property value is applied when the aynchronous queued event handler for the form is executed, and calls the DoOnChangeBounds method.

TControl.DoOnChangeBounds TControl.Width
The height of the form when it is resized

RestoredHeight is a read-only Integer property which contains the height for the form when size is altered in WMSize or WMMove message handlers. The property value is applied when the aynchronous queued event handler for the form is executed, and calls the DoOnChangeBounds method.

TControl.Height TControl.DoOnChangeBounds
How the form is represented in the system Task Bar

ShowInTaskBar is a TShowInTaskbar property which indicates how the form is represented on the system task bar. The default value for the property is stDefault, and indicates the default behavior for the widgetset, platform, or operating system is used. See TShowInTaskbar for more information about values in the enumeration and their meanings.

ShowInTaskBar is used in conjunction with the TaskBarBehavior property in the Application singleton to determine the effective visibility for the form on the system task bar. For example: The task bar behavior may require grouping related forms under a single form icon.

Changing the value for the property causes the effective visibility to be recalculated when the form is not hidden, or a MDI child form. The new effective task bar visibility is posted to the widgetset class.

Indicates whether the form is displayed in a minimized, maximized, fullscreen or normal state

WindowState is a TWindowState property which indicates whether the form is currently displayed minimized, maximized, fullscreen or normal (restored) state. The default value is wsNormal (i. e. neither minimized nor maximized).

Changing the value for the property at run-time causes the ShowWindow routine to be called with the Integer display command representing the new property value. The action is not performed at design-time, or when Showing is set to False.

TWinControl.Showing ShowWindow
Class reference for the TCustomForm class

Used primarily in the implementation of window classes for the Lazarus IDE.

WSRegisterClass is an overridden class procedure used to register the widget set class used to create new instances of the form. Arranges MDI child forms so they overlap Activates the next child MDI form (fsMDIChild) in the form sequence Activates the previous MDI child form in the form sequence Arranges MDI child forms side by side The version of the LCL as string. Used to distinguish form streams using different versions of the LCL Class of TForm A floating DockSite, usable to make TControls float Makes the client occupy the entire client area (alClient) Closes (releases) the form after the last client has been undocked Disallows docking of an second client Tries to make all child controls dockclients. This is of little use in practice, a floating hostdocksite should have no child controls. Owner for the class instance The popup box containing helpful information that appears when the mouse pointer hovers over an object

Usage:

HintWindow := THintWindow.Create(nil); Rect := HintWindow.CalcHintRect(0, 'This is the hint',nil); HintWindow.ActivateHint(Rect, 'This is the hint');
True during ActivateHint The timer used to make the hint disappear Adjusts HintRect to fit on the current monitor Used in the implementation of the OffsetHintRect method. Indicates that the width for HintRect should not be decreased Indicates that the height for HintRect should not be decreased Collects the flags for Draw Text formatting

Returns a Cardinal value that contains the Draw Text flags needed for the Alignment and BiDiMode used in the hint window.

Draw Text flags for the hint window New value for the property Hides the hint window when the hint timer has expired

Called when the hint timer expires. Ensures that the internal hint timer is disabled. Hides the hint window by setting the Visible property to False.

New value for the property Sets the value for the HintRectAdjust property New value for the property Treats the whole window as transparent Sets the bounds for the hint window and configures the auto-hide timer

Sets the bounds for the hint window to the values in the HintRect property, and makes the window Visible. The internal auto-hide timer is enabled when AutoHide contains True.

Called from the ActivateHint method.

TControl.Visible
Updates the Window Region fir the hint window

UpdateRegion calls the SetWindowRgn routine to set the window region for the hint window. The window region contains the area where the system can perform drawing operations; no area outside of the window region can be updated.

Please note: SetWindowRgn requires access to the Handle for the hint window; no actions are performed in the method when HandleAllocated returns False.

When UseBGThemes is enabled, ThemeServices are used to get the theme element details needed for the client rectangle in the hint window.

Sets the value for the Color property TControl.Color New value for the property Indicates if a background from theme services is used when drawing the hint window True when ThemeServices are used for the background Indicates if theme services are used for the foreground rendered for the hint window True when ThemeServices are used to draw the foreground for the hint window System font used to draw text in the hint window TFont instance for the system font provided by the widget set Destructor for the class instance

Destroy is a class destructor. Destroy ensures a reference to the System Font used for hint windows is freed.

Constructor for the class instance

Create is the overridden constructor for the class instance. Create calls the inherited CreateNew constructor, and allocates resources needed in the class instance. This includes an internal timer used when AutoHide is set to True.

Create sets the default values for the following properties:

Parent
Set to Nil
Color
Set to clInfoBk
Font
Uses the Screen.HintFont
Canvas
Uses the brush style bsClear
Alignment
Set to taLeftJustify
BorderStyle
Set to bsNone
Caption
Set to an empty string ('')
HideInterval
Set to 3000 milliseconds (3 seconds)
AutoHide
Set to False

Create uses the default size from the class type for the control to set the initial bounds for the hint window.

Owner of the class instance Shows the specified hint

ActivateHint is an overloaded procedure used to display the Hint text specified in AHint. An overloaded variant allows the display area for the hint window to be specified in the ARect argument.

Please note: No actions are performed in the method if ActivateHint has been previously called with the same hint text and display area.
Text displayed in the hint window TRect with the display area for the hint window Sets the bounds in HintRect and activates the hint window

ActivateWithBounds is a procedure used to update the location and text for the hint window. ActivateWithBounds sets the value in HintRect to the value in the ARect argument. ActivateWithBounds calls ActivateHint using the value in AHint as the text displayed in the hint window.

Rectangle with the bounds assigned to HintRect Text displayed in the hint window An extended version of ActivateHint with additional data used for the hint display

ActivateHintData is an extended version of ActivateHint. It provides the additional AData argument which contains a pointer to values which can be used to construct the text displayed in the hint window.

The implementation in THintWindow does not use the values in AData. The method must be overridden in a descendent class to use the additional hint data in AData.

Display rectangle for the hint text Text displayed in the hint window Pointer to additional data used to construct the hint text Determines the rectangle required for the hint display

CalcHintRect determines the display rectangle required for the hint display. CalcHintRect uses the larger of the values in the length of the hint text, and the width of the hint window.

Display area needed for the hint display Greater than zero, otherwise the full monitor width is used Hint text used to derive the display area Pointer to additional data used to construct the hint text Moves the hint rectangle by the specified amounts True when the hint rectangle was successfully moved by the specified amounts TPoint with the horizontal and vertical offets for the hint display Additional vertical offset applied to the hint rectangle Indicates the width for the hint rectanlge must be maintained Indicates the height for the hint rectanlge must be maintained Indicates if the specified message is relevant to a hint window display Destroys an allocated handle for the widget TWinControl.DestroyHandle Text alignment used for the hint window

Alignment is a TAlignment property that indicates the alignment used for the text displayed in the hint window.

The default value for the property is taLeftJustify, as assigned in the Create constructor. The value in Alignment is used to derive the draw text flags required for the BidiMode in the hint display, and passed to to DrawText routine in theme services or widget set classes.

Contains the bounds used to display the text for the hint

HintRect is a TRect property which contains the bounds used to display the hint when it is activated. HintRect is adjusted using the values in HintRectAdjust (when assigned) and the borders drawn around the hint display.

Contains the bounds with additional space used for the hint display Pointer to data used to formulate text displayed in the hint window Does the hint disappear (get hidden) after a while? If AutoHide is TRUE, the hint disappears after an interval specified by HideInterval. The time after which the displayed hint disappears Class of THintWindow For a rendered hint with a child control added by an external provider Constructor for the class instance Owner of the class instance Destructor for the class instance Shows hint contents are rendered by a provider on child control Provides information about a physical monitor

Monitor information is retrieved dynamically from the Operating System. This ensures that any changes to the installed hardware devices or their configuration are taken into account. TMonitor has properties that reflect its dimensions, use as the primary monitor, and its display density (or Pixels per Inch).

TMonitor is the type returned when reading the TScreen.Monitors property. TMonitor is the type used to implement the TCustomForm.Monitor property.

Retrieves monitor information from the OS or platform

Getinfo is a Boolean function used to get monitor information from the OS or platform hosting the LCL application. Getinfo initializes the Info output parameter to the size required for the TMonitorInfo type, and calls the GetMonitorInfo routine for the widget set.

The return value is True when monitor information is successfully retrieved for the OS or platform. Info contains the size, display rectangle, work area, and flags for the monitor.

TMonitorInfo
True when monitor information was successfully retrieved TMonitorInfo with values retrieved for the OS or platform Gets the value for the Left property Value for the property Gets the value for the PixelsPerInch property Value for the property Handle which identifies this monitor to the system Index of the monitor in the list The leftmost screen coordinate of the display The height of the display The topmost screen coordinate of the display The width of the display The logical dimensions of the monitor, within the desktop. The usable display area, excluding a taskbar etc True if this is the primary monitor of the system Contains the Pixels Per Inch or display density for the monitor A list of all available monitors List notification handler, destroys the Monitor object on removal from the list The monitor object The list operation The indexed list of all Monitors Items is the default property for the monitor list. Ordinal position for a monitor in the list An element of the Cursor list The next list element The list index The OS identifier for this cursor Type used for a screen notification handler, for form related events ? TObject for the event notification The affected form Type for a screen notification handler used for control related events ? TObject for the event notification The new active control Screen notification events and handler types A form was added A form was removed The focus moved to another control The focus moved to another form The visibility of a form changed The monitor to use when screen coordinates are outside of the physical screen bounds Default to the nearest monitor Default to Nil (no suggested monitor) Default to the primary monitor Provides information about the display and related objects

The virtual screen (desktop) can include multiple physical Monitors. Screen objects are Cursors, Fonts and Forms. For Delphi compatibility, non-visual DataModules are included.

The currently active Form, Control and Cursor also are tracked.

The last active control, used to detect focus changes The last active form, used to detect focus changes Removes a cursor from the Cursors property The logical cursor ID Deletes all TCursor instances in the Cursors property Clears the Monitors list The logical cursor ID Internal notification handler, adds a new form to the lists Form instance added in the method Internal notification handler, removes the form from the lists Form instance removed from the list Stores the currently active form and control in the last active members. Notifies all registered handlers of eventual changes. Moves the Focus back to the previously focused control Adds a notification handler The notification (event) type The notification handler Add the handler as the first (True) or last (False) handler Removes a notification handler The notification (event) type The notification handler Adds the specified DataModule to the list Data module instance added in the method Removes the specified DataModule from the list Data module removed in the method Notifies all registered handlers for the given event Event type for the notification Form instance for the notification The ordinal position in CustomForms the requested form The form Index, -1 if not found The Form to which the Index refers The ordinal position in Forms for the requested form The form Index, -1 if not found The Form to which the Index refers The index of the form in the Z dimension (Front to Back)

The return value contains the activation order for the specified form, with the currently active form at index position zero (0).

Moves the specified form to the front of all form lists Raises a GDB exception when the form is being destroyed, or the application is shutting down. Moves the form to the front of the Z-order list (notification only) Raises a GDB exception when the form is being destroyed, or the application is shutting down. Returns the topmost Modal form (i.e. a form that is awaiting a user response). The modal form, or Nil if none is active Returns the index of the topmost modal form in CustomFormsZOrdered[] The index for the form, or -1 if no modal form is active Checks whether the form is visible, and whether modal or not blocked by another modal form ? Finds the named form, excluding designer forms Finds a form by its name Finds the named DataModule, excluding designer modules Finds the named DataModule Builds the list of available monitors Updates the property Adds a notification handler Removes a notification handler Adds a notification handler Removes a notification handler Adds a notification handler Removes a notification handler Adds a notification handler Removes a notification handler Adds a notification handler Removes a notification handler Disables all forms except SkipForm.

Used to show modal forms or dialogs.

The enabled state is determined from the widget, not from LCL properties.

If DisabledList is Nil, a new list is created. Then all disabled forms are added to that list.

When the modal form returns, call EnableForms to restore all forms.

The list containing all disabled forms Don't disable this form (ignored if Nil) The list to update. If Nil, a new list is created and returned Use this method to restore all previously disabled forms. The list containing the forms to enable. The list is destroyed on exit. Find the monitor containing the given screen coordinates The monitor found The screen coordinates to find What to return when no monitor was found Find the monitor containing (most of) the given screen coordinates The monitor found The screen coordinates to find What to return when no monitor was found Finds the monitor containing (most of) the given window handle The monitor found The window handle to use What to return when no monitor was found Override the Cursor property with a temporary value. Use EndTempCursor to release it. Release the temporary cursor set with BeginTempCursor. The control which has the Focus for the screen The custom form which has the Focus The form which has the Focus The current mouse cursor shape Use one of the predefined cursor styles, e.g. crHourGlass. Gets the value for the Cursor property taking temporary cursors into account Provides indexed access to the available cursor shapes for the screen Ordinal position for the value requested The number of Custom Forms Provides indexed access to the list of Custom Forms for the screen Ordinal position for the requested form The list of Custom Forms, indexed by Z-order (zero is topmost) CustomFormZOrderCount - the number of forms arranged in Z-plane order (i.e. Front to Back) The leftmost coordinate of the desktop The topmost coordinate of the desktop The total vertical size of the desktop The total horizontal size of the display The total extent of the desktop, spanning all monitors The form that holds Focus really?what's different from ActiveForm? The number of existing Forms The indexed list of all Forms, in Z-order The number of existing data modules The indexed list of Data Modules The font used to display Hints The Icon font, used for desktop icons IconFont is passed to the InitStockFont method in the widgetset to load the font required. The font used in menus The default font used for system task dialogs and controls like TSpeedButton The names of the available (installed) fonts

Fonts is a read-only TStrings property which contains the names for the fonts available using the EnumFontFamiliesEx routine for the widgetset. Values in Fonts are sorted alphabetically in ascending order.

The height of the primary monitor The number of available Monitors The indexed list of available monitors. The number of screen pixels for an virtual inch (DPI), in the vertical direction.

The display uses virtual inches, which typically are bigger than physical inches. This requires that text appear bigger on a screen than on a printer.

The primary monitor typically shows the taskbar The width of the primary monitor The usable display area on the primary monitor, excluding e.g. the taskbar The usable height of the primary monitor The usable left coordinate on the primary monitor The usable top coordinate on the primary monitor The usable width of the primary monitor Handler for a Focus changed notification Handler for a Focus changed notification The type of an handler Set Cancel to True to prevent a logoff Defines an event handler signalled to perform exception handling in an application

TExceptionEvent is an object procedure type that defines an event handler signalled to perform exception handling in an application. Arguments passed to the event handler identify the application generating the notification, and the exception class instance. Applications must implement an object procedure using the signature for the event, and assign it to an event handler to respond to the notification.

TExceptionEvent is the type used to implement exception handlers in TApplication and TApplicationProperties.

Object instance for the notification Exception instance for the notification Specifies an event handler used to get the handle for the main form in an application

TGetHandleEvent is an object procedure type which defines an event handler signalled to get the handle for the main form in an application. TGetHandleEvent is the type used to implement the OnGetMainFormHandle event handler in TApplication and TApplicationProperties.

Handle for the form instance used as the main form Type of an Idle event handler

Lengthy operations should be broken into smaller parts, to ensure that the application remains responsive. The handlers are called repeatedly, until all signal Done.

Set to True when everything is done Specifies an event handler signalled to respond to user input messages in an application

TOnUserInputEvent is an object procedure type which defines an event handler signalled to respond to user input messages in an application. It is used as a callback which forwards input messages from widget set classes to the current application.

TOnUserInputEvent is the type used for the OnUserInput event handler in TApplication and TApplicationProperties.

The type of an asynchronous callback method The argument passed to the method Provides access to members in a CM_HINTSHOW control message TCMHintShow is a record type used to represent a CM_HINTSHOW control message passed as an argument to control methods. TControl.CMHintShow Cardinal value represnting the control message Reserved parameter values for the message Pointer to the hint information for the control message Result returned for the control message TCMHintShowPause is not used in the current LCL implementation. The TApplication hint timer state The hint timer is off Waiting to show a hint; used when a hint timer is started Waiting to hide an hint; used when the hint control is changed or the mouse leaevs a hint rectangle Waiting to show the next hint; used when the hide hint timer is started Defines an event handler signalled to perform hint display

TShowHintEvent is an object procedure type which defines an event handler signalled to perform hint display. It is the type used for the TApplication.OnShowHint event handler property.

Stores control and mouse position information for a hint display

THintInfoAtMouse is a record type used to store Control and Mouse position information for a hint display.

THintInfoAtMouse is passed as an argument to the ShowHintWindow method in TApplication. It is also used in the implementation of TApplication methods like ActivateHint and OnHintTimer.

POsition of the mouse cursor for the hint display Control for the hint display Indicates if hint text is available for form or control Application state flags

TApplicationFlag is an enumeration type with values that represent activity or state in an application. TApplicationFlag values are stored in the TApplicationFlags type used to implement the Flags property in TApplication.

Application is in an Idle state and waiting for a message IdleEnd handlers have been notified of message arrival; end the idle state for the application In exception handling Not used in the current LCL version. Suppresses exception display for the application; set when an exception is aborted in the application The application has focus; prevents recursive application activation Shutting down; set when the application instance is freed Skip asynchronous callbacks between handled messages Included in Flags when the application is being destroyed. Causes an exception to be raised in QueueAsyncCall. Application has been initialized Which keys can be used for the navigation within a form

TApplicationNavigationOption is an enumerated type with values that control the behaviors enabled for navigation in an application. Values from TApplicationNavigationOption are stored in the TApplicationNavigationOptions set type used to implement the Navigation property in TApplication.

The Tab key moves the Focus to the next (or previous) control in TabOrder. The Enter key triggers the default action. The Escape key triggers the Cancel action The F1 key brings up context sensitive help The Arrow keys move the focus ? Types of Application notification handlers TApplicationHandlerType is an enumerated type with values that identify handler categories used in TApplication. TApplicationHandlerType is used as an index value for the internal array of TMethodList instances used in TApplication. It is passed as an argument to the AddHandler and RemoveHandler methods in TApplication to identify the method list where the handler is stored. It is also used in the implementation of TApplication methods used to retrieve, execute, or maintain handlers such as: Destroy and RemoveAllHandlersOfObject. Application becoming idle Application idle state is ending Handler for KeyDown events, invoked before interface and LCL handlers Default handler for KeyDown events, invoked after interface and LCL handlers Handler invoked on application activated Handler invoked on application deactivated Handler invoked on user input Used in NotifyUserInputHandler; implemented in Sparta MDI package Handler invoked on handled exception ? Handler invoked on session end Used in IntfEndSession. Handler invoked before session ends Handler invoked when the application is minimized Handler invoked when a form is shown modally Handler invoked when the last modal form is closed Handler invoked on application restored (from minimized state) Handler invoked on files dropped Used in IntfDropFiles. Handler invoked on F1 key (help request) Used when OnHelp is not assigned in the application. Handler invoked on Hint request Handler invoked on Hint becoming visible Handler provides the Handle for the main form A queued asynchronous callback request node A queued asynchronous callback request node The callback method The method call argument The next list node The preceding list node superfluous, could be removed? The queue head for asynchronous callbacks The first queued method The last queued method Management information for asynchronous callbacks

Two queues are used:

New calls are added to the Next queue.

When the application starts processing the calls, the Next queue becomes the Cur queue, and a new Next queue is created. This simplifies thread-safe addition in subsequent calls.

The critical section for adding and removing queue elements The currently processed queue. Processed entries are removed New calls are added to this queue Identifies the kind of device where the application currently runs

TApplicationType identifies the kind of device where the application currently runs. Note that the same application can run on differing device types if it has a flexible user interface.

TApplicationType is the type used to implement the ApplicationType property in TApplication, and returned from widgetset methods that identify the platform for the interface.

The widgetset will attempt to auto-detect the device type For common desktops and notebooks For smartphones and other devices with a smallish touchscreen Devices without any pointing device, such as keypad feature phones or kiosk machines Enumeration with dialog types for an application

TApplicationExceptionDlg is an enumerated type with values that indicates the type of dialog displayed for an application exception. TApplicationExceptionDlg is the type used to implement the ExceptionDialog property in TApplication and TApplicationProperties.

Exception handler window will be a dialog with Ok/Cancel buttons Exception handler window will be a simple message box Describes the policy for the application of how to show menu and button glyphs

TApplicationShowGlyphs is an enuemrated type with values that indicate the policy for displaying glyphs on menus and buttons. TApplicationShowGlyphs is the type used to implement the ShowButtonGlyphs and ShowMenuGlyphs properties in both TApplication and TApplicationProperties.

TGlyphShowMode
Show glyphs always (disregards system preferences) Show glyphs never (disregards system preferences) Show glyphs according to the platform or OS preferences How forms are represented in the TaskBar

TTaskBarBehavior is an enumerated type with values that define how forms are displayed in the task bar. TTaskBarBehavior is the type used to implement the TaskBarBehavior property in TApplication.

Please note: Some Linux window managers do not support task bar behaviors. For example: Cinnamon.
Show TaskBar buttons according to the platform default Show buttons for Forms with ShowInTaskBar=stDefault Hide buttons for Forms with ShowInTaskBar=stDefault Enumeration with values used in the DoubleBuffered property in TApplication ? Widget set dependent; for LCL/Win32 it is True, unless in a remote desktop connection. For other widget sets it is False. Application management and configuration for a GUI application

TApplication is a TCustomApplication descendant which provides facilities used to manage and configure a GUI application. Properties, methods, and event handlers are provided which allow a program to create, execute, monitor, maintain and destroy an application and its forms. Every GUI application contains an Application variable that represents the TApplication or descendent class instance.

TApplication provides a message processing loop that includes hooks for event handlers and exception handling, and supports dispatching messages for TCustomAction instances used in application forms. TApplication provides support for Hints and content-sensitive help for forms and controls used in the application. Convenience methods, like MessageBox, are provided to simplify access to dialogs and error messages in the application.

Needs more (or better) descriptions.
Holds the registered notification handlers for the application The list of components marked for release The list of components which currently are released (destroyed) The screen area of the current Hint window The timer for showing and hiding Hints The Hint time mode The current Hint window The Handle for the big application icon The Handle for the small application icon Counter for nested Idle locks, preventing execution of OnIdle handlers Cached key event parameter List of key values for the last KeyDown sender Cached key event parameter The previously installed exception handler Queues for asynchronous calls Cached mouse event parameter Cached mouse event parameter Cached mouse event parameter The list of all forms that should be restored to StayOnTop The list is created in RemoveStayOnTop, processed in RestoreStayOnTop. Notifies the OnIdleEnd handlers; called when the application exits Idle state Gets the HelpFile name for the active form, or the Application

GetCurrentHelpFile is a String function used to get the help file name for the active form or application.

GetCurrentHelpFile checks for an active form in the Screen singleton. If a form is active, the file name in its HelpFile property is used as the return value. If a form is not active, the HelpFile in the Application instance is used.

Help file name located in the method Gets the name of the executable for the application

GetExename is a String function used to get the name of the executable file which started the application. The return value contains the first commandline parameter (ordinal position 0) returned from the ParamStrUTF8 routine in LazUtils.

Name of the executable file used to start the application Gets the value for the Handle property Returns the AppHandle property from the WidgetSet singleton. The Handle for the application Determines the main form handle, using all available handlers When no Title was stored, extracts the program name from the commandline arguments Destroys the application icons

FreeIconHandles is a procedure used to free icon handles used in the application. FreeIconHandles ensures that the internal members for the small and large icon handles are destroyed (when assigned). The DestroyIcon routine is called to destroy each of the icon handles using the correct routine for the widget set implementation.

FreeIconHandles is called from the destructor for the class instance, and when an icon for the application has been changed.

Loads the new application icons, notifies the widget set and all forms Handles mouse moving onto a new control Sets Hint to the (new) hint that applies to CurrentControl The control under the mouse Disables the Hint timer Checks for an installed HelpManager True when HelpManager is not Nil Asks the active form and MainForm to handle the action True when the action was handled Adds an application notification handler Removes an application notification handler Encapsulates the application message loop (HandleMessage) Handler for application activation, notifies all activation handlers Handler for application deactivation, notifies all deactivation handlers True when called from the widget set Here: returns False, because this is a GUI application. False for a GUI application Notifies all Idle handlers True when all handlers are done, meaning: wait for next message Notifies all Idle End handlers, when a new message arrived Notifies all Activation handlers Notifies all Deactivation handlers Notifies all CustomForms of Msg arrived The message to process NOP, exists for Delphi compatibility only Always False OnHelp message handler. Tries the OnHelp handlers for the active form, and the Application, as well as application Help handlers. True when the message was handled ? OnMouseMove message handler, updates the Hint Shows or hides the Hint window Is updated with the Hint related information Event handler for timing the duration of hints Starts the timer for display of a hint message Asks the widget set to update the TaskBar entries ? Updates all Actions, hides splash screens Hides the Hint window Calls all methods queued by QueueAsyncCall Ignored, should be zero Destroys all components marked for release Destroys all components

Called from the BeforeFinalization routine which is used as the ExitProc handler in the application instance.

Returns the commandline argument at the specified position The Owner object that invoked this instance of TApplication Destructor for the class instance

Destroy is the overridden destructor for the class instance.

Destroy ensures that the value AppDestroying is included in the Flags for the application, and signals the OnDestroy event handler (when assigned). Destroy calls the ProcessAsyncCallQueue method to process / handle queued asynchronous method calls pending for the application instance.

Hint display is cancelled and suppressed while the application is shutting down. The action component for the application is set to Nil to prevent execution of associated actions during shutdown.

Destroy frees resources allocated in the application instance, including the Icon and any Icon handles currently in use. Handlers added to application instance are also freed.

Destroy calls the inherited destructor, and discards any pending asynchronous calls not previously handled for the application instance. Exception handling is restored to the state on entry to the Create constructor. Finally, the Application class instance is set to Nil.

Destroy calls RaiseGDBException to raise an exception if the current class instance is unassigned (contains Nil). Uses the exception message 'TApplication.Destroy Self=nil'.

Raises an EAssertFalied exception if the CustomApplication and Application variables do not contain the same TCustomApplication instance.

Configures a hint window for the specified mouse position

ActivateHint is a procedure used to configure a hint window display at the coordinates specified in CursorPos.

ActivateHint retrieves the hint information at the mouse position. If the control for the hint differs from the current hint control, the existing hint is deactivated. The new hint window sets its hint timer and calculates the rectangle for the hint window.

If a hint is not availabe for the specified mouse position, the CancelHint method is called.

ActivateHint is used in the implementation of the DoOnMouseMove and ShowHintWindow methods.

Mouse cursor position used to retrieve the hint information Indicates if hint controls are used to compared existing and new hint windows Finds the control under the mouse Updates the LastMouse... info. The control, or Nil if no control is found Clears all references to the destroyed control The Handle of the large application Icon The Handle of the small application Icon Asks the widget set to bring the application's form(s) to the front ? Creates a Form or component, owned by Application Please note: The method name is confusing and kept only for Delphi compatibility. The method can actually create any kind of component.

CreateForm creates a Component instance of the given class, and sets the pointer to the component variable. If it is a form, it will be added to the form list in the application.

A splash form is shown immediately.

and loads the component?
The component class The variable receiving the new component reference When MainForm is Nil, this form becomes the application MainForm The form that may become the MainForm Inserts an asynchronous call into the queue This is thread safe. Exceptions on various inconsistencies of the queue. The method to call asynchronously The argument passed to the method Removes all calls added via QueueAsyncCall This is thread safe. Exceptions on various inconsistencies of the queue. Safe destruction of a component, can be requested by the component itself

Unless the application is shutting down, all requests are queued. Queued requests are processed when the application is not currently processing a message.

The component to destroy Invokes the OnActionExecute handler TComponent.ExecuteAction True when the Action was handled The Action to execute Invokes the OnActionUpdate handler TComponent.UpdateAction HandleException method for handling an exception; attempts to maintain program execution if possible, otherwise exits gracefully

Individual exception handler methods should be supplied by the application programmer, to override place-holder entries declared in ancestor classes. This method checks whether the application is halted when an exception occurs, or invokes the appropriate handler. It also writes details about the exception to the appropriate place for debugging.

TCustomApplication.HandleException
Handles all messages, and enters the Idle state Show help Currently relies on OnHelp handlers. CallHelp is not implemented. ? Show context sensitive help Request handled ? Show help for a keyword When Sender is a TControl, invoke its ShowHelp method Should be a TControl, else nothing will happen Remove StayOnTop from all forms. Builds a form list for use in RestoreStayOnTop. ? Restores StayOnTop for all forms changed by RemoveStayOnTop ? True if the application is awaiting an event ? True if the application is in AppWaiting state Called when the Hint time has expired, to stop showing the Hint. Hides the Hint window Called when the the mouse is over a control with a Hint Does nothing ?exists for Delphi compatibility only? Initializes the widget set (and more)

Initialize is an overridden procedure in TApplication used to perform initialization tasks for the application. Initialize calls the inherited method to provide supprt for instance counting in the custom application. Initialize ensures that the WidgetSet class type is assigned for the application, and that the Screen singleton is initialized and updated.

Initialize raises an Exception if WidgetSet has not been assigned, or contains a class type other than TWidgetSet, for the application.

Initialize updates the Flags property to include the value AppInitialized when both the LCL interface (Widget set) and the Screen singleton have been configured.

Initialize loads the graphic image used in the Icon property. If a resource with the name MAINICON is included in the Lazarus Resource, it is loaded and used as the application icon. Otherwise, FindResource is called to locate and load the named icon from the resource handle.

Raises an Exception if the Widget Set class is invalid or not assigned. WidgetSet TCustomApplication.Initialize
Display an message dialog with several response buttons

The function is used internally to display messages during the handling of Exceptions, but is also available to application programmers as an alternative to some of the message dialogs found in the Dialogs unit.

The function returns an integer value corresponding to the button that was pressed; its value can be determined by reference to the constants [IDOK..IDHELP].

MessageDlg
Indicates the pressed button

Can be one of the following values:

  • IDOK
  • IDCANCEL
  • IDABORT
  • IDRETRY
  • IDIGNORE
  • IDYES
  • IDNO
  • IDCLOSE
  • IDHELP
The text in the MessageBox The Caption of the MessageBox The icon and buttons appearing in the box.

Several constants are declared in the LCLType unit.

Add (better: OR) an icon constant and a buttons constant. For example:

MB_ABORTRETRYIGNORE + MB_ICONQUESTION

Causes the application to display a query (?) icon in a box with three buttons: ABORT RETRY IGNORE.

Buttons can be one of:

  • MB_OK
  • MB_OKCANCEL
  • MB_ABORTRETRYIGNORE
  • MB_YESNOCANCEL
  • MB_YESNO
  • MB_RETRYCANCEL

The icon can be one of:

  • MB_ICONHAND
  • MB_ICONQUESTION
  • MB_ICONEXCLAMATION
  • MB_ICONASTERISK
  • MB_ICONWARNING = MB_ICONEXCLAMATION
  • MB_ICONERROR = MB_ICONHAND
  • MB_ICONSTOP = MB_ICONHAND
  • MB_ICONINFORMATION = MB_ICONASTERISK
Asks the widget set to minimize the application. Called when a form is shown modally Invokes all OnModalBegin handlers when entering Modal state. Called when a modal form is closed Invokes all OnModalEnd handlers when exiting Modal state. Restores the previously minimized application. Invokes the notification handlers.

Special handling, here: Clears the reference to a removed component, terminates the application when the MainForm is removed.

TComponent.Notification
Call this method during lengthy operations, to keep the GUI responsive Processes all waiting messages, then the queued asynchronous callbacks. Invoked when the application enters the idle state Wait for next message? MainForm is loaded and control is passed to the event loop Shows the exception message and asks the user to abort or continue The exception to display for the application Exception The application is terminated and the component engine is shutdown Blocks Idle handling. Can be called more often, every call must be followed by EnableIdleHandler. what does this mean to application behavior? Resume Idle handling GDB exception when not previously disabled. Notifies all user input handlers of what? Notifies all ahtKeyDownBefore handlers Notifies all ahtKeyDownAfter handlers, eventually reacts on F1 (Help) Handles KeyDown events in a Control, e.g. handles navigation keys Handles KeyUp events in a Control, e.g. handles Enter and Esc keys Adds an application Idle handler Removes an application Idle handler Adds an application IdleEnd handler Removes an application IdleEnd handler Adds an application user input handler Removes an application user input handler Adds an application key down before interface handler Removes an application key down before interface handler Adds an application key down after interface handler Removes an application key down after interface handler Adds an application activation handler Removes an application activation handler Adds an application deactivation handler Removes an application deactivation handler Adds an application exception handler Removes an application exception handler Adds an application logoff handler ? Removes an application logoff handler ? Adds an application logoff query handler Removes an application logoff query handler Adds an application minimizing handler Removes an application minimizing handler Adds an application becoming modal handler Removes an application becoming modal handler Adds an application exiting modal state handler Removes an application exiting modal state handler Adds an application exiting minimized state handler Removes an application exiting minimized state handler Adds an application dropped files handler Removes an application dropped files handler Adds an application Help handler Removes an application Help handler Adds an application Hint handler Removes an application Hint handler Adds an application Hint show handler Removes an application Hint show handler Adds an application MainForm Handle handler Removes an application MainForm Handle handler Removes all handlers implemented in the given object Things to be done before a mouse message is processed Asks all shortcut handlers to handle the key True when the shortcut was handled Called by the interface to confirm the end of a session Asks all QueryEndSession handlers to confirm termination of the application. Called by the interface when the session ends Notifies all OnEndSession handlers. Called by the interface on application activation Notifies all activation handlers. ? Called by the interface on application deactivation ? Called by the interface when the application is minimized Called by the interface when the application is restored Called by the interface when files have been dropped Called by the interface when a theme option has changed Indicates if BiDiMode contains a value other than bdLeftToRight Checks the given language name for use of right-to-left reading True when the language code uses right-to-left reading ISO language code examined in the method Gets the BidiMode value for the specified language name TBiDiMode value for the specified language ISO language name examined in the method Uses arrow keys for navigation, if enabled The control receiving the key The virtual key; becomes VK_UNKNOWN when handled The active modifier keys Uses the Tab key for navigation, if enabled The control receiving the key The virtual key; becomes VK_UNKNOWN when handled Interprets Esc as Cancel action, if applicable The control receiving the key The virtual key; becomes VK_UNKNOWN when handled The active modifier keys Interprets Enter as the default action, if applicable The control receiving the key The virtual key; becomes VK_UNKNOWN when handled The active modifier keys True if the application has the focus The type of the application (i.e. the sort of device for which it is intended)

The type of the application:

Default, Desktop, Handheld, PDA, Smartphone

The bidirectional mode to use Enables exception handling by Application Indicates if the application uses double buffering Default value is adbDefault. Hint: platform specific. See VK_LSHIFT in LCLType for more details. Indicates the dialog type used for an exception in the application

ExceptionDialog is a TApplicationExceptionDlg property which indicates the dialog type displayed for an exception handled by the application instance. The default value for the property is aedOkCancelDialog, as assigned in the Create constructor.

See TApplicationExceptionDlg for more information about values in the enumeration and their meanings.

Enables searching for global components by name ? Application state flags Provides access to the widget set handle for the application instance

Handle is a THandle property which provides access to the widget set handle used for the application instance. Reading the value for the property is redirected to the AppHandle allocated in the widget set class. Setting the value for the property causes the AppHandle in the widget set class to be updated with the new value.

Handle is used to send and receive window messages and state change notifications for the application instance using the LCL interface.

The current Hint text

A hint is a pop-up message that appears briefly while the mouse hovers over a control. It usually displays useful information about how to the UI element, or the type of data that should be entered, etc.

Other properties can be used to customize the delay before a Hint is shown, after the mouse is moved away from the control or form, and how long it will remain visible.

The color of Hint windows How long a Hint stays visible, after an mouse move How long a keystroke extends the time a Hint remains visible (added to HintHidePause) The delay before a Hint is shown Enables the display of keyboard shortcuts (e.g. on menu entries) not implemented? The pause before a different Hint is displayed The icon associated with this application Indicates the layout and sizing policy used for forms and controls in the application Allows switching between controls using keyboard navigation

These keys can be enabled for navigation:

  • The Tab key moves the Focus to the next (or previous) control in TabOrder.
  • The Enter key triggers the default action.
  • The Escape key triggers the Cancel action.
  • The F1 key brings up context sensitive help.
  • The Arrow keys move the focus.
The application terminates when this form is closed

This property is set when the first form is created using the CreateForm method when FormStyle contains a valueother than fsSplash.

Window handle for the MainForm in the application

MainFormHandle is a read-only HWND property which contains the handle for the form instance used as the main form in the application.

The value for the property is derived using the OnGetMainFormHandle event handler (when assigned) or a TGetHandleEvent handler assigned in the application. When neither of these mechanisms provides a value other than zero (0), the window handle assigned in the MainForm property is used.

MainFormHandle is used in the implementation of methods in WidgetSet classes, primarily for the Windows platform, and in custom-drawn controls.

Controls whether a button is displayed on the task bar for the main form in the application

MainFormOnTaskBar is a Boolean property which determines whether the icon for the main form in the appliciation is displayed on the task bar. When MainFormOnTaskBar is set to True, a button representing the main form is displayed on the task bar area in the window manager. When set to False, the button is not displayed in the task bar area.

Changing the value in the property causes the Widgetset class to be notified of the new property value.

MainFormOnTaskBar is a platform-dependent property. It may not be implemented for all platforms supported for the Lazarus application. In addition, some platforms which display task bar thumbnails (like Windows Vista) may require the property to be set to True.

The default value for the property is normally set in the Lazarus project file (.lpr) used to compile the application.

The number of modal forms shown Tracks modal forms showing another form modally. Indicates if an active control is focused when a form receives focus

MoveFormFocusToChildren is a Boolean property which indicates if an active control is focused when a form receives focus in the application.

The default value is True. When set to False, the window or form will still receive focus, but a child control is not selected.

Used in TCustomForm.SetActive.

The control currently under the mouse Used to detect mouse entering and leaving a control. How forms are represented in the TaskBar Indicates if application format settings are updated when changed in a widget set class Default handler for unhandled Actions ? Default handler for unhandled Action updates ? Event handler for activation of the application Event handler for deactivation of the application Event handler used to provide a value for the MainFormHandle property

Used in the implementation of the GetMainFormHandle method. Provides the first opportunity to set the handle value before calling the other handlers added to the application.

Event handler for application entering Idle state Event handler for application leaving Idle state Event handler for ending a session of the application or logoff? This event handler can deny to end the session Event handler for application minimized Event handler signalled when a message dialog in the application has been completed Used in the CustomDraw interface. Event handler for a modal form opened (application entering modal mode) Event handler for closing modal forms (application exiting modal mode) Event handler for application restored (from minimized/maximized state) The default handler for dropped files ? Event handler when help is requested Event handler when a hint is requested This event handler can interpret keystrokes as shortcuts, before the normal target handles the key ? Event handler for showing an Hint Event handler signalled for application handler notifications for user input messages Event handler signalled when the application is freed

OnDestroy is signalled from the Destroy destructor prior to freeing resources allocated in the application class instance. It provides the first opportunity to respond to application shutdown after Flags has been updated to include the AppDestroying enumeration value.

Handler invoked when there a circular exception occurs before the application is halted. Allows to override the platform default for glyphs on buttons Some platforms show glyphs on all buttons, others don't. Sets the default policy for showing or hiding glyph images in menus TGlyphShowMode ? Indicates if Hints are displayed for the application

ShowHint is a Boolean property which indicates if Hints are displayed for the application. It is used when tracking the position of the mouse cursor over controls and forms, and determines if the items require a hint display.

Setting the value in ShowHints to False causes an existing THintWindow instance in the application to be freed.

Allows the main form to be shown or hidden when an application is started. Default is True. Indicates if forms and controls in the application can be scaled to different display densities (Pixels per Inch) Contains the default BiDiMode value used for the current LCL version Default value is bdLeftToRight. The default hint window color The default pause before the hint window displays (in milliseconds) The default Hint reshow pause (in milliseconds) The default pause before hint is hidden (in milliseconds) The default pause added to DefHintHidePause (in milliseconds) A component that provides access to the properties for the current application

TApplicationProperties is a non-visual component that provides access to a number of application properties, including:

  • CaptureExceptions
  • HelpFile
  • Hint
  • HintColor
  • HintHidePause
  • HintPause
  • HintShortCuts
  • HintShortPause
  • ShowButtonGlyphs
  • ShowMenuGlyphs
  • ShowHint
  • ShowMainForm
  • Title
  • OnException
  • OnGetMainFormHandle
  • OnIdle
  • OnIdleEnd
  • OnEndSession
  • OnQueryEndSession
  • OnMinimize
  • OnModalBegin
  • OnModalEnd
  • OnRestore
  • OnDropFiles
  • OnHelp
  • OnHint
  • OnShowHint
  • OnUserInput

Values for the properties are assigned in the constructor to the currently assigned values in the Application singleton.

At run-time, changes to the properties are also assigned to the Application singleton. For event handler properties, the previous routine is removed as a handler and the new handler is added to the Application singleton. When the component is freed, the event handlers are removed from the Application singleton. The changed properties are not assigned to Application at design-time.

TApplicationProperties is available on the Additional tab in the Lazarus IDE Component Palette. TApplicationProperties is similar to the TApplicationEvents class in Delphi.

Sets the value for the ExceptionDialog property New value for the property Sets the value for the CaptureExceptions property New value for the property Sets the value for the HelpFile property New value for the property Sets the value for the Hint property New value for the property Sets the value for the HintColor property New value for the property Sets the value for the HintHidePause property New value for the property Sets the value for the HintPause property New value for the property Sets the value for the HintShortCuts property New value for the property Sets the value for the HintShortPause property New value for the property Sets the value for the ShowButtonGlyphs property New value for the property Sets the value for the ShowMenuGlyphs property New value for the property Sets the value for the ShowHint property New value for the property Sets the value for the ShowMainForm property New value for the property Sets the value for the Title property New value for the property Sets the value for the OnActivate property New value for the property Sets the value for the OnDeactivate property New value for the property Sets the value for the OnException property New value for the property Sets the value for the OnGetMainFormHandle property New value for the property Sets the value for the OnIdle property New value for the property Sets the value for the OnIdleEnd property New value for the property Sets the value for the OnEndSession property New value for the property Sets the value for the OnQueryEndSession property New value for the property Sets the value for the OnMinimize property New value for the property Sets the value for the OnModalBegin property New value for the property Sets the value for the OnModalEnd property New value for the property Sets the value for the OnRestore property New value for the property Sets the value for the OnDropFiles property New value for the property Sets the value for the OnHelp property New value for the property Sets the value for the OnHint property New value for the property Sets the value for the OnShowHint property New value for the property Sets the value for the OnUserInput property New value for the property Constructor for the class instance

Create is the constructor for TApplicationProperties. Create calls the inherited Create method, and sets the defaults values when a new application is being designed, or loads local values for an existing application.

TComponent.Create
Owner of the class instance Destructor for the class instance

Destroy is the overridden destructor for the class instance. Destroy ensures that event handlers in the class instance are removed from the handlers registered in the global TApplication instance.

Please note: Event handlers are not removed from the Application variable at design-time; they were not added at design-time either.

Destroy calls the inherited destructor prior to exiting from the method.

Indicates the dialog type displayed for an exception The default value is aedOkCancelDialog. The abstract base class for visual Form designers

TIDesigner is a TObject descendant which specifies the interface used for visual Form designers . TIDesigner is the type used for the TCustomForm.Designer property.

It is used as the ancestor for TComponentEditorDesigner, and the type expected in the RootDesigner for the Object Inspector and Property editors used in the Lazarus IDE.

IsDesignMsg - receives a message from Sender, and returns True if it is a design message Method when design is Modified Notification that the supplied Operation has been applied to the specified Component ? PaintGrid - method for painting the grid in the designer ValidateRename - method to validate the Rename process GetShiftState - returns the value of the shift state (whether shifted, Cntl key, Alt key etc) SelectOnlyThisComponent - method to select only the current component in the designer UniqueName - returns a Unique name for the designer, using the BaseName as a starting point TFormPropertyStorage - class for storage of a Form's properties Calls the Restore method. Converts modifier keys from the LParam of a mouse message to a TShiftState TShiftState MK_SHIFT MK_CONTROL MK_LBUTTON MK_RBUTTON MK_MBUTTON MK_XBUTTON1 MK_XBUTTON2 The asynchronous keyboard state Converts modifier keys from the LParam keyboard message (WM_KEYUP for example) to a TShiftState TShiftState MK_SHIFT MK_CONTROL MK_LBUTTON MK_RBUTTON MK_MBUTTON MK_XBUTTON1 MK_XBUTTON2 Converts a shift state into a key state value compatible with the key state of a Windows API LParam

The Keys value is of the type PtrUInt and is a or'ed combination of the following constants:

  • MK_Shift
  • MK_Control
  • MK_LButton
  • MK_RButton
  • MK_MButton
  • MK_XBUTTON1
  • MK_XBUTTON2
TShiftState MK_SHIFT MK_CONTROL MK_LBUTTON MK_RBUTTON MK_MBUTTON MK_XBUTTON1 MK_XBUTTON2 into what?
? WindowStateToStr - converts a Window state to a string StrToWindowState - converts a string to a Window state Formats various typed values into readable text The formatted value Pointer to focus state information for the last active control in an application ? Returns the last focused control in an application ? Restores the last focused control in an application to specified value ? TIsFormDesignFunction is a Boolean function type used in the IsFormDesign variable. Returns True when the form has csDesignInstance in its component state OnGetDesignerForm is a TGetDesignerFormEvent variable that contains the event handler signalled to get a form with a design surface for the specified form or control. ? Gets the topmost Form containing the specified Control ? Does a recursive search for the first Parent of type TCustomForm Gets a valid parent form for the specified control

ValidParentForm is a TCustomForm function used to get a valid parent form for the control specified in the Control argument. TopForm indicates if the return value should contain the absolute root ancestor in the ancestry tree. ValidParentForm calls GetParentForm to get the return value for the routine.

ValidParentForm raises an EInvalidOperation exception with the message in sParentRequired when a valid parent form is not found for the specified control.

Raises an EInvalidOperation exception with the message in sParentRequired when a valid parent form is not found for the specified control.
Form instance that is the parent form for the control Control examined in the routine True if all parent forms are located in the routine ? Searches for the given virtual key, used as an accelerator

An accelerator consists of an ampersand followed by the accelerator key. Duplicate ampersands are ignored; they denote a literal (displayed) ampersand character (&).

True when the key is used as an accelerator The virtual key (uppercase ASCII) to find The string to scan Invokes all application user input handlers The message to process Returns the short version of a Hint string

A short Hint is separated from the long Hint by a '|' character. When no such character is found, the whole Hint is returned.

The short (or complete) Hint The string containing both a short and long Hint Returns the long version of a Hint string The TApplication singleton The TScreen singleton Variable representing the current exception object in an application

Used in the implementation of the TApplication.HandleException method.

The class used to create hint window instances for an application When True every form must have a resource (e.g. a .res file). An exception is raised if the resource is missing when creating a form.

The form resource is the .lfm file compiled into the executable of your application. For this flag, it does not matter if it was compiled via an .lrs file or via fpcres. The resource is automatically loaded by TForm and its descendants when created using the Create(Owner) method.

If the resource file is missing, there is something wrong with either a resource or the unit which contains the faulty form. If the flag is False, you will see a blank form and probably search a long time what is wrong. If you set this flag to True, you get an exception.

For creating forms without resources, you have 3 options:

  • Create a TForm class (not a descendant).
  • Construct your form using the CreateNew() constructor.
  • It is also possible to disable the exception by setting the global variable RequireDerivedFormResource to False.

History: Before 0.9.31 there was no exception. Therefore some resource-less forms might use the standard constructor Create(Owner) and will now get exceptions. This change is Delphi compatible and compatible with TFrame and TDataModule components.

The type used for the MessageBox variable

TMessageBoxFunction is an Integer function type which specifies the routine used to perform a message box or dialog.

Arguments passed to the function identify the content for the message dialog, including:

  • Text displayed in the mesaage dialog
  • Title used on dialog form
  • Flag values that control the buttons and icon for the dialog

The return value contains the modal result returned from the message dialog.

Provides the routine used to display a message dialog in widget set implementations

Normally contains a reference to the DefaultMessageBox function. It may have another function reference assigned to the variable in specific widget set implementations (such as CustomDraw controls).

DefaultMessageBox
Maps form border styles to their border icons

DefaultBorderIcons is an array constant with TBorderIcons values indicating the icons available for the various form border styles. Values in the array are indexed by the enumeration values in TFormBorderStyle. Each element in the array contains zero (0) or more values from the TBorderIcon enumeration, and indicates that the icon is used for the form border style.

DefaultBorderIcons contains the following values for the corresponding TFormBorderStyle values:

bsNone
An empty set ([])
bsSingle
[biSystemMenu, biMinimize]
bsSizeable
[biSystemMenu, biMinimize, biMaximize]
bsDialog
[biSystemMenu]
bsToolWindow
[biSystemMenu, biMinimize]
bsSizeToolWin
[biSystemMenu, biMinimize, biMaximize]

DefaultBorderIcons is used in the implementation of the SetFormBorderStyle method in TCustomForm.

Creates the widget set

CreateWidgetset is a procedure used to create the WidgetSet singleton. CreateWidgetset executes the nitialization handlers for the LCL interface.

AWidgetsetClass is the TWidgetsetClass class type used to create the WidgetSet singleton. CreateWidgetset is called from the interfaces.pp unit for a specific widget set implementation (win32, gtk, gtk2, gtk3, qt, qt5, et. al.).

TWidgetsetClass class type for the desired widget set implementation Destroys singletons for the Screen, Application, and WidgetSet

FreeWidgetSet is a procedure used to free resources allocated to the Screen, Application, Clipboards, and WidgetSet singletons.

For Screen, allocated cursors and monitors are destroyed. Application is freed, and set to Nil. All clipboard formats are freed as well. The WidgetSet singleton is freed, and set to Nil.

FreeWidgetSet executes the CallInterfaceFinalizationHandlers routine to perform any finalization handlers installed for the LCL interface.

CallInterfaceFinalizationHandlers
Registers components declared in this unit

Register is a procedure used to register components declared in the forms.pp unit for use in the Lazarus IDE. The TFrame component is added to the Standard tab. In addition, the TScrollBox and TApplicationProperties components are added to the Additional tab.