Mercurial > libervia-backend
comparison frontends/src/tools/xmlui.py @ 1473:675e0e9f1653
core , privmitivus (xmlui): add jidInput handling, with a simple String for now
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 18 Aug 2015 10:35:44 +0200 |
parents | 069ad98b360d |
children | 90130847a0a8 |
comparison
equal
deleted
inserted
replaced
1472:c005c212b538 | 1473:675e0e9f1653 |
---|---|
81 class StringWidget(Widget): | 81 class StringWidget(Widget): |
82 """Input widget wich require a string | 82 """Input widget wich require a string |
83 | 83 |
84 often called Edit in toolkits | 84 often called Edit in toolkits |
85 """ | 85 """ |
86 pass | |
87 | |
88 | |
89 class JidInputWidget(Widget): | |
90 """Input widget wich require a string | |
91 | |
92 often called Edit in toolkits | |
93 """ | |
94 pass | |
86 | 95 |
87 | 96 |
88 class PasswordWidget(Widget): | 97 class PasswordWidget(Widget): |
89 """Input widget with require a masked string""" | 98 """Input widget with require a masked string""" |
99 pass | |
90 | 100 |
91 | 101 |
92 class TextBoxWidget(Widget): | 102 class TextBoxWidget(Widget): |
93 """Input widget with require a long, possibly multilines string | 103 """Input widget with require a long, possibly multilines string |
94 often called TextArea in toolkits | 104 often called TextArea in toolkits |
95 """ | 105 """ |
106 pass | |
96 | 107 |
97 | 108 |
98 class BoolWidget(Widget): | 109 class BoolWidget(Widget): |
99 """Input widget with require a boolean value | 110 """Input widget with require a boolean value |
100 often called CheckBox in toolkits | 111 often called CheckBox in toolkits |
101 """ | 112 """ |
113 pass | |
102 | 114 |
103 | 115 |
104 class IntWidget(Widget): | 116 class IntWidget(Widget): |
105 """Input widget with require an integer""" | 117 """Input widget with require an integer""" |
118 pass | |
106 | 119 |
107 | 120 |
108 class ButtonWidget(Widget): | 121 class ButtonWidget(Widget): |
109 """A clickable widget""" | 122 """A clickable widget""" |
123 pass | |
110 | 124 |
111 | 125 |
112 class ListWidget(Widget): | 126 class ListWidget(Widget): |
113 """A widget able to show/choose one or several strings in a list""" | 127 """A widget able to show/choose one or several strings in a list""" |
128 pass | |
114 | 129 |
115 | 130 |
116 class Container(Widget): | 131 class Container(Widget): |
117 """Widget which can contain other ones with a specific layout""" | 132 """Widget which can contain other ones with a specific layout""" |
118 | 133 |
127 instance.__class__ = type(cls.__name__, cls.__bases__, dict(cls.__dict__)) | 142 instance.__class__ = type(cls.__name__, cls.__bases__, dict(cls.__dict__)) |
128 | 143 |
129 | 144 |
130 class PairsContainer(Container): | 145 class PairsContainer(Container): |
131 """Widgets are disposed in rows of two (usually label/input) """ | 146 """Widgets are disposed in rows of two (usually label/input) """ |
147 pass | |
132 | 148 |
133 | 149 |
134 class TabsContainer(Container): | 150 class TabsContainer(Container): |
135 """A container which several other containers in tabs | 151 """A container which several other containers in tabs |
136 | 152 |
137 Often called Notebook in toolkits | 153 Often called Notebook in toolkits |
138 """ | 154 """ |
155 pass | |
139 | 156 |
140 class VerticalContainer(Container): | 157 class VerticalContainer(Container): |
141 """Widgets are disposed vertically""" | 158 """Widgets are disposed vertically""" |
159 pass | |
142 | 160 |
143 | 161 |
144 class AdvancedListContainer(Container): | 162 class AdvancedListContainer(Container): |
145 """Widgets are disposed in rows with advaned features""" | 163 """Widgets are disposed in rows with advaned features""" |
164 pass | |
146 | 165 |
147 | 166 |
148 class Dialog(object): | 167 class Dialog(object): |
149 """base dialog""" | 168 """base dialog""" |
150 | 169 |
174 pass | 193 pass |
175 | 194 |
176 | 195 |
177 class MessageDialog(Dialog): | 196 class MessageDialog(Dialog): |
178 """Dialog with a OK/Cancel type configuration""" | 197 """Dialog with a OK/Cancel type configuration""" |
198 pass | |
179 | 199 |
180 | 200 |
181 class NoteDialog(Dialog): | 201 class NoteDialog(Dialog): |
182 """Dialog with a OK/Cancel type configuration""" | 202 """Dialog with a OK/Cancel type configuration""" |
203 pass | |
183 | 204 |
184 | 205 |
185 class ConfirmDialog(Dialog): | 206 class ConfirmDialog(Dialog): |
186 """Dialog with a OK/Cancel type configuration""" | 207 """Dialog with a OK/Cancel type configuration""" |
187 | 208 |
192 data[C.XMLUI_DATA_ANSWER] = C.BOOL_FALSE | 213 data[C.XMLUI_DATA_ANSWER] = C.BOOL_FALSE |
193 | 214 |
194 | 215 |
195 class FileDialog(Dialog): | 216 class FileDialog(Dialog): |
196 """Dialog with a OK/Cancel type configuration""" | 217 """Dialog with a OK/Cancel type configuration""" |
218 pass | |
197 | 219 |
198 | 220 |
199 class XMLUIBase(object): | 221 class XMLUIBase(object): |
200 """Base class to construct SàT XML User Interface | 222 """Base class to construct SàT XML User Interface |
201 | 223 |
384 style = node.getAttribute("style") or 'line' | 406 style = node.getAttribute("style") or 'line' |
385 ctrl = self.widget_factory.createDividerWidget(_xmlui_parent, style) | 407 ctrl = self.widget_factory.createDividerWidget(_xmlui_parent, style) |
386 elif type_=="string": | 408 elif type_=="string": |
387 ctrl = self.widget_factory.createStringWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) | 409 ctrl = self.widget_factory.createStringWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) |
388 self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) | 410 self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) |
411 elif type_=="jid_input": | |
412 ctrl = self.widget_factory.createJidInputWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) | |
413 self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) | |
389 elif type_=="password": | 414 elif type_=="password": |
390 ctrl = self.widget_factory.createPasswordWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) | 415 ctrl = self.widget_factory.createPasswordWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) |
391 self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) | 416 self.ctrl_list[name] = ({'type':type_, 'control':ctrl}) |
392 elif type_=="textbox": | 417 elif type_=="textbox": |
393 ctrl = self.widget_factory.createTextBoxWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) | 418 ctrl = self.widget_factory.createTextBoxWidget(_xmlui_parent, value, self._isAttrSet("read_only", node)) |