Implements an edit control specialized for Integer values which can be displayed with a specific numeric base (radix).
Specifies an event handler signalled when the numeric base (radix) for an Integer edit control is changed.

TLazIntegerEditBaseChangeEvent is the type used for the OnBaseChange property in TLazIntegerEditGen and TLazIntegerEdit. It allows actions to be performed when the numeric base (radix) for an integer edit control is changed.

Control for the event notification.
Current numeric base for the notification.
New numeric base for the notification.
Optional prefix for the new numeric base.
Generic type. makeskel generated it... so it is included here. It doesn't appear to be used at all.
Defines the base class for an Integer edit control using a specified numeric base.

TLazIntegerEditGen is the generic base class for an edit control which can display and edit a 64-bit integer value using a specified numeric base or radix. TLazIntegerEditGen is the ancestor for the TLazIntegerEdit type which specializes the ancestor for the TCustomEdit type.

TLazIntegerEditGen introduces properties which determine the appearance and editing behavior for the control, including: Value, MinValue, MaxValue, and DisplayBase.

Value contains the decimal (base-10) value for the control as an Int64 type. MinValue and MaxValue control the lower and upper limits for the value in the control. DisplayBase determines the numeric base (base-2, base-8, base-16, etc.) used to display and edit the text for for the control.

Changing the value in DisplayBase causes the Value to be converted to the specified numeric base and the control is updated. A prefix is displayed for some numeric base values like base-2 (binary), base-8 (octal) and base-16 (hexadecimal). Other numeric base values do not use a prefix.

The edit control supports changing the numeric base using DisplayBase, or using key presses which force the radix to be changed. See ToggleBinKeys, ToggleOctKeys, ToggleHexKeys for more information.

Use the OnBasechange event handler to perform actions needed when DisplayBase is changed for the control.

TCustomEdit
Lower limit for the Int64 value in the control.
Upper limit for the Int64 value in the control.
Implements an alternate KeyDown method for the generic base class.

_KeyDown is an implementation of the KeyDown method specific to the generic base class. It allows an alternate implementation without use of the override directive - which is not allowed in the generic class.

Key contains the virtual key code examined in the method. Shift contains the Alt, Ctrl, Shift, or Meta modifiers for the virtual key code.

_KeyDown calls the KeyDown method in the ancestor class on entry to signal an assigned OnKeyDown event handler, or any control handlers using the chtOnKeyDown handler type.

_KeyDown ensures that the following key codes are applied to the Text for the edit control:

- VK_BACK
- VK_DELETE

For both key codes, a visible sign (+ or -) or prefix for the DisplayBase in use on the the control is preserved.

_KeyDown is called from the overridden KeyDown method in the TLazIntegerEdit descendant.

TWinControl.KeyDown TWinControl.OnKeyDown TControl.DoCallKeyEventHandler TControlHandlerType
Virtual key code for the key down notification.
Shift, Ctrl, Alt, or Meta modifier(s) for the key code.
Implements an alternate KeyPress method used in the control.

_KeyPress is an implementation of the KeyPress method specific to the generic base class. It allows an alternate implementation without use of the override directive - which is not allowed in the generic class.

Key contains the character examined in the method.

_KeyPress calls the KeyPress method in the ancestor class on entry to signal an assigned OnKeyPress event handler.

_KeyDown ensures that the value in Key is not one of the allowed control characters used in the control, including:

- #8 (Backspace)
- #9 (Tab)
- ^A (Line Feed)
- ^C (Carriage Return)
- ^Z (Undo)

No actions are performed in the method if Key contains one of these values.

_KeyPress ensures that other characters or control characters in Key are properly applied to the Text in the control, including:

'-'
  Toggles the sign when AllowMinus is enabled, and re-selects the Text displayed for the control.
'+'
  Toggles the sign when AllowPlus is enabled, and re-selects the Text displayed for the control.
^X (Cut)
  Copies the selected text on the control to the clipboard and removes the selected text from the display value for the control.
^V (Insert)
  Copies the contents of the clipboard, converts it to the DIsplayBase in use, and inserts the value into the Text for the control. If text is selected on the control, only the selected text is replaced.
ToggleBinKeys
  If Key contains one of he values in ToggleBinKeys, DisplayBase is toggled between 2 (Binary) and 10 (Decimal).
ToggleOctKeys
  If Key contains one of he values in ToggleOctKeys, DisplayBase is toggled between 8 (Octal) and 10 (Decimal).
ToggleHexKeys
  If Key contains one of he values in ToggleHexKeys, DisplayBase is toggled between 16 (Hexadecimal) and 10 (Decimal).
SetDecimalKeys
  If Key contains one of he values in SetDecimalKeys, DisplayBase is switched to 10 (Decimal).
SetBinKeys
  If Key contains one of he values in SetBinKeys, DisplayBase is switched to 2 ( Binary).
SetOctKeys
  If Key contains one of he values in SetOctKeys, DisplayBase is switched to 8 ( Octal).
SetHexKeys
  If Key contains one of he values in SetHexKeys, DisplayBase is switched to 16 ( Hexadecimal).

Key is set to #0 if it is handled in the method.

_KeyPress is called from the overridden KeyPress method in the TLazIntegerEdit descendant.

TWinControl.KeyPress TWinControl.OnKeyPress
Character value for the key press notification. Set to #0 when handled in the method.
Implements an alternate UTF8KeyPress method used in the control.

_Utf8KeyPress is an implementation of the Utf8KeyPress method specific to the generic base class. It allows an alternate implementation without use of the override directive - which is not allowed in the generic class.

_Utf8KeyPress calls the Utf8KeyPress method from the ancestor class on entry to signal an assigned OnUtf8KeyPress event handler for the class instance. The handler inspects the value in UTF8Key to determine whether it can be applied to the control. Any bytes values in UTF8Key not handled in the ancestor method are discarded. Essentially, this limits the input value for the control to the single byte characters in the UTF-8 encoding.

_Utf8KeyPress is called from the UTF8KeyPress method in the TLazIntegerEdit descendant.

TCustomEdit.OnUTF8KeyPress TCustomEdit.OnUTF8KeyPress
UTF-8-encoded character value for the key press notification.
Implements an alternate InitializeWnd method used in the control.
Implements an alternate RealGetText method used to get the text for the control.
Caption text displayed in the edit box for the control.
Implements an alternate FinalizeWnd method used in the control.
Implements an alternate DoExit method used in the control.
Implements an alternate EditingDone method used in the control.
Implements an initialization routine used for new instances of the control.

_Init acts as a constructor for instances of the generic base class. It is called from the constructor in TLazIntegerEdit to ensure that default values are assigned to members, including:

- MinValue (Low(Int64))
- MaxValue (High(Int64))
- DisplayBase (10)
- BinIndicator ('%')
- HexIndicator ('$')
- OctIndicator ('&')
- SetDecimalKeys ('#')
- ToggleBinKeys ('%')
- ToggleHexKeys ('$x')
- ToggleOctKeys ('&)
- AllowMinus (True)
- AllowPlus (True)

Value for the control as an Int64 type.

Value is an Int64 property which contains the decimal (base-10) value for the control. Changing the property value causes the display Text in the control to be updated and displayed. DisplayBase determines the numeric base (radix) for the converted control Value. An optional prefix is used for numeric base values in DisplayBase like base-2 (binary), base-8 (octal), and base-16 (hexadecimal).

Use MinValue and MaxValue to set lower and upper limits for the control Value. Changing the Value property causes the new value to be normalized for the limits in MinValue and MaxValue; if the new value is not in the specified range, it is changed to the corresponding lower or upper limit.

Value for the control before EditingDone is called or the control loses focus.

CurrentValue is a read-only Int64 property which contains the control value while editing is active and before the control loses focus. The property value is derived by reading the Text in the edit box and converting it from the selected DisplayBase back to a decimal (base-10) value. If a handle has not been allocated for the control, the Value property is used instead.

Use Valid to determine if the edit box contains a valid value for the specified DisplayBase.

Indicates whether the value in the CurrentValue property is valid for the setting in DisplayBase.

Valid is a read-only Boolean property which indicates whether the text displayed on the control is a valid numeric value for the setting in DisplayBase. Valid converts the edit text to an Int64 value, and checks whether the value is within the limits specified in MinValue and MaxValue. This includes comparing the prefix in the edit text (if any) to the prefix needed for the DisplayBase setting.

Sets the lower limit for the Value property.

MinValue is an Int64 property which specifies the smallest Base-10 (decimal) value allowed for the control. Changing the value in MinValue causes any existing text on the edit control to be converted back to decimal (if needed) and normalized to the limits specified in MinValue and MinValue.

The default value for the property is set in the _Init method to the value in the Min_Limit constant.

Use MaxValue to specify the largest Base-10 Value allowed for the control.

MinValue and MaxValue are used when the Value property is updated, and ensure that the limits for the control are applied to Value before the display text is converted / displayed for the specified DisplayBase.

Sets the upper limit for the Value property.

MaxValue is an Int64 property which specifies the largest Base-10 (decimal) value allowed for the control. Changing the value in MaxValue causes any existing text on the edit control to be converted back to decimal (if needed) and normalized to the limits specified in MinValue and MinValue.

The default value for the property is set in the _Init method to the value in the Max_Limit constant.

Use MinValue to specify the smallest Base-10 Value allowed for the control.

MinValue and MaxValue are used when the Value property is updated, and ensure that the limits for the control are applied to Value before the display text is converted / displayed for the specified DisplayBase.

Contains the numeric base (radix) for the value displayed in the control.

DisplayBase is an Integer property which contains the numeric base (or radix) for the value displayed and maintained in the edit control.

DisplayBase determines the number of digits needed to represent the base-n text displayed on the control, and controls the conversion performed to get the display value. The default value for the property is 10 and indicates that the control displays its Value using base-10 or decimal notation.

DisplayBase must be in the range 2..35; a value outside this range is normalized to the lower or upper limit.

Changing the value for the property causes the OnBaseChange event handler to be signalled (when assigned) using the old and new values for the property and the optional prefix for the new numeric base (radix).

The Text for control is updated by converting Value to the specified radix and applying the prefix for the DisplayBase. See BinIndicator, OctIndicator, and HexIndicator for more information about common prefixes used for selected DisplayBase values.

Contains the characters which cause the edit control to be displayed using the decimal (base-10) radix.

SetDecimalKeys is a String property which contains the character(s) used to switch the edit controls to the decimal (base-10) radix when a key press is handled for the control. SetDecimals is used in the _KeyPress handler, and causes the DisplayBase property to be set to 10.

The default value for the property is '#' as assigned in the _Init method.

Please note that SetDecimalKeys is not like the toggles in the ToggleBinKeys, ToggleOctKeys, and ToggleHexKeys properties. It does not toggle between base-10 and another radix value. It selects base-10 only.
Contains the prefix displayed in the control when the value is displayed in hexadecimal representation (DisplayBase = 16).

HexIndicator contains the prefix displayed in the edit control when DisplayBase is set to 16 for hexadecimal format. The default value for the property is '$' as assigned in the _Init method. Changing the value for the property causes the text displayed on the control to be converted and re-encoded when DisplayBase is 16.

Use BinIndicator or OctIndicator for the prefix used for base-2 and base-8 respectively.

Contains the character(s) which cause the edit control to be displayed using the hexadecimal (base-16) radix.

A default value is not assigned for the property. The ToggleHexKeys property is used to toggle between Hexadecimal (base-16) and Decimal (base-10). When a value is assigned to ToggleHexKeys, those keys take precedence over the keys in SetHexKey. The value in SetHexKeys is used, when applicable, in the _KeyPress handler for the control.

Contains key(s) which cause the DisplayBase to be toggled between decimal (base-10) and hexadecimal (base-16) display formats.

ToggleHexKeys is a String property which contains one or more characters which cause the DisplayBase for the control to be toggled between decimal (base-10) and hexadecimal (base-16). The default value for the property is '$x' as assigned in the _Init method. If either of the keys is entered when the control has focus, the DisplayBase property is updated accordingly and the display Text for the control is updated to to reflect the numeric representation using the radix.

Values in ToggleHexKeys are used in the _KeyPress method when a key value is applied to the edit control.

Use ToggleBinKeys or ToggleOctKeys to specify the key characters which cause the control to toggle between Binary or Octal, and Decimal representations for the control Value.

Use SetDecimalKeys, SetBinKeys, SetOctKeys, or SetHexKeys to switch to a specific base-n representation rather than toggle between a base-n representation and decimal (base-10).

Contains the prefix displayed in the control when the value is displayed in octal representation (DisplayBase = 8).

OctIndicator contains the prefix displayed in the edit control when DisplayBase is set to 8 for octal format. The default value for the property is '&' as assigned in the _Init method. Changing the value for the property causes the text displayed on the control to be converted and re-encoded when DisplayBase is 8.

Use BinIndicator or HexIndicator for the prefix used for base-2 and base-16 respectively.

Contains the character(s) which cause the edit control to be displayed using the octal (base-8) radix.

A default value is not assigned for the property. The ToggleOctKeys property is used to toggle between Hexadecimal (base-16) and Decimal (base-10). When a value is assigned to ToggleHexKeys, those keys take precedence over the keys in SetOctKeys. The value in SetOctKeys is used, when applicable, in the _KeyPress handler for the control.

Contains key(s) which cause the DisplayBase to be toggled between decimal (10) and octal (8) display formats.

ToggleOctKeys is a String property which contains one or more characters which cause the DisplayBase for the control to be toggled between decimal (base-10) and octal (base-8). The default value for the property is '&' as assigned in the _Init method. If the key is entered when the control has focus, the DisplayBase property is updated accordingly and the display Text for the control is updated to to reflect the numeric representation using the radix.

Values in ToggleOctKeys are used in the _KeyPress method when a key value is applied to the edit control.

Use ToggleBinKeys or ToggleHexKeys to specify the key characters which cause the control to toggle between Binary or Hexadecimal, and Decimal representations for the control Value.

Use SetDecimalKeys, SetBinKeys, SetOctKeys, or SetHexKeys to switch to a specific base-n representation rather than toggle between a base-n representation and decimal (base-10).

Contains the prefix displayed in the control when the value is displayed in binary representation (DisplayBase = 2).

BinIndicator contains the prefix displayed in the edit control when DisplayBase is set to 2 for octal format. The default value for the property is '%' as assigned in the _Init method. Changing the value for the property causes the text displayed on the control to be converted and re-encoded when DisplayBase is 2.

Use OctIndicator or HexIndicator for the prefix used for base-8 and base-16 respectively.

Contains the character(s) which cause the edit control to be displayed using the binary (base-2) radix.

A default value is not assigned for the property. The ToggleBinKeys property is used to toggle between Binary (base-2) and Decimal (base-10). When a value is assigned to ToggleBinKeys, those keys take precedence over the keys in SetBinKeys. The value in SetBinKeys is used, when applicable, in the _KeyPress handler for the control.

Contains key(s) which cause the DisplayBase to be toggled between decimal (10) and binary (2) display formats.

ToggleBinKeys is a String property which contains one or more characters which cause the DisplayBase for the control to be toggled between decimal (base-10) and binary (base-2). The default value for the property is '%' as assigned in the _Init method. If the key is entered when the control has focus, the DisplayBase property is updated accordingly and the display Text for the control is updated to to reflect the numeric representation using the radix.

Values in ToggleBinKeys are used in the _KeyPress method when a key value is applied to the edit control.

Use ToggleOctKeys or ToggleHexKeys to specify the key characters which cause the control to toggle between Octal or Hexadecimal, and Decimal representations for the control Value.

Use SetDecimalKeys, SetBinKeys, SetOctKeys, or SetHexKeys to switch to a specific base-n representation rather than toggle between a base-n representation and decimal (base-10).

Event handler signalled when the value in DisplayBase is changed.

OnBaseChange allows the control to perform actions needed when the value for the DisplayBase property is changed. It is signalled (when assigned) after the value in DisplayBase has been updated but before the Text in control is converted and displayed using the new radix. It allows the application to override the new numeric base or radix and prefix in the event handler.

See TLazIntegerEditBaseChangeEvent for more information about the handler type and its arguments.

OnBaseChange is a public property in TLazIntegerEditGen, but it is published in the TLazIntegerEdit descendant.

Indicates whether the '-' key can be used to negate the control Value.

AllowMinus is a Boolean property which enables or disables use of the '-' key to change the sign for the value in the control. When enabled, the CurrentValue for the control is negated when the '-' key is pressed. A second press of the key causes the CurrentValue to become positive. The default value for the AllowMinus property is True. AllowMinus does enable direct entry of the sign; it reverses its state.

When editing is completed in the control, or it loses focus, the CurrentValue for the control is validated using the MinValue and MaxValue properties. If MinValue is not set to a value less than 0 (zero), a negative Value cannot be stored for the control and it defaults to MinValue.

AllowMinus and AllowPlus are used when key press events are applied in the _KeyPress handler.

Use AllowPlus to enable or disable use of the '+' key to force the control Value to become positive.

Indicates whether the '+' key can be used to switch a negative control value to a positive one.

AllowPlus is a Boolean property which enables or disables use of the '+' key to change the sign for the Value in the control to a positive one. When enabled, the CurrentValue for the control is negated when the '+' key is pressed. and the control value is negative. No actions are performed if the CurrentValue is already positive. AllowPlus does enable direct entry of the sign; it simply forces a positive sign for the value.

When editing is completed in the control, or it loses focus, the CurrentValue for the control is validated using the MinValue and MaxValue properties.

AllowMinus and AllowPlus are used when key press events are applied in the _KeyPress handler.

Use AllowMinus to enable or disable use of the '-' key to toggle the sign for the control Value.

Implements an edit control for Integer values displayed and maintained using a specified numeric base or radix.

TLazIntegerEdit is a TLazIntegerEdit descendant which specializes the generic base class for the TCustomEdit type. It implements an edit control which can display and edit a 64-bit integer value using a specified numeric base or radix.

TLazIntegerEdit introduces properties which determine the appearance and editing behavior for the control, including: Value, MinValue, MaxValue, and DisplayBase.

Value contains the decimal (base-10) value for the control as an Int64 type. MinValue and MaxValue control the lower and upper limits for the value in the control. DisplayBase determines the numeric base (base-2, base-8, base-10, base-16, etc.) used to display and edit the text for for the control.

Changing the value in DisplayBase causes the Value to be converted to the specified numeric base and the control is updated. A prefix is displayed for some numeric base values like base-2 (binary), base-8 (octal) and base-16 (hexadecimal). Other numeric base values do not use a prefix.

The edit control supports changing the numeric base using DisplayBase, or using key presses which force the radix to be changed. See ToggleBinKeys, ToggleOctKeys, ToggleHexKeys for more information.

Use the OnBasechange event handler to perform actions needed when DisplayBase is changed for the control.

TCustomEdit
Handles key down events for the control.

KeyDown is an overridden method in TLazIntegerEdit. It ensures that key down events which affect the current selection in the control are properly applied.

KeyDown calls the alternate handler in the ancestor class (_KeyDown) to signal assigned OnKeyDown event handler attached to the control. It updates the values in SelStart and SelLength as needed when VK_BACK or VK_DELETE key down events are received and applied to the edit box.

Virtual key code for the key down event.
Shift, Ctrl, Alt, or Meta modifiers for the key down event.
Handles key press events for the control.

KeyPress is an overridden method in TLazIntegerEdit. It calls the alternate _KeyPress handler in TLazIntegerEditGen to signal OnKeyPress (when assigned) and apply the specified character to the control. No actions are performed when ReadOnly is set to True.

KeyPress ensures that keys specific to the control or its DisplayBase are detected and applied to the control. This includes control characters like:

- #8 (BS) (Backspace)
- #9 (HT) (Tab)
- #33 (^A) (Select All)
- #35 (^C) (Copy)
- #58 (^Z) (Undo)

Values in SelStart and SelLength are updated as needed when the Text in the control has been updated.

Character for the key press notification.
Handles UTF-8 key press events for the control.

Utf8KeyPress is an overridden method in TLazIntegerEdit. It calls the alternate handler routine in _Utf8KeyPress (implemented in TLazIntegerEditGen) to examine, handle, or preprocess the UTF-8 character. The OnUTF8KeyPress event handler is signalled (when assigned). The alternate handler ensures that that multi-byte UTF-8 characters are ignored for the control; the value in Utf8Char is set to an empty string ('') if it contains more than 1 byte value.

TWinControl.Utf8KeyPress TWinControl.OnUtf8KeyPress
UTF-8-encoded character for the key press notification.
Gets the text displayed for the control.

RealGetText is an overridden TCaption function in TLazIntegerEdit used to get the value for the control Caption. It calls the alternate handler routine (_RealGetText) in TLazIntegerEditGen to get the return value. If the control handle has been allocated, the inherited RealGetText method in ancestor classes is called to get the return value. It the handle has not been allocated, the Value property is converted to a string which includes the optional prefix for the radix.

TCustomEdit.Text TControl.Caption
Value used for the Text property.
Updates the value in Text when the window handle is created.

InitializeWnd is an overridden method in TLazIntegerEdit. It calls the alternate routine in the generic base class (_InitializeWnd) on entry. The inherited method (in TCustomEdit) is called to initialize members in the widget instance including its Handle and control flag values.

InitializeWnd ensures that the Text displayed for the control is updated to reflect the Value property converted to the selected DisplayBase with the corresponding prefix.

TCustomEdit.InitializeWnd
Updates the Value for the control prior to freeing the window handle for the control.

FinalizeWnd is an overridden method in TLazIntegerEdit. It ensures that the control Value is updated using the Text for the control after conversion back to a Decimal (base-10) value. This action is performed prior to calling the inherited FinalizeWnd method (in TWinControl) to update the control Caption and free its Handle.

TWinControl.FinalizeWnd TControl.Caption
Updates Value with the contents in Text when the control loses input focus.

DoExit is an overridden method in TLazIntegerEdit. It ensures that the Value for the control is updated when the control loses input focus. DoExit calls the alternate handler (_DoExit) in TLazIntegerEditGen to perform the actions needed.

The Value property is updated by converting the Text for control back to its Decimal (base-10) representation. Values in MinValue and MaxValue are enforced when Value is updated.

DoExit calls the inherited method (in TCustomEdit) to reset the AutoSelected property, and to signal the OnExit event handler (when assigned).

DoExit is called when the CM_EXIT control message is handled for the control.

TCustomEdit.DoExit TWinControl.DoExit TWinControl.OnExit
Updates the control Value when editing has been completed for the control.

EditingDone is an overridden method in TLazIntegerEdit. It ensures that the Value property is updated when editing has been completed for the control. The alternate handler routine (_EditingDone) in the generic base class (TLazIntegerEditGen) is called to perform the actions needed.

Value is updated by converting the control Text back to its Decimal (base-10) representation. Values in the MinValue and MaxValue properties are enforced when Value is updated.

EditingDone in an ancestor class (TControl) is called when the ReadOnly property is set to False, and the OnEditingDone event handler is signalled (when assigned).

Editing is called when the VK_RETURN key is handled for the control.

TControl.EditingDone TControl.OnEditingDone
Constructor for the class instance.

Create is the overridden constructor for the class instance. It calls the _Init method in the base class to set the default values for members in the class instance. It calls the inherited constructor (in TCustomEdit) to set the default values for members in ancestor class.

Owner of the class instance.
Contains the prefix displayed in the control when the value is displayed in hexadecimal format (DisplayBase = 16).

HexIndicator contains the prefix displayed in the edit control when DisplayBase is set to 16 for hexadecimal format. The default value for the property is '$' as assigned in the _Init method in the base class. Changing the value for the property causes the text displayed on the control to be converted and re-encoded when DisplayBase is 16.

Use BinIndicator or OctIndicator for the prefix used for base-2 and base-8 respectively.

Contains the character(s) which cause the edit control to be displayed using the hexadecimal (base-16) radix.

A default value is not assigned for the property. The ToggleHexKeys property is used to toggle between Hexadecimal (base-16) and Decimal (base-10) instead. When a value is assigned to ToggleHexKeys, those keys take precedence over the keys in SetHexKey. The value is used, when applicable, in the _KeyPress handler for the control.

Converts the specified string to a QWord value using the specified numeric base.
Value for the specified string as a QWord type.
String with the value converted in the routine.
Numeric base (or radix) for the QWord value in the result.
Converts a QWord value using the specified numeric base to its string representation.
String representation for the converted numeric value.
QWord value converted to a string in the routine.
Numeric base (or radix) for the specified QWord value.