From 77576dbbf1694a2eed67c8451f01240e517b02c4 Mon Sep 17 00:00:00 2001
From: dsiders
+_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:
+
+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.
+
+_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:
+
+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:
+
+Key is set to #0 if it is handled in the method.
+
+_KeyPress is called from the overridden KeyPress method in the TLazIntegerEdit
+descendant.
+
+_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.
+
+_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:
+
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 redisplayed. 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).
+(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 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.
+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.
+
+
+
+
+
+
+
+
-Use Valid to determine if the edit box contains a valid value for the specified -DisplayBase. +Use Valid to determine if the edit box contains a valid value for the +specified 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. +
++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. +
++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. +
+-DisplayBase is an Integer property which contains the numeric base (or radix) for the value displayed and maintained in the edit 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 used to represent the Value in the -control and controls the conversion performed to get the display value. The -default value for the property is 10 and indicates the control displays its -Value using base-10 or decimal notation. +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). +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 @@ -412,61 +676,182 @@ HexIndicator for more information about common prefixes used for selected DisplayBase values.
+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. +
++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. +
++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. +
++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). +
++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. +
++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. +
++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). +
++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. +
++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. +
++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). +
+-OnBaseChange is a public property and does not appear in the Object -Inspector at design-time; it must be assigned at run-time using an object -procedure which implements the signature for the event. +OnBaseChange is a public property in TLazIntegerEditGen, but it is published +in the TLazIntegerEdit descendant.
+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. +
++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. +
++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. +
++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. +
+