Unit 'StdCtrls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#lcl]

TToggleBox

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

A labelled box capable of being checked or unchecked.

Declaration

Source position: stdctrls.pp line 1432

type TToggleBox = class(TCustomCheckBox)

protected

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  class function GetControlClassDefaultSize; override;

  

Returns the default size for this class of controls (when added to a form).

  procedure CreateParams(); override;

  

Initializes the window creation parameter record with the settings for the control.

  property ParentColor: Boolean;

  

Use the Color from the Parent control, when enabled.

public

  constructor Create(); override;

  

Constructor for the class instance.

published

  property AllowGrayed: Boolean;

  

Allows the check box to use a "grayed" state.

  property Align: TAlign;

  

Specifies the placement of the control on its Parent control.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AutoSize: Boolean;

  

Allows automatic adjustment of the size for the control, according to its content.

  property BidiMode: TBiDiMode;

  

Customization (of text controls) in bidirectional reading environments.

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property Caption: TCaption;

  

The text displayed for the control.

  property Checked: Boolean;

  

Indicates the checked state for the control.

  property Color: TGraphicsColor;

  

The background color of the control.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DoubleBuffered: Boolean;

  

Allows to reduce flicker in the painting of the control.

  property DragCursor: TCursor;

  

The cursor shape shown while the control is dragged.

  property DragKind: TDragKind;

  

The operation when the control is dragged - Drag or Dock.

  property DragMode: TDragMode;

  

Allows the user to drag the control.

  property Enabled: Boolean;

  

Determines whether the control reacts on mouse or keyboard input.

  property Font: TFont;

  

The font to be used for text display in this control.

  property Hint: string;

  

The text to show in the Hint window for the control.

  property OnChange: TNotifyEvent;

  

Event handler for changes to properties in the control.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDragDrop: TDragDropEvent;

  

This handler determines the action on an drop onto this control, in a drag-drop operation.

  property OnDragOver: TDragOverEvent;

  

Event handler for a control being dragged over this control.

  property OnEndDrag: TEndDragEvent;

  

Notification handler for the end of a drag operation.

  property OnEnter: TNotifyEvent;

  

Handler for control receiving the focus.

  property OnExit: TNotifyEvent;

  

Handler for control loosing the focus; This is a good place for checking the finished user input.

  property OnMouseDown: TMouseEvent;

  

Event handler signalled when a mouse down event is handled for the control.

  property OnMouseEnter: TNotifyEvent;

  

Event handler signalled when the mouse pointer has entered the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler signalled when the mouse pointer has left the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler for mouse movement within the control.

  property OnMouseUp: TMouseEvent;

  

Event handler signalled when a mouse up event is handled for the control.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler for downward movement of mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler for upward movement of the mouse wheel.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnStartDrag: TStartDragEvent;

  

Event handler for the start of a dragging operation.

  property ParentBidiMode: Boolean;

  

Indicates whether the BiDiMode settings in the Parent control are used.

  property ParentDoubleBuffered: Boolean;

  

Value for the DoubleBuffered property in a Parent control.

  property ParentFont: Boolean;

  

If True, the Font of the control will be the same as the one from the Parent. Default is True.

  property ParentShowHint: Boolean;

  

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property State: TCheckBoxState;

  

The check, unchecked, or grayed state for the control.

  property TabOrder: TTabOrder;

  

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

  property TabStop: Boolean;

  

Enables navigation using the Tab key.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

end;

Inheritance

TToggleBox

  

A labelled box capable of being checked or unchecked.

|

TCustomCheckBox

  

The base class for a check box component.

|

TButtonControl

  

Specifies a base class for button controls.

|

TWinControl

  

Implements a windowed control which can contain other child controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

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

|

TObject

Description

TToggleBox is TCustomCheckBox descendant which implements a labelled control with state values like a check box control. TToggleBox differs from TCheckBox in that it displays only the Caption text for the control; the graphical check mark representation is not used. TToggleBox is similar in appearance to a push button control. The control state determines whether the button is drawn using its up or down position.

The programmer must ensure that the OnClick event handler recognizes the State of the control, takes the appropriate Action, and stores the State into the appropriate storage.

See also

HowToUseStdCtrls

  

How to use StdCtrls, ComCtrls or ExtCtrls.

TCustomCheckBox

  

The base class for a check box component.

TCheckBox

  

A label with a box which can contain a check mark.

TButton

  

Implements a push button control.