[Plib-cvs] plib/src/pui pu.h,1.152,1.153 puLargeInput.cxx,1.51,1.52
Brought to you by:
sjbaker
From: John F. F. <fa...@us...> - 2006-03-20 15:17:39
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8652 Modified Files: pu.h puLargeInput.cxx Log Message: Moving the "wrapped_text" field into "puInputBase" and changing its name to "displayed_text" in preparation for adding it to "puInput" as well Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- pu.h 10 Nov 2005 20:21:22 -0000 1.152 +++ pu.h 20 Mar 2006 15:17:35 -0000 1.153 @@ -1547,6 +1547,8 @@ char *valid_data ; int input_disabled ; + char *displayed_text ; // Pointer to text as it is displayed in the box (chopped or word-wrapped) + puObject *widget ; /* Pointer to associated input box widget */ virtual void normalizeCursors ( void ) ; @@ -1608,13 +1610,14 @@ select_start_position = -1 ; select_end_position = -1 ; valid_data = NULL; + displayed_text = NULL ; widget = (puObject *)NULL ; input_disabled = FALSE ; } - virtual ~puInputBase () { delete [] valid_data ; } + virtual ~puInputBase () { delete [] valid_data ; delete [] displayed_text ; } } ; @@ -1927,8 +1930,6 @@ puSlider *bottom_slider ; // Horizontal slider at bottom of window puScrollBar *right_slider ; // Vertical slider at right of window - char *wrapped_text ; // Pointer to word-wrapped text in the box - int arrow_count ; // Number of up/down arrows above and below the right slider void normalizeCursors ( void ) ; @@ -1940,8 +1941,6 @@ puLargeInput ( int x, int y, int w, int h, int arrows, int sl_width, int wrap_text = FALSE ) ; ~puLargeInput () { - delete [] wrapped_text ; - if ( puActiveWidget() == this ) puDeactivateWidget () ; } @@ -1970,14 +1969,17 @@ void setValue ( const char *s ) ; void setText ( const char *l ) { setValue ( l ) ; } /* DEPRECATED */ char *getText ( void ) { return getStringValue () ; } /* DEPRECATED */ - char *getWrappedText ( void ) - { - return ( wrapped_text == NULL ? getStringValue () : wrapped_text ) ; - } void addNewLine ( const char *l ) ; void addText ( const char *l ) ; void appendText ( const char *l ) ; void removeText ( int start, int end ) ; + + char *getDisplayedText ( void ) + { + return ( displayed_text == NULL ? getStringValue () : displayed_text ) ; + } + char *getWrappedText ( void ) // THIS FUNCTION IS DEPRECATED 3/21/06 + { return getDisplayedText () ; } } ; //************************************************************************************ //* THIS CLASS IS DEPRECATED 1/26/04 -- please link to "puAux" and use puaLargeInput * Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- puLargeInput.cxx 5 Jan 2006 21:01:45 -0000 1.51 +++ puLargeInput.cxx 20 Mar 2006 15:17:35 -0000 1.52 @@ -107,7 +107,6 @@ right_slider->setUserData ( this ) ; right_slider->setCallback ( puLargeInputHandleRightSlider ) ; - wrapped_text = NULL ; setValue ( "\n" ) ; close () ; @@ -145,7 +144,7 @@ { select_start_position = s ; select_end_position = e ; [...117 lines suppressed...] { - wrapped_text_wp += strlen (wrapped_text_wp) ; + displayed_text_wp += strlen (displayed_text_wp) ; if ( space_ptr != NULL ) /* Advance past the NULL since there's more string left */ - wrapped_text_wp += 1 ; + displayed_text_wp += 1 ; } else { @@ -1258,7 +1257,7 @@ *space_ptr = ' ' ; *old_space_ptr = '\n' ; - wrapped_text_wp = old_space_ptr + 1 ; + displayed_text_wp = old_space_ptr + 1 ; } } } |