Update of /cvsroot/plib/plib/src/pui
In directory usw-pr-cvs1:/tmp/cvs-serv544
Modified Files:
pu.h puSpinBox.cxx puBiSlider.cxx puTriSlider.cxx
Log Message:
John Fay: Fix linux compile warnings, casting.
Index: pu.h
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/pu.h,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- pu.h 12 Jul 2002 03:23:33 -0000 1.115
+++ pu.h 14 Jul 2002 16:01:31 -0000 1.116
@@ -558,7 +558,7 @@
puPostRefresh () ;
}
- void setValue ( const char *s ) ;
+ virtual void setValue ( const char *s ) ;
void getValue ( int *i ) { re_eval () ; *i = *getIntegerp () ; }
void getValue ( float *f ) { re_eval () ; *f = *getFloaterp () ; }
@@ -1236,8 +1236,8 @@
[...63 lines suppressed...]
recalc_bbox() ;
}
@@ -1715,14 +1716,14 @@
}
puFilePicker ( int x, int y, int arrows,
- const char* dir, const char *title = "Pick a file" ) :
+ const char *dir, const char *title = "Pick a file" ) :
puDialogBox ( x, y )
{
- puFilePickerInit ( x, y, arrows, 220, 170, dir, title ) ;
+ puFilePickerInit ( x, y, 220, 170, arrows, dir, title ) ;
}
puFilePicker ( int x, int y,
- const char* dir, const char *title = "Pick a file" ) :
+ const char *dir, const char *title = "Pick a file" ) :
puDialogBox ( x, y )
{
puFilePickerInit ( x, y, 220, 170, 1, dir, title ) ;
Index: puSpinBox.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puSpinBox.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- puSpinBox.cxx 12 Jul 2002 02:57:19 -0000 1.1
+++ puSpinBox.cxx 14 Jul 2002 16:01:31 -0000 1.2
@@ -37,8 +37,7 @@
{
//input_box->draw ( dx, dy ) ;
- int size = ( inbox_height ) * getArrowHeight() ;
- int scalar = ( inbox_height ) * ( getArrowHeight() - 0.5 );
+ int size = int(inbox_height * getArrowHeight()) ;
int pos_y = dy + abox.min[1] + size / 2 ;
int pos_x = dx ;
if ( getArrowPosition() == 1 ) {
@@ -84,8 +83,7 @@
if ( button == PU_LEFT_BUTTON && updown == PU_UP )
{
- int size = ( inbox_height ) * getArrowHeight() ;
- int scalar = ( inbox_height ) * ( getArrowHeight() - 0.5 );
+ int size = int( inbox_height * getArrowHeight()) ;
if ( ( x < abox.max[0] - size ) && ( getArrowPosition() == 1 ) ||
( x > abox.min[0] + size ) && ( getArrowPosition() == 0 ) )
{/* User clicked in the input box */
Index: puBiSlider.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puBiSlider.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- puBiSlider.cxx 12 Jul 2002 02:57:19 -0000 1.18
+++ puBiSlider.cxx 14 Jul 2002 16:01:31 -0000 1.19
@@ -107,7 +107,7 @@
next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0) ? 1.0f : next_value ;
- float new_value = getMinValue() + ( next_value * ( getMaxValue() - getMinValue() ) + 0.5 ) ;
+ float new_value = getMinValue() + next_value * ( getMaxValue() - getMinValue() ) ;
if ( ( getActiveButton() == 0 ) || ( updown == PU_DOWN ) ) // No currently-active slider, set whichever is closest
{
Index: puTriSlider.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puTriSlider.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- puTriSlider.cxx 12 Jul 2002 02:57:19 -0000 1.19
+++ puTriSlider.cxx 14 Jul 2002 16:01:31 -0000 1.20
@@ -126,7 +126,7 @@
next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0) ? 1.0f : next_value ;
- int new_value = getMinValue() + (int)( next_value * ( getMaxValue() - getMinValue() ) + 0.5 ) ;
+ float new_value = getMinValue() + next_value * ( getMaxValue() - getMinValue() ) ;
if ( getFreezeEnds() ) // Cannot move end sliders, must move middle one
{
|