X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lwlib%2Fxlwradio.c;h=cfb0e5497dfded433588a9cd65f3fc4889b72b94;hb=8ccf542c980645ba3c02074a8bc67cd4fc8e7a1f;hp=18f9cdd1c670820f006a29bba4efc3888f1cc6e8;hpb=430e0db85cc37821320fe27da9feeacc7961003f;p=chise%2Fxemacs-chise.git.1 diff --git a/lwlib/xlwradio.c b/lwlib/xlwradio.c index 18f9cdd..cfb0e54 100644 --- a/lwlib/xlwradio.c +++ b/lwlib/xlwradio.c @@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: June 30, 1997 * * @@ -53,7 +53,7 @@ Boston, MA 02111-1307, USA. */ #include #include -#include +#include ATHENA_XawInit_h_ #include "../src/xmu.h" #include "xlwradioP.h" @@ -120,7 +120,7 @@ static XtActionsRec actionsList[] = RadioClassRec radioClassRec = { { - (WidgetClass) SuperClass, /* superclass */ + (WidgetClass) SuperClass, /* superclass */ "Radio", /* class_name */ sizeof(RadioRec), /* size */ RadioClassInit, /* class_initialize */ @@ -154,7 +154,7 @@ RadioClassRec radioClassRec = { NULL /* extension */ }, /* CoreClass fields initialization */ { - XtInheritChangeSensitive /* change_sensitive */ + XtInheritChangeSensitive /* change_sensitive */ }, /* SimpleClass fields initialization */ #ifdef _ThreeDP_h { @@ -241,7 +241,7 @@ RadioInit (Widget request, /* Function Name: RadioDestroy * Description: Destroy Callback for radio widget. * Arguments: w - the radio widget that is being destroyed. - * junk, grabage - not used. + * junk, garbage - not used. * Returns: none. */ @@ -272,13 +272,13 @@ RadioResize (Widget w) switch( rw->label.justify ) { case XtJustifyLeft: - rw->label.label_x += bs(rw) + rw->label.internal_width ; + rw->label.label_x += (bs(rw) + rw->label.internal_width) ; break ; case XtJustifyRight: break ; case XtJustifyCenter: default: - rw->label.label_x += (bs(rw) + rw->label.internal_width)/2 ; + rw->label.label_x += (bs(rw) + rw->label.internal_width)/2; break ; } } @@ -305,13 +305,6 @@ RadioExpose (Widget w, * but it bears thinking on. */ - /* Command widget may sometimes override the label GC in order - * to draw inverse video. We don't use inverse video, so we need - * to restore the label's normal GC. - */ - rw->label.normal_GC = rw->command.normal_GC ; - - /* Let label widget draw the label. If there was an lbm_x * field, we could let Label draw the bitmap too. But there * isn't, so we need to temporarily remove the bitmap and @@ -328,10 +321,10 @@ RadioExpose (Widget w, { /* TODO: handle pixmaps */ XCopyPlane(dpy, left_bitmap, win, gc, - 0,0, rw->label.lbm_width, rw->label.lbm_height, - (int) rw->label.internal_width*2 + bs(rw), - (int) rw->label.internal_height + rw->label.lbm_y, - (u_long) 1L) ; + 0,0, rw->label.lbm_width, rw->label.lbm_height, + (int) rw->label.internal_width*2 + bs(rw), + (int) rw->label.internal_height + rw->label.lbm_y, + 1UL) ; } /* Finally, the button itself */ @@ -375,6 +368,13 @@ RadioSetValues (Widget current, RadioSize(newrw, &newrw->core.width, &newrw->core.height) ; } + /* The label set values routine can resize the widget. We need to + * recalculate if this is true. + */ + if (newrw->label.label_x != oldrw->label.label_x) + { + RadioResize (new); + } return FALSE ; } @@ -416,7 +416,7 @@ RadioQueryGeometry (Widget w, * border. */ -static void +static void DrawHighlight (Widget w, GC gc) { @@ -466,7 +466,7 @@ RadioUnhighlight (Widget w, /* ARGSUSED */ -void +void RadioSet (Widget w, XEvent *event, String *params, /* unused */ @@ -485,7 +485,7 @@ RadioSet (Widget w, /* ARGSUSED */ -void +void RadioUnset (Widget w, XEvent *event, String *params, /* unused */