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

TCustomUpDown

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

TCustomUpDown - base class for TUpDown - a pair of arrow-like buttons which are used to increment or decrement some controlled variable; often attached to a scroll-bar but can also control a digital numeric display

Declaration

Source position: comctrls.pp line 1845

type TCustomUpDown = class(TCustomControl) end;

protected

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  procedure AssociateKeyDown();

  

AssociateKeyDown - protected procedure for dealing with action to be taken if an associate key (Shift, Ctrl or Alt) is pressed while the control is active

  procedure AssociateMouseWheel();

  procedure OnAssociateChangeBounds();

  

OnAssociateChangeBounds - event handler for a change in bounds of the associate control

  procedure OnAssociateChangeEnabled();

  procedure OnAssociateChangeVisible();

  procedure DoSetBounds(); override;

  procedure SetEnabled(); override;

  class function GetControlClassDefaultSize; override;

  

GetControlClassDefaultSize returns its own defaults, overriding inherited values

  procedure CalculatePreferredSize(); override;

  function CanChange; virtual;

  

CanChange - if True, control can be changed

  procedure Notification(); override;

  

Notification calls inherited method; if the operation requires removal of the associate control, this is performed

  procedure Click(); virtual; overload;

  

Click - calls OnClick event handler if it is assigned

  property AlignButton: TUDAlignButton; [rw]

  

AlignButton - how to align the button: left or right

  property ArrowKeys: Boolean; [rw]

  

ArrowKeys - if True, the control can be operated by the keyboard's arrow keys which would simulate a click on the Next or Previous button

  property Associate: TWinControl; [rw]

  

Associate - the associated control whose properties (controlled variable) are to be changed by the UpDown control

  property Increment: Integer; [rw]

  

The amount by which the controlled variable is to be increased or decreased on each click

  property Max: SmallInt; [rw]

  

Max - greatest value of controlled variable

  property Min: SmallInt; [rw]

  

Min - least value of controlled variable

  property MinRepeatInterval: Byte; [rw]

  property OnChanging: TUDChangingEvent; [rw]

  

OnChanging - event handler for a change in the value of the controlled variable

  property OnChangingEx: TUDChangingEventEx; [rw]

  property OnClick: TUDClickEvent; [rw]

  

OnClick - special event handler for a click on up or down button

  property Orientation: TUDOrientation; [rw]

  

Whether horizontal or vertical

  property Position: SmallInt; [rw]

  

The Position of the UpDown control

  property Thousands: Boolean; [rw]

  

If True, multiply all displayed values and the Increment by 1000

  property Flat: Boolean; [rw]

  property Wrap: Boolean; [rw]

  

If True, displayed control or value starts again from minimum or maximum value if clicking a button would cause incrementing or decrmenting beyond the extreme value

public

  constructor Create(); override;

  

Create - constructor for TCustomUpDown: calls inherited Create, initialises orientation, max and min, bounds, size and alignment

  destructor Destroy; override;

  

Destroy - destructor for TCustomUpDown: removes connection with associate control and calls inherited Destroy

Inheritance

TCustomUpDown

  

TCustomUpDown - base class for TUpDown - a pair of arrow-like buttons which are used to increment or decrement some controlled variable; often attached to a scroll-bar but can also control a digital numeric display

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

The base class for controls which can contain other (child) controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components associated with widgets.

|

TComponent

?

TObject

Description

TCustomUpDown - base class for TUpDown - a pair of arrow-like buttons which are used to increment or decrement some controlled variable; often attached to a scroll-bar but can also control a digital numeric display

The control definition itself does not specify the variable upon which the buttons operate. The application programmer is responsible for supplying an event handler for OnClick to determine which button has been selected (designated btNext or btPrev) and incrementing or decrementing the variable in the control with which the UpDown is associated.

The amount by which the variable is changed is set by the integer property Increment with the optional multiplier Thousands (a boolean property).

For example the UpDown control may be used to move a slider up and down a scale by a specified amount for each click; alternatively a number may be displayed in a text box and clicking the buttons of the UpDown control may increment or decrement the number displayed by a specified amount.

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