diff lwlib/xlwradio.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 9d177e8d4150
children c33ae14dd6d0
line wrap: on
line diff
--- a/lwlib/xlwradio.c	Mon Aug 13 11:33:40 2007 +0200
+++ b/lwlib/xlwradio.c	Mon Aug 13 11:35:02 2007 +0200
@@ -25,7 +25,7 @@
  *
  * Author: Edward A. Falk
  *         falk@falconer.vip.best.com
- *  
+ *
  * Date:   June 30, 1997
  *
  *
@@ -53,7 +53,7 @@
 
 #include <X11/IntrinsicP.h>
 #include <X11/StringDefs.h>
-#include ATHENA_INCLUDE(XawInit.h)
+#include ATHENA_XawInit_h_
 #include "../src/xmu.h"
 #include "xlwradioP.h"
 
@@ -120,7 +120,7 @@
 
 RadioClassRec radioClassRec = {
   {
-    (WidgetClass) SuperClass,		/* superclass		*/	
+    (WidgetClass) SuperClass,		/* superclass		*/
     "Radio",				/* class_name		*/
     sizeof(RadioRec),			/* size			*/
     RadioClassInit,			/* class_initialize	*/
@@ -154,7 +154,7 @@
     NULL				/* extension		*/
   },  /* CoreClass fields initialization */
   {
-    XtInheritChangeSensitive		/* change_sensitive	*/ 
+    XtInheritChangeSensitive		/* change_sensitive	*/
   },  /* SimpleClass fields initialization */
 #ifdef	_ThreeDP_h
   {
@@ -241,7 +241,7 @@
 /*	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 @@
 
     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 ;
     }
 }
@@ -375,6 +375,13 @@
       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 +423,7 @@
  * border.
  */
 
-static void 
+static void
 DrawHighlight (Widget w,
 	       GC gc)
 {
@@ -466,7 +473,7 @@
 
 
 /* ARGSUSED */
-void 
+void
 RadioSet (Widget   w,
 	  XEvent   *event,
 	  String   *params,     /* unused */
@@ -485,7 +492,7 @@
 
 
 /* ARGSUSED */
-void 
+void
 RadioUnset (Widget   w,
 	    XEvent   *event,
 	    String   *params,     /* unused */