[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Forms' (#lcl)

TScreen

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Provides information about screen displays in an application.

Declaration

Source position: forms.pp line 1130

type TScreen = class(TLCLComponent)

protected

  function GetHintFont; virtual;

  

Gets the value for the HintFont property.

  function GetIconFont; virtual;

  

Gets the value for the IconFont property.

  function GetMenuFont; virtual;

  

Gets the value for the MenuFont property.

  function GetSystemFont; virtual;

  

Gets the value for the SystemFont property.

  property MagnetManager: TWindowMagnetManager; [r]

  

Manages screen / form snapping behavior for the screen.

public

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  function CustomFormIndex();

  

Gets the ordinal position in CustomForms for the requested form.

  function FormIndex();

  

Gets the ordinal position in Forms for the requested form.

  function CustomFormZIndex();

  

Gets the position in CustomFormsZOrdered for the specified form.

  procedure MoveFormToFocusFront();

  

Moves the specified form to the front of all other forms.

  procedure MoveFormToZFront();

  

Moves the form to the front of the Z-order in the CustomFormsZOrdered property.

  procedure NewFormWasCreated();

  

Notifies handler(s) when a new form is created for the TScreen instance.

  function GetCurrentModalForm;

  

Returns the Modal form at the top of the Z-order for the screen.

  function GetCurrentModalFormZIndex;

  

Returns the index of the top-most modal form in CustomFormsZOrdered.

  function CustomFormBelongsToActiveGroup();

  

Checks whether the specified form is present in the Z-ordered list of forms.

  function FindNonDesignerForm();

  

Finds the form with the specified name, excluding designer forms.

  function FindForm();

  

Finds a form on the screen by its name.

  function FindNonDesignerDataModule();

  

Finds a data module with the specified name, excluding designer data modules.

  function FindDataModule();

  

Finds the data module with the specified name.

  procedure UpdateMonitors;

  

Rebuilds the list of available monitors.

  procedure UpdateScreen;

  

Updates the value for the PixelsPerInch property.

  procedure RemoveAllHandlersOfObject(); override;

  

Removes all handler routines for the specified object regardless of notification type.

  procedure AddHandlerNewFormCreated();

  

Adds the specified handler routine to the new form handlers for the screen instance.

  procedure RemoveHandlerNewFormCreated();

  

Removes the specified handler routine from the new form handlers for the screen instance.

  procedure AddHandlerFormAdded();

  

Adds a form added notification handler to the class instance.

  procedure RemoveHandlerFormAdded();

  

Removes a form added notification handler.

  procedure AddHandlerRemoveForm();

  

Adds a form removed notification handler.

  procedure RemoveHandlerRemoveForm();

  

Removes a from removed notification handler.

  procedure AddHandlerActiveControlChanged();

  

Adds a control changed notification handler.

  procedure RemoveHandlerActiveControlChanged();

  

Removes a control changed notification handler.

  procedure AddHandlerActiveFormChanged();

  

Adds a form changed notification handler.

  procedure RemoveHandlerActiveFormChanged();

  

Removes a form changed notification handler.

  procedure AddHandlerFormVisibleChanged();

  

Adds a visible changed notification handler.

  procedure RemoveHandlerFormVisibleChanged();

  

Removes a visible changed notification handler.

  function DisableForms();

  

Disables all forms except for SkipForm.

  procedure EnableForms();

  

Re-enables forms disabled in the DisableForms method.

  function MonitorFromPoint();

  

Finds the monitor containing the given screen coordinates.

  function MonitorFromRect();

  

Finds the monitor where the specified rectangle is located.

  function MonitorFromWindow();

  

Finds the monitor containing the form with the given window handle.

  procedure BeginTempCursor();

  

Sets the Cursor property to a temporary shape. Use EndTempCursor to release it.

  procedure EndTempCursor();

  

Releases a temporary mouse cursor set with BeginTempCursor.

  procedure BeginWaitCursor;

  

Sets the cursor to the shape in crHourGlass.

  procedure EndWaitCursor;

  

Removes the crHourGlass mouse cursor shape.

  procedure BeginScreenCursor;

  

Changes the active cursor to the most recent shape in the internal list of cursors.

  procedure EndScreenCursor;

  

Removes the current mouse cursor shape from the internal list, and restores the previous cursor shape.

  property ActiveControl: TWinControl; [r]

  

The control which has the focus on the active form for the screen.

  property ActiveCustomForm: TCustomForm; [r]

  

The TCustomForm instance which has the focus.

  property ActiveForm: TForm; [r]

  

The TForm instance which has the focus.

  property Cursor: TCursor; [rw]

  

Indicates the current mouse cursor shape.

  property RealCursor: TCursor; [r]

  

Gets the value for the Cursor property taking temporary cursors into account.

  property Cursors []: HCURSOR; [rw]

  

Provides indexed access to the available mouse cursor shapes for the screen.

  property CustomFormCount: Integer; [r]

  

Number of TCustomForm form instances in the CustomForms property.

  property CustomForms []: TCustomForm; [r]

  

Provides indexed access to the TCustomForm instances on the screen.

  property CustomFormZOrderCount: Integer; [r]

  

Number of custom forms instances in the CustomFormsZOrdered property.

  property CustomFormsZOrdered []: TCustomForm; [r]

  

The list of Custom Forms, indexed by Z-order (zero is top-most).

  property DesktopLeft: Integer; [r]

  

The left-most coordinate of the desktop.

  property DesktopTop: Integer; [r]

  

The top-most coordinate for the desktop.

  property DesktopHeight: Integer; [r]

  

The total vertical size for the desktop.

  property DesktopWidth: Integer; [r]

  

The total horizontal size for the desktop.

  property DesktopRect: TRect; [r]

  

Bounds rectangle for the desktop spanning all monitors.

  property FocusedForm: TCustomForm; [r]

  

The form that has Focus on the screen.

  property FormCount: Integer; [r]

  

The number of Forms on the screen.

  property Forms []: TForm; [r]

  

Provides indexed access to TForm instances on the screen.

  property DataModuleCount: Integer; [r]

  

The number of data modules for the screen.

  property DataModules []: TDataModule; [r]

  

Provides indexed access to data modules on the screen.

  property HintFont: TFont; [rw]

  

The font used to display Hints.

  property IconFont: TFont; [rw]

  

The font used for desktop icons.

  property MenuFont: TFont; [rw]

  

The font used in menus.

  property SystemFont: TFont; [rw]

  

The default font used for system task dialogs and controls like TSpeedButton.

  property Fonts: TStrings; [r]

  

The names for the available (installed) fonts.

  property Height: Integer; [r]

  

The height of the primary monitor.

  property MonitorCount: Integer; [r]

  

The number of available Monitors.

  property Monitors []: TMonitor; [r]

  

Provides indexed access to the available monitors in the class instance.

  property PixelsPerInch: Integer; [r]

  

The number of screen pixels per virtual inch (DPI) for the screen.

  property PrimaryMonitor: TMonitor; [r]

  

The primary monitor which typically includes the task bar area.

  property Width: Integer; [r]

  

The width of the primary monitor.

  property WorkAreaRect: TRect; [r]

  

The usable display area on the primary monitor excluding the task bar.

  property WorkAreaHeight: Integer; [r]

  

The usable height of the primary monitor excluding the system task bar.

  property WorkAreaLeft: Integer; [r]

  

The usable left coordinate on the primary monitor.

  property WorkAreaTop: Integer; [r]

  

The usable top coordinate on the primary monitor.

  property WorkAreaWidth: Integer; [r]

  

The usable width for the WorkAreaRect.

  property OnActiveControlChange: TNotifyEvent; [rw]

  

Event handler signalled when the active form control for the screen has been changed.

  property OnActiveFormChange: TNotifyEvent; [rw]

  

Event handler signalled when the active form on the screen has been changed.

end;

Inheritance

TScreen

  

Provides information about screen displays in an application.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TScreen is a TLCLComponent descendant which provides information about multiple monitors in an LCL application. TScreen allows the GUI for an application to be managed on multiple monitors. It includes the size and resolution for a screen, and allows mapping the virtual Desktop and Workareas to the physical Monitors known to the application.

TScreen also provides access to objects displayed on a given screen, including: Forms, Cursors, and Fonts. For Delphi compatibility, non-visual DataModules are also included in the TScreen information. Properties are provided in the class with the currently active Form, Control and Cursor for a screen.

TScreen is the type used for the Screen singleton in an LCL application.

See also

TScreen.Cursors

  

Provides indexed access to the available mouse cursor shapes for the screen.

TScreen.DataModules

  

Provides indexed access to data modules on the screen.

TScreen.Fonts

  

The names for the available (installed) fonts.

TScreen.Forms

  

Provides indexed access to TForm instances on the screen.

TScreen.CustomForms

  

Provides indexed access to the TCustomForm instances on the screen.

TScreen.Monitors

  

Provides indexed access to the available monitors in the class instance.

TScreen.WorkareaRect

  

The usable display area on the primary monitor excluding the task bar.

TScreen.DesktopRect

  

Bounds rectangle for the desktop spanning all monitors.


Version 3.2 Generated 2024-02-25 Home