def InitUI(self):
self.panel = wx.Panel(self, wx.ID_ANY)
# Info Text
infotext = _(u'Close all open Applications, it is possible that programs will be closed without a warning '
u'and system could reboot without further confirmation.')
infobox = wx.StaticBox(self.panel, -1, _(u'Attention'))
infoboxbsizer = wx.StaticBoxSizer(infobox, wx.VERTICAL)
info = wx.StaticText(self.panel, label=infotext)
info.Wrap(380)
infoboxbsizer.Add(info, 0)
self.gauge = wx.Gauge(self.panel, size=(24, 26))
self.update_label = wx.StaticText(self.panel, label=_(u'Current Progress:'))
self.update_box = wx.TextCtrl(self.panel, style=wx.TE_READONLY)
self.update_box.SetBackgroundColour(wx.WHITE)
self.chk_shutdown = wx.CheckBox(self.panel, size=(160,20), label=_(u"Shutdown after update"))
self.logButton = wx.Button(self.panel, size=(54,26), label="LOG")
self.logButton.SetToolTip(wx.ToolTip(_(u'Open WPKG Log')))
self.logButton.SetBitmap(img.get('log'))
self.startButton = wx.Button(self.panel, label=_(u"Update"))
self.abortButton = wx.Button(self.panel, label=_(u"Cancel"))
self.logButton.Disable()
self.abortButton.Disable()
self.line = wx.StaticLine(self.panel, -1, size=(2,2), style=wx.LI_HORIZONTAL)
self.startButton.Bind(wx.EVT_BUTTON, self.OnStartButton)
self.abortButton.Bind(wx.EVT_BUTTON, self.OnAbortButton)
self.logButton.Bind(wx.EVT_BUTTON, self.OnLogButton)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer2 = wx.BoxSizer(wx.HORIZONTAL)
self.sizer.Add(infoboxbsizer, 0, wx.ALL | wx.EXPAND, 5)
self.sizer.Add(self.gauge, 0, wx.ALL | wx.EXPAND, 5)
self.sizer.Add(self.update_label, 0, wx.ALL | wx.EXPAND, 5)
self.sizer.Add(self.update_box, 0, wx.ALL | wx.EXPAND, 5)
self.sizer.Add(self.line, 0, wx.ALL | wx.EXPAND, 5)
self.sizer.Add(self.chk_shutdown, 0, wx.LEFT | wx.EXPAND, 7)
self.sizer2.Add(self.logButton, 0)
self.sizer2.AddStretchSpacer()
self.sizer2.Add(self.startButton, 0)#, wx.RIGHT, 2)
self.sizer2.Add(self.abortButton, 0)
self.sizer.Add(self.sizer2, 0, wx.ALL | wx.EXPAND, 5)
self.panel.SetSizerAndFit(self.sizer)
self.Center()
评论列表
文章目录