From 0907833e1d87414215c13952336e2e8069042d31 Mon Sep 17 00:00:00 2001 From: pin Date: Tue, 16 Feb 2010 15:53:15 +0000 Subject: [PATCH] =?utf8?q?Affichage=20de=20l'=C3=A9cran=20d'accueil,=20ave?= =?utf8?q?c=20quelques=20remaniement=20sur=20le=20placement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@34 fe552daf-6dbe-4428-90eb-1537e0879342 --- src/app/widgets.py | 73 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/src/app/widgets.py b/src/app/widgets.py index e70ce5d..ab6763f 100755 --- a/src/app/widgets.py +++ b/src/app/widgets.py @@ -5,9 +5,80 @@ widgets minwii. $Id$ $URL$ """ -from pgu.gui import Table +from pgu.gui import Table, Spacer, Label, Button, Switch, Select +import pygame +from gui.constants import reversedReadabilityDict, modeDict class Home(Table) : + """ + Écran de démarrage de minwii + """ + def __init__(self,**params): Table.__init__(self,**params) + self.spaceSize = (100,100) + self.font = pygame.font.Font(None,70) + self._fill() + + + def _fill(self): + self.tr() + self.td(Spacer(*self.spaceSize)) + + + # bouton pour browser de fichiers + self.tr() + self.td(self.createLabel("Chanson :")) + self.browseButton = Button(self.createLabel("Choisir...")) + self.td(self.browseButton,colspan=2) + self.songSwitch = Switch(False) + self.td(self.songSwitch) + + self.tr() + self.td(Spacer(*self.spaceSize)) + + # choix du niveau + self.tr() + self.td(self.createLabel("Niveau :")) + self.modeSelect = Select('easy') + for key in modeDict.keys() : + self.modeSelect.add(self.createLabel(reversedReadabilityDict[key]),key) + self.td(self.modeSelect,colspan=3) + + self.tr() + self.td(Spacer(*self.spaceSize)) + + # choix des wiimotes + self.tr() + self.td(self.createLabel("Joueurs :", self.font)) + playerTable = Table() + self.activeWiimoteSwitches = [] + for i in range(4): + s = Switch(False) + playerTable.td(s) + playerTable.td(self.createLabel(" %d " % (i+1))) + self.activeWiimoteSwitches.append(s) + self.td(playerTable,colspan = 3) + + self.tr() + self.td(Spacer(*self.spaceSize)) + + # boutons jouer / quitter + self.tr() + self.quitButton = Button(self.createLabel("Quitter")) + self.td(self.quitButton) + self.goButton = Button(self.createLabel("Jouer")) + self.td(self.goButton,colspan=3) + + self.tr() + self.td(Spacer(500,500)) + + def createLabel(self,text,font = None): + if font == None : + font = self.font + w,h = self.font.size(text) + label = Label(text,width=w,height=h,font = font) + return(label) + + \ No newline at end of file -- 2.20.1