On 11/01/11 15:12, Mariwan wrote:
> HI,
> this is from the fl_input 1.3.x documentation
> 
> int Fl_Input_::wrap   (               )       const [inline]
> 
> Gets the word wrapping state of the input field.
> 
> Word wrap is only functional with multi-line input fields.
> 
> the last line I think it is wrong. I am working on a project and I use the 
> fl_input. I used the wrap function and it works while my fl_input is normal 
> (not multi-line).
> Please could you check it and if it is correct info, please update the 
> documentation.
> thanks,

        I think perhaps this is an unintended side effect.

        If I create an Fl_Input and make it much larger than
        a single line, and set wrap(1), it does indeed 'wrap'
        if I type enough to hit the right edge, and it moves
        to the next line (even though it's one continuous line),
        but there's a bunch of dead white space at the top
        (it seems the text is centered) and when you go off
        the bottom of the widget, the cursor disappears where
        it can't be seen.

        This could probably be modified so that if the widget
        is larger vertically than a single line, it could disable
        the text centering, so that it hugs the upper left
        (the way Fl_Multiline_Input does). Then perhaps this
        could be a 'supported' feature.

        But you're still screwed if the input fills the entire
        widget; in Fl_Input mode, the cursor goes off the bottom,
        and you can't scroll to it with the up/down arrows or page
        keys (since it's all one line).

        I myself have had the rare need for a "single line input"
        field that word wrapped. (Example: a prompt for a one line
        unix command, where the line might be very long)

        In my case I made a custom widget from Fl_Text_Input
        that enabled wrap, and prevented the user from typing Enter,
        and a modify callback to prevent copy/pasting a crlf'ed line.
        This way scrollbars would appear if the line went off the
        bottom of the widget (which is why I didn't use Fl_Input
        and Fl_Multiline_Input, because they don't support scroll bars)


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to