Please enable JavaScript to view this site.

CWT User Interface Design Handbook

Navigation: TFT Controls

IntegerInputBox (TFT)

Scroll Prev Top Next More

<TFT:IntegerInputBox Name='Month'

Description

The IntegerInputBox control is used for input of integer values from the software keyboard or step up or down the integer value with step buttons. The IntegerInputBox is mostly used as sub-controls to the DateTimePicker control for the different input fields. The IntegerInputBox can be selected for input (get focus) by clicking inside the control on the display.

 

Properties

Alignment

Type/Value: Possible values are “Near”, “Center” or “Far”

Description:The Alignment property defines where the rendering of text inside the integer input box shall start.

“Near” = Left justified.
“Far” = Right justified
“Center” = Centred.

BackColor

Type/Value: A string with a valid colour name

Description:Defines the background colour of the integer input box. The background of the integer input box will be filled with this colour. See Colour names for a list of available colours.

FocusedColor

Type/Value: A string with a valid colour name

Description:Defines the background colour of the integer input box when it has focus and accepts input.

Font

Type/Value: A Font formatting string.

Description:The Font property defines the font used to render the text in the IntegerInputBox as well as the size of the text and the text style (like normal, bold or italic).
The font name, font size and style are all set in the Font property with the format “FontName, FontSize, style=FontStyle”.
A typical example is “Arial, 24pt, style=Regular”.
See Pre-installed fonts in CWT for a list of available fonts.

NOTE: It is possible to use any custom True Type font by placing a font file in the folder “\Storage Card\Media\Fonts\” and using the font name for that particular font file.

Format

Description:Defines how the value is formatted in the IntegerInputBox control. Normally, set this to “D” followed by the number of digits to be displayed. If the value is 28 and Format is set to”D3” this means that “028” will be displayed in the integer input box.

Height

Type/Value: Unsigned integer. Value range 0–480.

Description:Defines the height of the  integer input box on the display.

Location

Type/Value: String in format “X,Y” where X and Y are both unsigned integers. Value range for X is 0–640 and value range for Y is 0–480.

Description:Specifies where the image shall be placed in relation to the parent control. If IntegerInputBox is defined in a panel, the Location property will specify where inside the panel the integer input box will be positioned. The physical location on the display will then depend on where the panel is placed (each panel also has a Location property) and where the integer input box is placed in the panel.

MaximumLength

Type/Value: Unsigned integer value.

Description:Maximum number of characters allowed by the IntegerInputBox control when entered at the software keyboard.

MaxValue

Description:Defines the maximum integer value allowed in the IntegerInputBox control.

MinimumLength

Type/Value: Unsigned integer value.

Description:Minimum number of characters required by the IntegerInputBox control when entered at the software keyboard.

MinValue

Type/Value: Integer value

Description:Defines the minimum integer value allowed in the IntegerInputBox control.

Name

Type/Value: A string of any length

Description:The name of the IntegerInputBox control. It is important that the name is unique within a panel.

TabIndex

Description:Defines the order of focus between multiple IntegerInputBox controls in a DateTimePicker control (see DateTimePicker (TFT) ).
This control decides which IntegerInputBox that gets into focus when the button-click action OnSetNextInputControl is executed.
An IntegerInputBox with TabIndex 1 will get into focus before an IntegerInputBox with TabIndex 2, and so on.

Width

Type/Value: Unsigned integer. Value range 0–640.

Description:Defines the width of the integer input box on the display.

WrapAroundValue

Type/Value: Boolean (“true” / “false”)default true

Description:If true the value entered will wrap around when MaxValue is exceeded. If false it will not accept trying to step over the MaxVaule

 

Examples

This example defines an IntegerInputBox control with the name “Month” that always displays 2 digits because the Format property is “D2” and has a value between 1 and 12. The text inside the integer input box is centred by the Alignment property:

<TFT:IntegerInputBox Name='Month' BackColor='White' FocusedColor='Gray'
  Location ='90,35' Width='80' Height='50' MinimumLength='2'
  MaximumLength='2' MinValue='1' MaxValue='12' Format='D2'
  Alignment='Center' Font='Tahoma, 18pt, style=Bold' TabIndex='2'/>