[AD] d_radio_proc and d_check_proc

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


This patch modifies the aforementioned GUI procs to display the dotted 
rectangle around the entire proc area, instead of just the circle/square 
which is a bit misleading towards the actual area the proc occupies. As well, 
it better follows modern GUI behavior.
Index: src/guiproc.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/guiproc.c,v
retrieving revision 1.30
diff -u -r1.30 guiproc.c
--- src/guiproc.c	29 Jun 2005 20:26:54 -0000	1.30
+++ src/guiproc.c	11 Sep 2005 06:35:41 -0000
@@ -417,17 +417,19 @@
       fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
       bg = (d->bg < 0) ? gui_bg_color : d->bg;
 
-      x = d->x + ((d->d1) ? 0 : gui_textout_ex(gui_bmp, d->dp, d->x, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, d->bg, FALSE) + text_height(font)/2);
+      rectfill(gui_bmp, d->x, d->y, d->x+d->h-1, d->y+d->h-1, bg);
+      if (d->flags & D_GOTFOCUS)
+	 dotted_rect(d->x, d->y, d->x+d->h-1, d->y+d->h-1, fg, bg);
+
+      x = d->x + ((d->d1) ? 0 : gui_textout_ex(gui_bmp, d->dp, d->x, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, -1, FALSE) + text_height(font)/2);
       rectfill(gui_bmp, x+1, d->y+1, x+d->h-2, d->y+d->h-2, bg);
       rect(gui_bmp, x, d->y, x+d->h-1, d->y+d->h-1, fg);
       if (d->d1)
-	 gui_textout_ex(gui_bmp, d->dp, x+d->h-1+text_height(font)/2, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, d->bg, FALSE);
+	 gui_textout_ex(gui_bmp, d->dp, x+d->h-1+text_height(font)/2, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, -1, FALSE);
       if (d->flags & D_SELECTED) {
 	 line(gui_bmp, x, d->y, x+d->h-1, d->y+d->h-1, fg);
 	 line(gui_bmp, x, d->y+d->h-1, x+d->h-1, d->y, fg);
       }
-      if (d->flags & D_GOTFOCUS)
-	 dotted_rect(x+1, d->y+1, x+d->h-2, d->y+d->h-2, fg, bg);
 
       return D_O_K;
    } 
@@ -454,18 +456,20 @@
 	 fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
 	 bg = (d->bg < 0) ? gui_bg_color : d->bg;
 
-	 gui_textout_ex(gui_bmp, d->dp, d->x+d->h-1+text_height(font), d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, d->bg, FALSE);
+	 rectfill(gui_bmp, d->x, d->y, d->x+d->w-1, d->y+d->h-1, bg);
+	 if (d->flags & D_GOTFOCUS)
+	    dotted_rect(d->x, d->y, d->x+d->w-1, d->y+d->h-1, fg, bg);
+
+	 gui_textout_ex(gui_bmp, d->dp, d->x+d->h-1+text_height(font), d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, -1, FALSE);
 
 	 x = d->x;
 	 r = d->h/2;
-
 	 center = x+r;
-	 rectfill(gui_bmp, x, d->y, x+d->h-1, d->y+d->h-1, bg);
 
 	 switch (d->d2) {
 
 	    case 1:
-	       rect(gui_bmp, x, d->y, x+d->h-1, d->y+d->h-1, fg);
+	       rect(gui_bmp, x+1, d->y+1, x+d->h-2, d->y+d->h-2, fg);
 	       if (d->flags & D_SELECTED)
 		  rectfill(gui_bmp, x+r/2, d->y+r/2, x+d->h-1-r/2, d->y+d->h-1-r/2, fg);
 	       break;
@@ -477,13 +481,6 @@
 	       break;
 	 }
 
-	 if (d->flags & D_GOTFOCUS) {
-	    if (d->d2 == 1)
-	       dotted_rect(x+1, d->y+1, x+d->h-2, d->y+d->h-2, fg, bg);
-	    else
-	       dotted_rect(x, d->y, x+d->h-1, d->y+d->h-1, fg, bg);
-	 }
-
 	 return D_O_K;
 
       case MSG_KEY:


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