Mercurial > libervia-backend
comparison frontends/wix/form.py @ 70:8f2ed279784b
i18n
- gettext support added in frontends
- first draft of frontends french translation
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 05 Mar 2010 20:33:10 +1100 |
parents | a5b5fb5fc9fd |
children | 39c672544593 |
comparison
equal
deleted
inserted
replaced
69:86f1f7f6d332 | 70:8f2ed279784b |
---|---|
72 label=wx.StaticText(panel, -1, label+": ") | 72 label=wx.StaticText(panel, -1, label+": ") |
73 ctrl = wx.TextCtrl(panel, -1, value, style=wx.TE_PASSWORD) | 73 ctrl = wx.TextCtrl(panel, -1, value, style=wx.TE_PASSWORD) |
74 self.ctl_list.append({'name':name, 'type':type, 'control':ctrl}) | 74 self.ctl_list.append({'name':name, 'type':type, 'control':ctrl}) |
75 sizer.Add(label) | 75 sizer.Add(label) |
76 else: | 76 else: |
77 error("FIXME FIXME FIXME: type [%s] is not implemented" % type) #FIXME ! | 77 error(_("FIXME FIXME FIXME: type [%s] is not implemented") % type) #FIXME ! |
78 raise NotImplementedError | 78 raise NotImplementedError |
79 sizer.Add(ctrl, 1, flag=wx.EXPAND) | 79 sizer.Add(ctrl, 1, flag=wx.EXPAND) |
80 #self.ctl_list[(name, category)] = ctrl | 80 #self.ctl_list[(name, category)] = ctrl |
81 panel.sizer.Add(sizer, flag=wx.EXPAND) | 81 panel.sizer.Add(sizer, flag=wx.EXPAND) |
82 | 82 |
96 self.sizer.Add(panel, 1, flag=wx.EXPAND) | 96 self.sizer.Add(panel, 1, flag=wx.EXPAND) |
97 cat_dom.unlink() | 97 cat_dom.unlink() |
98 | 98 |
99 def onFormSubmitted(self, event): | 99 def onFormSubmitted(self, event): |
100 """Called when submit button is clicked""" | 100 """Called when submit button is clicked""" |
101 debug("Submitting form") | 101 debug(_("Submitting form")) |
102 data = [] | 102 data = [] |
103 for ctrl in self.ctl_list: | 103 for ctrl in self.ctl_list: |
104 data.append((ctrl["name"], ctrl["control"].GetValue())) | 104 data.append((ctrl["name"], ctrl["control"].GetValue())) |
105 print "submitting:",data | |
106 id = self.host.bridge.gatewayRegister("SUBMIT",self.target, data) | 105 id = self.host.bridge.gatewayRegister("SUBMIT",self.target, data) |
107 self.host.current_action_ids.add(id) | 106 self.host.current_action_ids.add(id) |
108 print "action id:",id | |
109 self.MakeModal(False) | 107 self.MakeModal(False) |
110 self.Destroy() | 108 self.Destroy() |
111 | 109 |
112 def onFormCancelled(self, event): | 110 def onFormCancelled(self, event): |
113 """Called when cancel button is clicked""" | 111 """Called when cancel button is clicked""" |
114 debug("Cancelling form") | 112 debug(_("Cancelling form")) |
115 self.MakeModal(False) | 113 self.MakeModal(False) |
116 self.Close() | 114 self.Close() |
117 | 115 |
118 def onClose(self, event): | 116 def onClose(self, event): |
119 """Close event: we have to send the form.""" | 117 """Close event: we have to send the form.""" |
120 debug("close") | 118 debug(_("close")) |
121 self.MakeModal(False) | 119 self.MakeModal(False) |
122 event.Skip() | 120 event.Skip() |
123 | 121 |