[Plib-cvs] plib/src/pui Makefile.am,1.18,1.19 pu.h,1.135,1.136 puInput.cxx,1.30,1.31 puLargeInput.cx
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-09-27 23:53:57
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv23161 Modified Files: Makefile.am pu.h puInput.cxx puLargeInput.cxx pui.dsp Log Message: John F. Fay / me: Introduced common baseclass for puInput and puLargeInput Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/src/pui/Makefile.am,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Makefile.am 31 Aug 2002 22:21:21 -0000 1.18 +++ Makefile.am 27 Sep 2002 23:53:52 -0000 1.19 @@ -13,7 +13,7 @@ puValue.cxx puFont.cxx puBiSlider.cxx puTriSlider.cxx \ puDial.cxx puVerticalMenu.cxx puLargeInput.cxx \ puFileSelector.cxx puComboBox.cxx puSelectBox.cxx puRange.cxx \ - puSpinBox.cxx puScrollBar.cxx + puSpinBox.cxx puScrollBar.cxx puInputBase.cxx INCLUDES = -I$(top_srcdir)/src/sg -I$(top_srcdir)/src/fnt INCLUDES += -I$(top_srcdir)/src/util Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 --- pu.h 24 Sep 2002 22:18:07 -0000 1.135 +++ pu.h 27 Sep 2002 23:53:52 -0000 1.136 @@ -669,20 +669,20 @@ void setCallback ( puCallback c ) { cb = c ; } puCallback getCallback ( void ) const { return cb ; } - void invokeCallback ( void ) { if ( cb ) (*cb)(this) ; } + void invokeCallback ( void ) { if ( cb != NULL ) (*cb)(this) ; } void setActiveCallback ( puCallback c ) { active_cb = c ; } puCallback getActiveCallback ( void ) const { return active_cb ; } - void invokeActiveCallback ( void ) { if ( active_cb ) (*active_cb)(this) ; } + void invokeActiveCallback ( void ) { if ( active_cb != NULL ) (*active_cb)(this) ; } [...204 lines suppressed...] - if ( valid_data != NULL ) - return ( strchr ( valid_data, c ) != NULL ) ? 1 : 0 ; - else - return 1 ; - } - void invokeDownCallback ( void ) { rejectInput () ; - normalize_cursors () ; + normalizeCursors () ; if ( down_cb != NULL ) (*down_cb)(this) ; } - - void enableInput ( void ) { input_disabled = FALSE ; } - void disableInput ( void ) { input_disabled = TRUE ; } - int inputDisabled ( void ) const { return input_disabled ; } void setValue ( const char *s ) ; void setText ( const char *l ) { setValue ( l ) ; } /* DEPRECATED */ Index: puInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puInput.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- puInput.cxx 24 Sep 2002 22:18:07 -0000 1.30 +++ puInput.cxx 27 Sep 2002 23:53:52 -0000 1.31 @@ -24,45 +24,7 @@ #include "puLocal.h" -UL_RTTI_DEF1(puInput,puObject) - - -void puInput::normalize_cursors ( void ) -{ - int sl = strlen ( getStringValue () ) ; - - /* Clamp the positions to the limits of the text. */ [...98 lines suppressed...] - - -puInput::puInput ( int minx, int miny, int maxx, int maxy ) : - puObject ( minx, miny, maxx, maxy ) -{ - type |= PUCLASS_INPUT ; - - accepting = FALSE ; - - cursor_position = 0 ; - select_start_position = -1 ; - select_end_position = -1 ; - - valid_data = NULL ; - input_disabled = FALSE ; - - setColourScheme ( 0.8f, 0.7f, 0.7f ) ; /* Yeukky Pink */ - setColour ( PUCOL_MISC, 0.1f, 0.1f, 1.0f ) ; /* Colour of 'I' bar cursor */ -} Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- puLargeInput.cxx 25 Sep 2002 19:44:30 -0000 1.44 +++ puLargeInput.cxx 27 Sep 2002 23:53:53 -0000 1.45 @@ -24,12 +24,12 @@ #include "puLocal.h" -UL_RTTI_DEF1(puLargeInput,puGroup) +UL_RTTI_DEF2(puLargeInput,puInputBase,puGroup) // Callbacks from the internal widgets -static void puLargeInputHandleRightSlider ( puObject * slider ) +static void puLargeInputHandleRightSlider ( puObject *slider ) [...154 lines suppressed...] } -void puLargeInput::addValidData ( const char *data ) -{ - int valid_len = valid_data != NULL ? strlen ( valid_data ) : 0 ; - int data_len = data != NULL ? strlen ( data ) : 0 ; - int new_data_len = valid_len + data_len ; - - char *new_data = new char [ new_data_len + 1 ] ; - - if ( valid_len != 0 ) - memcpy ( new_data, valid_data, valid_len ) ; - if ( data_len != 0 ) - memcpy ( new_data + valid_len, data, data_len ) ; - - new_data [ new_data_len ] = '\0' ; - delete [] valid_data ; - valid_data = new_data ; -} Index: pui.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pui.dsp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- pui.dsp 1 Sep 2002 02:51:42 -0000 1.23 +++ pui.dsp 27 Sep 2002 23:53:53 -0000 1.24 @@ -154,6 +154,10 @@ # End Source File # Begin Source File +SOURCE=.\puInputBase.cxx +# End Source File +# Begin Source File + SOURCE=.\puInput.cxx # End Source File # Begin Source File |