I've added more changes to CPTextField in my fork of Cappuccino.
http://github.com/Me1000/cappuccino/tree/master
I rewrote support for multiline support so that it is implemented a
little cleaner (modeled after the secure text field implementation)
I also fixed a bug in the secure text field in the event manager.
The default behavior for the enter key in any NSTextField in Cocoa is
to select the text. I've made those changes to all textfields too. I
know that's not what you want, but that's how cocoa handle it. But
since you're replacing the CPTextField.j file anyway you might
consider looking at the event handlers in the file and changing them
accordingly.
Feel free to make fixes. For some reason when you hit enter now, it
only actually selects the text of the first CPTextField that gets
focus. I'm not sure what I'm going to do with it yet though. I really
wish we could get this multiline support in the 280north master
branch. Until then, this what we've got to work with. :/
On Jul 28, 12:57 pm, Saikat Chakrabarti <
saik...@gmail.com> wrote:
> I just realized that wasn't very clear - I had been getting around the
> hardcoded return handling by sending a message to a delegate in another case
> where I needed to specially handle the return key.
>
> On Tue, Jul 28, 2009 at 10:56 AM, Saikat Chakrabarti <
saik...@gmail.com>wrote:
>
>
>
> > Hi Randall,
> > I just tried out your patch, and I like the idea, but I don't think it's
> > enough to really get multiline text support working. One problem I am
> > having right now with it is that CPTextField hardcodes the return key to
> > mean text is done being inputted (and it's done in a way that isn't easy to
> > override in a
> > subclass). This makes it impossible to actually add new lines in a multiline input by hitting enter. Did you have a way for getting around this? I've been getting around it by changing
> > the CPTextFieldKeyDownFunction to send a message to a delegate when return
> > is pressed.
>