comparison browser_side/base_widget.py @ 210:3092f6b1710c

browser side: make the OK button title for group selector configureable + few "cosmetic" changes (PEP 8...) fix bug 15 fix bug 33
author souliane <souliane@mailoo.org>
date Fri, 06 Sep 2013 15:40:33 +0200
parents aa76793da353
children 9b93a21dc5e2
comparison
equal deleted inserted replaced
209:4564c7bc06a7 210:3092f6b1710c
153 button_group_wrapper.setWidget(button_group) 153 button_group_wrapper.setWidget(button_group)
154 self.add(button_group_wrapper) 154 self.add(button_group_wrapper)
155 self.addStyleName('widgetHeader') 155 self.addStyleName('widgetHeader')
156 LiberviaDragWidget.__init__(self, "", "WIDGET", parent) 156 LiberviaDragWidget.__init__(self, "", "WIDGET", parent)
157 157
158
158 class LiberviaWidget(DropCell, VerticalPanel, ClickHandler): 159 class LiberviaWidget(DropCell, VerticalPanel, ClickHandler):
159 """Libervia's widget which can replace itself with a dropped widget on DnD""" 160 """Libervia's widget which can replace itself with a dropped widget on DnD"""
160 161
161 def __init__(self, host, title='', selectable=False): 162 def __init__(self, host, title='', selectable=False):
162 """Init the widget 163 """Init the widget
163 @param host: SatWebFrontend object 164 @param host: SatWebFrontend object
164 @param title: title show in the header of the widget 165 @param title: title show in the header of the widget
165 @param selectable: True is widget can be selected by user""" 166 @param selectable: True is widget can be selected by user"""
256 def onReset(sender): 257 def onReset(sender):
257 colspan_setter.setValue(1) 258 colspan_setter.setValue(1)
258 rowspan_setter.setValue(1) 259 rowspan_setter.setValue(1)
259 width_setter.setValue(0) 260 width_setter.setValue(0)
260 height_setter.setValue(0) 261 height_setter.setValue(0)
261 262
262 reset_bt = Button("Reset", onReset) 263 reset_bt = Button("Reset", onReset)
263 body.add(reset_bt) 264 body.add(reset_bt)
264 body.setCellHorizontalAlignment(reset_bt, HasAlignment.ALIGN_CENTER) 265 body.setCellHorizontalAlignment(reset_bt, HasAlignment.ALIGN_CENTER)
265 266
266 _dialog = dialog.GenericDialog("Widget setting", body) 267 _dialog = dialog.GenericDialog("Widget setting", body)
267 _dialog.show() 268 _dialog.show()
268 269
269 def setTitle(self, text): 270 def setTitle(self, text):
270 """change the title in the header of the widget 271 """change the title in the header of the widget