El 14/12/2013 21:02, Paul McNett escribió:
On 12/14/13 2:13 PM, Ricardo Aráoz wrote:
I guess that's some wx thingy.
Yes.

How do I add this to the dabo dNumericBox  object?
Just to see if it's even going to work, edit dabo/dabo/ui/uiwx/dNumericBox.py, 
and in
the __init__ method say:

kwargs["style"] = wx.WANTS_CHARS

at some point before the super method is called.

If that works, come back and we'll explore options.


Done. It works!!!
So what are the options you wish to explore.

Below shows where I placed it in case it helps :

class dNumericBox(dtbm.dTextBoxMixin, masked.NumCtrl):
"""This is a specialized textbox class that maintains numeric values."""

def __init__(self, parent, properties=None, attProperties=None, *args, **kwargs):
        localeData = locale.localeconv()
        enc = locale.getdefaultlocale()[1]
        self._baseClass = dNumericBox
kwargs["integerWidth"] = self._extractKey((properties, attProperties, kwargs),
                "IntegerWidth", 10)
kwargs["fractionWidth"] = self._extractKey((properties, attProperties, kwargs),
                "DecimalWidth", 2)
kwargs["Alignment"] = self._extractKey((properties, attProperties, kwargs),
                "Alignment", "Right")
kwargs["selectOnEntry"] = self._extractKey((properties, attProperties, kwargs),
                "SelectOnEntry", self.SelectOnEntry)
        groupChar = self._extractKey((properties, attProperties, kwargs),
                "GroupChar", localeData["thousands_sep"].decode(enc))
        # Group char can't be empty string.
        if groupChar or groupChar >= " ":
            kwargs["groupChar"] = groupChar
            kwargs["groupDigits"] = True
        else:
            kwargs["groupChar"] = " "
            kwargs["groupDigits"] = False
kwargs["autoSize"] = self._extractKey((properties, attProperties, kwargs),
                "AutoWidth", True)
kwargs["allowNegative"] = self._extractKey((properties, attProperties, kwargs),
                "AllowNegative", True)
kwargs["useParensForNegatives"] = self._extractKey((properties, attProperties, kwargs),
                "ParensForNegatives", False)
kwargs["decimalChar"] = self._extractKey((properties, attProperties, kwargs),
                "DecimalChar", localeData["decimal_point"].decode(enc))
kwargs["foregroundColour"] = self._extractKey((properties, attProperties, kwargs),
                "ForeColor", "Black")
kwargs["validBackgroundColour"] = self._extractKey((properties, attProperties, kwargs),
            "BackColor", wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
kwargs["invalidBackgroundColour"] = self._extractKey((properties, attProperties, kwargs),
                "InvalidBackColor", "Yellow")
kwargs["signedForegroundColour"] = self._extractKey((properties, attProperties, kwargs),
                "SignedForeColor", "Red")
kwargs["allowNone"] = self._extractKey((properties, attProperties, kwargs),
                "AllowNoneValue", False)
kwargs["max"] = self._extractKey((properties, attProperties, kwargs),
                "MaxValue", None)
kwargs["min"] = self._extractKey((properties, attProperties, kwargs),
                "MinValue", None)
        # Base class 'limited' property is inconvenient.
        kwargs["limited"] = False
fontFace = self._extractKey((properties, attProperties, kwargs), "FontFace", "")
        if not fontFace and self.Application.Platform in ("Win",):
            fontFace = "Tahoma"
        elif not fontFace and self.Application.Platform in ("Mac",):
            fontFace = "Lucida Grande"
        if fontFace:
             kwargs["FontFace"] = fontFace
_*        kwargs["style"] = wx.WANTS_CHARS*_
dtbm.dTextBoxMixin.__init__(self, masked.NumCtrl, parent, properties,
                attProperties, *args, **kwargs)




--- StripMime Report -- processed MIME parts ---
multipart/alternative
 text/plain (text body -- kept)
 text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/52adb056.8030...@gmail.com

Reply via email to