Class TCheckListBox (unit LBCheck)

Inherits from

TCustomListBox

Constructors


constructor Create( AParent : TComponent );

Overriden constructor and destructor

------------------------------------------------------------------------------} { PUBLIC , OVERRIDE } { Constructor for TCheckListBox



Functions

procedure CheckAll( AChecked : Boolean );

Sets the Checked property to AChecked for all items in the list box

------------------------------------------------------------------------------} { PUBLIC } { Checks all items in the list box if AChecked is True, unchecks them otherwise


procedure CheckSelection( AChecked : Boolean );

Sets the Checked property to AChecked for all selected items

------------------------------------------------------------------------------} { PUBLIC } { Sets all selected items to checked if AChecked is True, unchecked otherwise


destructor Destroy;

------------------------------------------------------------------------------} { PUBLIC , OVERRIDE } { Constructor for TCheckListBox

procedure Toggle( Index : Integer );

Toggles the check of the given item

------------------------------------------------------------------------------} { PUBLIC } { Toggles the state of the item at the given index


procedure CheckEvent( Index : Integer );

Protected handlers for OnCheck and OnUncheck events

------------------------------------------------------------------------------} { PROTECTED , VIRTUAL } { Calls user's OnCheck event handler


procedure DrawItem( Index: Integer; ARect: TRect; State: TOwnerDrawState);

Overriden owner draw method

------------------------------------------------------------------------------} { PROTECTED , OVERRIDE } { Clears the rectangle, draws the check box and draws the item text


procedure MouseDown( Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

Overriden mouse down event

------------------------------------------------------------------------------} { PROTECTED , OVERRIDE } { Calls inherited MouseDown ( which calls user's mouse down ) } { If the user has clicked inside a check box , toggle the checkbox and draw } { the focus rectangle.


procedure UnCheckEvent( Index : Integer );

------------------------------------------------------------------------------} { PROTECTED , VIRTUAL } { Calls user's OnUnChecked event handler

procedure Check( Index : Integer ; AChecked : Boolean );

Write fucntion for Checked property , sets Checked[ Index ] := AChecked

------------------------------------------------------------------------------} { PRIVATE } { Sets the item at index to be checked if AChecked is True } { or unchecked if AChecked is False } { If the item was not already in the given state, it redraws the check box } { and generates either an OnCheck or OnUnCheck event


procedure DrawCheckBox( Index : Integer ; State: TOwnerDrawState );

Draws the checkbox for the given item in the appropriate state

------------------------------------------------------------------------------} { PRIVATE } { Draws the check box for the item at Index in the given state


function IsChecked( Index : Integer ) : Boolean;

OnUnCheck event property } { Read function for Checked property

------------------------------------------------------------------------------} { PRIVATE } { Returns True if the item at Index is Checked, otherwise returns False


procedure SetAuthor( Author : string );

------------------------------------------------------------------------------

Properties

property Align :

Original properties

property Author : string

Properties not published } { Style : set to lbOwnerDrawFixed by the constructor } { OnDrawItem : used to draw check boxes } { Properties Added

property BorderStyle :


property Color :


property Columns :


property Ctl3D :


property Cursor :


property DragCursor :


property DragMode :


property Enabled :


property ExtendedSelect :


property Font :


property Height :


property HelpContext :


property Hint :


property IntegralHeight :


property ItemHeight :


property Items :


property Left :


property MultiSelect :


property Name :


property ParentColor :


property ParentCtl3D :


property ParentFont :


property ParentShowHint :


property PopupMenu :


property ShowHint :


property Sorted :


property TabOrder :


property TabStop :


property Tag :


property Top :


property Visible :


property Width :


property Checked : Boolean

Checked property.

Events

event OnCheck : TCheckEvent


event OnClick :


event OnDblClick :


event OnDragDrop :


event OnDragOver :


event OnEndDrag :


event OnEnter :


event OnExit :


event OnKeyDown :


event OnKeyPress :


event OnKeyUp :


event OnMeasureItem :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


event OnUncheck : TCheckEvent


Variables

Bitmap : TBitmap;


FAuthor : string;

The standard Windows checkbox bitmaps

FOnCheck : TCheckEvent;

Me

FOnUnCheck : TCheckEvent;

OnCheck event property


Constructors


constructor Create( AParent : TComponent );

Overriden constructor and destructor

------------------------------------------------------------------------------} { PUBLIC , OVERRIDE } { Constructor for TCheckListBox


Functions


procedure CheckAll( AChecked : Boolean );

Sets the Checked property to AChecked for all items in the list box

------------------------------------------------------------------------------} { PUBLIC } { Checks all items in the list box if AChecked is True, unchecks them otherwise


procedure CheckSelection( AChecked : Boolean );

Sets the Checked property to AChecked for all selected items

------------------------------------------------------------------------------} { PUBLIC } { Sets all selected items to checked if AChecked is True, unchecked otherwise


destructor Destroy;

------------------------------------------------------------------------------} { PUBLIC , OVERRIDE } { Constructor for TCheckListBox


procedure Toggle( Index : Integer );

Toggles the check of the given item

------------------------------------------------------------------------------} { PUBLIC } { Toggles the state of the item at the given index


procedure CheckEvent( Index : Integer );

Protected handlers for OnCheck and OnUncheck events

------------------------------------------------------------------------------} { PROTECTED , VIRTUAL } { Calls user's OnCheck event handler


procedure DrawItem( Index: Integer; ARect: TRect; State: TOwnerDrawState);

Overriden owner draw method

------------------------------------------------------------------------------} { PROTECTED , OVERRIDE } { Clears the rectangle, draws the check box and draws the item text


procedure MouseDown( Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

Overriden mouse down event

------------------------------------------------------------------------------} { PROTECTED , OVERRIDE } { Calls inherited MouseDown ( which calls user's mouse down ) } { If the user has clicked inside a check box , toggle the checkbox and draw } { the focus rectangle.


procedure UnCheckEvent( Index : Integer );

------------------------------------------------------------------------------} { PROTECTED , VIRTUAL } { Calls user's OnUnChecked event handler


procedure Check( Index : Integer ; AChecked : Boolean );

Write fucntion for Checked property , sets Checked[ Index ] := AChecked

------------------------------------------------------------------------------} { PRIVATE } { Sets the item at index to be checked if AChecked is True } { or unchecked if AChecked is False } { If the item was not already in the given state, it redraws the check box } { and generates either an OnCheck or OnUnCheck event


procedure DrawCheckBox( Index : Integer ; State: TOwnerDrawState );

Draws the checkbox for the given item in the appropriate state

------------------------------------------------------------------------------} { PRIVATE } { Draws the check box for the item at Index in the given state


function IsChecked( Index : Integer ) : Boolean;

OnUnCheck event property } { Read function for Checked property

------------------------------------------------------------------------------} { PRIVATE } { Returns True if the item at Index is Checked, otherwise returns False


procedure SetAuthor( Author : string );

------------------------------------------------------------------------------


Properties


property Align :

Original properties


property Author : string

Properties not published } { Style : set to lbOwnerDrawFixed by the constructor } { OnDrawItem : used to draw check boxes } { Properties Added


property BorderStyle :


property Color :


property Columns :


property Ctl3D :


property Cursor :


property DragCursor :


property DragMode :


property Enabled :


property ExtendedSelect :


property Font :


property Height :


property HelpContext :


property Hint :


property IntegralHeight :


property ItemHeight :


property Items :


property Left :


property MultiSelect :


property Name :


property ParentColor :


property ParentCtl3D :


property ParentFont :


property ParentShowHint :


property PopupMenu :


property ShowHint :


property Sorted :


property TabOrder :


property TabStop :


property Tag :


property Top :


property Visible :


property Width :


property Checked : Boolean

Checked property. When True , the item is checked


Events


event OnCheck : TCheckEvent


event OnClick :


event OnDblClick :


event OnDragDrop :


event OnDragOver :


event OnEndDrag :


event OnEnter :


event OnExit :


event OnKeyDown :


event OnKeyPress :


event OnKeyUp :


event OnMeasureItem :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


event OnUncheck : TCheckEvent


Variables


Bitmap : TBitmap;


FAuthor : string;

The standard Windows checkbox bitmaps


FOnCheck : TCheckEvent;

Me


FOnUnCheck : TCheckEvent;

OnCheck event property