johnf wrote:
> Is this correct? It does not look what others have posted in the past?????
> Close but not the same.
Looks good to me! Now I can see what lines you removed, and what you replaced
them
with. Much more explicit, thanks!
See my comments, based on reading your code. No time to test it right now.
> ===================================================================
> --- dabo/ui/uiwx/dTextBoxMixin.py (revision 4697)
> +++ dabo/ui/uiwx/dTextBoxMixin.py (working copy)
> @@ -614,7 +614,10 @@
> # Get the string value as reported by wx, which is the
> up-to-date
> # string value of the control:
> if isinstance(self, masked.TextCtrl) and hasattr(self,
> "_template"):
> - strVal = self.GetPlainValue()
> + if self.UseGetPlain:
> + strVal = self.GetPlainValue()
> + else:
> + strVal = self.GetValue()
> else:
> strVal = self.GetValue()
I don't like the property name UseGetPlain, as it doesn't describe the
behavior, but
an implementation detail (the dabo appdev doesn't care that the wx function
name is
GetPlainValue()).
I like UsePlainValue better, but I'm sure there's a better name than that...
>
> Index: dabo/ui/uiwx/dMaskedTextBox.py
> ===================================================================
> --- dabo/ui/uiwx/dMaskedTextBox.py (revision 4697)
> +++ dabo/ui/uiwx/dMaskedTextBox.py (working copy)
> @@ -65,20 +65,29 @@
> "ip": "IPADDR"}
>
>
> - def __init__(self, parent, properties=None, attProperties=None, *args,
> **kwargs):
> + def __init__(self, parent, properties=None, attProperties=None, *args,
> **kwargs):
> self._baseClass = dMaskedTextBox
> + self.UseGetPlain = False
You are implying that UseGetPlain is a property, and not a simple attribute, by
the
capital "U". To give the appdev standard ways to override the default, you
really
must make it into a property not an attribute.
> + self._useGetPlain = self._extractKey((properties,
> attProperties,
> kwargs), "UseGetPlain", "")
> + if self._useGetPlain:
> + self.UseGetPlain = self._useGetPlain
> + #kwargs.pop("UseGetPlain")
> +
Strange, unneeded code block above, if you'd just make it a property to begin
with.
> self._mask = self._extractKey((properties, attProperties,
> kwargs), "Mask", "")
> self._format = self._extractKey((properties, attProperties,
> kwargs), "Format", "")
> + self._validregex = self._extractKey((properties, attProperties,
> kwargs), "ValidRegex", "")
> self._inputCodes =
> self._uniqueCodes(self._extractKey((properties,
> attProperties, kwargs),
> "InputCodes", "_>"))
> kwargs["mask"] = self._mask
> kwargs["formatcodes"] = self._inputCodes
> + kwargs["validRegex"] = self._validregex
> if self._format:
> code = self._formatMap.get(self._format.lower(), "")
> if code:
> kwargs["autoformat"] = code
> kwargs.pop("mask")
> kwargs.pop("formatcodes")
> + kwargs.pop("validRegex")
> kwargs["useFixedWidthFont"] = False
>
> preClass = wx.lib.masked.TextCtrl
Thanks for the work on this!
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]