Mercurial > hg > xemacs-beta
diff lwlib/xlwgauge.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 | 8de8e3f6228a |
children | c33ae14dd6d0 |
line wrap: on
line diff
--- a/lwlib/xlwgauge.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lwlib/xlwgauge.c Mon Aug 13 11:35:02 2007 +0200 @@ -1,4 +1,4 @@ -/* Gauge Widget for XEmacs. +/* Gauge Widget for XEmacs. Copyright (C) 1999 Edward A. Falk This file is part of XEmacs. @@ -25,7 +25,7 @@ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: July 9, 1997 * * Note: for fun and demonstration purposes, I have added selection @@ -52,7 +52,7 @@ #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 @@ -160,7 +160,7 @@ GaugeClassRec gaugeClassRec = { { -/* core_class fields */ +/* core_class fields */ /* superclass */ (WidgetClass) &labelClassRec, /* class_name */ "Gauge", /* widget_size */ sizeof(GaugeRec), @@ -334,7 +334,7 @@ } else { - gw->gauge.margin0 = + gw->gauge.margin0 = gw->gauge.margin1 = lh / 2 ; size += lwm + vmargin ; } @@ -404,7 +404,7 @@ } /* if the gauge is selected, signify by drawing the background - * in a constrasting color. + * in a contrasting color. */ if( gw->gauge.selected ) @@ -466,7 +466,7 @@ 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 ; @@ -483,13 +483,13 @@ 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) ; } } } @@ -540,7 +540,7 @@ else GaugeResize(new) ; } - + if( gw->gauge.update != oldgw->gauge.update ) { if( gw->gauge.update > 0 ) @@ -674,7 +674,7 @@ return True ; } - else + else #endif if( *target == XA_INTEGER ) { @@ -685,10 +685,10 @@ 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 ) { @@ -707,7 +707,7 @@ if( XmuConvertStandardSelection(w, req->time, selection, target, type, (XPointer *) value, length, format) ) return True ; - else + else #endif { printf( @@ -787,12 +787,12 @@ 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)) ;