def __init__(self, parent, label, edit_label='edit'): """ A wx.Checkbox which displays a hyperlink next to it when checked. This should be subclassed and the on_checkbox and on_edit_link methods should be overridden to handle their respective events. """ self.parent = parent wx.BoxSizer.__init__(self, wx.HORIZONTAL) self.checkbox = wx.CheckBox(parent, -1, label + " ") self.edit_link = wx.HyperlinkCtrl(parent, wx.ID_ANY, edit_label, "", style=wx.HL_ALIGN_CENTRE | wx.BORDER_NONE) self.edit_link_parentheses = [ wx.StaticText(parent, wx.ID_ANY, "("), wx.StaticText(parent, wx.ID_ANY, ")") ] f = self.edit_link.GetFont() f.SetUnderlined(False) self.edit_link.SetFont(f) self.edit_link.SetVisitedColour(self.edit_link.GetNormalColour()) #gridlines editing self.edit_link.Show(False) self.edit_link_parentheses[0].Show(False) self.edit_link_parentheses[1].Show(False) wx.EVT_HYPERLINK(parent, self.edit_link.GetId(), self.on_edit_link) self.Add(self.checkbox, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTRE_VERTICAL) self.Add( self.edit_link_parentheses[0], 0, wx.ALIGN_LEFT | wx.ALIGN_CENTRE_VERTICAL | wx.RESERVE_SPACE_EVEN_IF_HIDDEN) self.Add( self.edit_link, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTRE_VERTICAL | wx.RESERVE_SPACE_EVEN_IF_HIDDEN) self.Add( self.edit_link_parentheses[1], 0, wx.ALIGN_LEFT | wx.ALIGN_CENTRE_VERTICAL | wx.RESERVE_SPACE_EVEN_IF_HIDDEN) wx.EVT_CHECKBOX(parent, self.checkbox.GetId(), self._on_checkbox)
def addCat(self, name, icon, iid): espace = 80 if (os.environ["POL_OS"] == "Mac"): offset = 10 w_offset = 5 else: offset = 2 w_offset = 10 self.cats_icons[name] = wx.BitmapButton(self.panelButton, 2000 + iid, wx.Bitmap(icon), (0, 0), style=wx.NO_BORDER) self.cats_links[name] = wx.HyperlinkCtrl(self.panelButton, 3000 + iid, name, "", pos=(0, 52)) mataille = self.cats_links[name].GetSize()[0] mataille2 = self.cats_icons[name].GetSize()[0] image_pos = (espace - mataille2) / 2 + espace * iid self.cats_links[name].SetPosition( (espace * iid + espace / 2 - mataille / 2, 47)) self.cats_icons[name].SetPosition((image_pos, offset)) #self.cats_icons[name].SetSize((espace,100)) wx.EVT_HYPERLINK(self, 3000 + iid, self.AddApps) wx.EVT_BUTTON(self, 2000 + iid, self.AddApps) #self.cats_icons[name].Bind(wx.EVT_LEFT_DOWN, 2000+iid, self.AddApps) self.cats_links[name].SetNormalColour(wx.Colour(0, 0, 0)) self.cats_links[name].SetVisitedColour(wx.Colour(0, 0, 0)) self.cats_links[name].SetHoverColour(wx.Colour(0, 0, 0)) self.cats_links[name].SetBackgroundColour((255, 255, 255)) self.cats_links[name].SetFont(self.fontText)
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size=(800, 550 + Variables.windows_add_size), style=wx.CLOSE_BOX | wx.CAPTION | wx.MINIMIZE_BOX) self.cats_icons = {} self.cats_links = {} self.description = getDescription() self.panelFenp = wx.Panel(self, -1) self.panelItems = wx.Panel(self.panelFenp, -1, size=(800, 550 + Variables.windows_add_size), pos=(0, 71)) self.panelWait = wx.Panel(self.panelFenp, -1, size=(800, 550 + Variables.windows_add_size), pos=(0, 71)) self.panelWait.Hide() self.panelManual = wx.Panel(self.panelFenp, -1, size=(800, 550 + Variables.windows_add_size), pos=(0, 71)) self.panelManual.Hide() self.currentPanel = 0 # [ 1 = manual, 0 = items ] # Categories self.panelButton = wx.Panel(self.panelFenp, -1, size=(802, 69), pos=(-1, -1), style=Variables.widget_borders) self.panelButton.SetBackgroundColour((255, 255, 255)) if (os.environ["POL_OS"] == "Mac"): self.fontText = wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "", wx.FONTENCODING_DEFAULT) self.fontTitre = wx.Font(14, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT) else: self.fontText = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "", wx.FONTENCODING_DEFAULT) self.fontTitre = wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT) self.addCat( _("Accessories"), Variables.playonlinux_env + "/resources/images/install/32/applications-accessories.png", 0) self.addCat( _("Development"), Variables.playonlinux_env + "/resources/images/install/32/applications-development.png", 1) self.addCat( _("Education"), Variables.playonlinux_env + "/resources/images/install/32/applications-science.png", 2) self.addCat( _("Games"), Variables.playonlinux_env + "/resources/images/install/32/applications-games.png", 3) self.addCat( _("Graphics"), Variables.playonlinux_env + "/resources/images/install/32/applications-graphics.png", 4) self.addCat( _("Internet"), Variables.playonlinux_env + "/resources/images/install/32/applications-internet.png", 5) self.addCat( _("Multimedia"), Variables.playonlinux_env + "/resources/images/install/32/applications-multimedia.png", 6) self.addCat( _("Office"), Variables.playonlinux_env + "/resources/images/install/32/applications-office.png", 7) self.addCat( _("Other"), Variables.playonlinux_env + "/resources/images/install/32/applications-other.png", 8) self.addCat( _("Patches"), Variables.playonlinux_env + "/resources/images/install/32/view-refresh.png", 9) self.live = 0 self.openMin = False self.SetIcon( wx.Icon(Variables.playonlinux_env + "/etc/playonlinux.png", wx.BITMAP_TYPE_ANY)) self.images_cat = wx.ImageList(22, 22) self.imagesapps = wx.ImageList(22, 22) #self.list_cat = wx.TreeCtrl(self.panelItems, 105, style=wx.TR_HIDE_ROOT|wx.TR_FULL_ROW_HIGHLIGHT|Variables.widget_borders, size=(200, 363), pos=(10,10)) #self.list_cat.Hide() if (os.environ["POL_OS"] == "Mac"): self.image_position = (738 - 160, 346 - 71) self.new_size = (196, 218 - 4) self.search_offset = 3 if (os.environ["POL_OS"] == "Linux"): self.image_position = (740 - 160, 348 - 71) self.new_size = (200, 222 - 4) self.search_offset = 5 self.image = wx.StaticBitmap( self.panelItems, 108, wx.Bitmap(Variables.playonlinux_env + "/resources/images/pol_min.png"), self.image_position, wx.DefaultSize) self.image.Bind(wx.EVT_LEFT_DOWN, self.sizeUpScreen) #self.list_cat.SetSpacing(0); #self.list_cat.SetImageList(self.images_cat) position = 10 + self.search_offset #self.searchcaption = wx.StaticText(self.panelItems, -1, _("Search"), (position,82-71+self.search_offset), wx.DefaultSize) #position += self.searchcaption.GetSize()[0]+5 self.searchbox = wx.SearchCtrl(self.panelItems, 110, size=(250, 22), pos=(position, 9)) self.searchbox.SetDescriptiveText(_("Search")) position += self.searchbox.GetSize()[0] + 20 self.filterscaption = wx.StaticText( self.panelItems, -1, _("Include:"), (position, 82 - 71 + self.search_offset), wx.DefaultSize) position += self.filterscaption.GetSize()[0] + 10 self.testingChk = wx.CheckBox(self.panelItems, 401, pos=(position, 82 - 71), size=wx.DefaultSize) self.testingChk.SetValue(True) position += 15 + self.search_offset self.testingCapt = wx.StaticText( self.panelItems, -1, _("Testing"), (position, 82 - 71 + self.search_offset), wx.DefaultSize) position += self.testingCapt.GetSize()[0] + 10 self.nocdChk = wx.CheckBox(self.panelItems, 402, pos=(position, 82 - 71), size=wx.DefaultSize) position += 15 + self.search_offset self.noDvDCapt = wx.StaticText( self.panelItems, -1, _("No-cd needed"), (position, 82 - 71 + self.search_offset), wx.DefaultSize) position += self.noDvDCapt.GetSize()[0] + 10 self.freeChk = wx.CheckBox(self.panelItems, 403, pos=(position, 82 - 71), size=wx.DefaultSize) self.freeChk.SetValue(True) position += 15 + self.search_offset self.FreeCapt = wx.StaticText(self.panelItems, -1, _("Commercial"), (position, 82 - 71 + self.search_offset), wx.DefaultSize) position += self.FreeCapt.GetSize()[0] + 10 self.star_x = position self.lasthtml_content = "" self.list_apps = wx.TreeCtrl(self.panelItems, 106, style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders, size=(550, 385), pos=(15, 113 - 71)) self.list_apps.SetImageList(self.imagesapps) self.list_apps.SetSpacing(0) self.stars = 0 #self.content = wx.TextCtrl(self.panelItems, 107, pos=(220,301), size=(562,212), style = wx.TE_MULTILINE | wx.TE_RICH2 | wx.CB_READONLY | Variables.widget_borders) self.content = PyClickableHtmlWindow(self.panelItems, 107, style=Variables.widget_borders, pos=(580, 113 - 71), size=(200, 218)) self.button = wx.Button(self.panelItems, wx.ID_CLOSE, _("Cancel"), pos=(736 - 160, 510 - 71), size=(100, 35)) self.install_button = wx.Button(self.panelItems, wx.ID_APPLY, _("Install"), pos=(843 - 160, 510 - 71), size=(100, 35)) self.update_button = wx.Button(self.panelItems, wx.ID_REFRESH, _("Refresh"), pos=(630 - 160, 510 - 71), size=(100, 35)) self.install_button.Enable(False) self.new_panel = wx.Panel(self.panelItems, -1, pos=(740 - 160, 113 - 71), style=Variables.widget_borders, size=self.new_size) self.new_panel.SetBackgroundColour((255, 255, 255)) self.animation = wx.animate.GIFAnimationCtrl( self.new_panel, -1, Variables.playonlinux_env + "/resources/images/install/wait_mini.gif", (90, 100)) self.animation.Hide() self.new_panel.Hide() self.ManualInstall = wx.HyperlinkCtrl( self.panelItems, 111, _("Install a non-listed program"), "", pos=(10, 515 - 71)) self.ManualInstall.SetNormalColour(wx.Colour(0, 0, 0)) # Panel wait self.animation_wait = wx.animate.GIFAnimationCtrl( self.panelWait, -1, Variables.playonlinux_env + "/resources/images/install/wait.gif", ((800 - 128) / 2, (550 - 128) / 2 - 71)) self.percentageText = wx.StaticText(self.panelWait, -1, "", ((800 - 30) / 2, (550 - 128) / 2 + 128 + 10 - 71), wx.DefaultSize) self.percentageText.SetFont(self.fontTitre) self.timer = wx.Timer(self, 1) self.Bind(wx.EVT_TIMER, self.TimerAction, self.timer) self.timer.Start(200) # panel manual # self.AddApps() #wx.EVT_TREE_SEL_CHANGED(self, 105, self.AddApps) wx.EVT_TREE_SEL_CHANGED(self, 106, self.AppsDetails) wx.EVT_BUTTON(self, wx.ID_CLOSE, self.closeapp) wx.EVT_BUTTON(self, wx.ID_APPLY, self.installapp) wx.EVT_BUTTON(self, wx.ID_REFRESH, self.UpdatePol) wx.EVT_CLOSE(self, self.closeapp) wx.EVT_TREE_ITEM_ACTIVATED(self, 106, self.installapp) wx.EVT_TEXT(self, 110, self.search) wx.EVT_HYPERLINK(self, 111, self.manual) wx.EVT_CHECKBOX(self, 401, self.CheckBoxReload) wx.EVT_CHECKBOX(self, 402, self.CheckBoxReload) wx.EVT_CHECKBOX(self, 403, self.CheckBoxReload)
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size=(792, 593), style=wx.CLOSE_BOX | wx.CAPTION | wx.MINIMIZE_BOX) self.panelFenp = wx.Panel(self, -1) self.live = 0 self.SetIcon( wx.Icon(Variables.playonlinux_env + "/etc/playonlinux.png", wx.BITMAP_TYPE_ANY)) self.images_cat = wx.ImageList(22, 22) self.imagesapps = wx.ImageList(22, 22) self.list_cat = wx.TreeCtrl(self.panelFenp, 105, style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | wx.RAISED_BORDER, size=(200, 363), pos=(10, 10)) self.image = wx.StaticBitmap( self.panelFenp, -1, wx.Bitmap(Variables.playonlinux_env + "/etc/pol_min.png"), (10, 383), wx.DefaultSize) self.list_cat.SetSpacing(0) self.list_cat.SetImageList(self.images_cat) self.AddCats() self.searchbox = wx.TextCtrl(self.panelFenp, 110, size=(364, 25), pos=(319, 9)) self.searchcaption = wx.StaticText(self.panelFenp, -1, _("Search: "), (220, 15), wx.DefaultSize) self.lasthtml_content = "" self.list_apps = wx.TreeCtrl(self.panelFenp, 106, style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | wx.RAISED_BORDER, size=(562, 261), pos=(220, 40)) self.list_apps.SetImageList(self.imagesapps) self.list_apps.SetSpacing(0) self.stars = 0 self.content = wx.html.HtmlWindow(self.panelFenp, 107, style=wx.RAISED_BORDER, pos=(220, 311), size=(562, 222)) self.button = wx.Button(self.panelFenp, wx.ID_CLOSE, pos=(576, 545), size=(100, 35)) self.install_button = wx.Button(self.panelFenp, wx.ID_APPLY, pos=(683, 545), size=(100, 35)) self.update_button = wx.Button(self.panelFenp, wx.ID_REFRESH, pos=(470, 545), size=(100, 35)) self.install_button.Enable(False) self.new_panel = wx.Panel(self.panelFenp, -1, pos=(220, 311), style=wx.RAISED_BORDER, size=(562, 222)) self.new_panel.SetBackgroundColour((255, 255, 255)) self.animation = wx.animate.GIFAnimationCtrl( self.new_panel, -1, Variables.playonlinux_env + "/etc/24-0.gif", (271, 86)) self.animation.Play() self.new_panel.Hide() self.timer = wx.Timer(self, 1) self.Bind(wx.EVT_TIMER, self.TimerAction, self.timer) self.timer.Start(200) #self.ManualInstall = wx.CheckBox(self.panelFenp, 111, label=_("Install a .pol package or an unsupported application"), pos=(10,530)) self.ManualInstall = wx.HyperlinkCtrl( self.panelFenp, 111, _("Install a .pol package or an unsupported application"), "", pos=(10, 565)) self.ManualInstall.SetNormalColour(wx.Colour(0, 0, 0)) # self.AddApps() wx.EVT_TREE_SEL_CHANGED(self, 105, self.AddApps) wx.EVT_TREE_SEL_CHANGED(self, 106, self.AppsDetails) wx.EVT_BUTTON(self, wx.ID_CLOSE, self.closeapp) wx.EVT_BUTTON(self, wx.ID_APPLY, self.installapp) wx.EVT_BUTTON(self, wx.ID_REFRESH, self.UpdatePol) wx.EVT_TREE_ITEM_ACTIVATED(self, 106, self.installapp) wx.EVT_TEXT(self, 110, self.search) wx.EVT_HYPERLINK(self, 111, self.manual)
def make_gui(self): # Fonts if (os.environ["POL_OS"] == "Mac"): self.fontTitre = wx.Font(14, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT) self.fontText = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "", wx.FONTENCODING_DEFAULT) else: self.fontTitre = wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT) self.fontText = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "", wx.FONTENCODING_DEFAULT) # GUI elements self.panel = wx.Panel(self, -1, pos=(0, 0), size=((520, 398 + Variables.windows_add_size))) self.header = wx.Panel(self.panel, -1, style=Variables.widget_borders, size=(522, 65)) self.header.SetBackgroundColour((255, 255, 255)) self.footer = wx.Panel(self.panel, -1, size=(522, 45), pos=(-1, 358), style=Variables.widget_borders) # Panels self.MainPanel = wx.Panel(self.panel, -1, pos=(150, 0), size=(370, 356)) self.MainPanel.SetBackgroundColour((255, 255, 255)) # Images self.top_image = wx.StaticBitmap(self.header, -1, self.small_image, (self.small_x, 0), wx.DefaultSize) self.left_image = wx.StaticBitmap(self.panel, -1, self.big_image, (0, 0), wx.DefaultSize) # Text self.titre_header = wx.StaticText(self.header, -1, _('{0} Wizard').format( os.environ["APPLICATION_TITLE"]), pos=(5, 5), size=(340, 356), style=wx.ST_NO_AUTORESIZE) self.titre_header.SetFont(self.fontTitre) self.titre_header.SetForegroundColour((0, 0, 0)) # For dark themes self.texte = wx.StaticText(self.panel, -1, "", pos=(20, 80), size=(480, 275), style=wx.ST_NO_AUTORESIZE) self.texte_bis = wx.StaticText(self.panel, -1, "", size=(480, 30), style=wx.ST_NO_AUTORESIZE) self.titre = wx.StaticText(self.header, -1, "", pos=(20, 30), size=(340, 356), style=wx.ST_NO_AUTORESIZE) self.titre.SetForegroundColour((0, 0, 0)) # For dark themes self.texteP = wx.StaticText(self.MainPanel, -1, "", pos=(5, 50)) self.texteP.SetForegroundColour((0, 0, 0)) # For dark themes self.titreP = wx.StaticText(self.MainPanel, -1, "", pos=(5, 5), size=(340, 356)) self.titreP.SetFont(self.fontTitre) self.titreP.SetForegroundColour((0, 0, 0)) # For dark themes self.txtEstimation = wx.StaticText(self.panel, -1, "", size=(480, 30), style=wx.ST_NO_AUTORESIZE) self.register_link = "" # Buttons if (os.environ["POL_OS"] != "Mac"): self.CancelButton = wx.Button(self.footer, wx.ID_CANCEL, _("Cancel"), pos=(430, 0), size=(85, 37)) self.NextButton = wx.Button(self.footer, wx.ID_FORWARD, _("Next"), pos=(340, 0), size=(85, 37)) else: self.CancelButton = wx.Button(self.footer, wx.ID_CANCEL, _("Cancel"), pos=(420, -3), size=(85, 37)) self.NextButton = wx.Button(self.footer, wx.ID_FORWARD, _("Next"), pos=(330, -3), size=(85, 37)) if (self.ProtectedWindow == True): self.CancelButton.Enable(False) self.InfoScript = wx.StaticBitmap( self.footer, -1, wx.Bitmap(os.environ['PLAYONLINUX'] + "/resources/images/setups/about.png"), pos=(10, 8)) self.InfoScript.Hide() self.script_ID = 0 self.InfoScript.Bind(wx.EVT_LEFT_DOWN, self.InfoClick) self.InfoScript.SetCursor(wx.StockCursor(wx.CURSOR_HAND)) self.DebugScript = wx.StaticBitmap( self.footer, -1, wx.Bitmap(os.environ['PLAYONLINUX'] + "/resources/images/setups/bug.png"), pos=(32, 8)) self.DebugScript.Hide() self.script_LOGTITLE = None self.DebugScript.Bind(wx.EVT_LEFT_DOWN, self.DebugClick) self.DebugScript.SetCursor(wx.StockCursor(wx.CURSOR_HAND)) if (os.environ["POL_OS"] != "Mac"): self.NoButton = wx.Button(self.footer, wx.ID_NO, _("No"), pos=(430, 0), size=(85, 37)) self.YesButton = wx.Button(self.footer, wx.ID_YES, _("Yes"), pos=(340, 0), size=(85, 37)) else: self.NoButton = wx.Button(self.footer, wx.ID_NO, _("No"), pos=(420, -3), size=(85, 37)) self.YesButton = wx.Button(self.footer, wx.ID_YES, _("Yes"), pos=(330, -3), size=(85, 37)) self.browse = wx.Button(self.panel, 103, _("Browse"), size=(130, 40)) self.browse_text = wx.StaticText(self.panel, -1, "") self.browse_image = wx.StaticBitmap( self.panel, -1, wx.Bitmap(os.environ['PLAYONLINUX'] + "/etc/playonlinux.png")) # D'autres trucs self.champ = wx.TextCtrl(self.panel, 400, "", size=(300, 22)) self.bigchamp = wx.TextCtrl(self.panel, -1, "", size=wx.Size(460, 240), pos=(30, 105), style=Variables.widget_borders | wx.TE_MULTILINE) self.MCheckBox = wx.CheckBox(self.panel, 302, _("I Agree"), pos=(20, 325)) self.NCheckBox = wx.CheckBox(self.panel, 305, _("Don't remind me anymore"), pos=(20, 325)) self.PCheckBox = wx.CheckBox(self.panel, 304, _("Show virtual drives"), pos=(20, 325)) self.Menu = wx.ListBox(self.panel, 104, pos=(25, 105), size=(460, 220), style=Variables.widget_borders) self.scrolled_panel = wx.ScrolledWindow(self.panel, -1, pos=(20, 100), size=(460, 220), style=Variables.widget_borders | wx.HSCROLL | wx.VSCROLL) self.scrolled_panel.SetBackgroundColour((255, 255, 255)) self.texte_panel = wx.StaticText(self.scrolled_panel, -1, "", pos=(5, 5)) self.gauge = wx.Gauge(self.panel, -1, 50, size=(375, 20)) self.WaitButton = wx.Button(self.panel, 310, "", size=(250, 25)) self.animation = wx.StaticBitmap(self.panel, -1, self.GetLoaderFromAngle(1), (228, 170)) self.current_angle = 1 self.images = wx.ImageList(22, 22) self.MenuGames = wx.TreeCtrl(self.panel, 111, style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders, pos=(25, 105), size=(460, 220)) self.MenuGames.SetImageList(self.images) self.MenuGames.SetSpacing(0) # Login self.login = wx.StaticText(self.panel, -1, _("Login: "******"Password: "******"", size=(250, 22), pos=(200, 115)) self.passbox = wx.TextCtrl(self.panel, -1, "", size=(250, 22), pos=(200, 145), style=wx.TE_PASSWORD) self.register = wx.HyperlinkCtrl(self.panel, 303, _("Register"), "", pos=(20, 180)) self.register.SetNormalColour(wx.Colour(0, 0, 0)) # Fixed Events wx.EVT_BUTTON(self, wx.ID_YES, self.release_yes) wx.EVT_BUTTON(self, wx.ID_NO, self.release_no) wx.EVT_BUTTON(self, wx.ID_CANCEL, self.Cancel) wx.EVT_BUTTON(self, 103, self.Parcourir) wx.EVT_CHECKBOX(self, 302, self.agree) wx.EVT_CHECKBOX(self, 304, self.switch_menu) wx.EVT_HYPERLINK(self, 303, self.POL_register) # Debug Window self.debugImage = wx.StaticBitmap( self.panel, -1, wx.Bitmap(Variables.playonlinux_env + "/resources/images/setups/face-sad.png"), (196, 130)) self.debugZone = wx.TextCtrl(self.panel, -1, "", size=wx.Size(440, 82), pos=(40, 274), style=Variables.widget_borders | wx.TE_MULTILINE | wx.TE_READONLY) # Hide all self.Destroy_all() self.Result = "" self.animation.Show() self.footer.Hide() # Set the timer self.timer = wx.Timer(self, 3) self.Bind(wx.EVT_TIMER, self.TimerAction, self.timer) self.timer.Start(100) self.Timer_downloading = False self.Timer_animate = True
def _createUI(self): # GUI elements self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(self.mainSizer) self._createPresentationPanel() self._createHeader() self.mainSizer.AddSpacer(10) self._createMain() self._createFooter() self.texte = wx.StaticText(self.contentPanel, -1, "", pos=(20, 0), size=(480, 275), style=wx.ST_NO_AUTORESIZE) self.texte_bis = wx.StaticText(self.contentPanel, -1, "", size=(480, 30), style=wx.ST_NO_AUTORESIZE) self.txtEstimation = wx.StaticText(self.contentPanel, -1, "", size=(480, 30), style=wx.ST_NO_AUTORESIZE) self.register_link = "" self.browse = wx.Button(self.contentPanel, 103, _("Browse"), size=(130, 40)) self.browse_text = wx.StaticText(self.contentPanel, -1, "") self.browse_image = wx.StaticBitmap( self.contentPanel, -1, wx.Bitmap(os.environ['PLAYONLINUX'] + "/etc/playonlinux.png")) # D'autres trucs self.champ = wx.TextCtrl(self.contentPanel, 400, "", size=(300, 22)) self.bigchamp = wx.TextCtrl(self.contentPanel, -1, "", size=wx.Size(460, 240), pos=(30, 25), style=Variables.widget_borders | wx.TE_MULTILINE) self.MCheckBox = wx.CheckBox(self.contentPanel, 302, _("I Agree"), pos=(20, 245)) self.NCheckBox = wx.CheckBox(self.contentPanel, 305, _("Don't remind me anymore"), pos=(20, 245)) self.PCheckBox = wx.CheckBox(self.contentPanel, 304, _("Show virtual drives"), pos=(20, 245)) self.Menu = wx.ListBox(self.contentPanel, 104, pos=(25, 25), size=(460, 220), style=Variables.widget_borders) self.scrolled_panel = wx.ScrolledWindow(self.contentPanel, -1, pos=(20, 20), size=(460, 220), style=Variables.widget_borders | wx.HSCROLL | wx.VSCROLL) self.scrolled_panel.SetBackgroundColour((255, 255, 255)) self.texte_panel = wx.StaticText(self.scrolled_panel, -1, "", pos=(5, 5)) self.gauge = wx.Gauge(self.contentPanel, -1, 50, size=(375, 20)) self.WaitButton = wx.Button(self.contentPanel, 310, "", size=(250, 25)) self.animation = wx.StaticBitmap(self.contentPanel, -1, self.GetLoaderFromAngle(1), (228, 170)) self.current_angle = 1 self.images = wx.ImageList(22, 22) self.MenuGames = wx.TreeCtrl(self.contentPanel, 111, style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders, pos=(25, 25), size=(460, 220)) self.MenuGames.SetImageList(self.images) self.MenuGames.SetSpacing(0) # Login self.login = wx.StaticText(self.contentPanel, -1, _("Login: "******"Password: "******"", size=(250, 22), pos=(200, 35)) self.passbox = wx.TextCtrl(self.contentPanel, -1, "", size=(250, 22), pos=(200, 65), style=wx.TE_PASSWORD) self.register = wx.HyperlinkCtrl(self.contentPanel, 303, _("Register"), "", pos=(20, 100)) self.register.SetNormalColour(wx.Colour(0, 0, 0)) # Fixed Events wx.EVT_BUTTON(self, wx.ID_YES, self.release_yes) wx.EVT_BUTTON(self, wx.ID_NO, self.release_no) wx.EVT_BUTTON(self, wx.ID_CANCEL, self.Cancel) wx.EVT_BUTTON(self, 103, self.Parcourir) wx.EVT_CHECKBOX(self, 302, self.agree) wx.EVT_CHECKBOX(self, 304, self.switch_menu) wx.EVT_HYPERLINK(self, 303, self.POL_register) # Debug Window self.debugImage = wx.StaticBitmap( self.contentPanel, -1, wx.Bitmap(Variables.playonlinux_env + "/resources/images/setups/face-sad.png"), (196, 60)) self.debugZone = wx.TextCtrl(self.contentPanel, -1, "", size=wx.Size(440, 82), pos=(40, 194), style=Variables.widget_borders | wx.TE_MULTILINE | wx.TE_READONLY) # Hide all self.resetSetupWindow() self.Result = "" self.animation.Show() self.footer.Hide() # Set the timer self.timer = wx.Timer(self, 3) self.Bind(wx.EVT_TIMER, self.TimerAction, self.timer) self.timer.Start(100) self.Timer_downloading = False self.Timer_animate = True
def make_gui(self): # Fonts if(os.environ["POL_OS"] == "Mac"): self.fontTitre = wx.Font(14, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT) self.fontText = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,False, "", wx.FONTENCODING_DEFAULT) else : self.fontTitre = wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT) self.fontText = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,False, "", wx.FONTENCODING_DEFAULT) # GUI elements self.panel = wx.Panel(self, -1, pos=(0,0), size=((520, 398+Variables.windows_add_size))) self.header = wx.Panel(self.panel, -1, style=Variables.widget_borders, size=(522,65)) self.header.SetBackgroundColour((255,255,255)) self.footer = wx.Panel(self.panel, -1, size=(522,45), pos=(-1,358), style=Variables.widget_borders) # Panels self.MainPanel = wx.Panel(self.panel, -1, pos=(150,0), size=(370,356)) self.MainPanel.SetBackgroundColour((255,255,255)) # Images self.top_image = wx.StaticBitmap(self.header, -1, self.small_image, (self.small_x,0), wx.DefaultSize) self.left_image = wx.StaticBitmap(self.panel, -1, self.big_image, (0,0), wx.DefaultSize) # Text self.titre_header = wx.StaticText(self.header, -1, _('{0} Wizard').format(os.environ["APPLICATION_TITLE"]),pos=(5,5), size=(340,356)) self.titre_header.SetFont(self.fontTitre) self.titre_header.SetForegroundColour((0,0,0)) # For dark themes self.texte = wx.StaticText(self.panel, -1, "",pos=(20,80),size=(480,275)) self.texte_bis = wx.StaticText(self.panel, -1, "",size=(480,30)) self.titre = wx.StaticText(self.header, -1, "",pos=(20,30), size=(340,356)) self.titre.SetForegroundColour((0,0,0)) # For dark themes self.texteP = wx.StaticText(self.MainPanel, -1, "",pos=(5,50)) self.texteP.SetForegroundColour((0,0,0)) # For dark themes self.titreP = wx.StaticText(self.MainPanel, -1,"",pos=(5,5), size=(340,356)) self.titreP.SetFont(self.fontTitre) self.titreP.SetForegroundColour((0,0,0)) # For dark themes self.txtEstimation = wx.StaticText(self.panel, -1, "",size=(480,30)) self.register_link = "" # Buttons self.CancelButton = wx.Button(self.footer, wx.ID_CANCEL, _("Cancel"), pos=(430,0),size=(85,37)) if(self.ProtectedWindow == True): self.CancelButton.Enable(False) self.NextButton = wx.Button(self.footer, wx.ID_FORWARD, _("Next"), pos=(340,0),size=(85,37)) self.BackButton = wx.Button(self.footer, wx.ID_FORWARD, _("Back"), pos=(250,0),size=(85,37)) self.NoButton = wx.Button(self.footer, wx.ID_NO, _("No"), pos=(430,0),size=(85,37)) self.YesButton = wx.Button(self.footer, wx.ID_YES, _("Yes"), pos=(340,0), size=(85,37)) self.browse = wx.Button(self.panel, 103, _("Browse"), size=(130,25)) #self.register = wx.HyperlinkCtrl(self.footer, 305, _("Having "), "", pos=(20,180)) # D'autres trucs self.champ = wx.TextCtrl(self.panel, 400, "",size=(300,22)) self.bigchamp = wx.TextCtrl(self.panel, -1, "",size=wx.Size(460,240), pos=(25,105),style=Variables.widget_borders|wx.TE_MULTILINE) self.MCheckBox = wx.CheckBox(self.panel, 302, _("I Agree"), pos=(20,325)) self.PCheckBox = wx.CheckBox(self.panel, 304, _("Show virtual drives"), pos=(20,325)) self.Menu = wx.ListBox(self.panel, 103, pos=(25,105),size=(460,220), style=Variables.widget_borders) self.MenuList = wx.ComboBox(self.panel, 103, style=wx.CB_READONLY) self.scrolled_panel = wx.ScrolledWindow(self.panel, -1, pos=(20,100), size=(460,220), style=Variables.widget_borders|wx.HSCROLL|wx.VSCROLL) self.scrolled_panel.SetBackgroundColour((255,255,255)) self.texte_panel = wx.StaticText(self.scrolled_panel, -1, "",pos=(5,5)) self.gauge = wx.Gauge(self.panel, -1, 50, size=(375, 20)) self.pulsebar = wx.Gauge(self.panel, -1, 50, size=(375, 20)) self.WaitButton = wx.Button(self.panel, 310, "", size=(250,25)) self.images = wx.ImageList(22, 22) self.MenuGames = wx.TreeCtrl(self.panel, 111, style=wx.TR_HIDE_ROOT|wx.TR_FULL_ROW_HIGHLIGHT|Variables.widget_borders, pos=(25,105),size=(460,220)) self.MenuGames.SetImageList(self.images) self.MenuGames.SetSpacing(0) # Login self.login = wx.StaticText(self.panel, -1, _("Login: "******"Password: "******"",size=(250,22),pos=(200,115)) self.passbox = wx.TextCtrl(self.panel, -1, "",size=(250,22),pos=(200,145), style=wx.TE_PASSWORD) self.register = wx.HyperlinkCtrl(self.panel, 303, _("Register"), "", pos=(20,180)) self.register.SetNormalColour(wx.Colour(0,0,0)) # Fixed Events wx.EVT_BUTTON(self, wx.ID_YES, self.release_yes) wx.EVT_BUTTON(self, wx.ID_NO, self.release_no) wx.EVT_BUTTON(self, wx.ID_CANCEL , self.Cancel) wx.EVT_BUTTON(self, 103, self.Parcourir) wx.EVT_CHECKBOX(self, 302, self.agree) wx.EVT_CHECKBOX(self, 304, self.switch_menu) wx.EVT_HYPERLINK(self, 303, self.POL_register) #wx.EVT_HYPERLINK(self, 305, self.Send_Bug) # Hide all self.Destroy_all()