NumberPresenter.Integer text view

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

NumberPresenter.Integer text view

Sean M-3
When a TextEdit view is has its isNumeric Aspect set to true, and you
attempt to type in non-numeric characters, you get a popup-helper which says
"Unacceptable Character You can only type a number here."

Where is that implemented? I can't seem to find it anywhere... If I halt in
TextEdit>>wmKeyDown:wParam:lParam: the popup still appears... Seems tricky,
but I'm sure it's not, and I'm just missing the obvious

I'm asking for multiple reasons:

a) I'd like to understand it
b) I'd like to change it

Anyone attempted this?


Reply | Threaded
Open this post in threaded view
|

Re: NumberPresenter.Integer text view

hboon@motionobj.com
Sean M wrote:
> Where is that implemented? I can't seem to find it anywhere... If I halt in
> TextEdit>>wmKeyDown:wParam:lParam: the popup still appears... Seems tricky,
> but I'm sure it's not, and I'm just missing the obvious

Check out TextEdit>>isNumeric:. Its implemented by setting a style on
the windows control directly. If you need a more robust validation
scheme, it might not be appropriate. It doesn't allow a period (.)
character and allows copy and paste of non-numeric chars for eg.

--
HweeBoon


Reply | Threaded
Open this post in threaded view
|

Re: NumberPresenter.Integer text view

Sean M-3
> Check out TextEdit>>isNumeric:. Its implemented by setting a style on
> the windows control directly. If you need a more robust validation
> scheme, it might not be appropriate. It doesn't allow a period (.)
> character and allows copy and paste of non-numeric chars for eg.

Yep, I realise that isNumeric: gets se.. Thats one of the aspects that gets
published to the View composer..

What I wanted to know, is where the little popup error that gets displayed
when you type invalid characters into the box defined? Is it built into
windows, or built into dolphin?


Reply | Threaded
Open this post in threaded view
|

Re: NumberPresenter.Integer text view

Chris Uppal-3
Sean M wrote:

> What I wanted to know, is where the little popup error that gets displayed
> when you type invalid characters into the box defined? Is it built into
> windows, or built into dolphin?

I'm virtually certain that it's a Windows thing -- controlled by the ES_NUMBER
style.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: NumberPresenter.Integer text view

Sean M-4
> I'm virtually certain that it's a Windows thing -- controlled by the
> ES_NUMBER
> style.

Thanks Chris, mentioning the style constant put me on the right track..

I managed to make a NumericTextBox in C#, which resulted in the same popup
window, the hunt is over. I'm not sure why it isn't included by default in
the Windows.Forms components.. Which is why I thought it must be built into
Dolphin!

Thanks!