Roy Sutton wrote:> For whatever reason I decided to implement the validator class tonight.
Cool. Validators are an important part of wx. I look forward to getting
your patch when it''s ready.
> It''s my first go at implementing the class. My first run at it
looked
> pretty good. I just added a generic .i for it and it all compiled.
> Sadly, the samples didn''t work because the base Validator class
can''t
> actually be used as a validator! You have to derive from
> GenericValidator. I thought the way to get around this might be to
> include both wxValidator.h and wxGenericValidator.h into the Validator.i
> file. I''m a bit unclear on how one might specify that Validator
in Ruby
> refers to wxGenericValidator. Something to dig into this weekend I
> suppose.
There is a weird file in swig/classes/include named parents.i, which
contains a map of all the classes to their parents. One of the swig
post-processors uses this to adjust the ruby class parentage. I think
this file (and events.rb which is in the same directory) should move to
swig/ but I don''t have immediate plans to do so.
> Another thing I''m a bit unclear on is the whole
(directors="1"). I''ll
> investigate that this weekend, too.
Most classes should have directors. These allow two-way calling which
facilitates overriding virtual methods and having callbacks. They are
necessary in most cases for proper memory management.
If you get compile errors with directors enabled, you''ll probably need
to disable them for that class, as you can see in Bitmap.i. This would
be if the class has no virtual methods at all. Note that two lines are
required to disable directors...one tells swig, and the other tells our
post-procesor.
> Finally, one last little problem. It appears the C->ruby renamer
isn''t
> handling names like centreX properly. centreX should be converted to
> centre_x as I understand it. The un_camelcase function in renamer.rb
> apparenly only uncamelcases if the first characters are uppercase.
> Thoughts?
I haven''t confirmed what you are saying, but based on your description
I
agree with you. Since that''s ruby code and not C++, I''m hoping
you or
any of several other folks on this list should be able to submit a patch :-)
Thanks again,
Kevin