1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Defines a simple list."""
17
18 from muntjac.ui.abstract_select import AbstractSelect
19
20
22 """This is a simple list select without, for instance, support for
23 new items, lazyloading, and other advanced features.
24 """
25
26 CLIENT_WIDGET = None
27
33
34
36 """Sets the number of columns in the editor. If the number of columns
37 is set 0, the actual number of displayed columns is determined
38 implicitly by the adapter.
39
40 @param columns:
41 the number of columns to set.
42 """
43 if columns < 0:
44 columns = 0
45
46 if self._columns != columns:
47 self._columns = columns
48 self.requestRepaint()
49
50
53
54
57
58
60 """Sets the number of rows in the editor. If the number of rows is
61 set 0, the actual number of displayed rows is determined implicitly
62 by the adapter.
63
64 @param rows:
65 the number of rows to set.
66 """
67 if rows < 0:
68 rows = 0
69
70 if self._rows != rows:
71 self._rows = rows
72 self.requestRepaint()
73
74
75 - def paintContent(self, target):
76 target.addAttribute('type', 'list')
77
78
79 if self._columns != 0:
80 target.addAttribute('cols', self._columns)
81
82
83 if self._rows != 0:
84 target.addAttribute('rows', self._rows)
85
86 super(ListSelect, self).paintContent(target)
87