Tomas Bym wrote:
> Hello,
> I would like to implement to my application a widget, that would work
> like a commad line or if know know the AutoCad input line. I think that
> multiline input could work for me, but what I need is to have part of
> the text read only and retrieve only the user input value.

        I think someone was working on a 'terminal' widget.. it was mentioned
        on the list here within the last 3 months I think. Sounds like what you
        want.

        If you wanted to 'roll your own', I'd say use Fl_Text_Editor
        instead, so that you can have scrollbars. (Fl_Multiline_Input
        doesn't have scrollbars)

        Then derive a class from that with your own handle() method
        to manage trapping the keyboard events, so that you can tell
        the user typed stuff from the AutoCad's shell responses.

> exemple:
> select action (D-delete,N-new,C-copy): D
> I need the first part to be readonly and get only the value D when the user 
> click enter.
> Is it possible to achieve this somehow?

        It's a little unclear what the above is showing..
        I'm guessing the "select action (D-delete,N-new,C-copy):" is the 
'prompt'
        from the AutoCad shell, and the 'D' at the end is what the user typed?

        And you want it so that if they type D, then a bunch of backspaces,
        it only clears the 'D', but doesn't clear the prompt? (ie. 'read only')

        I would think you can do this with the above described handle() method,
        but you'd have to manage your own 'input buffer' so that you know when
        the user has backspaced to the beginning of the buffer, and would need
        to prevent further backspaces from reaching the Fl_Text_Editor widget
        so that the user can't backspace over the prompt.

        That'd be some work on your part, since you'd probably also have to deal
        with the user doing copy/pastes (having to trap paste operations to add
        to your separate 'input buffer') and either prevent or handle fancy line
        editing sequences like ^W (word erase), up/down/left/right arrows, 
handling
        tabs, etc. This would be tricky. Probably the easiest thing to do would
        be to trap all keyboard input, and only allow alpha/numeric/whitespace,
        handle backspace yourself, and throw away all other keyboard events
        (like ^W, arrow keys, etc)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to