Re: [Plib-devel] [PATCH] puAuxLargeInput: fix selection bug, make not needed sliders disappear
Brought to you by:
sjbaker
From: Melchior F. <mf...@us...> - 2009-01-20 20:18:45
|
* Fay, John F Dr CTR USAF AFMC 46 SK -- Tuesday 20 January 2009: > As I am making the changes, I find that the default value of the > puAuxLargeInput text is being changed from a "\n" to an empty string. setValue() does this: void puaLargeInput::setValue ( const char *s ) { if (!s || !*s) { puValue::setValue ( "\n" ) ; cursor_position = select_start_position = select_end_position = 0 ; } else { int len = strlen(s); if (s[len - 1] == '\n') { puValue::setValue ( s ) ; } else { char *buf = new char [ len + 2 ] ; strcpy ( buf, s ) ; strcat ( buf, "\n" ) ; puValue::setValue ( buf ) ; delete [] buf ; } } ... so for an empty string, "\n" is set automatically. But this branch also sets the selection variables, which I kept from the old code, and it's a tad faster. So, yes. It's intentional. m. |