1adime_d_double_calc_edit_proc(3A)dime API Referenacdeime_d_double_calc_edit_proc(3)
2
3
4
6 adime_d_double_calc_edit_proc
7
9 #include <adime.h>
10
11
12 int adime_d_double_calc_edit_proc(int msg, DIALOG *d, int c);
13
15 Gui proc for an edit box accepting a mathematical expression whose
16 result is a floating point number. The result is calculated and dis‐
17 played on a separate gui object as the user types. The edit box has a
18 3d-ish look.
19
20 The dp2 field points to a `struct ADIME_EDIT_NUMBER *´ which holds some
21 information about the behavior of the edit box:
22
23 typedef struct ADIME_EDIT_NUMBER
24 {
25 int is_signed; /* Set for integer formats if it is signed. */
26 int is_float; /* Set if we only have float, not double. */
27 double min_val, max_val;/* Range for numbers. */
28 DIALOG *result_object; /* DIALOG object to display result in. */
29 } ADIME_EDIT_NUMBER;
30
31 The `result_object´ will be used to display the result of the expres‐
32 sion. There is an `adime_d_calc_edit_result_proc´ object type which is
33 designed to be used as `result_object´, but you may of course write
34 your own object to take care of this. Whenever the user changes the
35 text in the `adime_d_double_calc_edit_proc´, the result is printed to
36 the `dp´ field of `result_object´; hence you must have set the dp field
37 of `result_object´ to a text buffer with enough space (256 bytes is
38 safe). The `result_object´ will then be sent a `MSG_DRAW´ message with
39 the `c´ parameter set to 2 if there is an error in the expression or 1
40 if it is ok.
41
42
44 adime_d_calc_edit_result_proc(3), adime_d_int_calc_edit_proc(3)
45
46
47
48Adime version 2.2.1adime_d_double_calc_edit_proc(3)