Fix for bug in spinner - xforms.git - xforms

index : xforms.git
xforms
summary refs log tree commit diff
diff options
context:
space:
mode:
authorJens Thoms Toerring <jt@toerring.de>2014年05月14日 23:57:42 +0200
committerJens Thoms Toerring <jt@toerring.de>2014年05月14日 23:57:42 +0200
commit9cf03d7d008fd67613db0f2d573939883eada57c (patch)
tree02a7e6945ab409e0b599daa4df3d55cd4011175b
parentf7f12ce0eb215bbda0fbec1843da51b3cd8ccdd4 (diff)
downloadxforms-9cf03d7d008fd67613db0f2d573939883eada57c.tar.gz
Fix for bug in spinner
Diffstat
-rw-r--r--ChangeLog 4
-rw-r--r--configure.ac 2
-rw-r--r--doc/part4_drawing_objects.texi 4
-rw-r--r--doc/xforms.texi 2
-rw-r--r--lib/include/XBasic.h 24
-rw-r--r--lib/pixmap.c 13
-rw-r--r--lib/spinner.c 5
-rw-r--r--lib/xyplot.c 9
8 files changed, 37 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 04332f7..3c8f2b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014年05月14日 Jens Thoms Toerring <jt@toerring.de>
+
+ * lib/spinner.c: Bug in handling of FL_FLOAT_SPINNER fixed.
+
2014年05月06日 Jens Thoms Toerring <jt@toerring.de>
* lib/xyplot.c: fl_set_xyplot_mouse_buttons() and
diff --git a/configure.ac b/configure.ac
index fcc6417..c74fe8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
dnl Process with autoconf to generate configure script -*- sh -*-
AC_PREREQ(2.59)
-AC_INIT([xforms],[1.3.7],[xforms-development@nongnu.org])
+AC_INIT([xforms],[1.3.8],[xforms-development@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(lib/forms.c)
XFORMS_CHECK_VERSION
diff --git a/doc/part4_drawing_objects.texi b/doc/part4_drawing_objects.texi
index 8642370..0756342 100644
--- a/doc/part4_drawing_objects.texi
+++ b/doc/part4_drawing_objects.texi
@@ -698,8 +698,8 @@ void fl_line(FL_Coord x1, FL_Coord y1,
FL_Coord x2, FL_Coord y2, FL_COLOR col);
@end example
-There is also a routine to draw a line along the diagonal of a box (to
-draw a horizontal line set @code{h} to 1, not to 0):
+There is also a macro for drawing a line along the diagonal of a box
+(to draw a horizontal line set @code{h} to 1, not to 0):
@findex fl_diagline()
@anchor{fl_diagline()}
@example
diff --git a/doc/xforms.texi b/doc/xforms.texi
index 5f476e5..07c9482 100644
--- a/doc/xforms.texi
+++ b/doc/xforms.texi
@@ -2,7 +2,7 @@
@setfilename xforms.info
@settitle XForms (Forms Library) - Version 1.2@*A Graphical User Interface Toolkit for X
-@set lastupdate May 5, 2014
+@set lastupdate May 8, 2014
@paragraphindent 0
@titlepage
diff --git a/lib/include/XBasic.h b/lib/include/XBasic.h
index da5a6c6..2013ef3 100644
--- a/lib/include/XBasic.h
+++ b/lib/include/XBasic.h
@@ -250,8 +250,12 @@ FL_EXPORT void fl_dashedlinestyle( const char * dash,
FL_EXPORT void fl_update_display( int block );
-#define fl_diagline( x, y, w, h, c ) \
- fl_line( x, y, ( x ) + ( w ) - 1, ( y ) + ( h ) - 1, c )
+#define fl_diagline( x, y, w, h, c ) \
+ do \
+ { \
+ FL_COORD fli_x = ( x ), fli_y = ( y ); \
+ fl_line( fli_x, fli_y, fli_x + ( w ) - 1, fli_y + ( h ) - 1, ( c ) ); \
+ } while ( 0 )
/* Line attributes */
@@ -461,15 +465,15 @@ FL_EXPORT void fl_wintitle( Window win,
const char * title );
FL_EXPORT void fl_wintitle_f( Window win,
- const char * fmt,
- ... );
+ const char * fmt,
+ ... );
FL_EXPORT void fl_winicontitle( Window win,
const char * title );
FL_EXPORT void fl_winicontitle_f( Window win,
- const char * fmt,
- ... );
+ const char * fmt,
+ ... );
FL_EXPORT void fl_winposition( FL_Coord x,
FL_Coord y );
@@ -872,3 +876,11 @@ typedef struct {
#define FL_RGB2PIXEL FL_RGB2PIXEL_
#endif /* ! defined FL_XBASIC_H */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/lib/pixmap.c b/lib/pixmap.c
index 5c963ef..a10c304 100644
--- a/lib/pixmap.c
+++ b/lib/pixmap.c
@@ -216,6 +216,7 @@ show_pixmap( FL_OBJECT * obj,
int bits_w,
bits_h,
is_focus = focus && sp->focus_pixmap && psp->show_focus;
+ int bw = obj->boxtype != FL_NO_BOX ? FL_abs( obj->bw ) : 0;
pixmap = is_focus ? sp->focus_pixmap : sp->pixmap;
mask = is_focus ? sp->focus_mask : sp->mask;
@@ -231,10 +232,10 @@ show_pixmap( FL_OBJECT * obj,
return;
}
- m_dest_x = dest_x = obj->x + FL_abs( obj->bw ) + psp->dx;
- m_dest_y = dest_y = obj->y + FL_abs( obj->bw ) + psp->dy;
- dest_w = obj->w - 2 * FL_abs( obj->bw ) - 2 * psp->dx;
- dest_h = obj->h - 2 * FL_abs( obj->bw ) - 2 * psp->dy;
+ m_dest_x = dest_x = obj->x + bw + psp->dx;
+ m_dest_y = dest_y = obj->y + bw + psp->dy;
+ dest_w = obj->w - 2 * bw - 2 * psp->dx;
+ dest_h = obj->h - 2 * bw - 2 * psp->dy;
src_x = 0;
src_y = 0;
@@ -319,14 +320,13 @@ show_pixmap( FL_OBJECT * obj,
}
}
- /* hopefully, XSetClipMask is smart */
+ /* Hopefully, XSetClipMask is smart */
XSetClipMask( flx->display, psp->gc, mask );
XSetClipOrigin( flx->display, psp->gc, m_dest_x, m_dest_y );
XCopyArea( flx->display, pixmap, FL_ObjWin( obj ),
psp->gc, src_x, src_y, dest_w, dest_h, dest_x, dest_y );
-
}
@@ -392,7 +392,6 @@ draw_pixmap( FL_OBJECT * obj )
fl_drw_box( obj->boxtype, obj->x, obj->y, obj->w, obj->h,
obj->col2, obj->bw );
-
show_pixmap( obj, 0 );
}
diff --git a/lib/spinner.c b/lib/spinner.c
index 39e620f..d06c3af 100644
--- a/lib/spinner.c
+++ b/lib/spinner.c
@@ -169,8 +169,7 @@ spinner_callback( FL_OBJECT * obj,
int max_len = 4 + sp->prec + log10( DBL_MAX );
char *buf = NULL;
- /* Don't react to editing the input field unless user ended interaction
- with input field */
+ /* Don't react to editing the input field unless user ended interaction */
if ( data == 0 && ! ( obj->returned & FL_RETURN_END ) )
return;
@@ -238,7 +237,7 @@ spinner_callback( FL_OBJECT * obj,
}
else
{
- int old_f_val = sp->f_val;
+ double old_f_val = sp->f_val;
if ( data == 0 )
{
diff --git a/lib/xyplot.c b/lib/xyplot.c
index 05be23b..c63a2a9 100644
--- a/lib/xyplot.c
+++ b/lib/xyplot.c
@@ -1792,11 +1792,8 @@ find_data( FL_OBJECT * ob,
int dy = 0; /* same here */
FL_POINT *p = sp->xpactive;
- if ( draw_to_pixmap )
- {
- mx -= ob->x;
- my -= ob->y;
- }
+ mx -= ob->x;
+ my -= ob->y;
for ( i = found = 0; i < *sp->n && ! found; i++ )
{
@@ -1854,7 +1851,7 @@ handle_mouse( FL_OBJECT * ob,
float ymin = FL_min( sp->ymin, sp->ymax ),
ymax = FL_max( sp->ymax, sp->ymin );
- if ( *sp->n == 0 || ! sp->x || ! ( sp->active || sp->inspect ) )
+ if ( sp->n[ 0 ] == 0 || ! sp->x || ! ( sp->active || sp->inspect ) )
return FL_RETURN_NONE;
if ( lmx == mx && lmy == my )
generated by cgit v1.2.3 (git 2.39.1) at 2025年11月25日 16:18:34 +0000

AltStyle によって変換されたページ (->オリジナル) /