User Tools

Site Tools


axnumvalidatedtf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
axnumvalidatedtf [2019/10/21 12:30]
bloguintosh
axnumvalidatedtf [2019/10/28 13:53] (current)
bloguintosh
Line 1: Line 1:
 ====== AXNumValidatedTF ====== ====== AXNumValidatedTF ======
  
-AXNumValidatedTF is a Xojo TextField subclass (32/64 bits) for Windows ​and macOS allowing the input validation of a defined numeric range, using the system Locale settings for decimal and grouping text formating.+AXNumValidatedTF is a Xojo TextField subclass (32/64 bits) for WindowsmacOS and Linux allowing the input validation of a defined numeric range, using the system Locale settings for decimal and grouping text formatting.
  
   * Raise Events when the entered value is in / out of Range (active catching / propagation of the value).   * Raise Events when the entered value is in / out of Range (active catching / propagation of the value).
Line 12: Line 12:
   * IsInRange property to passively check if the value is inside the defined range.   * IsInRange property to passively check if the value is inside the defined range.
   * Xojo API 2.0 / API 1.0 versions of the Class.   * Xojo API 2.0 / API 1.0 versions of the Class.
-  * macOS / Windows (32/64 bits) compatible.+  * macOS / Windows ​/ Linux (32/64 bits) compatible.
  
-Among other features, ​the user can set the kind of numerical input (Integer or Real), Minimum and Maximum values ​for the accepted numerical input, the decimal lenght for real numbers, and the default value for the field. It also provides properties to enforce the input of a numerical value in the defined range (the focus stays in the field) and the optional display of an error message dialog.+Buy the [[https://​www.aprendexojo.com/​en/​shop/​axnumvalidatedtf-for-xojo-2/​|AXNumValidatedTF License]] from the product Page
  
-As part of the validation processAXNumValidatedTF properly formats ​the displayed number, including ​the use of the Grouping ​and Decimal character defined in the system Locale settings, the deletion of left side zeroes ​and even trying to fix the incorrect use of the Grouping and Decimal characters as part of the input from the user (for example, "​10,​00.32"​ is formated as "​1,​000.32"​ after the validation when the ","​ character is set for number Grouping ​and "​."​ as the decimal separator).+Among other features, the user can set the kind of numerical input (Integer or Real), Minimum ​and Maximum values for the accepted numerical input, the decimal length for real numbers, ​and the default value for the field. It also provides properties to enforce ​the input of a numerical value in the defined range (the focus stays in the field) ​and the optional display of an error message dialog.
  
-AXNumValidatedTF formats the Minimum ​and Maximum valuesshowing them as a hint in the ToolTip ​(API 2.0) or HelpTag (API 1) for everyone of the instances used in the Layout of the App.+As part of the validation process, ​AXNumValidatedTF ​properly ​formats the displayed number, including the use of the Grouping ​and Decimal character defined in the system Locale settingsthe deletion of left side zeroes and even trying to fix the incorrect use of the Grouping and Decimal characters ​as part of the input from the user (for example, "10,00.32" is formatted as "1,​000.32"​ after the validation when the ","​ character is set for number Grouping and "​."​ as the decimal separator).
  
-Besides the usual Methods and Properties ​availables ​in a TextField, AXNumValidatedTF adds its own Properties, Methods and Events to simplify the access and notification of the entered values. For example:+AXNumValidatedTF formats the Minimum and Maximum values, showing them as a hint in the ToolTip (API 2.0) or HelpTag (API 1) for each of the instances used in the Layout of the App. 
 + 
 +Besides the usual Methods and Properties ​available ​in a TextField, AXNumValidatedTF adds its own Properties, Methods and Events to simplify the access and notification of the entered values. For example:
  
   * ''​IsInRange As Boolean''​   * ''​IsInRange As Boolean''​
  
-Is a Property set to True when the entered value is inside ​the defined Range, and False otherwise.+Is a Property set to True when the entered value is in the defined Range, and False otherwise.
  
 For those cases when an active notification or propagation of the value is needed, it also provide the following Event Handlers: For those cases when an active notification or propagation of the value is needed, it also provide the following Event Handlers:
Line 35: Line 37:
 Copy the ''​AXNumValidated''​ folder from the Xojo Demo Project and paste it into your own Xojo Project. Make sure you're copying the right API 2.0 or API 1.0 version of the Demo project. Copy the ''​AXNumValidated''​ folder from the Xojo Demo Project and paste it into your own Xojo Project. Make sure you're copying the right API 2.0 or API 1.0 version of the Demo project.
  
-If your app windows ​layouts already include ​TextField ​you want to use for validation, select them and use the Inspector Panel and change ​its Super class to AXNumValidatedTF.+If your app window'​s ​layouts already include ​the TextFields ​you want to use for validation, select them and use the Inspector Panel and change ​their Superclass ​to AXNumValidatedTF.
  
-Then, and using the Inspector Panel or via code, set the ''​ValueType''​ (Integer / Real), ''​MinValue'',​ ''​MaxValue''​ and ''​DecimalPositions''​ properties for the instance. ​In addition, and optionally, you can set the ''​ForceValueInRange''​ and ''​DisplayValidationMessage''​ properties.+Then, and using the Inspector Panel or via code, set the ''​ValueType''​ (Integer / Real), ''​MinValue'',​ ''​MaxValue''​ and ''​DecimalPositions''​ properties for the instance. ​Optionally, you can set the ''​ForceValueInRange''​ and ''​DisplayValidationMessage''​ properties.
  
 If you want your instance to be notified when the value is in or out of range, implement the ''​ValueInRange''​ and/or ''​ValueOutOfRange''​ Event Handlers. If you want your instance to be notified when the value is in or out of range, implement the ''​ValueInRange''​ and/or ''​ValueOutOfRange''​ Event Handlers.
  
-==== When kicks-in ​the Validation? ====+AXNumValidatedTF is fully functional when running from the Xojo IDE (debug), but you'll need a License in order for it to work in compiled apps.
  
-The validation process of the entered data is fired when the field lost the focus or when the user press the Return key.+==== When does the Validation kick-in? ====
  
 +The validation process of the entered data is fired when the field looses the focus or when the user press the Return key.
 +
 +==== AXNumValidatedTF Locale ====
 +
 +AXNumValidatedTF class is aware of any on-the-fly changes in the System Grouping and Decimal separator characters settings; but these are not reflected in some of the Xojo functions used during the validation process. Until this changes, the App should be restarted so these Xojo functions are aware of the new system Locale settings for numeric formatting.
  
 ===== Minimum Requirements ===== ===== Minimum Requirements =====
Line 50: Line 57:
 AXNumValidatedTF requires Xojo 2017r3 or later, and is compatible with projects using both API 2.0 and API 1. AXNumValidatedTF requires Xojo 2017r3 or later, and is compatible with projects using both API 2.0 and API 1.
  
-===== AXNumValidatedTF Methods ====+===== AXNumValidatedTF Methods ​=====
 ^Signature^Description^ ^Signature^Description^
 |IsInRange As Boolean|Call this method to know if the entered / displayed value is in or out of Range| |IsInRange As Boolean|Call this method to know if the entered / displayed value is in or out of Range|
 +
 +===== AXNumValidatedTF Shared Methods =====
 +^Signature^Description^
 +|APIVersion As Integer|Returns the API version of the Class.|
 +|License(Name As String, Surname As String, Data as String|License the class for use in compiled applications.|
 +|Version As String|Returns the version of the Class.|
 +
 +===== AXNumValidatedTF Event Handlers =====
 +^Signature^Description^
 +|ValueInRange(Value As Double)|This event is fired after the validation process, when the entered value is in range. The Value variable is set to the entered value, as Double.|
 +|ValueOutOfRange(Value As Double)|This event is fired when the entered value is in range. The Value variable is set to the entered value, as Double.|
 +
 +===== AXNumValidatedTF Properties =====
 +^Name^Description^
 +|DecimalPositions As Integer|Length of decimal fraction for the entered number. This property has effect if the ValueType is set to Real for the instance.|
 +|DefaultValue As Double|Default Value displayed in the instance.|
 +|DisplayValidationMessage As Boolean|When set to True, it displays a message error showing the validation Range when the entered value is out of range.|
 +|ForceValueInRange As Boolean|When set to True, the instance field stays in focus until a valid value is entered.|
 +|MaxValue As Double|Set the maximum value for the acceptable value range.|
 +|MinValue As Double|Set the minimum value for the acceptable value range.|
 +|ValueType As NumberType|Set the kind of numeric value accepted: Integer or Real.|
 +
 +===== AXNumValidatedTF Enumerations =====
 +^Name^Values^Description^
 +|NumberType|IntegerValue,​ RealValue|Defines the acceptable values types for the Field.|
 +
 +===== Version Log =====
 +^Version^Release Date^Description^
 +|1.1|2019-10-28|[New] Added Linux Compatibility|
 +|1.0|2019-10-21|Initial Release|
axnumvalidatedtf.1571653806.txt.gz · Last modified: 2019/10/21 12:30 by bloguintosh