[AD] alert3_interlined

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


And this patch (*) adds the function alert3_interlined, that is like the
old alert3, but also can choose how many pixels put between the lines of
the box. IMHO this way the box looks a lot nicer...

(*) i don't know if it's correct, i never made a patch for more that 1
file... i guessed and i merged the 2 diffs... is it ok? otherwise i'll
send two separate diffs (if u intend to apply them... :)

-- 
"Keep mouthing off like that, little girl, and you're going to get
burned""I got insurance"
                                        Yuffie, Final Fantasy 7

_.-:/°^^°\:-._.-:/°^^°\:-._          __.         ____
 - Lo'oRiS il Kabukimono -          / /|       /^___ \
Real Name: Lorenzo Petrone         / / /      / /L_/ /
e-mail: _lano_@xxxxxxxxxx          / / /      /  ___-°/
irc.azzurra.org #lano            / /_/__    /  /|__-°
digilander.iol.it/lano666       /______/|  /__/ /
^°\:-.__.-:/°^°\:-.__.-:/°^     |______|/  |__L/
--- /tmp/gui.c	Wed Jan 23 18:31:02 2002
+++ src/gui.c	Wed Jan 23 19:01:22 2002
@@ -1864,14 +1864,21 @@
 
 
 
-/* alert3:
+int alert3(AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3)
+{
+   return alert3_interlined(0, s1, s2, s3, b1, b2, b3, c1, c2, c3);
+}
+
+
+/* alert3_interlined:
  *  Displays a simple alert box, containing three lines of text (s1-s3),
  *  and with either one, two, or three buttons. The text for these buttons 
  *  is passed in b1, b2, and b3 (NULL for buttons which are not used), and
  *  the keyboard shortcuts in c1 and c2. Returns 1, 2, or 3 depending on 
  *  which button was selected.
+ *  interline is the pixel space between two lines.
  */
-int alert3(AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3)
+int alert3_interlined(int interline, AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3)
 {
    char tmp[16];
    int avg_w, avg_h;
@@ -1898,7 +1905,7 @@
    usetc(tmp+usetc(tmp, ' '), 0);
 
    avg_w = text_length(font, tmp);
-   avg_h = text_height(font);
+   avg_h = text_height(font)+interline;
 
    alert_dialog[A_S1].dp = alert_dialog[A_S2].dp = alert_dialog[A_S3].dp = 
    alert_dialog[A_B1].dp = alert_dialog[A_B2].dp = empty_string;
--- /tmp/gui.h	Wed Jan 23 18:30:52 2002
+++ include/allegro/gui.h	Wed Jan 23 18:59:22 2002
@@ -181,6 +181,7 @@
 AL_FUNC(int, do_menu, (MENU *menu, int x, int y));
 AL_FUNC(int, alert, (AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, int c1, int c2));
 AL_FUNC(int, alert3, (AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3));
+AL_FUNC(int, alert3_interlined, (int interline, AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3));
 AL_FUNC(int, file_select, (AL_CONST char *message, char *path, AL_CONST char *ext));
 AL_FUNC(int, file_select_ex, (AL_CONST char *message, char *path, AL_CONST char *ext, int size, int w, int h));
 AL_FUNC(int, gfx_mode_select, (int *card, int *w, int *h));


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/