Hi,
I would like to use a wxTextValidator for some fields (wxTextCtrl) in a dialog which is created by wxCrafter.
The fields however are arranged on several notebook pages (wxNotebook) and therefore the text controls are children of the notebook page rather than the dialog.
In order to bind their text controls to the members of my c++ class I need to add the extra style wxWS_EX_VALIDATE_RECURSIVELY for the dialog and this needs to be done before the controls are created.
Is there a way to set this extra style using wxCrafter? I tried typing it into the wxWindow line on the "Styles" property grid but it does not persist.
Many thanks!
p.s. maybe a nice future feature would be to allow the user to type a variable name into the property grid for wxTextCtrl etc. and wxCrafter automatically binds them
wxCrafter and wxValidator
-
- CodeLite Veteran
- Posts: 81
- Joined: Thu Mar 21, 2013 1:12 pm
- Genuine User: Yes
- IDE Question: c++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: wxCrafter and wxValidator
You could use the Subclass feature of wxDialog (it exists for all controls) or use a custom control
Eran
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Veteran
- Posts: 81
- Joined: Thu Mar 21, 2013 1:12 pm
- Genuine User: Yes
- IDE Question: c++
- Contact:
Re: wxCrafter and wxValidator
Thank you Erin, yes that works!
I created a myDialog with SetExtraStyle (wxWS_EX_VALIDATE_RECURSIVELY) in the ctor and then subclassed the dialog in wxCrafter.
By the way, just upgraded to CodeLite 7 and wxCrafter 2 - looking good
I created a myDialog with SetExtraStyle (wxWS_EX_VALIDATE_RECURSIVELY) in the ctor and then subclassed the dialog in wxCrafter.
By the way, just upgraded to CodeLite 7 and wxCrafter 2 - looking good