Other GUI Functions

NOTE: Many, maybe all, of these functions may soon move to another library, and their API may change at that point. So they may not be forwards compatible.



int adime_file_select(const char *message, char *path, const char *ext, int size, int w, int h);
Like Allegro's `file_select_ex()', but with Adime's 3d look and feel. It is not affected by all `adime_window_*' variables though, only the ones beginning with `adime_window_title_*'. Also, it has the extra feature of not changing `path' if it gets cancelled.
See also: adime_dialogf, Adime Metrics.

int adime_d_double_calc_edit_proc(int msg, DIALOG *d, int c);
Gui proc for an edit box accepting a mathematical expression whose result is a floating point number. The result is calculated and displayed on a separate gui object as the user types. The edit box has a 3d-ish look.
The dp2 field points to a `struct ADIME_EDIT_NUMBER *' which holds some information about the behavior of the edit box:
   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' will be used to display the result of the expression. There is an `adime_d_calc_edit_result_proc' object type which is designed to be used as `result_object', but you may of course write your own object to take care of this. Whenever the user changes the text in the `adime_d_double_calc_edit_proc', the result is printed to the `dp' field of `result_object'; hence you must have set the dp field of `result_object' to a text buffer with enough space (256 bytes is safe). The `result_object' will then be sent a `MSG_DRAW' message with the `c' parameter set to 2 if there is an error in the expression or 1 if it is ok.
See also: adime_d_calc_edit_result_proc, adime_d_int_calc_edit_proc.

int adime_d_int_calc_edit_proc(int msg, DIALOG *d, int c);
Like `adime_d_double_calc_edit_proc()', but displaying the result as an integer. If the user tries to enter a floating point value, it will be rounded.
See also: adime_d_double_calc_edit_proc, adime_d_calc_edit_result_proc.

int adime_d_calc_edit_result_proc(int msg, DIALOG *d, int c);
Dialog proc for the result of a calculator edit box. The difference between this and Allegro's `d_text_proc()' is that it uses the c parameter to find the color to draw with (see `d_double_calc_edit_proc()'), and it also erases its whole area even if the text doesn't fill it.
See also: adime_d_int_calc_edit_proc, adime_d_double_calc_edit_proc.

int adime_d_line_proc(int msg, DIALOG *d, int c);
A simple dialog object which draws a 3d-ish horizontal or vertical line (depending on whether its `w' field is greater or less than its `h' field).



int adime_d_check_proc(int msg, DIALOG *d, int c)
Like Allegro's `d_check_box()', but with 3d-ish style.
See also: adime_d_greyable_check_proc.

int adime_d_greyable_check_proc(int msg, DIALOG *d, int c)
A three-state greyable version of `adime_d_check_box()'. Unlike `adime_d_check_proc()', this does not use the (flags & D_SELECTED) flag to determine the state of the check box. Instead, the d1 field is 0 for off, 1 for on, and 2 for greyed.
See also: adime_d_check_proc.

int adime_d_list_proc(int msg, DIALOG *d, int c)
Like Allegro's `d_list_proc()', but with 3d-ish style.



int adime_d_text_list_proc(int msg, DIALOG *d, int c)
Like Allegro's `d_text_list_proc()', but with 3d-ish style.



int adime_d_edit_proc(int msg, DIALOG *d, int c)
Like Allegro's `d_edit_proc()', but with 3d-ish style. Note that the 3d border is three pixels wide, so you have to add those pixels to the size of the edit box. It also adds an extra feature: The `d->d1' field, if positive, is the maximal number of characters, just like with d_edit_proc(). But you may also set it to be negative, meaning that (after removing the sign) it is the maximal number of bytes occupied by the string, including the trailing zero. (This may be different from the number of characters when you use Unicode.)



int adime_d_button_proc(int msg, DIALOG *d, int c)
Similar to Allegro's `d_button_proc()', but with 3d-ish style. It also has a slightly different behaviour: Unlike `d_button_proc()', the D_EXIT flag has no effect. Instead you need to set the `d1' field to one of the three constants:
int adime_d_multiline_text_proc(int msg, DIALOG *d, int c)
Like Allegro's `d_text_proc()', but supports newlines ('\n') in the string.



int adime_d_window_proc(int msg, DIALOG *d, int c)
Gui proc that draws a window. The `dp' field should be the caption of the dialog, as a string. All fields except x, y, w, h are ignored. Note that this object is purely cosmetical: you can't move or resize the window.



void adime_draw_empty_button(BITMAP *bmp, int x1, int y1, int x2, int y2, int face_color, int xlight, int light, int dark, int xdark)
Draws an empty button on the given position of the bitmap, using the given colors.
See also: adime_draw_text_button, adime_draw_picture_button.

void adime_draw_text_button(BITMAP *bmp, int x1, int y1, int x2, int y2, int face_color, int text_color, int xlight, int light, int dark, int xdark, const FONT *f, const char *text)
Draws a button with a text on it, at the given position of the bitmap and using the given colors and font.
See also: adime_draw_text_button_down, adime_draw_empty_button, adime_draw_picture_button.

void adime_draw_text_button_down(BITMAP *bmp, int x1, int y1, int x2, int y2, int face_color, int text_color, int xlight, int light, int dark, int xdark, const FONT *f, const char *text)
Like `adime_draw_text_button()', but draws the button pressed down.
See also: adime_draw_text_button.

void adime_draw_picture_button(BITMAP *bmp, int x1, int y1, int x2, int y2, int face,int xlight, int light, int dark, int xdark, BITMAP *sprite)
Draws a button with a sprite on it at the given position of the bitmap and using the given colors and sprite.
See also: adime_draw_picture_button_down, adime_draw_empty_button, adime_draw_text_button.

void adime_draw_picture_button_down(BITMAP *bmp, int x1, int y1, int x2, int y2, int face, int xlight, int light, int dark, int xdark, BITMAP *sprite)
Like `adime_draw_picture_button()', but draws the button pressed down.
See also: adime_draw_picture_button.

void adime_fill_textout(BITMAP *bmp, const FONT *f, const char *text, int x, int y, int w, int fg, int bg)
Like Allegro's `textout()', but erases the whole area of width `w' if the text doesn't cover it. If the text is longer than `w' it will be clipped.



Back to Contents