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

TCustomTrayIcon

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

TCustomTrayIcon - the base class for TTrayIcon, a multiplatform System Tray component.

Declaration

Source position: extctrls.pp line 1292

type TCustomTrayIcon = class(TLCLComponent)

  class procedure WSRegisterClass; override;

  

WSRegisterClass - Register this Class for the current Widget Set

protected

  procedure Notification(); override;

public

  Handle: HWND;

  

Operating system Handle for the Tray Icon

  constructor Create(); override;

  

Create - constructor for TCustomTrayIcon: performs inherited Create then creates icon, timer and initialises balloon timeout

  destructor Destroy; override;

  

Destroy - destructor for TCustomTrayIcon: frees icon and timer then calls inherited Destroy

  function Hide;

  

Hide - Removes the icon from the System Tray

  function Show;

  

Show - Shows the icon on the System Tray

  procedure InternalUpdate;

  

InternalUpdate - updates any pending changes

  procedure ShowBalloonHint;

  

ShowBalloonHint displays a smal balloon-like window near the tray icon. It can be used to send notifications about the status of an action, or notify of a received message or any other event which doesn't require an imediate response. The Ballon window disappears after BallonHintTimeout milliseconds or when the user clicks it or it's close button.

  function GetPosition;

  

Find the position of the Tray Icon and thus a position suitable to display the hinting BalloonHint. Under Windows an approximate location is detected.

  property Animate: Boolean; [rw]

  property AnimateInterval: Cardinal; [rw]

  property BalloonFlags: TBalloonFlags; [rw]

  

the set of kinds of balloon flag that can be displayed (may be None, Info, Warning or Error)

  property BalloonHint: String; [rw]

  

The text to be shown in the hinting balloon

  property BalloonTimeout: Integer; [rw]

  

The period after which the hinting balloon disappears

  property BalloonTitle: String; [rw]

  

The title to be shown on the hinting balloon

  property Canvas: TCanvas; [r]

  

The canvas of the Tray Icon

  property PopUpMenu: TPopupMenu; [rw]

  

PopUpMenu - a popup menu which is displayed when right mouse button is clicked over icon - separate from hint balloon

  property Icon: TIcon; [rw]

  

The Icon or picture that is to be displayed

  property Icons: TCustomImageList; [rw]

  property Hint: String; [rw]

  

A simple hint that is shown when the mouse hovers over the icon.

  property ShowIcon: Boolean; [rw]

  

Determines if Icon should be painted to the System Tray. This can be set to false if one wishes to instead paint to the Canvas of the Tray Icon.

  property Visible: Boolean; [rw]

  

It is set to true when the icon is shown and remains true until Hide is called. Setting Visible has the same effect as calling Hide or Show.

  property OnClick: TNotifyEvent; [rw]

  

Event Handler for Mouse Click on Tray Icon

  property OnDblClick: TNotifyEvent; [rw]

  

Event handler for mouse double-click

  property OnMouseDown: TMouseEvent; [rw]

  

Event handler if mouse button is pressed down

  property OnMouseUp: TMouseEvent; [rw]

  

Event handler if mouse button is up

  property OnMouseMove: TMouseMoveEvent; [rw]

  

Event handler for mouse movement

  property OnPaint: TNotifyEvent; [rw]

  

Use this to implement custom drawing to the icon. Draw using the canvas property of the icon. Note: Does not work on win32.

end;

Inheritance

TCustomTrayIcon

  

TCustomTrayIcon - the base class for TTrayIcon, a multiplatform System Tray component.

|

TLCLComponent

  

TLCLComponent - base class for LCL components

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent

|

TObject

The latest version of this document can be found at lazarus-ccr.sourceforge.net.