[wx-dev] [wxMac] spell checker off in wxTextCtrl by default ?
Robin Dunn
robin at alldunn.com
Thu Jun 14 20:35:16 PDT 2007
Vadim Zeitlin wrote:
> On Thu, 14 Jun 2007 14:41:18 -0700 Robin Dunn <robin at alldunn.com> wrote:
>
> RD> Or use flags that are objects, not bits in an integer.
>
> I've already started doing this with wxSizerFlags and I'd obviously be
> for extending this approach to wxWindow-derived classes but it only helps
> with the controls created in the code, not with the ones created from XRC.
> And we really need to allow setting the flags from XRC -- any ideas about
> how to do it?
I was thinking that maybe something like this would work.
* Have some wxFlag class that holds a string, and create a bunch of them
with the same names as the current bit flags.
wxFlag wxTE_READONLY("wxTE_READONLY");
wxFlag wxRE_MULTILINE("wxTE_MULTILINE");
* wxFlag can have an operator| that returns a wxFlagCollection, and
wxFlagCollection can have an operator| for adding more flags, and the
widget style parameters can be switched to a wxFlagCollection.
* Things like HasFlag() can just delegate to the collection object which
searches itself for a flag object with a matching string.
* XRC can just create new flag objects from the strings it reads from
the XML.
* We may want to allow wxFlag objects to have more than one string as a
way to have simpler flag names that are equivalent to the "wx" name.
That would allow the simpler name to be used from Python and the other
scripting languages as strings, and be more natural way to do things.
For example:
wxFlag wxTE_READONLY("wxTE_READONLY", "readonly");
could allow either string to be used for making a flag that turns on
wxTE_READONLY.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wx-dev
mailing list