comparison browser_side/xmlui.py @ 392:f539f6f8ee9c

browser_side: standardize the dialogs size and buttons display: - do not set a default width/height for the XMLUI dialogs - do not display an extra "Close" button when XMLUI form is showed - the buttons order is OK/Save on the left, Cancel/Close on the right - horizontally center the dialog buttons
author souliane <souliane@mailoo.org>
date Mon, 03 Mar 2014 16:24:00 +0100
parents 76583fab7ea0
children 0c4547587637
comparison
equal deleted inserted replaced
391:c86d7a8d2c1e 392:f539f6f8ee9c
362 super(XMLUI, self).constructUI(xml_data) 362 super(XMLUI, self).constructUI(xml_data)
363 self.add(self.main_cont) 363 self.add(self.main_cont)
364 self.setCellHeight(self.main_cont, '100%') 364 self.setCellHeight(self.main_cont, '100%')
365 if self.type == 'form': 365 if self.type == 'form':
366 hpanel = HorizontalPanel() 366 hpanel = HorizontalPanel()
367 hpanel.setStyleName('marginAuto')
367 hpanel.add(Button('Submit',self.onFormSubmitted)) 368 hpanel.add(Button('Submit',self.onFormSubmitted))
368 if not 'NO_CANCEL' in self.flags: 369 if not 'NO_CANCEL' in self.flags:
369 hpanel.add(Button('Cancel',self.onFormCancelled)) 370 hpanel.add(Button('Cancel',self.onFormCancelled))
370 self.add(hpanel) 371 self.add(hpanel)
371 elif self.type == 'param': 372 elif self.type == 'param':
372 assert(isinstance(self.children[0][0],TabPanel)) 373 assert(isinstance(self.children[0][0],TabPanel))
373 hpanel = HorizontalPanel() 374 hpanel = HorizontalPanel()
375 hpanel.add(Button('Save', self.onSaveParams))
374 hpanel.add(Button('Cancel', lambda ignore: self._xmluiClose())) 376 hpanel.add(Button('Cancel', lambda ignore: self._xmluiClose()))
375 hpanel.add(Button('Save', self.onSaveParams))
376 self.add(hpanel) 377 self.add(hpanel)