* [sup-devel] [PATCH] fix textfield truncation
@ 2010-01-22 7:46 Rich Lane
2010-01-22 12:02 ` Eric Sherman
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Rich Lane @ 2010-01-22 7:46 UTC (permalink / raw)
To: sup-devel
Long query strings (for example) are (for some people) silently truncated.
Other people have seen large amounts of whitespace inserted at word boundaries.
These issues are caused by using a multiline text field. This patch uses a
single-line dynamically growable textfield instead. It also disables the
field-blanking misfeature.
---
lib/sup/textfield.rb | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
index 9afeb34..1c19751 100644
--- a/lib/sup/textfield.rb
+++ b/lib/sup/textfield.rb
@@ -33,7 +33,9 @@ class TextField
@w, @y, @x, @width = window, y, x, width
@question = question
@completion_block = block
- @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
+ @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
+ @field.opts_off Ncurses::Form::O_STATIC
+ @field.opts_off Ncurses::Form::O_BLANK
@form = Ncurses::Form.new_form [@field]
@value = default || ''
Ncurses::Form.post_form @form
--
1.6.3.3
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-devel] [PATCH] fix textfield truncation
2010-01-22 7:46 [sup-devel] [PATCH] fix textfield truncation Rich Lane
@ 2010-01-22 12:02 ` Eric Sherman
2010-02-27 7:44 ` Rich Lane
2010-03-01 14:49 ` Christian Dietrich
2 siblings, 0 replies; 5+ messages in thread
From: Eric Sherman @ 2010-01-22 12:02 UTC (permalink / raw)
To: sup-devel
This is awesome, thank you!
Excerpts from Rich Lane's message of Fri Jan 22 02:46:40 -0500 2010:
> Long query strings (for example) are (for some people) silently truncated.
> Other people have seen large amounts of whitespace inserted at word boundaries.
> These issues are caused by using a multiline text field. This patch uses a
> single-line dynamically growable textfield instead. It also disables the
> field-blanking misfeature.
> ---
> lib/sup/textfield.rb | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
> index 9afeb34..1c19751 100644
> --- a/lib/sup/textfield.rb
> +++ b/lib/sup/textfield.rb
> @@ -33,7 +33,9 @@ class TextField
> @w, @y, @x, @width = window, y, x, width
> @question = question
> @completion_block = block
> - @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
> + @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
> + @field.opts_off Ncurses::Form::O_STATIC
> + @field.opts_off Ncurses::Form::O_BLANK
> @form = Ncurses::Form.new_form [@field]
> @value = default || ''
> Ncurses::Form.post_form @form
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-devel] [PATCH] fix textfield truncation
2010-01-22 7:46 [sup-devel] [PATCH] fix textfield truncation Rich Lane
2010-01-22 12:02 ` Eric Sherman
@ 2010-02-27 7:44 ` Rich Lane
2010-03-01 14:49 ` Christian Dietrich
2 siblings, 0 replies; 5+ messages in thread
From: Rich Lane @ 2010-02-27 7:44 UTC (permalink / raw)
To: sup-devel
Applied to master.
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-devel] [PATCH] fix textfield truncation
2010-01-22 7:46 [sup-devel] [PATCH] fix textfield truncation Rich Lane
2010-01-22 12:02 ` Eric Sherman
2010-02-27 7:44 ` Rich Lane
@ 2010-03-01 14:49 ` Christian Dietrich
2010-03-01 14:50 ` Christian Dietrich
2 siblings, 1 reply; 5+ messages in thread
From: Christian Dietrich @ 2010-03-01 14:49 UTC (permalink / raw)
To: sup-devel
[-- Attachment #1.1: Type: text/plain, Size: 1559 bytes --]
Excerpts from Rich Lane's message of Fr Jan 22 08:46:40 +0100 2010:
> Long query strings (for example) are (for some people) silently truncated.
> Other people have seen large amounts of whitespace inserted at word boundaries.
> These issues are caused by using a multiline text field. This patch uses a
> single-line dynamically growable textfield instead. It also disables the
> field-blanking misfeature.
> ---
> lib/sup/textfield.rb | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
> index 9afeb34..1c19751 100644
> --- a/lib/sup/textfield.rb
> +++ b/lib/sup/textfield.rb
> @@ -33,7 +33,9 @@ class TextField
> @w, @y, @x, @width = window, y, x, width
> @question = question
> @completion_block = block
> - @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
> + @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
> + @field.opts_off Ncurses::Form::O_STATIC
> + @field.opts_off Ncurses::Form::O_BLANK
> @form = Ncurses::Form.new_form [@field]
> @value = default || ''
> Ncurses::Form.post_form @form
Breaks sup here, says opts_off isn't a method, using
iU libncurses-ruby1.8 1.2.4-2 ruby Extension for the ncurses C library
from debian sid. What version should i use, in order to make this
work?
greetz didi
--
No documentation is better than bad documentation
-- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-01 14:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-22 7:46 [sup-devel] [PATCH] fix textfield truncation Rich Lane
2010-01-22 12:02 ` Eric Sherman
2010-02-27 7:44 ` Rich Lane
2010-03-01 14:49 ` Christian Dietrich
2010-03-01 14:50 ` Christian Dietrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox