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年03月28日 17:46:06 +0100
committerJens Thoms Toerring <jt@toerring.de>2014年03月28日 17:46:06 +0100
commit9f19c52795957e5759543420b4756ff32f720c69 (patch)
tree9d3c7e3a5eaf93ef3fbdb7c23675d8bd2c35cd82
parent9806bce102d0c079c2c486b25ae6bdac3c98eecf (diff)
downloadxforms-9f19c52795957e5759543420b4756ff32f720c69.tar.gz
Corrections for label alignment
Diffstat
-rw-r--r--ChangeLog 4
-rw-r--r--configure.ac 2
-rw-r--r--fdesign/fd_attribs.c 20
-rw-r--r--lib/canvas.c 4
-rw-r--r--lib/clock.c 5
-rw-r--r--lib/counter.c 4
-rw-r--r--lib/dial.c 4
-rw-r--r--lib/frame.c 13
-rw-r--r--lib/input.c 6
-rw-r--r--lib/lframe.c 12
-rw-r--r--lib/menu.c 4
-rw-r--r--lib/positioner.c 4
-rw-r--r--lib/scrollbar.c 1
-rw-r--r--lib/spinner.c 1
-rw-r--r--lib/thumbwheel.c 4
-rw-r--r--lib/timer.c 17
-rw-r--r--lib/xtext.c 2
17 files changed, 77 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index 0af08cb..a8e4e44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014年03月27日 Jens Thoms Toerring <jt@toerring.de>
+
+ * Some minor fixes for object label alignment
+
2014年03月25日 Jens Thoms Toerring <jt@toerring.de>
* */Makefile.am: Removed '-Wl,--no-undefined' since
diff --git a/configure.ac b/configure.ac
index e661ef6..f439608 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.4],[xforms-development@nongnu.org])
+AC_INIT([xforms],[1.3.5],[xforms-development@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(lib/forms.c)
XFORMS_CHECK_VERSION
diff --git a/fdesign/fd_attribs.c b/fdesign/fd_attribs.c
index 5fe90d8..e7d6b83 100644
--- a/fdesign/fd_attribs.c
+++ b/fdesign/fd_attribs.c
@@ -454,17 +454,17 @@ show_attributes( const FL_OBJECT * obj )
/* Fill in settings */
- /* a. boxtype */
+ /* a) boxtype */
fl_set_choice( fd_generic_attrib->boxobj, obj->boxtype + 1 );
- /* b. label alignment */
+ /* b) label alignment */
fl_set_choice_text( fd_generic_attrib->align, align_name( align, 0 ) + 9 );
fl_set_choice( fd_generic_attrib->inside,
fl_is_outside_lalign( obj->align ) + 1 );
- /* c. label font and style */
+ /* c) label font and style */
lstyle = obj->lstyle % FL_SHADOW_STYLE;
spstyle = obj->lstyle / FL_SHADOW_STYLE;
@@ -475,7 +475,7 @@ show_attributes( const FL_OBJECT * obj )
fl_set_choice( fd_generic_attrib->fontobj, lstyle + 1 );
fl_set_choice( fd_generic_attrib->styleobj, spstyle + 1 );
- /* d. label font size */
+ /* d) label font size */
for ( oksize = i = 0; ! oksize && i < ( int ) NFSIZE; i++ )
if ( ( oksize = ( obj->lsize == fsizes[ i ].size ) ) )
@@ -490,25 +490,25 @@ show_attributes( const FL_OBJECT * obj )
fl_set_choice( fd_generic_attrib->sizeobj, NFSIZE );
}
- /* e. gravity settings */
+ /* e) gravity settings */
fl_set_choice_text( fd_generic_attrib->nwgravity,
gravity_name( obj->nwgravity ) + 3 );
fl_set_choice_text( fd_generic_attrib->segravity,
gravity_name( obj->segravity ) + 3 );
- /* f. resize behaviour */
+ /* f) resize behaviour */
fl_set_choice_text( fd_generic_attrib->resize,
resize_name( obj->resize ) + 3 );
- /* g. Label string */
+ /* g) Label string */
label = get_label( obj, 0 );
fl_set_input( fd_generic_attrib->labelobj, label );
fl_free( label );
- /* h. name, callback function name and argument */
+ /* h) name, callback function name and argument */
get_object_name( obj, objname, cbname, argname );
@@ -516,11 +516,11 @@ show_attributes( const FL_OBJECT * obj )
fl_set_input( fd_generic_attrib->cbnameobj, cbname );
fl_set_input( fd_generic_attrib->argobj, argname );
- /* h. shortcut */
+ /* h) shortcut */
fl_set_input( fd_generic_attrib->scobj, get_shortcut_string( obj ) );
- /* i. object and label colors */
+ /* i) object and label colors */
fl_set_object_color( fd_generic_attrib->col1obj, obj->col1, obj->col1 );
fl_set_object_color( fd_generic_attrib->col2obj, obj->col2, obj->col2 );
diff --git a/lib/canvas.c b/lib/canvas.c
index 299580f..7d14d79 100644
--- a/lib/canvas.c
+++ b/lib/canvas.c
@@ -522,6 +522,10 @@ handle_canvas( FL_OBJECT * ob,
switch ( event )
{
+ case FL_ATTRIB :
+ ob->align = fl_to_outside_lalign( ob->align );
+ break;
+
case FL_DRAW:
if ( ob->col1 != FL_NoColor )
sp->xswa.background_pixel = fl_get_pixel( ob->col1 );
diff --git a/lib/clock.c b/lib/clock.c
index 1db86e8..b5f6b74 100644
--- a/lib/clock.c
+++ b/lib/clock.c
@@ -229,6 +229,11 @@ handle_clock( FL_OBJECT * ob,
switch ( event )
{
+ case FL_ATTRIB :
+ if ( ob->align & ~ FL_ALIGN_INSIDE )
+ ob->align = fl_to_outside_lalign( ob->align );
+ break;
+
case FL_DRAW :
fl_drw_box( ob->boxtype, ob->x, ob->y, ob->w, ob->h,
ob->col1, ob->bw );
diff --git a/lib/counter.c b/lib/counter.c
index 2fa275d..501b7a1 100644
--- a/lib/counter.c
+++ b/lib/counter.c
@@ -453,6 +453,10 @@ handle_counter( FL_OBJECT * ob,
switch ( event )
{
+ case FL_ATTRIB :
+ ob->align = fl_to_outside_lalign( ob->align );
+ break;
+
case FL_DRAW:
draw_counter( ob );
break;
diff --git a/lib/dial.c b/lib/dial.c
index 6ea8279..00438b5 100644
--- a/lib/dial.c
+++ b/lib/dial.c
@@ -341,6 +341,10 @@ handle_dial( FL_OBJECT * obj,
switch ( event )
{
+ case FL_ATTRIB :
+ obj->align = fl_to_outside_lalign( obj->align );
+ break;
+
case FL_DRAW:
draw_dial( obj );
break;
diff --git a/lib/frame.c b/lib/frame.c
index 62528d3..e2932ed 100644
--- a/lib/frame.c
+++ b/lib/frame.c
@@ -45,17 +45,18 @@ handle_frame( FL_OBJECT * ob,
{
switch ( event )
{
+ case FL_ATTRIB :
+ ob->align = fl_to_inside_lalign( ob->align );
+ break;
+
case FL_DRAW:
fl_drw_frame( ob->type, ob->x, ob->y, ob->w, ob->h,
ob->col1, ob->bw );
- fl_drw_text( ob->align, ob->x, ob->y, ob->w, ob->h,
- ob->lcol, ob->lstyle, ob->lsize, ob->label );
- break;
+ /* fall through */
case FL_DRAWLABEL:
- if ( ! fl_is_center_lalign( ob->align ) )
- fl_drw_text( ob->align, ob->x, ob->y, ob->w, ob->h,
- ob->lcol, ob->lstyle, ob->lsize, ob->label );
+ fl_drw_text( ob->align, ob->x, ob->y, ob->w, ob->h,
+ ob->lcol, ob->lstyle, ob->lsize, ob->label );
break;
}
diff --git a/lib/input.c b/lib/input.c
index 42474d1..98c39c6 100644
--- a/lib/input.c
+++ b/lib/input.c
@@ -1451,10 +1451,8 @@ handle_input( FL_OBJECT * obj,
switch ( event )
{
case FL_ATTRIB :
- if ( ! ( obj->align & ~ FL_ALIGN_INSIDE ) )
- obj->align = FL_ALIGN_LEFT;
- else
- obj->align = fl_to_outside_lalign( obj->align );
+ obj->align = fl_to_outside_lalign( obj->align );
+ break;
case FL_RESIZED :
check_scrollbar_size( obj );
diff --git a/lib/lframe.c b/lib/lframe.c
index e324289..1828574 100644
--- a/lib/lframe.c
+++ b/lib/lframe.c
@@ -57,6 +57,18 @@ handle_lframe( FL_OBJECT * ob,
switch ( event )
{
+ case FL_ATTRIB :
+ if ( ! ( ob->align & ~ FL_ALIGN_INSIDE ) )
+ ob->align = FL_ALIGN_TOP;
+ else
+ ob->align = fl_to_outside_lalign( ob->align );
+
+ if ( ob->align == FL_ALIGN_RIGHT )
+ ob->align = FL_ALIGN_RIGHT_TOP;
+ if ( ob->align == FL_ALIGN_LEFT )
+ ob->align = FL_ALIGN_LEFT_TOP;
+ break;
+
case FL_DRAW :
fl_drw_frame( ob->type, ob->x, ob->y, ob->w, ob->h,
ob->col1, ob->bw );
diff --git a/lib/menu.c b/lib/menu.c
index a35b273..2d39897 100644
--- a/lib/menu.c
+++ b/lib/menu.c
@@ -246,6 +246,10 @@ handle_menu( FL_OBJECT * ob,
switch ( event )
{
+ case FL_ATTRIB :
+ ob->align = fl_to_inside_lalign( ob->align );
+ break;
+
case FL_DRAW:
/* Draw the object */
diff --git a/lib/positioner.c b/lib/positioner.c
index 6bd5e2b..a924282 100644
--- a/lib/positioner.c
+++ b/lib/positioner.c
@@ -174,6 +174,10 @@ handle_positioner( FL_OBJECT * obj,
switch ( event )
{
+ case FL_ATTRIB :
+ obj->align = fl_to_outside_lalign( obj->align );
+ break;
+
case FL_DRAW:
if ( obj->type != FL_INVISIBLE_POSITIONER )
draw_positioner( obj );
diff --git a/lib/scrollbar.c b/lib/scrollbar.c
index 1d7b7de..f9268a7 100644
--- a/lib/scrollbar.c
+++ b/lib/scrollbar.c
@@ -62,6 +62,7 @@ handle_scrollbar( FL_OBJECT * obj,
{
case FL_ATTRIB :
case FL_RESIZED :
+ obj->align = fl_to_outside_lalign( obj->align );
attrib_change( obj );
get_geom( obj );
break;
diff --git a/lib/spinner.c b/lib/spinner.c
index 6c51b9e..39e620f 100644
--- a/lib/spinner.c
+++ b/lib/spinner.c
@@ -128,6 +128,7 @@ handle_spinner( FL_OBJECT * obj,
{
case FL_ATTRIB :
case FL_RESIZED :
+ obj->align = fl_to_outside_lalign( obj->align );
sp->attrib = 1;
break;
diff --git a/lib/thumbwheel.c b/lib/thumbwheel.c
index a7cad2e..b82337e 100644
--- a/lib/thumbwheel.c
+++ b/lib/thumbwheel.c
@@ -239,6 +239,10 @@ handle_thumbwheel( FL_OBJECT * ob,
switch ( ev )
{
+ case FL_ATTRIB :
+ ob->align = fl_to_outside_lalign( ob->align );
+ break;
+
case FL_DRAW:
draw( ob );
sp->draw_type = COMPLETE_DRAW;
diff --git a/lib/timer.c b/lib/timer.c
index d672bd2..dd963d9 100644
--- a/lib/timer.c
+++ b/lib/timer.c
@@ -140,12 +140,7 @@ handle_timer( FL_OBJECT * ob,
{
case FL_ATTRIB :
if ( ob->type == FL_VALUE_TIMER )
- {
- if ( fl_is_center_lalign( ob->align ) )
- ob->align = FL_ALIGN_LEFT;
- else
- ob->align = fl_to_outside_lalign( ob->align );
- }
+ ob->align = fl_to_outside_lalign( ob->align );
break;
case FL_DRAW:
@@ -153,11 +148,17 @@ handle_timer( FL_OBJECT * ob,
/* fall through */
case FL_DRAWLABEL:
- if ( ob->type != FL_HIDDEN_TIMER
- && ! ( ob->type == FL_VALUE_TIMER && update_only ) )
+ if ( ob->type == FL_HIDDEN_TIMER
+ || ( ob->type == FL_VALUE_TIMER && update_only ) )
+ break;
+ if ( fl_is_outside_lalign( ob->align ) )
fl_drw_text_beside( ob->align, ob->x, ob->y, ob->w, ob->h,
ob->lcol, ob->lstyle, ob->lsize,
ob->label );
+ else
+ fl_drw_text( ob->align, ob->x, ob->y, ob->w, ob->h,
+ ob->lcol, ob->lstyle, ob->lsize,
+ ob->label );
break;
case FL_RELEASE:
diff --git a/lib/xtext.c b/lib/xtext.c
index 3c5f1cc..85f9fa2 100644
--- a/lib/xtext.c
+++ b/lib/xtext.c
@@ -118,7 +118,7 @@ typedef int ( * DrawString )( Display *,
* this is also handled. Finally, parts of the text can be shown as selected.
*
* Arguments:
- * align: Alignmnet of the text relative to the box
+ * align: Alignment of the text relative to the box
* x, ym w, h: postion and size of box
* clip: 0 = no clipping is to be used at all
* 1 = clipping is to be done by this function
generated by cgit v1.2.3 (git 2.25.1) at 2025年11月24日 19:12:55 +0000

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