Class TLED (unit GHLED)

Inherits from

TGraphicControl

LEDLabel Caption position

Constructors


constructor Create(AOwner: TComponent);

Public declarations

Free both the LED bitmap matrix, and LED_List



Functions

function ChangeColor: TLEDColor;

Cycle LED Colour through Red.

function ChangeState : Boolean;

Toggle LED Lit state

destructor Destroy;

Default = clRed

procedure Paint;

Protected declarations

Call User Method


procedure PaintLED;

Paint the LED Bitmap

procedure CM_ENABLEDCHANGED(var Msg: TMessage);

The Enabled property has changed

procedure CM_PARENTCOLORCHANGED(var Msg: TMessage);

The Parent Colour has changed

procedure SetColor(const NewColor: TLEDColor);

Set LED Colour

procedure SetState(const NewState: Boolean);

Custom Event

Set LED Lit state


procedure WMWINDOWPOSCHANGED(var Msg: TWMWindowPosChanged);

Previous version used SetBounds - I think this is more elegant

Properties

property Color : TLEDColor

LED is On or Off

property Enabled :


property Height :

LED is Red, Green or Yellow

property Hint :


property Lit : Boolean

Published declarations

property ParentShowHint :


property ShowHint :


property Tag :


property Visible :


property Width :


Events

event OnChangeState : TNotifyEvent


event OnClick :


event OnDblClick :


event OnDragDrop :

User-defined Method

event OnDragOver :


event OnEndDrag :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


Variables

fChange : TNotifyEvent;

LED colour

fColor : TLEDColor;

LED On or Off

fLit : Boolean;

Private declarations


Constructors


constructor Create(AOwner: TComponent);

Public declarations

Free both the LED bitmap matrix, and LED_List


Functions


function ChangeColor: TLEDColor;

Cycle LED Colour through Red...Green...Yellow...Red... etc.


function ChangeState : Boolean;

Toggle LED Lit state


destructor Destroy;

Default = clRed


procedure Paint;

Protected declarations

Call User Method


procedure PaintLED;

Paint the LED Bitmap


procedure CM_ENABLEDCHANGED(var Msg: TMessage);

The Enabled property has changed


procedure CM_PARENTCOLORCHANGED(var Msg: TMessage);

The Parent Colour has changed


procedure SetColor(const NewColor: TLEDColor);

Set LED Colour


procedure SetState(const NewState: Boolean);

Custom Event

Set LED Lit state


procedure WMWINDOWPOSCHANGED(var Msg: TWMWindowPosChanged);

Previous version used SetBounds - I think this is more elegant


Properties


property Color : TLEDColor

LED is On or Off


property Enabled :


property Height :

LED is Red, Green or Yellow


property Hint :


property Lit : Boolean

Published declarations


property ParentShowHint :


property ShowHint :


property Tag :


property Visible :


property Width :


Events


event OnChangeState : TNotifyEvent


event OnClick :


event OnDblClick :


event OnDragDrop :

User-defined Method


event OnDragOver :


event OnEndDrag :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


Variables


fChange : TNotifyEvent;

LED colour


fColor : TLEDColor;

LED On or Off


fLit : Boolean;

Private declarations