Update of /cvsroot/plib/plib/src/pui
In directory usw-pr-cvs1:/tmp/cvs-serv32174/pui
Modified Files:
pu.h puObject.cxx
Log Message:
Fixed calculation of legend place with PUSTYLE_SPECIAL_UNDERLINED; Cleanups
Index: pu.h
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/pu.h,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- pu.h 16 Jan 2002 17:56:43 -0000 1.94
+++ pu.h 28 Feb 2002 20:54:10 -0000 1.95
@@ -714,16 +714,24 @@
{
style = which ;
- if ( abs(style) == PUSTYLE_SPECIAL_UNDERLINED )
- border_thickness = 1 ;
- else if ( ( abs(style) == PUSTYLE_SMALL_BEVELLED ) ||
- ( abs(style) == PUSTYLE_SMALL_SHADED ) ||
- ( abs(style) == PUSTYLE_BOXED ) )
- border_thickness = 2 ;
- else if ( ( abs(style) == PUSTYLE_BEVELLED ) ||
- ( abs(style) == PUSTYLE_SHADED ) ||
- ( abs(style) == PUSTYLE_DROPSHADOW ) )
- border_thickness = 5 ;
+ switch ( abs(style) )
+ {
+ case PUSTYLE_SPECIAL_UNDERLINED :
+ border_thickness = 1 ;
+ break ;
+
+ case PUSTYLE_SMALL_BEVELLED :
+ case PUSTYLE_SMALL_SHADED :
+ case PUSTYLE_BOXED :
+ border_thickness = 2 ;
+ break ;
+
+ case PUSTYLE_BEVELLED :
+ case PUSTYLE_SHADED :
+ case PUSTYLE_DROPSHADOW :
+ border_thickness = 5 ;
+ break ;
+ }
recalc_bbox () ;
puPostRefresh () ;
Index: puObject.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- puObject.cxx 27 Feb 2002 02:58:34 -0000 1.37
+++ puObject.cxx 28 Feb 2002 20:54:10 -0000 1.38
@@ -76,20 +76,28 @@
static puFont defaultLabelFont ;
static float defaultColourScheme [ 4 ] ;
-void puSetDefaultStyle ( int style )
+void puSetDefaultStyle ( int style )
{
defaultStyle = style ;
- if ( abs(style) == PUSTYLE_SPECIAL_UNDERLINED )
- defaultBorderThickness = 1 ;
- else if ( ( abs(style) == PUSTYLE_SMALL_BEVELLED ) ||
- ( abs(style) == PUSTYLE_SMALL_SHADED ) ||
- ( abs(style) == PUSTYLE_BOXED ) )
- defaultBorderThickness = 2 ;
- else if ( ( abs(style) == PUSTYLE_BEVELLED ) ||
- ( abs(style) == PUSTYLE_SHADED ) ||
- ( abs(style) == PUSTYLE_DROPSHADOW ) )
- defaultBorderThickness = 5 ;
+ switch ( abs(style) )
+ {
+ case PUSTYLE_SPECIAL_UNDERLINED :
+ defaultBorderThickness = 1 ;
+ break ;
+
+ case PUSTYLE_SMALL_BEVELLED :
+ case PUSTYLE_SMALL_SHADED :
+ case PUSTYLE_BOXED :
+ defaultBorderThickness = 2 ;
+ break ;
+
+ case PUSTYLE_BEVELLED :
+ case PUSTYLE_SHADED :
+ case PUSTYLE_DROPSHADOW :
+ defaultBorderThickness = 5 ;
+ break ;
+ }
}
int puGetDefaultStyle ( void ) { return defaultStyle ; }
@@ -259,22 +267,23 @@
void puObject::draw_legend ( int dx, int dy )
{
- if ( getStyle () == PUSTYLE_RADIO ) return ;
-
int xx, yy ;
int lgap = PUSTR_LGAP ;
int rgap = PUSTR_RGAP ;
int tgap = PUSTR_TGAP ;
int bgap = PUSTR_BGAP ;
+
if ( ( abs(style) != PUSTYLE_NONE ) &&
( abs(style) != PUSTYLE_PLAIN ) &&
- ( abs(style) != PUSTYLE_DROPSHADOW ) &&
- ( abs(style) != PUSTYLE_SPECIAL_UNDERLINED ) )
+ ( abs(style) != PUSTYLE_DROPSHADOW ) )
{
- lgap += getBorderThickness () ;
- rgap += getBorderThickness () ;
- tgap += getBorderThickness () ;
+ if ( abs(style) != PUSTYLE_SPECIAL_UNDERLINED )
+ {
+ lgap += getBorderThickness () ;
+ rgap += getBorderThickness () ;
+ tgap += getBorderThickness () ;
+ }
bgap += getBorderThickness () ;
}
|