def add_pref(preflist): def _get(name): def _f(name=name): from modules import Globals return getattr(Globals.pref, name) return _f from modules import meide as ui box = ui.VGroup(tr('Network')) grid = ui.SimpleGrid() grid.add('', ui.Check(_get('use_proxy'), tr('Use a proxy')), name='use_proxy', span=True) grid.add(tr('IP address:'), ui.Text(_get('proxy')), name='proxy') grid.add(tr('Port number:'), ui.Int(_get('proxy_port')), name='proxy_port') grid.add(tr('Username:'******'proxy_user')), name='proxy_user') grid.add(tr('Password:'******'proxy_password')), name='proxy_password') box.add(grid) # preflist.extend([ # (tr('Network'), 100, 'check', 'use_proxy', tr('Use proxy'), None), # (tr('Network'), 110, 'text', 'proxy', tr('Proxy URL:'), None), # (tr('Network'), 120, 'text', 'proxy_user', tr('Proxy User:'******'Network'), 130, 'password', 'proxy_password', tr('Proxy Password:'******'Network'), 100, box, '', '', { 'span': True }), ])
def create_page(self, pagename): self.pagenames[pagename] = sys.maxint if pagename not in self.pages: page = wx.ScrolledWindow(self.treebook, -1) # page.SetBackgroundColour('white') page.EnableScrolling(False, True) page.SetScrollbars(10, 10, 30, 30) self.pages[pagename] = page page.box = ui.SimpleGrid().create(page).auto_layout() self.value_set.append(page.box) else: page = self.pages[pagename] return page
def __init__(self, parent, ftpname, user, password): wx.Dialog.__init__(self, parent, -1, style=wx.DEFAULT_DIALOG_STYLE, title=tr("FTP site: %s") % ftpname, size=(200, 50)) self.sizer = box = ui.SimpleGrid( namebinding='widget').create(self).auto_layout() box.add(tr('Username:'******'txtUser') box.add(tr('Password:'******'txtPassword') box.add('', ui.simple_buttons(), flag=wx.ALIGN_CENTER | wx.BOTTOM, span=True) self.btnOk.SetDefault() box.auto_fit(2) box.bind('btnOk', wx.EVT_UPDATE_UI, self.OnUpdateUI)