Mercurial > libervia-web
comparison browser_side/dialog.py @ 41:7782a786b2f0
Tarot game: score is now shown (need to use XMLUI later)
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 22 May 2011 17:56:59 +0200 |
parents | 305e81c7a32c |
children | 71a9cc9b9d57 |
comparison
equal
deleted
inserted
replaced
40:49f1829fb928 | 41:7782a786b2f0 |
---|---|
22 from pyjamas.ui.VerticalPanel import VerticalPanel | 22 from pyjamas.ui.VerticalPanel import VerticalPanel |
23 from pyjamas.ui.HorizontalPanel import HorizontalPanel | 23 from pyjamas.ui.HorizontalPanel import HorizontalPanel |
24 from pyjamas.ui.DialogBox import DialogBox | 24 from pyjamas.ui.DialogBox import DialogBox |
25 from pyjamas.ui.ListBox import ListBox | 25 from pyjamas.ui.ListBox import ListBox |
26 from pyjamas.ui.Button import Button | 26 from pyjamas.ui.Button import Button |
27 from pyjamas.ui.HTML import HTML | |
27 | 28 |
28 class ContactsChooser(DialogBox): | 29 class ContactsChooser(DialogBox): |
29 | 30 |
30 def __init__(self, host, callback, nb_contact=None, text='Please select contacts'): | 31 def __init__(self, host, callback, nb_contact=None, text='Please select contacts'): |
31 """ | 32 """ |
107 | 108 |
108 def onCancel(self): | 109 def onCancel(self): |
109 self.hide() | 110 self.hide() |
110 self.callback(False) | 111 self.callback(False) |
111 | 112 |
113 class SimpleDialog(DialogBox): | |
114 | |
115 def __init__(self, title, body): | |
116 """Simple notice dialog box | |
117 @param title: HTML put in the header | |
118 @param body: HTML put in the body""" | |
119 DialogBox.__init__(self, centered=True) | |
120 _body = VerticalPanel() | |
121 _body.setSpacing(4) | |
122 _body.add(HTML(body)) | |
123 _body.add(Button("Close", self.onClose)) | |
124 _body.setStyleName("dialogBody") | |
125 self.setHTML(title) | |
126 self.setWidget(_body) | |
127 | |
128 def onClose(self): | |
129 self.hide() |