Beispiel #1
0
    def afficher(self, record):
        if self.parent.IsShown():
            texte = self.format(record)
            tb = toast.ToasterBox(self.parent, toast.TB_SIMPLE,
                                  toast.TB_DEFAULT_STYLE,
                                  toast.TB_ONTIME | toast.TB_ONCLICK)

            w = 200
            h = 125
            tb.SetPopupSize((w, h))

            rect = self.parent.GetRect()
            x = rect[0] + rect[2] - w
            y = rect[1] + rect[3] - h
            tb.SetPopupPosition((x, y))

            tb.SetPopupPauseTime(3000)
            tb.SetPopupScrollSpeed(1)

            tb.SetPopupBackgroundColour(images.couleur('selection'))
            tb.SetPopupTextColour(images.couleur('texte_bouton'))

            tb.SetPopupText(texte)
            tb.SetPopupTextFont(wx.Font(12, wx.SWISS, wx.ITALIC, wx.NORMAL))

            tb.Play()
Beispiel #2
0
    def info_systeme(self, event):
        dlg = wx.Dialog(self,
                        style=wx.DEFAULT_DIALOG_STYLE | wx.CENTER_ON_SCREEN)
        dlg.CenterOnScreen()

        grille = grid.Grid(dlg, wx.ID_ANY)
        grille.CreateGrid(0, 2)
        grille.SetRowLabelSize(0)
        grille.SetDefaultCellBackgroundColour(images.couleur('grille'))
        grille.SetColLabelValue(0, u"Elément")
        grille.SetColSize(0, dlg.GetSize()[0] / 2)
        grille.SetColLabelValue(1, u"Valeur")
        grille.SetColSize(1, dlg.GetSize()[0] / 2)

        for a, b in systeme_config():
            grille.AppendRows(1)
            index = grille.GetNumberRows() - 1
            grille.SetCellValue(index, 0, " %s" % a)
            grille.SetCellValue(index, 1, b)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(grille, 1)
        dlg.SetSizer(sizer)
        dlg.Layout()

        dlg.ShowModal()
        dlg.Destroy()
Beispiel #3
0
 def attribut(self, ref='paire'):
     attr = grid.GridCellAttr()
     if ref == 'paire':
         attr.SetBackgroundColour(images.couleur('grille_paire'))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'impaire':
         attr.SetBackgroundColour(images.couleur('grille_impaire'))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'selection':
         attr.SetBackgroundColour(images.couleur('selection'))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'entete1':
         attr.SetBackgroundColour(images.couleur('gradient1'))
         attr.SetTextColour(images.couleur('texte'))
         attr.SetFont(wx.Font(14, wx.ROMAN, wx.ITALIC, wx.BOLD))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'entete2':
         attr.SetBackgroundColour(images.couleur('gradient1'))
         attr.SetTextColour(images.couleur('texte'))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     return attr
Beispiel #4
0
    def __init__(self, parent, lignes=1, colonnes=1):
        grid.Grid.__init__(self, parent, wx.ID_ANY)
        self.CreateGrid(1 + (lignes * 2), colonnes)

        self._horizontal_line_color = wx.Colour(0, 0, 0)
        self._horizontal_line_width = 3

        # Propriétés générales de la gille
        self.SetColMinimalAcceptableWidth(0)
        self.SetRowMinimalAcceptableHeight(0)
        self.SetSelectionMode(0)
        self.SetGridLineColour(images.couleur('grille'))
        self.SetDefaultCellBackgroundColour(images.couleur('grille'))
        grid.Grid.SetColLabelSize(self, 0)
        grid.Grid.SetRowLabelSize(self, 0)
        self.EnableDragColSize(False)
        self.EnableDragRowSize(False)
        self.rafraichir()
Beispiel #5
0
 def attribut(self, ref):
     attr = wx.grid.GridCellAttr()
     if ref == 'paire':
         attr.SetBackgroundColour(images.couleur('grille_paire'))
         attr.SetFont(self.font)
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'impaire':
         attr.SetBackgroundColour(images.couleur('grille_impaire'))
         attr.SetFont(self.font)
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'espace':
         attr.SetBackgroundColour(images.couleur('grille'))
         attr.SetAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     elif ref == 'entete':
         attr.SetBackgroundColour(images.couleur('texte_bouton'))
         attr.SetFont(self.font)
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetReadOnly(True)
     return attr
Beispiel #6
0
def etat_style(valeur):
    police = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)
    couleur = images.couleur(valeur)

    if valeur == cst.FORFAIT:
        texte = u"F"
    elif valeur == cst.CHAPEAU:
        texte = u"C"
    elif valeur == cst.GAGNE:
        texte = u"G"
    elif valeur == cst.PERDU:
        texte = u"P"
    else:
        texte = u""

    return texte, couleur, police
Beispiel #7
0
 def attribut(self, ref):
     attr = grid.GridCellAttr()
     if ref == 'equipe':
         attr.SetBackgroundColour(wx.Colour(255, 255, 255))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetTextColour(wx.Colour(0, 0, 200))
         attr.SetReadOnly(True)
     elif ref == 'piquet':
         attr.SetBackgroundColour(images.couleur('piquet'))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD))
         attr.SetAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
         attr.SetTextColour(wx.Colour(0, 0, 0))
         attr.SetReadOnly(False)
     elif ref == 'info':
         attr.SetBackgroundColour(wx.Colour(255, 255, 255))
         attr.SetTextColour(wx.Colour(255, 0, 0))
         attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
         attr.SetReadOnly(True)
     return attr
Beispiel #8
0
 def _tourner(self, event):
     """
     Tourner d'un pas les données.
     """
     if self._compteur < self.GetNumberRows():
         i = 0
         while i < self.GetNumberRows():
             for j in range(4):
                 self.SetCellTextColour(i, 0, wx.Colour(0, 0, 200))
                 self.SetCellTextColour(i, 1, wx.Colour(126, 126, 126))
                 self.SetCellTextColour(i, 3, wx.Colour(0, 0, 0))
                 if i < self.GetNumberRows() - 1:
                     self.SetCellValue(i, j, self.GetCellValue(i + 1, j))
                 else:
                     if self._compteur < len(self.manches):
                         equipe = self.manches[self._compteur][0]
                         adversaires = self.manches[self._compteur][1:]
                         # Equipe
                         self.SetCellValue(i, 0, unicode(equipe))
                         # Adversaires
                         if adversaires:
                             self.SetCellValue(
                                 i, 1, " - ".join(
                                     [unicode(num) for num in adversaires]))
                         else:
                             self.SetCellValue(i, 1, u"C")
                             self.SetCellTextColour(
                                 i, 1, images.couleur(cst.CHAPEAU))
                         # Piquet
                         piquet = tournoi.tournoi().equipe(equipe).resultat(
                             tournoi.tournoi().partie_courante(
                             ).numero).piquet
                         if not piquet:
                             piquet = "-"
                         self.SetCellValue(i, 3, unicode(piquet))
                     else:
                         self.SetCellValue(i, j, u"")
             i += 1
         self._compteur += 1
     else:
         self._timer.Stop()
Beispiel #9
0
    def maj(self, manches, chapeaux=[], statistiques={}):
        self.statistiques = statistiques

        # Suppression des lignes
        if self.GetNumberRows() > 0:
            self.DeleteRows(0, self.GetNumberRows())

        # Nombre de lignes (1 par manche + 1 pour les chapeaux)
        self.nbr_ligne = len(manches)
        if len(chapeaux) != 0:
            self.nbr_ligne += 1
        self.InsertRows(0, self.nbr_ligne)

        # Première ligne pour afficher les chapeaux
        i = 0
        j = 0
        if len(chapeaux) != 0:
            self.SetCellValue(i, 0, u"-")
            while j < self.equipes_par_manche:
                if j < len(chapeaux):
                    self.SetCellValue(i, j + 1, unicode(chapeaux[j]))
                else:
                    self.SetCellValue(i, j + 1, u"C")
                    self.SetCellTextColour(i, j + 1,
                                           images.couleur(cst.CHAPEAU))
                j += 1
            i += 1

        # Afficher les manches
        for piquet, m in manches.items():
            self.SetCellValue(i, 0, unicode(piquet))
            j = 1
            for e in m:
                self.SetCellValue(i, j, unicode(e))
                j += 1
            i += 1
Beispiel #10
0
    def __init__(self, parent, config):
        wx.Dialog.__init__(self,
                           parent,
                           wx.ID_ANY,
                           title=u"Informations",
                           style=wx.DEFAULT_FRAME_STYLE,
                           pos=wx.DefaultPosition)
        w, h = wx.ScreenDC().GetSizeTuple()
        self.SetSize((w * 0.5, h * 0.5))
        self.SetBackgroundColour(images.couleur('grille'))

        # Timer pour durée d'affichage des données
        self._timer = wx.Timer(self)
        self._test_statut = "test inscription"

        # Configuration
        self.config = config
        self.configurer(config.get_options('AFFICHAGE', upper_keys=True))

        # Titre
        self.txt_titre = wx.StaticText(self,
                                       wx.ID_ANY,
                                       u"",
                                       style=wx.ALIGN_CENTER)

        # Texte
        self.txt_interlude = wx.StaticText(self,
                                           wx.ID_ANY,
                                           u"",
                                           style=wx.ALIGN_CENTER)

        # Grilles tirages
        self.gri_tirages = DoubleGrilleTirage(self)
        self.gri_tirages.Show(False)

        # Grille resultats
        self.gri_resultats = GrilleResultats(self)
        gri_resultats_box = wx.BoxSizer(wx.HORIZONTAL)
        gri_resultats_box.AddSpacer((20, 10), 1, wx.EXPAND)
        gri_resultats_box.Add(self.gri_resultats)
        gri_resultats_box.AddSpacer((20, 10), 1, wx.EXPAND)
        self.gri_resultats.Show(False)

        # Texte défilant
        self.ticker = ticker.Ticker(self)

        # Position des widgets
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add((10, 10), 0, wx.EXPAND)
        self.sizer.Add(self.txt_titre, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL)
        self.sizer.Add((20, 20), 1)
        self.sizer.Add(self.txt_interlude, 0,
                       wx.EXPAND | wx.ALIGN_CENTER_VERTICAL)
        self.sizer.Add(self.gri_tirages, 0, wx.EXPAND | wx.ALIGN_CENTER)
        self.sizer.Add(gri_resultats_box, 0, wx.EXPAND | wx.ALIGN_CENTER)
        self.sizer.Add((20, 20), 1)
        self.sizer.Add(self.ticker, 0, wx.EXPAND)
        self.SetSizer(self.sizer)

        self.Bind(wx.EVT_TIMER, self._suivant, self._timer)
        self.Bind(wx.EVT_LEFT_DCLICK, self.plein_ecran)
        self.txt_titre.Bind(wx.EVT_LEFT_DCLICK, self.plein_ecran)
        self.Bind(wx.EVT_CLOSE, self.stop_timer)
        self.Bind(wx.EVT_CHAR, self.echappe)
        self.Bind(wx.EVT_SIZE, self.redim, self)
Beispiel #11
0
    def __init__(self, parent):
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)

        # Initialisation de la grille de resumé de partie
        self._grille_partie = grid.Grid(parent, wx.ID_ANY)
        self._grille_partie.CreateGrid(2, len(TITRES['partie']))
        self._grille_partie.nom = 'partie'
        self.Add(self._grille_partie)

        # Espace entre grilles
        self._espace = self.AddSpacer((50, 50), 1)

        # Initialisation de la grille des statistiques du tournoi
        self._grille_statistiques = grid.Grid(parent, wx.ID_ANY)
        self._grille_statistiques.CreateGrid(2, len(TITRES['statistiques']))
        self._grille_statistiques.nom = 'statistiques'
        self.Add(self._grille_statistiques)

        self._grilles = [self._grille_partie, self._grille_statistiques]

        # Selection précédente
        self.selection_prec = 0

        # Propriétés générales des gilles
        for grille in self._grilles:
            grille.SetDefaultCellBackgroundColour(images.couleur('grille'))
            grille.SetGridLineColour(images.couleur('grille'))
            grille.SetColMinimalAcceptableWidth(0)
            grille.EnableDragColSize(False)
            grille.EnableDragRowSize(False)
            # Supprimer ligne d'entête
            grille.SetColLabelSize(0)
            # Supprimer colonne d'entête
            grille.SetRowLabelSize(0)
            # Création de l'entête: 1ème ligne
            grille.SetRowSize(0, 30)
            grille.SetRowAttr(0, self.attribut('entete1'))
            # Création de l'entête: 2ème ligne
            grille.SetRowSize(1, 35)
            grille.SetRowAttr(1, self.attribut('entete2'))
            colonne = 0
            for titre, largeur in TITRES[grille.nom]:
                if grille.nom == 'partie':
                    ligne = 0
                    grille.SetCellSize(0, colonne, 2, 1)
                else:
                    ligne = 1
                grille.SetCellValue(ligne, colonne, titre)
                grille.SetColSize(colonne, largeur)
                colonne += 1
            # Evénements
            grille.Bind(grid.EVT_GRID_CELL_LEFT_CLICK, self.selectionner)
            grille.Bind(grid.EVT_GRID_CELL_RIGHT_CLICK, self.selectionner)
            grille.Bind(wx.EVT_KEY_DOWN, partial(self._touche, grille=grille))

        # Cellule fusionnée
        self._grille_statistiques.SetCellSize(0, 0, 1, 9)
        self._grille_statistiques.SetCellValue(0, 0,
                                               u"Statistiques du tournoi")

        self.Layout()
Beispiel #12
0
    def __init__(self, parent):
        bp.ButtonPanel.__init__(self,
                                parent,
                                wx.ID_ANY,
                                text="",
                                agwStyle=bp.BP_USE_GRADIENT,
                                alignment=bp.BP_ALIGN_LEFT)
        self.controls = []

        self.Freeze()
        # Bouton partie précédente
        self.btn_precedente = ButtonInfo(
            self,
            id=wx.ID_ANY,
            bmp=images.bitmap('precedent.png'),
            kind=wx.ITEM_NORMAL,
            shortHelp="Précédente",
            longHelp="Afficher les données de la partie précédente.")

        self.btn_precedente.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(self.btn_precedente)
        self.controls.append(self.btn_precedente)

        # Partie affichée
        self.txt_partie = wx.StaticText(self,
                                        id=wx.ID_ANY,
                                        label="0",
                                        size=(50, -1),
                                        style=wx.ALIGN_CENTER)
        self.txt_partie.SetToolTipString("Partie affichée")
        font = wx.Font(35, wx.SWISS, wx.NORMAL, wx.BOLD, False, "Impact")

        self.txt_partie.SetFont(font)
        self.txt_partie.SetForegroundColour(wx.Colour(144, 65, 21))
        self.AddControl(self.txt_partie)

        # Bouton partie suivante
        self.btn_suivante = ButtonInfo(
            self,
            id=wx.ID_ANY,
            bmp=images.bitmap('suivant.png'),
            kind=wx.ITEM_NORMAL,
            shortHelp="Suivante",
            longHelp="Afficher les données de la partie suivante.")

        self.btn_suivante.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(self.btn_suivante)
        self.controls.append(self.btn_suivante)

        # Ajouter un espace
        self.AddSpacer((100, 0), 0, wx.ALIGN_RIGHT)

        # Bouton inscription
        self.btn_equipe = ButtonInfo(
            self,
            id=ID_NOUVELLE_E,
            bmp=images.bitmap('equipe.png'),
            kind=wx.ITEM_NORMAL,
            shortHelp="Inscription",
            longHelp="Inscrire des équipes au tournoi.")

        self.btn_equipe.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(self.btn_equipe)
        self.controls.append(self.btn_equipe)

        # Bouton ajouter partie
        self.btn_partie = ButtonInfo(self,
                                     id=ID_NOUVELLE_P,
                                     bmp=images.bitmap('partie.png'),
                                     kind=wx.ITEM_NORMAL,
                                     shortHelp="Nouvelle partie",
                                     longHelp="Démarrer une nouvelle partie.")

        self.btn_partie.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(self.btn_partie)
        self.controls.append(self.btn_partie)

        # Bouton resultats
        self.btn_resultats = ButtonInfo(
            self,
            id=ID_RESULTATS,
            bmp=images.bitmap('resultats.png'),
            kind=wx.ITEM_NORMAL,
            shortHelp="Résultats",
            longHelp="Enregistrer le résultat d'une manche.")

        self.btn_resultats.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(self.btn_resultats)
        self.controls.append(self.btn_resultats)

        # Ajouter un espace
        self.AddSpacer((50, 0), 1, wx.ALL)

        # Bouton afficher informations
        self.btn_info = ButtonInfo(
            self,
            id=ID_INFO,
            bmp=images.bitmap('info.png'),
            kind=wx.ITEM_CHECK,
            shortHelp="Informations",
            longHelp=
            "Afficher les informations relatives au tournoi en fonction de son statut."
        )

        self.btn_info.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(self.btn_info)
        self.controls.append(self.btn_info)

        # Chercher
        self.box_chercher = wx.SearchCtrl(self,
                                          wx.ID_FIND,
                                          size=(200, -1),
                                          style=wx.TE_PROCESS_ENTER)

        menu = wx.Menu()
        titres = [t[0] for t in grl.TITRES['partie'] if t[0] != u""] + [
            t[0] for t in grl.TITRES['statistiques'] if t[0] != u""
        ]
        for texte in titres:
            menu.Append(wx.ID_ANY, texte, "", wx.ITEM_RADIO)
        self.box_chercher.SetMenu(menu)
        self.box_chercher.ShowCancelButton(True)

        self.AddControl(self.box_chercher, 0, wx.ALIGN_CENTER_VERTICAL)
        self.controls.append(self.box_chercher)

        # Ajouter un separateur
        self.AddSeparator()

        # Bouton Enregistrer
        btn = ButtonInfo(self,
                         id=wx.ID_SAVE,
                         bmp=images.bitmap('enregistrer.png'),
                         kind=wx.ITEM_NORMAL,
                         shortHelp="Enregistrer",
                         longHelp="Enregistrer le tournoi en cours.")

        btn.SetTextAlignment(bp.BP_BUTTONTEXT_ALIGN_RIGHT)
        self.AddButton(btn)
        self.controls.append(btn)

        # Propiétés
        bpArt = self.GetBPArt()
        self.SetAlignment(bp.BP_ALIGN_RIGHT)

        bpArt.SetMetric(bp.BP_SEPARATOR_SIZE, 10)
        bpArt.SetMetric(bp.BP_MARGINS_SIZE, wx.Size(10, 3))
        bpArt.SetMetric(bp.BP_PADDING_SIZE, wx.Size(3, 0))
        bpArt.SetMetric(bp.BP_BORDER_SIZE, 2)

        bpArt.SetColour(bp.BP_TEXT_COLOUR, images.couleur('texte'))
        bpArt.SetColour(bp.BP_BORDER_COLOUR, images.couleur('bordure'))
        bpArt.SetColour(bp.BP_GRADIENT_COLOUR_FROM,
                        images.couleur('gradient1'))
        bpArt.SetColour(bp.BP_GRADIENT_COLOUR_TO, images.couleur('gradient2'))
        bpArt.SetColour(bp.BP_BUTTONTEXT_COLOUR,
                        images.couleur('texte_bouton'))
        bpArt.SetColour(bp.BP_SEPARATOR_COLOUR,
                        bp.BrightenColour(images.couleur('separateur'), 0.85))
        bpArt.SetColour(bp.BP_SELECTION_BRUSH_COLOUR,
                        images.couleur('selection'))
        bpArt.SetColour(
            bp.BP_SELECTION_PEN_COLOUR,
            wx.SystemSettings_GetColour(wx.SYS_COLOUR_ACTIVECAPTION))

        self.Thaw()
        self.DoLayout()

        self.box_chercher.Bind(wx.EVT_MENU, self._menu_recherche)
        self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self._effacer_recherche)
        self.Bind(wx.EVT_SIZE, self._force_layout)
Beispiel #13
0
    def __init__(self, config):
        wx.Frame.__init__(self,
                          None,
                          id=wx.ID_ANY,
                          title=tourbillon.__nom__,
                          size=(640, 400),
                          style=wx.DEFAULT_FRAME_STYLE)
        self.SetBackgroundColour(images.couleur('grille'))
        self.config = config

        # Création d'un gestionnaire de fenetres pour la gestion des fenêtres flottantes
        self._mgr = aui.AuiManager(
            self, aui.AUI_MGR_ALLOW_FLOATING | aui.AUI_MGR_TRANSPARENT_HINT
            | aui.AUI_MGR_TRANSPARENT_DRAG | aui.AUI_MGR_ALLOW_ACTIVE_PANE)

        # Fenêtre informations montrée
        self.fenetre_affichage = dlginfo.DialogueInformations(
            self, self.config)
        self.affichage_visible = False
        self.fenetre_affichage.Bind(wx.EVT_CLOSE, self.masquer_info)

        # Icon
        self.SetIcon(images.TourBillon_icon())

        # Créer la barre de menu
        self.barre_menu = barres.BarreMenu(self)
        self.SetMenuBar(self.barre_menu)

        # Créer la barre de statut
        self.barre_etat = barres.BarreEtat(self)
        self.SetStatusBar(self.barre_etat)

        # Créer la barre des boutons (pas la guerre)
        self.barre_bouton = barres.BarreBouton(self)
        self._mgr.AddPane(
            self.barre_bouton,
            aui.AuiPaneInfo().Name("controles").Top().CaptionVisible(
                False).MinSize(wx.Size(-1, 60)).DockFixed().Floatable(False))

        # Créer la grille
        if self.config.get_typed('INTERFACE', 'image'):
            chemin_image = glob(configdir('fond_perso*'))[0]
        else:
            chemin_image = ""
        self.grille = grl.GrillePanel(self, images.bitmap(chemin_image))
        self.barre_menu.FindItemById(barres.ID_STATISTIQUES).Check(
            self.config.get_typed('INTERFACE', 'afficher_statistiques'))
        self.afficher_statistiques(None)
        self._mgr.AddPane(self.grille,
                          aui.AuiPaneInfo().Name("grille").CenterPane())

        # Creation d'un shell Python (utile pour le debug)
        self.shell = Shell(self,
                           introText='',
                           locals={
                               'intf': self,
                               'trb': tournoi.tournoi(),
                               'cfg': self.config,
                               'cst': cst
                           },
                           InterpClass=None,
                           startupScript=None,
                           execStartupScript=True)
        self.shell.SetSize((600, 200))
        self._mgr.AddPane(
            self.shell,
            aui.AuiPaneInfo().Name('shell').Caption("Python Shell").Bottom().
            CloseButton(True).MaximizeButton(True).Hide())
        self.barre_menu.FindItemById(barres.ID_SHELL).Check(
            self.config.get_typed('INTERFACE', 'afficher_shell'))
        self.afficher_shell(None)

        # Effectuer les connections sur les evenements

        # ... de la barre de menu
        self.Bind(wx.EVT_MENU, self.nouveau, id=wx.ID_NEW)
        self.Bind(wx.EVT_MENU, self.ouvrir_demande, id=wx.ID_OPEN)
        self.Bind(wx.EVT_MENU, self.enregistrer, id=wx.ID_SAVE)
        self.Bind(wx.EVT_MENU, self.enregistrer_sous, id=wx.ID_SAVEAS)
        self.Bind(wx.EVT_MENU,
                  self.apercu_avant_impression,
                  id=wx.ID_PREVIEW_PRINT)
        self.Bind(wx.EVT_MENU, self.imprimer, id=wx.ID_PRINT)
        self.Bind(wx.EVT_MENU, self.quitter, id=wx.ID_EXIT)

        self.Bind(wx.EVT_MENU,
                  self.afficher_statistiques,
                  id=barres.ID_STATISTIQUES)
        self.Bind(wx.EVT_MENU, self.afficher_info, id=barres.ID_INFO)
        self.Bind(wx.EVT_MENU, self.afficher_tirage, id=barres.ID_TIRAGE)
        self.Bind(wx.EVT_MENU, self.afficher_shell, id=barres.ID_SHELL)

        self.Bind(wx.EVT_MENU, self.nouvelle_equipe, id=barres.ID_NOUVELLE_E)
        self.Bind(wx.EVT_MENU, self.modifier_equipe, id=barres.ID_MODIFIER_E)
        self.Bind(wx.EVT_MENU, self.supprimer_equipe, id=barres.ID_SUPPRIMER_E)
        self.Bind(wx.EVT_MENU, self.nouvelle_partie, id=barres.ID_NOUVELLE_P)
        self.Bind(wx.EVT_MENU, self.supprimer_partie, id=barres.ID_SUPPRIMER_P)
        self.Bind(wx.EVT_MENU, self.entrer_resultats, id=barres.ID_RESULTATS)
        self.Bind(wx.EVT_MENU, self.classement, id=barres.ID_CLASSEMENT)
        self.Bind(wx.EVT_MENU, self.preferences, id=wx.ID_PREFERENCES)

        self.Bind(wx.EVT_MENU, self.info_systeme, id=wx.ID_PROPERTIES)
        self.Bind(wx.EVT_MENU, self.a_propos_de, id=wx.ID_ABOUT)

        # ... de la barre de contrôle
        self.Bind(wx.EVT_BUTTON, self.afficher_partie_prec,
                  self.barre_bouton.btn_precedente)
        self.Bind(wx.EVT_BUTTON, self.afficher_partie_suiv,
                  self.barre_bouton.btn_suivante)

        self.Bind(wx.EVT_BUTTON, self.enregistrer, id=wx.ID_SAVE)
        self.Bind(wx.EVT_BUTTON, self.afficher_info, id=barres.ID_INFO)
        self.Bind(wx.EVT_BUTTON, self.afficher_tirage, id=barres.ID_TIRAGE)
        self.Bind(wx.EVT_BUTTON, self.nouvelle_equipe, id=barres.ID_NOUVELLE_E)
        self.Bind(wx.EVT_BUTTON, self.nouvelle_partie, id=barres.ID_NOUVELLE_P)
        self.Bind(wx.EVT_BUTTON, self.entrer_resultats, id=barres.ID_RESULTATS)
        self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN,
                  self.grille.rechercher_suivant,
                  id=wx.ID_FIND)
        self.Bind(wx.EVT_TEXT_ENTER,
                  self.grille.rechercher_suivant,
                  id=wx.ID_FIND)
        self.Bind(wx.EVT_TEXT, self.grille.rechercher, id=wx.ID_FIND)
        self.Bind(evt.EVT_MENU_RECHERCHE, self.grille.chg_recherche_colonne,
                  self.barre_bouton)

        # ... des autres événements
        self.Bind(wx.EVT_CLOSE, self.quitter)
        self.Bind(aui.EVT_AUI_PANE_CLOSE, self.masquer_shell)
        self.Bind(evt.EVT_RAFRAICHIR, self.rafraichir)
        self.grille.Bind(grl.grid.EVT_GRID_CELL_LEFT_DCLICK,
                         self.grille_double_click)
        self.grille.Bind(grl.grid.EVT_GRID_CELL_RIGHT_CLICK,
                         self.grille_contexte)
        self.grille.Bind(wx.EVT_KEY_DOWN, self.grille_enter)

        # Rafraichir
        self._mgr.Update()
        self.Layout()
        wx.PostEvent(self, evt.RafraichirEvent(self.GetId()))