Odd paste-behaviour - ctrl-v vs shift-insert

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Odd paste-behaviour - ctrl-v vs shift-insert

talios@gmail.com
I have a Shell with a MultiLineTextEdit which I'm limiting the length of
the input in the model by:

content: anObject
    anObject size <= (160 * maxMessageCount) ifTrue: [content := anObject].
    self calculateCharactersRemaining

When pasting content into this presenter using ctrl-v I see the model
undated, and #refreshContents called on the TextEdit control, yet if I
use shift-insert I see content pasted in, but the model isn't updated,
nor is #refreshContents called.

Does anyone know why there would be a difference in behaviour between
the two keystrokes?  And also - is there a better way to handle setting
a "max length" for the MultiLineTextEdit?


Reply | Threaded
Open this post in threaded view
|

Re: Odd paste-behaviour - ctrl-v vs shift-insert

Udo Schneider
Mark Derricutt wrote:
> Does anyone know why there would be a difference in behaviour between
> the two keystrokes?  And also - is there a better way to handle setting
> a "max length" for the MultiLineTextEdit?

A unqualified "guess": Ctrl+V is handled by Dolphin (or at least
forwarded to Dolphin from the Control) whereas Shift+Insert is
"hardwired" in the control?

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: Odd paste-behaviour - ctrl-v vs shift-insert

talios@gmail.com
In reply to this post by talios@gmail.com
Mark Derricutt wrote:

> And also - is there a better way to handle setting a "max length" for
> the MultiLineTextEdit?

Found TextEdit>>#textLimit: which sounds like it should do the trick,
but calling "MyPresenter view textLimit: 10" in my #createComponents
doesn't seem to do anything, view sits on a DeafObject, mmmm.


Reply | Threaded
Open this post in threaded view
|

Re: Odd paste-behaviour - ctrl-v vs shift-insert

Ian Bartholomew-19
Mark,

> Found TextEdit>>#textLimit: which sounds like it should do the trick, but
> calling "MyPresenter view textLimit: 10" in my #createComponents doesn't
> seem to do anything, view sits on a DeafObject, mmmm.

#createComponents is too early.  Adding an #onViewOpened: method and setting
the text limit there should work.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: Odd paste-behaviour - ctrl-v vs shift-insert

talios@gmail.com
Ian Bartholomew wrote:

>#createComponents is too early.  Adding an #onViewOpened: method and setting
>the text limit there should work.
>  
>
Cool - that works, also seems to "fix" the shift-insert issue I was
having as well ( well, part of it, its limited the text size fine, but
shift-insert doesn't trigger #refreshContents still ).


Reply | Threaded
Open this post in threaded view
|

Re: Odd paste-behaviour - ctrl-v vs shift-insert

talios@gmail.com
In reply to this post by Udo Schneider
Udo Schneider wrote:

> A unqualified "guess": Ctrl+V is handled by Dolphin (or at least
> forwarded to Dolphin from the Control) whereas Shift+Insert is
> "hardwired" in the control?

I'm starting to think you might be right here.  After I switched to
using textLimit: to limit the length of the text I noticed shift-insert
honoured the limit, but still didn't trigger #refreshContents, if I get
some time I'll have to dig deaper into this....