adime_d_dou...lc_edit_proc(3)
β¨ NAME β¨
adime_d_double_calc_edit_proc β bestie, it's the Allegro GUI proc that gives you an edit box where you type a lil math expression and it hands you back a floating point number π (this is from the Adime API Reference, in case you were wondering π)
πΈ SYNOPSIS πΈ
#include <adime.h>
int adime_d_double_calc_edit_proc(int msg, DIALOG *d, int c);
π DESCRIPTION π
Okay so, no cap: this is a Gui proc for an edit box that accepts a mathematical expression, and the result of that expression is a floating point number. As the user types, the result gets calculated and displayed on a separate gui object. The edit box itself? It's giving 3d-ish look β¨ lowkey iconic.
The dp2 field points to a struct ADIME_EDIT_NUMBER * and that struct is literally holding all the tea about how the edit box should behave:
typedef struct ADIME_EDIT_NUMBER
{
int is_signed; /* Set for integer formats if it is signed. */
int is_float; /* Set if we only have float, not double. */
double min_val, max_val;/* Range for numbers. */
DIALOG *result_object; /* DIALOG object to display result in. */
} ADIME_EDIT_NUMBER;
The result_object is the one that's gonna display the result of the expression, periodt. There's an adime_d_calc_edit_result_proc object type that was literally designed to be used as the result_object, but bestie, you can of course write your own object to take care of that if you want to be extra π.
So whenever the user changes the text in the adime_d_double_calc_edit_proc, the result gets printed to the dp field of result_object. Which means β and this is the part you cannot skip, fr fr β you must have set the dp field of result_object to a text buffer with enough space. 256 bytes is safe, so like, just do that π«Ά.
Then result_object gets sent a MSG_DRAW message, and the c parameter is set to 2 if there's an error in the expression, or 1 if it's ok. That's the whole vibe check right there π
β οΈ For real though: if you forget to giveresult_object'sdpa big enough buffer, that's on you, and it will not be slay.256bytes. Safe. Do it.
π¦ SEE ALSO π¦
That's the whole page, bestie π β brought to you by Adime, version 2.2.1, and this little corner of the man pages called adime_d_dou...lc_edit_proc(3) πβ¨
π¦ where this page comes from
- fedora 43: adime-devel 2.2.1-42.fc43 Β· zlib
- fedora 43: adime-devel 2.2.1-42.fc43 Β· zlib
- fedora 44: adime-devel 2.2.1-44.fc44 Β· zlib
- fedora 44: adime-devel 2.2.1-44.fc44 Β· zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms