wxSpinCtrl issue ?

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
Tim
Earned some good credits
Earned some good credits
Posts: 104
Joined: Wed Nov 23, 2005 5:41 pm

wxSpinCtrl issue ?

Post by Tim » Sat Jan 28, 2006 10:32 am

Hi,
I'd like to use wxspinctrl.
I have found 2 issue:

1) there isn't the wxTE_RIGHT (for numeric is a must)
2) spinctr->SetValidator( wxTextValidator(wxFILTER_NUMERIC) ) doesn't work

Has anybody found the same ?

It's by design ?

Tim

Bundy
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Apr 29, 2005 9:46 am
Location: Poland

Post by Bundy » Tue Jan 31, 2006 9:03 am

Yep, this control is very poor when You want to create program that check what user put into field. On windows You can catch EVT_TEXT and in function reacting on event get text by event.GetText() - but this only works on windows.

Unfortunatly it is no function that return string from field, only number, and when user put example "some_text_not_numer" function GetValue() returns 0, so You can't know it is 0, some text or empty field :(

I use normal wxTextCtrl with wxTextValidator(wxFILTER_NUMERIC))

Regards
Bundy
"Fate rewards prepared mind"

Quote from movie "Liberator 2"

Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator » Tue Jan 31, 2006 10:57 am

create your own control by which inherits from wxtextctrl and wxspinbutton and implement your needs yourself :) that's what id did to be able to use floats and to append things like %, s, h etc.
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3

Tim
Earned some good credits
Earned some good credits
Posts: 104
Joined: Wed Nov 23, 2005 5:41 pm

Post by Tim » Tue Jan 31, 2006 5:02 pm

Thanks guys,
I did it.

Tim

Post Reply