needed wxTextValidator

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
meirs
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Jul 09, 2008 1:59 am

needed wxTextValidator

Post by meirs » Fri Jul 25, 2008 4:45 am

Hi,

Is it possible to set the validator on wxSpinCtrl. We can directly
input anything in spincontrol text area, so if we can set the
validator, user wont be able to enter directly unwanted characters. I
want the spinctrl to accept only numbers and nothing else.

Thanks in advance.

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Sun Jul 27, 2008 1:14 pm

It looks to me that you have to capture the EVT_TEXT and do the filtering manually.


But I think that the GetValue, will automatically provide you the right value like "100ADD" would be returned as "100" only.

Post Reply