wxCrafter and wxValidator

Post here wxCrafter related issues / features / bugs
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

wxCrafter and wxValidator

Post by iwbnwif »

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 :)
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter and wxValidator

Post by eranif »

You could use the Subclass feature of wxDialog (it exists for all controls) or use a custom control

Eran
Make sure you have read the HOW TO POST thread
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: wxCrafter and wxValidator

Post by iwbnwif »

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 :D
Post Reply