comparison src/browser/sat_browser/dialog.py @ 524:d41e850b31b9

browser_side (plugin OTR): limit the max width for all dialogs
author souliane <souliane@mailoo.org>
date Wed, 03 Sep 2014 11:22:37 +0200
parents 1af112b97e45
children ed9cd20260ff
comparison
equal deleted inserted replaced
523:5add182e7dd5 524:d41e850b31b9
254 @param prompt (TextBox, list[TextBox]): input widgets from which to retrieve 254 @param prompt (TextBox, list[TextBox]): input widgets from which to retrieve
255 the string value(s) to be passed to the callback when OK button is pressed. 255 the string value(s) to be passed to the callback when OK button is pressed.
256 If None, OK button will return "True". Cancel button always returns "False". 256 If None, OK button will return "True". Cancel button always returns "False".
257 """ 257 """
258 self.callback = callback 258 self.callback = callback
259 added_style = kwargs.pop('AddStyleName', None)
259 DialogBox.__init__(self, centered=True, **kwargs) 260 DialogBox.__init__(self, centered=True, **kwargs)
261 if added_style:
262 self.addStyleName(added_style)
260 263
261 if prompt is None: 264 if prompt is None:
262 prompt = [] 265 prompt = []
263 elif isinstance(prompt, TextBox): 266 elif isinstance(prompt, TextBox):
264 prompt = [prompt] 267 prompt = [prompt]
309 @param title: HTML put in the header 312 @param title: HTML put in the header
310 @param main_widget: widget put in the body 313 @param main_widget: widget put in the body
311 @param callback: method to call on closing 314 @param callback: method to call on closing
312 @param options: one or more of the following options: 315 @param options: one or more of the following options:
313 - NO_CLOSE: don't add a close button""" 316 - NO_CLOSE: don't add a close button"""
317 added_style = kwargs.pop('AddStyleName', None)
314 DialogBox.__init__(self, centered=True, **kwargs) 318 DialogBox.__init__(self, centered=True, **kwargs)
319 if added_style:
320 self.addStyleName(added_style)
321
315 self.callback = callback 322 self.callback = callback
316 if not options: 323 if not options:
317 options = [] 324 options = []
318 _body = VerticalPanel() 325 _body = VerticalPanel()
319 _body.setSize('100%', '100%') 326 _body.setSize('100%', '100%')