- An automatic calculator
- Operating mode
- Customizing and translating the calculator
- Modifying the numeric value with the mouse
- Operating mode
AAFs available for numeric edit controls
The numeric edit controls propose several AAFs (Automatic Application Features):
Any numeric control automatically proposes a "Calculator" option in its popup menu. This option displays a calculator, initialized with the value found in the edit control. This calculator is used to perform a calculation and to assign the result of this calculation to the content of the control.
The "Calculator" option in the context menu of the numeric edit controls is automatic.
You also have the ability to display a "Calculator" button on the right of the input area of the control. To do so, check "Display calculator button" in the "General" tab of the description window of the edit control.
- the CalculatorButton property is used to determine and indicate whether a Numeric or Currency Edit control has a button to display a popup calculator.
- AAFExecute associated with the aafCalculator constant is used to display the calculator below the specified edit control.
- AAFDisable with the aafCalculator constant removes the "Calculator" option from the context menu of the specified Edit control.
Customizing and translating the calculator
The calculator is available in English and in French. It uses a skin template that can be used with all types of applications.
WINDEV gives you the ability to include the calculator window used by the AAF in your application. You will have the ability to customize:
- the appearance of this window (modification of skin template for example).
- the languages supported by this window. This feature is very useful when translating this window into the different languages proposed by the application.
To include the calculator window in your application:
- On the "Project" tab, in the "Project" group, expand "Import" and select "WINDEV elements and their dependencies".
- Select the subdirectory that contains the elements to import. The calculator window is located in "Programs\Data\Preset windows\AAF", in the setup directory of WINDEV.
- WINDEV lists the elements of the directory. This directory contains the different elements corresponding to the customizable AAFs. The window to import is named "WinDevAaf_Calculator.wdw".
- Validate. The window is included in the project and it can be modified. This custom window will be automatically taken into account when running the application.
- The window must not be renamed.
- If this window is included in your application, you may not benefit from the improvements made to this window during the different updates. Don't forget to check whether this window has evolved.
- Caution: To modify this window, the corresponding file must not be read-only. Modify the characteristics of the file in Windows if necessary.
Modifying the numeric value with the mouse
When the cursor is positioned in an edit control that contains numbers (numeric, currency, date, time or duration edit controls), the mouse wheel can be used to increment or decrement its value.
The increment step is set to 1 by default: when the value is selected in the control, each action performed on the wheel modifies the value by 1.
If the cursor is positioned in the value, the increment or decrement operation will be performed on the digit to the left of the cursor.
For example, if the cursor is positioned between the hundreds and thousands of a numeric edit control, the increment or decrement will be applied on the thousands (+ 1000 or -1000).
with the aafModifyInputValueWithWheel
constant deletes the AAF for the specified Edit control or for all the Edit controls.