1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from pyjamas import DOM
16 from pyjamas import Factory
17
18 from TextBoxBase import TextBoxBase
19
20 -class TextBox(TextBoxBase):
21 - def __init__(self, **kwargs):
22 if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-TextBox"
23 if kwargs.has_key('Element'):
24 element = kwargs.pop('Element')
25 else:
26 element = DOM.createInputText()
27 TextBoxBase.__init__(self, element, **kwargs)
28
29 - def getMaxLength(self):
30 return DOM.getIntAttribute(self.getElement(), "maxLength")
31
33 return DOM.getIntAttribute(self.getElement(), "size")
34
35 - def setMaxLength(self, length):
36 DOM.setIntAttribute(self.getElement(), "maxLength", length)
37
38 - def setVisibleLength(self, length):
39 DOM.setIntAttribute(self.getElement(), "size", length)
40
41 Factory.registerClass('pyjamas.ui.TextBox', TextBox)
42