diff frontends/src/wix/xmlui.py @ 1220:f91e7028e2c3

memory (params), tools (xml_tools), plugins, frontends: add "int" parameter type with "min" and "max" attributes
author souliane <souliane@mailoo.org>
date Fri, 03 Oct 2014 12:27:43 +0200
parents e2e1e27a3680
children
line wrap: on
line diff
--- a/frontends/src/wix/xmlui.py	Mon Sep 22 22:25:44 2014 +0200
+++ b/frontends/src/wix/xmlui.py	Fri Oct 03 12:27:43 2014 +0200
@@ -127,6 +127,16 @@
         return "true" if self.GetValue() else "false"
 
 
+# TODO: use wx.SpinCtrl instead of wx.TextCtrl
+class IntWidget(EventWidget, ValueWidget, xmlui.IntWidget, wx.TextCtrl):
+    _xmlui_change_event = wx.EVT_TEXT
+
+    def __init__(self, _xmlui_parent, value, read_only=False):
+        style = wx.TE_READONLY if read_only else 0
+        wx.TextCtrl.__init__(self, _xmlui_parent, -1, value, style=style)
+        self._xmlui_proportion = 1
+
+
 class ButtonWidget(EventWidget, WixWidget, xmlui.ButtonWidget, wx.Button):
     _xmlui_change_event = wx.EVT_BUTTON