Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 91bcabdccb824ec72a416086efeaaf0e > files > 13

adime-devel-2.2.1-10.fc15.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>
Adime - API Reference: Other GUI Functions
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b">
<h1><a name="Other GUI Functions">Other GUI Functions</a></h1>

<ul>
<li><a href="#adime_d_button_proc">adime_d_button_proc</a>
<li><a href="#adime_d_calc_edit_result_proc">adime_d_calc_edit_result_proc</a>
<li><a href="#adime_d_check_proc">adime_d_check_proc</a>
<li><a href="#adime_d_double_calc_edit_proc">adime_d_double_calc_edit_proc</a>
<li><a href="#adime_d_edit_proc">adime_d_edit_proc</a>
<li><a href="#adime_d_greyable_check_proc">adime_d_greyable_check_proc</a>
<li><a href="#adime_d_int_calc_edit_proc">adime_d_int_calc_edit_proc</a>
<li><a href="#adime_d_line_proc">adime_d_line_proc</a>
<li><a href="#adime_d_list_proc">adime_d_list_proc</a>
<li><a href="#adime_d_multiline_text_proc">adime_d_multiline_text_proc</a>
<li><a href="#adime_d_text_list_proc">adime_d_text_list_proc</a>
<li><a href="#adime_d_window_proc">adime_d_window_proc</a>
<li><a href="#adime_draw_empty_button">adime_draw_empty_button</a>
<li><a href="#adime_draw_picture_button">adime_draw_picture_button</a>
<li><a href="#adime_draw_picture_button_down">adime_draw_picture_button_down</a>
<li><a href="#adime_draw_text_button">adime_draw_text_button</a>
<li><a href="#adime_draw_text_button_down">adime_draw_text_button_down</a>
<li><a href="#adime_file_select">adime_file_select</a>
<li><a href="#adime_fill_textout">adime_fill_textout</a>
</ul>

<p>
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.

<p><br>
<hr><font size="+1"><b>int <a name="adime_file_select">adime_file_select</a>(const char *message, char *path, const char *ext,
                      int size, int w, int h);</b></font><br>
   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 <tt>`path'</tt> if it gets cancelled.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="adime000.html#adime_dialogf">adime_dialogf</a>,
<a href="adime001.html#Adime Metrics">Adime Metrics</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_d_double_calc_edit_proc">adime_d_double_calc_edit_proc</a>(int msg, DIALOG *d, int c);</b></font><br>
   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.<br>
   The dp2 field points to a `struct ADIME_EDIT_NUMBER *' which holds some
   information about the behavior of the edit box:
<pre>
   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;
</pre>
   The <tt>`result_object'</tt> will be used to display the result of the expression.
   There is an <tt>`adime_d_calc_edit_result_proc'</tt> object type which is designed
   to be used as <tt>`result_object'</tt>, but you may of course write your own object
   to take care of this. Whenever the user changes the text in the
   <tt>`adime_d_double_calc_edit_proc'</tt>, the result is printed to the <tt>`dp'</tt> field of
   <tt>`result_object'</tt>; hence you must have set the dp field of <tt>`result_object'</tt>
   to a text buffer with enough space (256 bytes is safe). The
   <tt>`result_object'</tt> will then be sent a <tt>`MSG_DRAW'</tt> message with the <tt>`c'</tt>
   parameter set to 2 if there is an error in the expression or 1 if it is
   ok.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_d_calc_edit_result_proc">adime_d_calc_edit_result_proc</a>,
<a href="#adime_d_int_calc_edit_proc">adime_d_int_calc_edit_proc</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_d_int_calc_edit_proc">adime_d_int_calc_edit_proc</a>(int msg, DIALOG *d, int c);</b></font><br>
   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.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_d_double_calc_edit_proc">adime_d_double_calc_edit_proc</a>,
<a href="#adime_d_calc_edit_result_proc">adime_d_calc_edit_result_proc</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_d_calc_edit_result_proc">adime_d_calc_edit_result_proc</a>(int msg, DIALOG *d, int c);</b></font><br>
   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.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_d_int_calc_edit_proc">adime_d_int_calc_edit_proc</a>,
<a href="#adime_d_double_calc_edit_proc">adime_d_double_calc_edit_proc</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_d_line_proc">adime_d_line_proc</a>(int msg, DIALOG *d, int c);</b></font><br>
   A simple dialog object which draws a 3d-ish horizontal or vertical line
   (depending on whether its <tt>`w'</tt> field is greater or less than its <tt>`h'</tt>
   field).

<p><br>
<hr><font size="+1"><b>int <a name="adime_d_check_proc">adime_d_check_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   Like Allegro's `d_check_box()', but with 3d-ish style.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_d_greyable_check_proc">adime_d_greyable_check_proc</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_d_greyable_check_proc">adime_d_greyable_check_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   A three-state greyable version of `adime_d_check_box()'. Unlike
   `adime_d_check_proc()', this does not use the (flags &amp; 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.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_d_check_proc">adime_d_check_proc</a>.</font></blockquote>
<hr><font size="+1"><b>int <a name="adime_d_list_proc">adime_d_list_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   Like Allegro's `d_list_proc()', but with 3d-ish style.

<p><br>
<hr><font size="+1"><b>int <a name="adime_d_text_list_proc">adime_d_text_list_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   Like Allegro's `d_text_list_proc()', but with 3d-ish style.

<p><br>
<hr><font size="+1"><b>int <a name="adime_d_edit_proc">adime_d_edit_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   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.)

<p><br>
<hr><font size="+1"><b>int <a name="adime_d_button_proc">adime_d_button_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   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 <tt>`d1'</tt> field to one of the three
   constants:
<ul><li>
      ADIME_BUTTON_TOGGLE<br>
         The button behaves like a check box, i.e. when clicked it toggles
         between being in and being out.
<li>
      ADIME_BUTTON_EXIT<br>
         The button exits the dialog when clicked.
<li>
      ADIME_BUTTON_CALLBACK<br>
         If you provide a callback function in the dp2 field, then it will
         be called whenever the button is clicked. This callback should have
         the form `int my_callback(DIALOG *d)', and its return value will be
         passed back to the dialog manager.
</ul>
<hr><font size="+1"><b>int <a name="adime_d_multiline_text_proc">adime_d_multiline_text_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   Like Allegro's `d_text_proc()', but supports newlines ('\n') in the
   string.

<p><br>
<hr><font size="+1"><b>int <a name="adime_d_window_proc">adime_d_window_proc</a>(int msg, DIALOG *d, int c)</b></font><br>
   Gui proc that draws a window. The <tt>`dp'</tt> 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.

<p><br>
<hr><font size="+1"><b>void <a name="adime_draw_empty_button">adime_draw_empty_button</a>(BITMAP *bmp, int x1, int y1, int x2, int y2,
                             int face_color, int xlight, int light,
                             int dark, int xdark)</b></font><br>
   Draws an empty button on the given position of the bitmap, using the
   given colors.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_draw_text_button">adime_draw_text_button</a>,
<a href="#adime_draw_picture_button">adime_draw_picture_button</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_draw_text_button">adime_draw_text_button</a>(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)</b></font><br>
   Draws a button with a text on it, at the given position of the bitmap and
   using the given colors and font.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_draw_text_button_down">adime_draw_text_button_down</a>,
<a href="#adime_draw_empty_button">adime_draw_empty_button</a>,
<a href="#adime_draw_picture_button">adime_draw_picture_button</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_draw_text_button_down">adime_draw_text_button_down</a>(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)</b></font><br>
   Like `adime_draw_text_button()', but draws the button pressed down.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_draw_text_button">adime_draw_text_button</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_draw_picture_button">adime_draw_picture_button</a>(BITMAP *bmp, int x1, int y1, int x2, int y2,
                               int face,int xlight, int light, int dark, int xdark,
                               BITMAP *sprite)</b></font><br>
   Draws a button with a sprite on it at the given position of the bitmap
   and using the given colors and sprite.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_draw_picture_button_down">adime_draw_picture_button_down</a>,
<a href="#adime_draw_empty_button">adime_draw_empty_button</a>,
<a href="#adime_draw_text_button">adime_draw_text_button</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_draw_picture_button_down">adime_draw_picture_button_down</a>(BITMAP *bmp,
                                    int x1, int y1, int x2, int y2,
                                    int face, int xlight, int light,
                                    int dark, int xdark,
                                    BITMAP *sprite)</b></font><br>
   Like `adime_draw_picture_button()', but draws the button pressed down.


<blockquote><font size="-1" face="helvetica,verdana"><em><b>See also:</b></em>
<a href="#adime_draw_picture_button">adime_draw_picture_button</a>.</font></blockquote>
<hr><font size="+1"><b>void <a name="adime_fill_textout">adime_fill_textout</a>(BITMAP *bmp, const FONT *f, const char *text,
                        int x, int y, int w, int fg, int bg)</b></font><br>
   Like Allegro's `textout()', but erases the whole area of width <tt>`w'</tt> if the
   text doesn't cover it. If the text is longer than <tt>`w'</tt> it will be clipped.



<p><br>
<hr><a href="adime.html">Back to Contents</a>

</body>
</html>