-/* Gauge Widget for XEmacs.
+/* Gauge Widget for XEmacs.
Copyright (C) 1999 Edward A. Falk
This file is part of XEmacs.
*
* Author: Edward A. Falk
* falk@falconer.vip.best.com
- *
+ *
* Date: July 9, 1997
*
* Note: for fun and demonstration purposes, I have added selection
#include <X11/IntrinsicP.h>
#include <X11/Xatom.h>
#include <X11/StringDefs.h>
-#include ATHENA_INCLUDE(XawInit.h)
+#include ATHENA_XawInit_h_
#include "xlwgaugeP.h"
#include "../src/xmu.h"
#ifdef HAVE_XMU
GaugeClassRec gaugeClassRec = {
{
-/* core_class fields */
+/* core_class fields */
/* superclass */ (WidgetClass) &labelClassRec,
/* class_name */ "Gauge",
/* widget_size */ sizeof(GaugeRec),
}
else
{
- gw->gauge.margin0 =
+ gw->gauge.margin0 =
gw->gauge.margin1 = lh / 2 ;
size += lwm + vmargin ;
}
}
/* if the gauge is selected, signify by drawing the background
- * in a constrasting color.
+ * in a contrasting color.
*/
if( gw->gauge.selected )
if( gw->gauge.nlabels > 1 )
{
char label[20], *s = label ;
- int len, w,h =0 ;
+ int xlen, wd,h =0 ;
if( gw->gauge.orientation == XtorientHorizontal )
y = gw->gauge.lmargin + gw->label.font->max_bounds.ascent - 1 ;
s = gw->gauge.labels[i] ;
if( s != NULL ) {
x = e0 + i*(e1-e0-1)/(gw->gauge.nlabels-1) ;
- len = strlen(s) ;
+ xlen = strlen(s) ;
if( gw->gauge.orientation == XtorientHorizontal ) {
- w = XTextWidth(gw->label.font, s, len) ;
- XDrawString(dpy,win,gc, x-w/2,y, s,len) ;
+ wd = XTextWidth(gw->label.font, s, xlen) ;
+ XDrawString(dpy,win,gc, x-wd/2,y, s,xlen) ;
}
else {
- XDrawString(dpy,win,gc, y,x+h, s,len) ;
+ XDrawString(dpy,win,gc, y,x+h, s,xlen) ;
}
}
}
else
GaugeResize(new) ;
}
-
+
if( gw->gauge.update != oldgw->gauge.update )
{
if( gw->gauge.update > 0 )
return True ;
}
- else
+ else
#endif
if( *target == XA_INTEGER )
{
return True ;
}
- else if( *target == XA_STRING
+ else if( *target == XA_STRING
#ifdef HAVE_XMU
- ||
- *target == XA_TEXT(XtDisplay(w))
+ ||
+ *target == XA_TEXT(XtDisplay(w))
#endif
)
{
if( XmuConvertStandardSelection(w, req->time, selection, target,
type, (XPointer *) value, length, format) )
return True ;
- else
+ else
#endif
{
printf(
XawGaugeSetValue(w, *iptr) ;
}
- else if( *type == XA_STRING
+ else if( *type == XA_STRING
#ifdef HAVE_XMU
||
- *type == XA_TEXT(dpy)
+ *type == XA_TEXT(dpy)
#endif
- )
+ )
{
cptr = (char *)value ;
XawGaugeSetValue(w, atoi(cptr)) ;