Exemple #1
0
    def __init__(self, app, panel_class):
        #title = 'Allmydata Config Wizard'
        title = 'Setup - Allmydata'
        wx.Frame.__init__(self, None, -1, title)
        self.app = app
        self.SetIcon(amdlogo.getIcon())
        self.Bind(wx.EVT_CLOSE, self.close)

        self.SetSizeHints(500, 360, 600, 800)

        banner = wx.Panel(self, -1)
        banner.SetSize((496,58))
        banner.SetBackgroundColour(wx.WHITE)

        banner_title = wx.StaticText(banner, -1, panel_class.title)
        banner_desc = wx.StaticText(banner, -1, "        " + panel_class.description)
        font = banner_title.GetFont()
        font.SetWeight(wx.FONTWEIGHT_BOLD)
        banner_title.SetFont(font)
        banner_icon = wx.StaticBitmap(banner, -1, amdlogo.getBitmap())
        banner_label_sizer = wx.BoxSizer(wx.VERTICAL)
        banner_label_sizer.Add(banner_title, 0, wx.EXPAND | wx.ALL, 2)
        banner_label_sizer.Add(banner_desc, 0, wx.EXPAND | wx.ALL, 2)

        banner_sizer = wx.BoxSizer(wx.HORIZONTAL)
        banner_sizer.Add(banner_label_sizer, 1, wx.EXPAND | wx.ALL, 12)
        banner_sizer.Add(banner_icon, 0, wx.ALL, 12)
        banner.SetSizer(banner_sizer)
        banner.SetAutoLayout(True)

        background = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
        background.parent = self

        button_panel = wx.Panel(self, -1)
        button_panel.SetSize((496, 64))

        self.panel = panel_class(background, button_panel, app)
        sizer = wx.BoxSizer(wx.VERTICAL)
        background_sizer = wx.BoxSizer(wx.VERTICAL)
        background_sizer.Add(wx.Size(2,2), 0, wx.EXPAND | wx.ALL, self.panel.padding)
        background_sizer.Add(self.panel, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 26)
        background_sizer.Add(wx.Size(2,2), 0, wx.EXPAND | wx.ALL, self.panel.padding)
        background.SetSizer(background_sizer)


        sizer.Add(banner, 0, wx.EXPAND | wx.HORIZONTAL, 0)
        sizer.Add(background, 0, wx.EXPAND | wx.ALL, 0)
        sizer.Add(button_panel, 0, wx.EXPAND | wx.HORIZONTAL, 0)
        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        self.Fit()
        self.Layout()
Exemple #2
0
    def __init__(self, parent, on_close):
        wx.Panel.__init__(self, parent, -1)
        self.parent = parent

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        vbox = wx.BoxSizer(wx.VERTICAL)
        self.sizer = wx.BoxSizer(wx.VERTICAL)

        self.icon = wx.StaticBitmap(self, -1, amdlogo.getBitmap())
        self.label = wx.StaticText(self, -1, 'Allmydata')
        bigfont = self.label.GetFont()
        bigfont.SetPointSize(26)
        smlfont = self.label.GetFont()
        smlfont.SetPointSize(10)
        self.label.SetFont(bigfont)
        ver = "Version 3.0 (%s)" % (allmydata.__version__,)
        self.ver_label = wx.StaticText(self, -1, ver)
        self.ver_label.SetFont(smlfont)
        copy = u"Copyright \N{COPYRIGHT SIGN} 2004-2008 Allmydata Inc.,"
        self.copy_label = wx.StaticText(self, -1, copy)
        self.copy_label.SetFont(smlfont)
        self.res_label = wx.StaticText(self, -1, "All Rights Reserved.")
        self.res_label.SetFont(smlfont)
        ##self.ok = wx.Button(self, -1, 'Ok')
        ##self.Bind(wx.EVT_BUTTON, on_close, self.ok)
        hbox.Add(self.icon, 0, wx.CENTER | wx.ALL, 2)
        vbox.Add(self.label, 0, wx.CENTER | wx.ALL, 2)
        vbox.Add(self.ver_label, 0, wx.CENTER | wx.ALL, 2)
        hbox.Add(vbox)
        self.sizer.Add(hbox)
        self.sizer.Add(wx.Size(8,8), 1, wx.EXPAND | wx.ALL, 2)
        self.sizer.Add(self.copy_label, 0, wx.CENTER | wx.ALL, 2)
        self.sizer.Add(self.res_label, 0, wx.CENTER | wx.ALL, 2)
        #self.sizer.Add(wx.Size(42,42), 1, wx.EXPAND | wx.ALL, 2)
        ##self.sizer.Add(self.ok, 0, wx.CENTER | wx.ALL, 2)
        self.SetSizer(self.sizer)
        self.SetAutoLayout(True)