1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
| # -*- coding:iso-8859-15 -*-
import wxversion, os, getopt, sys, urllib, signal, urlparse
wxversion.select("2.8")
import wx
class VarGUI(object):
currentBuffer = ""
class VarPOL(object):
int2 = 0
class VarOther(object):
int3 = 0
########################## DECLARATION FENÊTRE PRINCIPALE #########################
class POLscFenp(wx.MDIParentFrame): #fenêtre principale
def __init__(self, titre):
wx.MDIParentFrame.__init__(self, None, -1, title = titre,
style = wx.DEFAULT_FRAME_STYLE |wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX, size = (1024, 768))
#print self
#******************* Menus ******************
#main
self.fileMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.commandMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.sendMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.configMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.aboutMenu = wx.Menu(style = wx.MENU_TEAROFF)
#sub
self.fileDirectorySubMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.prefixeSubMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.wineVersionSubMenu = wx.Menu(style = wx.MENU_TEAROFF)
self.CDROMSubMenu = wx.Menu(style = wx.MENU_TEAROFF)
#******************* Assignation ***************
#Fichier
self.fileMenu.Append(wx.ID_NEW, "&Nouveau\tCTRL+n", "Nouveau script")
self.fileMenu.Append(wx.ID_OPEN, "&Ouvrir\tCTRL+o", "Ouvrir un script/fichier")
self.fileMenu.Append(wx.ID_SAVE, "&Enregistrer\tCTRL+s", "Enregistrer le fichier courant")
self.fileMenu.Append(wx.ID_SAVEAS, "&Enregistrer sous...\tCTRL+a", "Enregistrer sous")
self.fileMenu.AppendSeparator()
self.fileMenu.Append(wx.ID_EXIT, "&Quitter\tCTRL+q", "Quitter")
#Send
self.sendMenu.Append(-1, "&Executer le script", "Executer le script dans PlayOnLinux")
self.sendMenu.Append(-1, "&Proposer son script", "Proposer son script sur playonlinux.com")
#Files and directory (SUB)
self.fileDirectorySubMenu.Append(-1, "&Se placer dans un répertoire", "")
#Prefix (SUB)
self.prefixeSubMenu.Append(-1, "&Créer un préfixe", "")
#Wine Versions (SUB)
self.wineVersionSubMenu.Append(-1, "&Assigner une version de Wine", "")
self.wineVersionSubMenu.Append(-1, "&Désassigner une version de Wine", "")
self.wineVersionSubMenu.Append(-1, "&Installer une version de Wine", "")
self.wineVersionSubMenu.Append(-1, "&Désinstaller une version de Wine", "")
#CDROM (SUB)
self.CDROMSubMenu.Append(-1, "&Choisir le point de montage", "")
self.CDROMSubMenu.Append(-1, "&Monter le lecteur sur un point de montage", "")
self.CDROMSubMenu.Append(-1, "&Tester la présence d'un executable", "")
#Commands
self.commandMenu.AppendSubMenu(self.fileDirectorySubMenu, "Fichier et répertoire", "")
self.commandMenu.AppendSubMenu(self.prefixeSubMenu, "Préfixes Wine", "")
self.commandMenu.AppendSubMenu(self.wineVersionSubMenu, "Versions de Wine", "")
self.commandMenu.AppendSubMenu(self.CDROMSubMenu, "CD-ROM", "")
#Config
self.configMenu.Append(1000, "&Configurer l'interface", "")
self.configMenu.Append(-1, "&Langue", "")
#About
self.aboutMenu.Append(wx.ID_HELP, "&Aide en ligne", "Obtenir de l'aide en ligne")
self.aboutMenu.Append(wx.ID_ABOUT, "&À propos de PolScriptCreator", "À propos de PolScriptCreator")
#******************* Implantation **************
self.menuBar = wx.MenuBar()
self.menuBar.Append(self.fileMenu, "&Fichier")
self.menuBar.Append(self.sendMenu, "&Finalisation")
self.menuBar.Append(self.commandMenu, "&Fonctions")
self.menuBar.Append(self.configMenu, "&Configuration")
self.menuBar.Append(self.aboutMenu, "&A propos")
self.SetMenuBar(self.menuBar)
#******************* ToolBar ********************
self.toolBar = self.CreateToolBar(wx.TB_TEXT)
self.toolBar.AddLabelTool(wx.ID_NEW, "", wx.ArtProvider.GetBitmap("gtk-new", wx.ART_TOOLBAR))
self.toolBar.AddLabelTool(wx.ID_OPEN, "", wx.ArtProvider.GetBitmap("gtk-open", wx.ART_TOOLBAR))
self.toolBar.AddLabelTool(wx.ID_SAVE, "", wx.ArtProvider.GetBitmap("gtk-save", wx.ART_TOOLBAR))
#******************* TextArea *******************
#self.currentTextArea = wx.TextCtrl(self, -1, "Bonjour ", wx.DefaultPosition,(1024, 764), wx.TE_MULTILINE)
######################################### EVENENEMENTS ##############################################
wx.EVT_MENU(self, wx.ID_ABOUT, self.aboutPOLSC)
wx.EVT_MENU(self, 1000, self.startFunctionCd)
######################################## FONCTIONS GUI ##############################################
def aboutPOLSC(self, event):
self.aboutBox = wx.AboutDialogInfo()
self.aboutBox.SetName("PolScriptCreator")
self.aboutBox.SetVersion("0.1")
self.aboutBox.SetDescription("Créateur de script pour PlayOnLinux")
self.aboutBox.SetCopyright("(C) Zoloom \nSous licence GPL version 3")
self.aboutBox.AddDeveloper("Zoloom (Cassarin-Grand Arthur)")
self.aboutBox.AddArtist("Les logos sont issus des projets Tango et Crystal Project")
self.aboutBox.SetWebSite("http://www.playonlinux.com")
self.about = wx.AboutBox(self.aboutBox)
def startFunctionCd(self, event):
fenFCd = FunctionCd(self, "Parcourir un répertoire")
fenFCd.Show(True)
class FunctionCd(wx.MDIChildFrame):
def __init__(self, parent, titre):
wx.MDIChildFrame.__init__(self, parent, -1,
title = titre,
style = wx.DEFAULT_FRAME_STYLE |wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX,
size = (300, 500), pos=(50, 50))
self.panel = wx.Panel(self, -1)
self.txt = wx.StaticText(self.panel, -1, "fenetre enfant", pos=(10, 10))
########################## DECLARATION DE L'APPLICATION ###########################
class POLscApp(wx.App): #instance principale classe application
def OnInit(self):
fenp = POLscFenp("PlayOnLinux - PolScriptCreator")
fenp.Center(wx.BOTH)
fenp.Show(True)
self.SetTopWindow(fenp)
return True
FenpApp = POLscApp(redirect=False) #création de l'application
FenpApp.MainLoop() |
Partager