Переглянути джерело

Debut de refonte de la partie Attaques

unknown 10 роки тому
батько
коміт
5d84c17ee2

+ 0 - 1
DMonde.py

@@ -23,7 +23,6 @@ from lib.Case import Case
 from lib.Combattant import Combattant
 from lib.Decor import Decor
 from lib.Terrain import Terrain
-from lib.Attaque import Attaque
 
 from lib.Cache import Cache
 from lib.EntreeSortie import EntreeSortie

+ 87 - 12
lib/Actions.py

@@ -15,6 +15,9 @@ class Action(object):
         self._sourceCurseur = ""
         self._nomBouton = ""     
 
+    def typeAtt(self):
+        return ""
+
     def activer(self, plateau, numPion):
         self.plateau = plateau
         self._num = numPion
@@ -102,6 +105,10 @@ class Deplacement(Action):
         self._sourceCurseur = ""
         self._nomBouton = "pi_deplacement" 
 
+
+    def typeAtt(self):
+        return "dep"
+    
     def activer(self, plateau, numPion):
         super(Deplacement, self).activer(plateau, numPion)
         self.plateau.proj.creer(self.acteur())
@@ -163,20 +170,74 @@ class Attaque(Action):
     """attaque pre-parametree affectee a un pion, un personnage ou une creature"""
     def __init__(self):
         super(Attaque, self).__init__()
-        self.nom = "Attaque"
-        self.portee = 1   #portee max en cases
-        self.attributs = regles.listeAttributsAttaques()
-        self.notes = ""
-        
+        self._nom = "Attaque"
+        self._portee = 1   #portee max en cases
+        self._rayon = 0
+        self._attributs = regles.listeAttributsAttaques()
+        self._notes = ""
+
+    def typeAtt(self):
+        return "att"
+
+    def nom(self):
+        return self._nom
+
+    def majNom(self, nom):
+        if len(str(nom)) > 0:
+            self._nom = nom
+
+    def portee(self):
+        return self._portee
+
+    def majPortee(self, portee):
+        try:
+            ent = int(portee)
+            if ent > 0:
+                if ent >= 1000: ent = 999
+                self._portee = ent
+        except:
+            pass
+
+    def rayon(self):
+        return self._rayon
+    
+    def majRayon(self, rayon):
+        try:
+            ent = int(rayon)
+            if ent > 0:
+                if ent >= 100: ent = 99
+                self._rayon = ent
+        except:
+            pass
+
+    def majAttribut(self, nom, nouvelleVal):
+        if nom in self._attributs:
+            if regles.attributAttaque(nom).controler(nouvelleVal):
+                self._attributs[nom] = nouvelleVal
+
+    def attributs(self):
+        return self._attributs
+
+    def notes(self):
+        return self._notes
+
+    def majNotes(self, notes):
+        #on limite a 400 le nombre de caracteres
+        notes = str(notes)
+        self._notes = notes[0:400]
+       
 class Cac(Attaque):
     """attaque au corps a corps"""
     def __init__(self):
         super(Cac, self).__init__()
-        self.nom = "Attaque au corps-à-corps"
+        self._nom = "Attaque au corps-à-corps"
         self._pionCible = None
         self._sourceCurseur = ""
         self._nomBouton = "pi_attaqueCac" 
 
+    def typeAtt(self):
+        return "cac"
+
     def desactiver(self):
         self.afficherCibles(False)
         super(Cac, self).desactiver()
@@ -208,12 +269,15 @@ class Distance(Attaque):
     """attaque a distance"""
     def __init__(self):
         super(Distance, self).__init__()
-        self.nom = "Attaque à distance"
+        self._nom = "Attaque à distance"
         self._itemLigne = None
         self._pionCible = None
         self._sourceCurseur = ""
         self._nomBouton = "pi_attaqueDist" 
 
+    def typeAtt(self):
+        return "dist"
+
     def majCoordCible(self, coord):
         if self._pionCible:
             self._pionCible.estCibleAttaque(False, self.estValide())
@@ -275,13 +339,16 @@ class Zone(Attaque):
     """attaque de zone de base"""
     def __init__(self):
         super(Zone, self).__init__()    
-        self.nom = "Attaque de zone"
+        self._nom = "Attaque de zone"
         self._itemLigne = None
         self._itemCible = None
         self._casesCibles = []
         self._sourceCurseur = ""
         self._nomBouton = "pi_attaqueZone" 
 
+    def typeAtt(self):
+        return "zone"
+
     def valider(self):
         if self.estValide() and len(self._casesCibles) > 0:
             super(Zone, self).valider()
@@ -345,7 +412,10 @@ class Ligne(Zone):
     """attaque de zone de forme lineaire"""
     def __init__(self):
         super(Ligne, self).__init__()
-        self.nom = "Attaque de zone: ligne"
+        self._nom = "Attaque de zone: ligne"
+
+    def typeAttZone(self):
+        return "ligne"
 
     def majItemsGraphiques(self):
         self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
@@ -372,7 +442,10 @@ class Disque(Zone):
     """attaque de zone de forme circulaire"""
     def __init__(self):
         super(Disque, self).__init__()
-        self.nom = "Attaque de zone: disque"
+        self._nom = "Attaque de zone: disque"
+
+    def typeAttZone(self):
+        return "disque"
 
     def majCoordCible(self, coord):
         if self._coordCible in self.plateau.cases:    
@@ -389,7 +462,6 @@ class Disque(Zone):
             self.plateau.cases[self._coordCible].majEstCibleCurseur(actif, False)
 
     def majItemsGraphiques(self):
-        self.rayon = self.plateau.fenetre.ui.pi_rayonAttaqueZone.value()
         self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
                                        self.plateau.cases[self._coordCible].centreGraphique))
         if self.estValide():
@@ -420,7 +492,10 @@ class Cone(Zone):
     """attaque de zone de forme conique"""
     def __init__(self):
         super(Cone, self).__init__()
-        self.nom = "Attaque de zone: cône"
+        self._nom = "Attaque de zone: cône"
+
+    def typeAttZone(self):
+        return "cone"
 
     def creerItemsGraphiques(self):
         self._itemCible = QGraphicsPolygonItem()

+ 0 - 332
lib/Attaque.py

@@ -1,332 +0,0 @@
-#from __future__ import unicode_literals
-# -*- coding: utf-8 -*-
-import regles
-
-
-
-class Attaque():
-    """attaque pre-parametree affectee a un pion, un personnage ou une creature"""
-    def __init__(self):
-        self.nom = "Attaque"
-        self.portee = 1   #portee max en cases
-        self.attributs = regles.listeAttributsAttaques()
-        self.notes = ""
-
-        self._coordCible = (-1, -1)
-##        self._itemCible = [] #cible du curseur: liste de pions et/ou cases
-        
-    def activer(self, plateau):
-        self.plateau = plateau
-
-    def majCoordCible(self, coord):
-        """met a jour les coordonnees de la cible,
-            cad la case actuellement survolee par la souris"""
-        if self.plateau.estCoordonneeValide(coord):
-            self._coordCible = coord
-            self.maj()
-
-    def desactiver(self):
-        pass
-
-    def valider(self):
-        #envoyer signal
-        self.desactiver()
-
-    def estValide(self):
-        return True
-
-    #manipulation des items graphiques
-    def creerItemsGraphiques(self):
-        pass
-
-    def majItemsGraphiques(self):
-        pass    
-
-    def detruireItemsGraphiques(self):
-        pass
-
-    #affichage des cibles
-    def afficherCibles(self, actif):
-        pass
-    
-
-class Cac(Attaque):
-    """attaque au corps a corps"""
-    def __init__(self):
-        super(Cac, self).__init__(self)
-        self.nom = "Attaque au corps-à-corps"
-        self._pionCible = None
-        
-    def maj(self):
-        pionCible = self_plateau.cases[self._coordCible].pionOccupant()
-        
-        if pionCible != None and pionCible != self._plateau.pionSelectionne():
-            self._pionCible = pionCible
-            self._pionCible.estCibleAttaque(True, self.estValide())
-        else:
-            self._pionCible.estCibleAttaque(False)
-            self._pionCible = None
-
-    def estValide(self):
-        return (self._coordCible in self.plateau.zone(self.plateau.pionSelectionne().position, self.portee, 0, False, True))
-
-
-            
-class Distance(Attaque):
-    """attaque a distance"""
-    def __init__(self):
-        super(Distance, self).__init__(self)
-        self.nom = "Attaque à distance"
-        self._itemLigne = None
-        self._pionCible = None
-
-    def activer(self, plateau):
-        #creation de la ligne de mire
-##        self._pointOrigine = self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique
-        self._itemLigne = QGraphicsLineItem()
-        self._itemLigne.setZValue(100)
-        pinceau = QPen()
-        pinceau.setWidth(6)
-        self._itemLigne.setPen(pinceau)
-        self._itemLigne.prepareGeometryChange()
-        self.plateau.addItem(self._itemLigne)
-        super(Distance, self).activer(self, plateau)
-
-    def majCoordCible(self, coord):
-        if self._pionCible:
-            self._pionCible.estCibleAttaque(False, self.estValide())
-        if self._coordCible in self.plateau.cases:    
-            self.plateau.cases[self._coordCible].majEstCibleCurseur(False)
-        super(Distance, self).majCoord(self, coord)        
-        
-    def desactiver(self):
-        if self._itemLigne != None:
-            self._itemLigne.prepareGeometryChange()
-            self.removeItem(self._itemLigne)
-            self._itemLigne = None
-        super(Distance, self).desactiver(self)
-        
-
-    def maj(self):
-        """met a jour la ligne de mire representant l'attaque a distance"""
-        pionCible = self_plateau.cases[self._coordCible].pionOccupant()
-
-        self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
-                                       self.plateau.cases[self._coordCible].centreGraphique))
-
-        if pionCible != None and pionCible != self._plateau.pionSelectionne():
-            self._pionCible = pionCible
-            self._pionCible.estCibleAttaque(True, self.estValide())
-        else:
-            self._pionCible.estCibleAttaque(False)
-            self._pionCible = None
-            #si pas de pion vise, on affiche la case cible comme visee
-            self.plateau.cases[self._coordCible].majEstCibleCurseur(True, self.estValide())
-
-    def estValide(self):
-        return self.plateau.estCibleAttaqueDistValide(self.plateau.pionSelectionne().position, self._coordCible, 0)
-
-
-
-class Ligne(Attaque):
-    """attaque de zone de forme lineaire"""
-    def __init__(self):
-        super(Ligne, self).__init__(self)
-        self.nom = "Attaque de zone: ligne"
-        self._itemLigne = None
-        self._casesCibles = []
-
-
-    def activer(self, plateau):
-        self._itemLigne = QGraphicsLineItem()
-        self._itemLigne.setPen(QPen(QColor("black")))
-        self._itemLigne.prepareGeometryChange()
-        self.plateau.addItem(self._itemLigne)
-
-        super(Ligne, self).activer(self, plateau)
-
-    def desactiver(self):
-        if self._itemLigne != None:
-            self._itemLigne.prepareGeometryChange()
-            self.removeItem(self._itemLigne)
-            self._itemLigne = None
-        super(Ligne, self).desactiver(self)
-
-    def majCoordCible(self, coord):
-        for coord in self._casesCibles:
-            self.plateau.cases[coord].majEstCibleAttaque(False)
-            
-        for numCombattant in self.pionsSurListeCase(self._casesCibles):
-             self.plateau.combattants[numCombattant].estCibleAttaque(False)
-        super(Ligne, self).majCoord(self, coord)
-
-
-    def maj(self):
-        """cree la forme de l'attaque de zone"""
-        self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
-                                       self.plateau.cases[self._coordCible].centreGraphique))
-        self._casesCibles = []
-        for coord in self.plateau.casesSousForme(self._itemLigne, False):
-            if coord != self.plateau.pionSelectionne().position:
-                self._casesCibles.append(coord)    
-
-        for coord in self._casesCibles:
-            self.plateau.cases[coord].majEstCibleAttaque(True)
-        for numCombattant in self.plateau.pionsSurListeCase(self._casesCibles):
-            self.plateau.combattants[numCombattant].estCibleAttaque(True)
-
-
-class Disque(Attaque):
-    """attaque de zone de forme circulaire"""
-    def __init__(self):
-        super(Disque, self).__init__(self)
-        self.nom = "Attaque de zone: disque"
-        self.rayon = 1
-        
-        self._itemLigne = None
-        self._casesCibles = []
-        self._itemLigne = None
-        self._itemCible = None
-
-    def activer(self, plateau):
-        self._itemLigne = QGraphicsLineItem()
-        self._itemLigne.setPen(QPen(QColor("black")))
-        self._itemLigne.prepareGeometryChange()
-        self.plateau.addItem(self._itemLigne)
-
-        self._itemCible = QGraphicsEllipseItem()
-        self._itemCible.setPen(QPen(QColor("black")))
-        self._itemCible.prepareGeometryChange()
-        self.plateau.addItem(self._itemCible)
-
-        super(Disque, self).activer(self, plateau)
-
-    def desactiver(self):
-        if self._itemCible != None:
-            self._itemCible.prepareGeometryChange()
-            self.removeItem(self._itemCible)
-            self._itemCible = None
-
-        if self._itemLigne != None:
-            self._itemLigne.prepareGeometryChange()
-            self.removeItem(self._itemLigne)
-            self._itemLigne = None
-            
-        super(Disque, self).desactiver(self)
-
-    def majCoordCible(self, coord):
-        for coord in self._casesCibles:
-            self.plateau.cases[coord].majEstCibleAttaque(False)
-            
-        for numCombattant in self.pionsSurListeCase(self._casesCibles):
-             self.plateau.combattants[numCombattant].estCibleAttaque(False)
-        super(Disque, self).majCoord(self, coord)
-
-    def maj(self):
-        """cree la forme de l'attaque de zone"""
-        self._itemLigne.setLine(QLineF(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
-                                       self.plateau.cases[self._coordCible].centreGraphique))
-
-        if self.estValide():
-            #maj du disque
-            self.rectEllipseCirculaire(self.plateau.cases[self._coordCible].centreGraphique, self.rayon)
-            
-            self._casesCibles = []
-            if rect != None:
-                self._itemCible.setRect(rect)
-                #zone plus rapide que casesSousForme:
-                self._casesCibles = self.plateau.zone(self._coordCible, self.rayon, 0)
-
-                for coord in self._casesCibles:
-                    self.plateau.cases[coord].majEstCibleAttaque(True)
-                for numCombattant in self.plateau.pionsSurListeCase(self._casesCibles):
-                    self.plateau.combattants[numCombattant].estCibleAttaque(True)
-        else:
-            self.plateau.cases[self._coordCible].majEstCibleCurseur(True, False)
-
-        self._itemCible.setVisible(self.estvalide() and rect != None)
-
-
-    def estValide(self):
-        return self.plateau.estCibleAttaqueDistValide(self.plateau.pionSelectionne().position, self._coordCible)
-
-    def rectEllipseCirculaire(self, centre, rayon):
-        """renvoie le QRectF definissant une ellipse ayant le QPointF pour centre et le rayon en cases entres en param
-           attention: l'ellipse n'est pas tout a fait circulaire, elle couvre horizontalement et
-           verticalement le nombre de cases demandees"""
-        rect = None
-        if rayon > 0:
-            p1 = QPointF((centre.x() - (rayon*self.hCase)), (centre.y() - (rayon*self.hCase)))
-            p2 = QPointF((centre.x() + (rayon*self.hCase)), (centre.y() + (rayon*self.hCase)))
-            if p1 != p2:
-                rect = QRectF()
-                rect.setTopLeft(p1)
-                rect.setBottomRight(p2)
-        return rect
-
-
-
-class Cone(Attaque):
-    """attaque de zone de forme conique"""
-    def __init__(self):
-        super(Cone, self).__init__(self)
-        self.nom = "Attaque de zone: cône"
-        self._itemCible = None
-        self._casesCibles = []
-
-    def activer(self, plateau):
-        self._itemCible = QGraphicsPolygonItem()
-        self._itemCible.setPen(QPen(QColor("black")))
-        self._itemCible.prepareGeometryChange()
-        self.plateau.addItem(self._itemCible)
-
-        super(Cone, self).activer(self, plateau)
-
-    def desactiver(self):
-        if self._itemCible != None:
-            self._itemCible.prepareGeometryChange()
-            self.removeItem(self._itemCible)
-            self._itemCible = None
-            
-        super(Cone, self).desactiver(self)
-
-    def majCoordCible(self, coord):
-        for coord in self._casesCibles:
-            self.plateau.cases[coord].majEstCibleAttaque(False)
-            
-        for numCombattant in self.pionsSurListeCase(self._casesCibles):
-             self.plateau.combattants[numCombattant].estCibleAttaque(False)
-
-        super(Cone, self).majCoord(self, coord)
-
-    def maj(self):
-        """cree la forme de l'attaque de zone"""
-        self._itemCible.setPolygon(self.polygoneCone(self.plateau.cases[self.plateau.pionSelectionne().position].centreGraphique, \
-                                                     self.plateau.cases[self._coordCible].centreGraphique))
-        self._casesCibles = []
-        for coord in self.plateau.casesSousForme(self._itemCible, True, True):
-            if coord != self.plateau.pionSelectionne().position:
-                self._casesCibles.append(coord)    
-
-        for coord in self._casesCibles:
-            self.plateau.cases[coord].majEstCibleAttaque(True)
-        for numCombattant in self.plateau.pionsSurListeCase(self._casesCibles):
-            self.plateau.combattants[numCombattant].estCibleAttaque(True)
-
-    def polygoneCone(self, point1, point2):
-        """renvoie le polygone du cone defini par les deux points (origine, distance)"""
-        ligne1 = QLineF(point1, point2)
-        longueur = ligne1.length()
-        ligne1.setAngle(ligne1.angle() + 22.5)
-        ligne1.setLength(1.1547*longueur)
-        ligne2 = QLineF(point1, point2)    
-        ligne2.setAngle(ligne2.angle() - 22.5)
-        ligne2.setLength(1.1547*longueur)
-        polygone = QPolygonF()
-        polygone.append(point1)
-        polygone.append(ligne1.p2())
-        polygone.append(ligne2.p2())
-        return polygone
-
-
-

+ 15 - 4
lib/EcranEditionCombattant.py

@@ -8,7 +8,6 @@ from Combattant import Combattant
 from ui.ecran_editionCombattant import Ui_edc_fenetre
 from outilsSvg import *
 from VueEditionForme import VueEditionForme
-from EcranEditionAttaques import EcranEditionAttaques
 import regles
 import ui.dm as dm
 
@@ -68,6 +67,9 @@ class EcranEditionCombattant(QDialog):
         self.ui.edc_listeAttributs.setColumnWidth(1, (0.4*self.ui.edc_listeAttributs.width()))
         self.connect(self.ui.edc_listeAttributs, SIGNAL("cellChanged(int,int)"), self.listeAttributCelluleModifiee, Qt.UniqueConnection)
 
+##        self.connect(self.ui.edc_nouvelleAttaque, SIGNAL("clicked()"), self.nouvelleAttaque)
+##        self.connect(self.ui.edc_supprimerAttaque, SIGNAL("clicked()"), self.supprimerAttaque)
+
 ##        self.ui.listeInventaireCombattant.setColumnWidth(0, (0.2*self.ui.listeInventaireCombattant.width()))
 ##        self.ui.listeInventaireCombattant.setColumnWidth(1, (0.8*self.ui.listeInventaireCombattant.width()))
 ##        self.connect(self.ui.listeInventaireCombattant, SIGNAL("clicked()"), self.listeInventaireCelluleModifiee)
@@ -102,8 +104,9 @@ class EcranEditionCombattant(QDialog):
         self.majListeAttributs()
 
         #page attaques
-        ###
-
+        self.ui.edc_attaque_panneau.maj()
+##        self.ui.edc_listeAttaques.construire()
+##        self.ui.edc_listeAttaques.charger(self.combattant.attaques)
 
         #page inventaire
         #self.majListeInventaire()
@@ -206,6 +209,14 @@ class EcranEditionCombattant(QDialog):
             self.combattant.couleur = couleur
             self.vueForme.majCouleur(couleur)
 
+    def nouvelleAttaque(self):
+        """ajoute une nouvelle ligne a la liste des attaques"""
+        self.ui.edc_listeAttaques.nouvelle()
+
+    def supprimerAttaque(self):
+        """supprime la ligne selectionnee de la liste des attaques"""
+        self.ui.edc_listeAttaques.supprimer()
+
     def enregistrer(self):
         """enregistre le terrain cree/edite"""
         #identifiant
@@ -232,7 +243,7 @@ class EcranEditionCombattant(QDialog):
         #dans listeAttributCelluleModifiee
 
         #page attaque
-        #dans EcranEditionAttaque
+        self.combattant.attaques = self.ui.edc_listeAttaques.listeAttaques()
 
         #page inventaire
         #a voir...

+ 0 - 1
lib/Plateau.py

@@ -29,7 +29,6 @@ from EcranEditionDecors import EcranEditionDecors
 from EcranEditionTerrain import EcranEditionTerrain
 from EcranAffichageTexte import EcranAffichageTexte
 from EcranGestionCombat import EcranGestionCombat
-from EcranEditionAttaques import EcranEditionAttaques
 
 import regles as regles
 from outilsSvg import *

BIN
lib/biblio/combattant


+ 147 - 14
lib/ui/dm.py

@@ -116,6 +116,20 @@ class DmGraphicsView(QGraphicsView):
            self.centerOn(self.mapToScene(event.pos()))
         event.accept() #pour considerer l'evenement comme resolu, sans ca les barres de defilement reagissent aussi      
 
+
+class DmComboBox(QComboBox):
+    """surcharge de QComboBox"""
+    def __init__(self, parent = None):
+        super(DmComboBox, self).__init__(parent)
+
+    def allerA(self, donnee):
+        """cherche la donnee demandee et affiche la ligne"""
+        index = self.findData(QVariant(donnee))
+        self.setCurrentIndex(index)
+
+    def valeurActuelle(self):
+        """renvoie sous forme de QVariant la valeur en cours"""
+        return self.itemData(self.currentIndex())
     
 class DmTableWidget(QTableWidget):
     """surcharge de QTableWidget"""
@@ -130,10 +144,91 @@ class DmTableWidget(QTableWidget):
             self.removeRow(0)
         self.majEnCours = False    
 
+    def nouvelleLigneFin(self):
+        """ajoute une ligne en derniere position"""
+        pos = self.rowCount()
+        self.insertRow(pos)
+        return pos
+
+    def lignes(self):
+        """retourne la liste des index de lignes de la table"""
+        return range(0, self.rowCount())
+
+    def colonnes(self):
+        """retourne la liste des index de lignes de la table"""
+        return range(0, self.columnCount())
+
     def masquerColonneId(self):
         """masque la colonne en position 0 qui contient les identifiants"""
         self.setColumnWidth(0, 0)
-        
+
+    def majData(self, ligne, colonne, var):
+        """met a jour la cellule avec une donnee de type QVariant"""
+        var = QVariant(var)
+        self.item(ligne, colonne).setData(0, var)
+        return True
+    
+    def majTexte(ligne, colonne, texte):
+        """met a jour la cellule avec du texte"""
+        self.item(ligne, colonne).setText(QString.fromUtf8(str(texte)))
+        return True
+
+    def majEnt(ligne, colonne, valeur):
+        """met a jour la cellule avec une valeur numerique entiere
+           si valeur ne peut etre converti en numerique, on retourne Faux"""
+        retour = False
+        try:
+            entier = QVariant(long(valeur))
+            self.item(ligne, colonne).setData(0, entier)
+            retour = True
+        except:
+            pass
+        return retour
+                
+    def chercherLigne(self, colonne, valeur):
+        """cherche la valeur dans la colonne demandee
+           renvoie la ligne correspondante """
+        ligne = None
+        for i in range(0, self.rowCount()):
+            if str(self.item(i, colonne).text().toUtf8()) == str(valeur):
+                ligne = i
+                break           
+        return ligne
+
+    def majLigne(self, ligne, dico, flags = []):
+        """rempli la ligne avec les donnees trouvees dans le dictionnaire"""
+        for colonne in range(0, self.columnCount()):
+            nomChamp = ""
+            item = self.horizontalHeaderItem(colonne)
+            if item:
+                nomChamp = str(item.text())
+            if nomChamp in dico:
+                item = QTableWidgetItem()
+                for f in flags:
+                    item.setFlag(f)
+                var = QVariant(dico[nomChamp])
+                item.setData(0, var)
+                self.setItem(ligne, colonne, item)
+
+    def texte(self, ligne, colonne):
+        return str(self.item(ligne, colonne).text().toUtf8())
+
+    def data(self, ligne, colonne):
+        retour = None
+        item = self.item(ligne, colonne)
+        if item:
+            retour = item.data(0)
+        return retour
+
+    def ligneSelectionnee(self):
+        """renvoie la ligne selectionnee (la premiere si plusieurs le sont)"""
+        retour = None
+        if self.columnCount() > 0:
+            for i in range(0, self.rowCount()):
+                if self.item(i,0).isSelected():
+                    retour = i
+                    break
+        return retour
 
 class DmTableBiblio(DmTableWidget):
     """table utilisee pour afficher les bibliotheques d'objets:
@@ -296,19 +391,57 @@ class DmFrameInf_Case(QGroupBox):
         else:
             self.findChild(DmLabel, "inf_caseEffet").clear()      
 
-
-
-
-
-
-
-
-
-
-
-
-
-
+class DmFrame(QFrame):
+    """surcharge de QFrame"""
+    def __init__(self, parent = None):
+        super(DmFrame, self).__init__(parent)
+
+    def widget(self, nom):
+        """recupere la ref au widget enfant / attention, pas ideal en terme de perf"""
+        widget = None
+        for widget in self.children():
+            if widget.objectName() == nom:
+                print nom, widget.__class__.__name__
+                retour = widget
+                break
+        return widget
+
+
+
+
+class DmEdcPanneauAttaque(DmFrame):
+    """frame contenant les donnees de l'attaque actuellement
+        affichee lors de la creation de combattant"""
+    def __init__(self, fenetre, parent = None):
+        super(DmEdcPanneauAttaque, self).__init__(parent)
+
+##    def widget(self, nom):
+##        """surcharge de la fonction de DmFrame"""
+##        return super(DmEdcPanneauAttaque, self).widget(nom)
+
+    def maj(self, attaque = None):
+        """met a jour le contenu avec les donnees de l'attaque en param"""
+        if attaque:
+##            self.widget("edc_attaque_type").setCurrentIndex(0)
+            self.widget("edc_attaque_nom").majTexte(attaque.nom())
+            self.widget("edc_attaque_portee").setValue(attaque.portee())
+            self.widget("edc_attaque_rayon").setValue(attaque.rayon())
+##            self.widget("edc_attaque_attributs").vider()
+            self.widget("edc_attaque_notes").majTexte(attaque.notes())
+        else:
+            self.reinit()
+            self.setEnabled(False)
+
+    def reinit(self):
+##        self.widget("edc_attaque_type").setCurrentIndex(0)
+        self.widget("edc_attaque_nom").majTexte("")
+        self.widget("edc_attaque_portee").setValue(1)
+        self.widget("edc_attaque_rayon").setValue(1)
+        self.widget("edc_attaque_rayon").setVisible(False)
+##        self.widget("edc_attaque_attributs").vider()
+        self.widget("edc_attaque_notes").majTexte("")
+        
+    
 
 
 

+ 274 - 0
lib/ui/dmtableattaques - Copie.py

@@ -0,0 +1,274 @@
+#from __future__ import unicode_literals
+# -*- coding: utf-8 -*-
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+from lib.Actions import *
+import lib.regles as regles
+from dm import *
+
+#dans une DmTableAttaques, les 10 premieres colonnes sont reservees aux donnees de base
+#le reste des colonnes sert aux donnees complementaires issues des regles
+colonnesBase= ["numAttaque","Type","Nom","Portee","Forme","Rayon"]
+largeurColonnesBase = {"numAttaque": 0, "Type": 70, "Nom": 100, "Portee": 60, "Forme": 80,"Rayon": 60}
+        
+class DmTableAttaques(DmTableWidget):
+    """interface d'edition des attaques du combattant"""
+    def __init__(self, parent=None):
+        super (DmTableAttaques, self).__init__()
+        self.combattant = None
+        self.construire()
+
+    def construire(self):
+        """cree les colonnes de la table"""
+        #colonnes de base: celles qui ne dependent pas des regles utilisees
+        for i in range(0, 10):
+            self.insertColumn(i)
+            #on cache les colonnes qui ne seront pas utilisees
+            self.setColumnHidden(i, (i >= len(colonnesBase)))
+            if i < len(colonnesBase):
+                #la largeur est geree par une variable globale
+                self.setHorizontalHeaderItem(i, QTableWidgetItem(colonnesBase[i]))
+
+                if colonnesBase[i] in largeurColonnesBase:
+                    largeur = largeurColonnesBase[colonnesBase[i]]
+                else:
+                    largeur = 60
+                if largeur > 0:    
+                    self.setColumnWidth(i, largeur)
+                else:    
+                    self.setColumnHidden(i, True)
+
+
+##        self.cellWidget(index, self.posColonne("Type")).setEnabled(False)
+                    
+        #on ajoute maintenant les colonnes issues des regles            
+        ordre = regles.ordreAttributsAttaques()
+        for elt in ordre:
+            numCol = 10 + ordre.index(elt)
+            self.insertColumn(numCol)
+            self.setHorizontalHeaderItem(numCol, QTableWidgetItem(QString.fromUtf8(elt)))
+            self.setColumnWidth(numCol, 45)
+            self.setColumnHidden(numCol, False)
+
+        self.connect(self, SIGNAL("cellChanged(int, int)"), self.celluleModifiee)
+
+    def siCombattant(fonction):
+        """decorateur: si combattant"""
+        
+        def _siCombattant(self, *args):
+            def fVide(*args):
+                pass
+            retour = fVide
+            if self.combattant:
+                retour = fonction
+            retour(self)                            
+        return _siCombattant  
+
+    def charger(self, combattant):
+        self.combattant = combattant
+        self.maj()
+        self.nouvelle()
+
+    @siCombattant
+    def maj(self):
+        """met a jour le contenu de la table des donnees"""
+        self.vider()
+        self.majEnCours = True
+        
+        index = 0
+        for attaque in self.combattant.attaques:
+            self.insertRow(int(index))
+            #liste deroulante des types d'attaque
+            
+            
+##            #num de l'attaque
+##            self.setItem(int(index), 0, QTableWidgetItem(QString.fromUtf8(str(index))))
+        
+            donneesAttaque = {"NumAttaque": index, "Nom": attaque.nom, "Portee": attaque.portee}
+            self.majLigne(index, donneesAttaque)  #[Qt.NoItemFlags, Qt.ItemIsSelectable]
+
+            #met a jour l'index en cours de la liste deroulante des types d'attaque
+            widget = self.listeTypesAttaques()
+            widget.allerA(attaque.typeAtt())
+            self.setCellWidget(int(index), self.posColonne("Type"), widget)
+##            self.setCellWidget(int(index), self.posColonne("Type"), self.listeTypesAttaques())
+##            self.cellWidget(index, self.posColonne("Type")).allerA(attaque.typ)
+            self.afficherDonneesAttaqueZone(index, (attaque.typ == "zone"))            
+
+            ### parametres supplementaires (issus des regles)
+            self.majLigne(index, attaque.attributs)
+##            for elt in attaque.attributs:
+##                col = 10 + regles.ordreAttributsAttaques().index(elt)
+##                self.setItem(index, col , QTableWidgetItem(QString.fromUtf8(str(attaque.attributs[elt]))))
+          
+            index += 1
+
+        self.majEnCours = False
+
+    def posColonne(self, nom):
+        """renvoie la position de la colonne demandee"""
+        retour = None
+        if nom in colonnesBase:
+            retour = colonnesBase.index(nom)
+        elif nom in regles.ordreAttributsAttaques():
+            retour = 10 + regles.ordreAttributsAttaques().index(nom)
+        return retour
+    
+    @siCombattant
+    def celluleModifiee(self, ligne, colonne):
+        """une cellule de la table a ete modifiee par l'utilisateur"""
+        if not self.majEnCours:
+            numAttaque = int(self.val(ligne, 0))
+            attaque = self.combattant.attaques[numAttaque]
+            
+            if colonne < len(colonnesBase):
+                if colonne == self.posColonne("Nom"):
+                    #maj du nom de l'attaque
+                    nom = self.texte(ligne, colonne)
+                    if not len(nom) > 0:
+                        nom = "Att. {}".format(numAttaque)
+                    attaque.nom = nom
+                
+                elif colonne == self.posColonne("Type"):
+                    #maj du type de l'attaque
+                    typ = str(self.cellWidget(ligne, colonne).valeurActuelle().toString())
+                    attaque.typ = typ
+                    self.afficherDonneesAttaqueZone(ligne, (typ == "zone"))
+                    
+                elif colonne == self.posColonne("Forme"):
+                    #maj de la forme de l'attaque
+                    forme = str(self.cellWidget(ligne, colonne).valeurActuelle().toString())
+                    attaque.formeZone = forme
+                    
+                elif colonne == self.posColonne("Portee"):
+                    #maj de la portee de l'attaque
+                    #doit etre de type numerique
+                    try:
+                        portee = int(self.data(ligne, colonne))
+                        if portee < 1000:
+                            attaque.portee = portee
+                        else:
+                            self.majEnt(ligne, colonne, attaque.portee)
+                    except:
+                        #sinon, on restaure l'ancienne valeur
+                        self.majEnt(ligne, colonne, attaque.portee)
+
+                elif colonne == self.posColonne("Rayon"):
+                    #doit etre de type numerique
+                    try:
+                        rayon = int(self.data(ligne, colonne))
+                        if rayon < 100:
+                            self.combattant.attaques[numAttaque].rayon = rayon
+                        else:
+                            self.majEnt(ligne, colonne, attaque.rayon)         
+                    except:
+                        self.majEnt(ligne, colonne, attaque.rayon) 
+    
+            elif colonne >= 10:
+                #colonnes issues des regles
+                index = colonne - 10
+                attribut = regles.ordreAttributsAttaques()[index]
+                valeurAttribut = regles.listeControleAttaques()[attribut].controler(str(self.data(ligne, colonne).toString()))
+                if valeurAttribut != None:
+                    attaque.attributs[attribut] = valeurAttribut
+                else:
+                    self.majData(ligne, colonne, attaque.attributs[attribut])
+
+    @siCombattant
+    def nouvelle(self):
+        """ajoute une ligne a la table et une attaque au pion"""
+        self.combattant.attaques.append(Cac())
+        self.maj()
+
+    @siCombattant
+    def supprimer(self):
+        """supprime l'attaque selectionnee de la liste des attaques du pion"""
+        select = self.ligneSelectionnee()
+        if select:
+            numAttaque = int(self.data(sel,0))
+            reponse = QMessageBox.question(self, 'Message',
+                           "Etes vous sûr de vouloir supprimer cette attaque?", QMessageBox.Yes | 
+                           QMessageBox.No, QMessageBox.No)
+            if reponse == QMessageBox.Yes:   
+                del self.combattant.attaques[numAttaque]
+                self.maj()
+
+    def majTypeAttaque(self):
+        """une des liste de type a ete modifiee, on met a jour toute la colonne (en attendant mieux :( )"""
+        colonne = self.posColonne("Type")
+        for i in range(0, self.rowCount()):
+            if str(self.cellWidget(i, colonne).itemData(\
+                   self.cellWidget(i, colonne).currentIndex())) != \
+                   self.combattant.attaques[int(self.item(i, 0).text().toUtf8())].typ:
+                self.celluleModifiee(i, colonne)
+
+    def majFormeZone(self):
+        """une des liste de type a ete modifiee, on met a jour toute la colonne (en attendant mieux :( )"""
+        colonne = self.posColonne("Forme")
+        for i in range(0, self.rowCount()):
+            if self.cellWidget(i, colonne).__class__.__name__ == "QComboBox":
+                if str(self.cellWidget(i, colonne).itemData(\
+                       self.cellWidget(i, colonne).currentIndex())) != \
+                       self.combattant.attaques[int(self.item(i, 0).text().toUtf8())].formeZone:
+                    self.celluleModifiee(i, colonne)
+                
+    def listeTypesAttaques(self):
+        """retourne la DmComboBox qui apparait dans la colonne Type d'attaque"""
+        liste = DmComboBox()
+        liste.addItem(QIcon("img\\curseurEpee.png"), QString.fromUtf8("C.à.C"), "cac")
+        liste.addItem(QIcon("img\\arc.png"), QString.fromUtf8("Dist."), "dist")
+        liste.addItem(QIcon("img\\baguette.png"), QString.fromUtf8("Zone"), "zone")
+        self.connect(liste, SIGNAL("currentIndexChanged(int)"), self.majTypeAttaque)
+        return liste
+    
+    def listeFormesZone(self):
+        """retourne la QComboBox qui apparait dans la colonne forme de zone"""
+        liste = QComboBox()
+        liste.addItem(QIcon("img\\formeLigne.png"), QString.fromUtf8("Ligne"), "ligne")
+        liste.addItem(QIcon("img\\formeEllipsePlein.png"), QString.fromUtf8("Disque"), "disque")
+        liste.addItem(QIcon("img\\cone.png"), QString.fromUtf8("Cone"), "cone")
+        self.connect(liste, SIGNAL("currentIndexChanged(int)"), self.majFormeZone)
+        return liste
+
+    @siCombattant
+    def afficherDonneesAttaqueZone(self, ligne, afficher):
+        """rend modifiables ou non les donnees de base liees aux attaques de zone et modifie l'affichage en consequence"""
+        self.majEnCours = True
+        
+        if afficher:
+            numAttaque = int(self.data(ligne, 0))
+            attaque = self.combattant.attaques[numAttaque]
+            
+            if self.cellWidget(ligne, self.posColonne("Forme")) == None:
+                self.setCellWidget(ligne, self.posColonne("Forme"), self.listeFormesZone())
+                
+            if attaque.formeZone in ["ligne", "disque", "cone"]:
+                self.cellWidget(ligne, self.posColonne("Forme")).allerA(attaque.formeZone)
+
+            item = QTableWidgetItem()
+            item.setData(0, attaque.rayon)
+            item.setBackgroundColor(QColor("white"))
+            self.setItem(ligne, self.posColonne("Rayon"), item)
+            
+        else:
+            if self.cellWidget(ligne, self.posColonne("Forme")) != None:
+                self.removeCellWidget(ligne, self.posColonne("Forme"))
+                
+            item = QTableWidgetItem(QString.fromUtf8(""))
+            item.setFlags(Qt.NoItemFlags)
+            item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
+            item.setBackgroundColor(QColor(200,200,200))
+            self.setItem(ligne, self.posColonne("Forme"), item)
+            
+            item = QTableWidgetItem(QString.fromUtf8(""))
+            item.setFlags(Qt.NoItemFlags)
+            item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
+            item.setBackgroundColor(QColor(200,200,200))
+            self.setItem(ligne, self.posColonne("Rayon"), item)
+
+        self.majEnCours = False
+
+
+
+
+

+ 266 - 0
lib/ui/dmtableattaques.py

@@ -0,0 +1,266 @@
+#from __future__ import unicode_literals
+# -*- coding: utf-8 -*-
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+from lib.Actions import *
+import lib.regles as regles
+from lib.ui.dm import *
+
+#dans une DmTableAttaques, les 10 premieres colonnes sont reservees aux donnees de base
+#le reste des colonnes sert aux donnees complementaires issues des regles
+colonnesBase= ["Type", "Nom", "Portee", "Forme", "Rayon"]
+largeurColonnesBase = {"Type": 70, "Nom": 100, "Portee": 60, "Forme": 80,"Rayon": 60}
+        
+class DmTableAttaques(DmTableWidget):
+    """interface d'edition des attaques du combattant"""
+    def __init__(self, parent=None):
+        super (DmTableAttaques, self).__init__(parent)
+            
+    def construire(self):
+        """cree les colonnes de la table"""
+        #colonnes de base: celles qui ne dependent pas des regles utilisees
+        for i in range(0, 10):
+            self.insertColumn(i)
+            
+            #on cache les colonnes qui ne seront pas utilisees
+            self.setColumnHidden(i, (i >= len(colonnesBase)))
+            if i < len(colonnesBase):
+                #la largeur est geree par une variable globale
+                self.setHorizontalHeaderItem(i, QTableWidgetItem(colonnesBase[i]))
+
+                if colonnesBase[i] in largeurColonnesBase:
+                    largeur = largeurColonnesBase[colonnesBase[i]]
+                else:
+                    largeur = 60
+                if largeur > 0:    
+                    self.setColumnWidth(i, largeur)
+                else:
+                    self.setColumnHidden(i, True)
+                    
+        #on ajoute maintenant les colonnes issues des regles            
+        ordre = regles.ordreAttributsAttaques()
+        for elt in ordre:
+            numCol = 10 + ordre.index(elt)
+            self.insertColumn(numCol)
+            self.setHorizontalHeaderItem(numCol, QTableWidgetItem(QString.fromUtf8(elt)))
+            self.setColumnWidth(numCol, 45)
+            self.setColumnHidden(numCol, False)
+
+        self.connect(self, SIGNAL("cellChanged(int, int)"), self.celluleModifiee)
+
+    def posColonne(self, nom):
+        """renvoie la position de la colonne demandee"""
+        retour = None
+        if nom in colonnesBase:
+            retour = colonnesBase.index(nom)
+        elif nom in regles.ordreAttributsAttaques():
+            retour = 10 + regles.ordreAttributsAttaques().index(nom)
+        return retour
+
+    def listeAttaques(self):
+        """retourne la liste des attaques de la liste"""
+        liste = []
+        for ligne in self.lignes():
+            attaque = None
+            typeAttaque = str(self.cellWidget(ligne, self.posColonne("Type")).valeurActuelle().toString())
+            if typeAttaque == "cac":
+                attaque = Cac()
+            elif typeAttaque == "dist":
+                attaque = Distance()
+            elif typeAttaque == "zone":
+                formeAttaque = str(self.cellWidget(ligne, self.posColonne("Forme")).valeurActuelle().toString())
+                if formeAttaque == "ligne":
+                    attaque = Ligne()
+                elif formeAttaque == "disque":
+                    attaque = Disque()
+                elif formeAttaque == "cone":
+                    attaque = Cone()
+                    
+            if attaque:
+                attaque.majNom(self.texte(ligne, self.posColonne("Nom")))
+                attaque.majPortee(self.data(ligne, self.posColonne("Portee")))
+                if typeAttaque == "zone" and formeAttaque == "disque":
+                    attaque.majRayon(self.data(ligne, self.posColonne("Rayon")))
+                for col in range(10, self.columnCount()):
+                    attr = regles.ordreAttributsAttaques()[(col-10)]
+                    val = str(self.data(ligne, col-10))
+                    if regles.attributAttaque(attr).controler(val):
+                        attaque.majAttribut(attr, val)
+                liste.append(attaque)
+        return liste
+
+    def charger(self, listeAttaques):
+        """charge et affiche une liste d'attaques"""
+        self.vider()
+        self.majEnCours = True
+        ligne = 0
+        for attaque in listeAttaques:
+            #controle du type d'attaque
+            if attaque.typeAtt() in ["cac", "dist", "ligne", "disque", "cone"]:
+                if attaque.typeAtt() in ["ligne", "disque", "cone"]:
+                    typeAtt = "zone"
+                    formeAtt = attaque.typeAtt()
+                else:
+                    typeAtt = attaque.typeAtt()  
+                    formeAtt = ""
+                    
+                self.nouvelleLigneFin()
+                #donnees generales
+                donneesAttaque = {"Nom": attaque.nom(), "Portee": attaque.portee(), "Rayon": attaque.rayon()}
+                self.majLigne(ligne, donneesAttaque)
+
+                #met a jour le type d'attaque
+                widget = self.listeTypesAttaques(ligne)
+                widget.allerA(typeAtt)
+                self.setCellWidget(ligne, self.posColonne("Type"), widget)
+                self.afficherDonneesAttaqueZone(ligne, (typeAtt == "zone"))
+
+                #maj des attributs de regles
+                self.majLigne(ligne, attaque.attributs())
+
+            ligne += 1
+
+        self.majEnCours = False
+
+    def nouvelle(self):
+        """ajoute une ligne a la table et maj avec les valeurs par defaut"""
+        ligne = self.nouvelleLigneFin()
+        modeleAttaque = Attaque()
+        #donnees generales
+        donneesAttaque = {"Nom": modeleAttaque.nom(), "Portee": modeleAttaque.portee(), "Rayon": modeleAttaque.rayon()}
+        self.majLigne(ligne, donneesAttaque)
+
+        #liste types attaque
+        widget = self.listeTypesAttaques(ligne)
+        widget.allerA("cac")
+        self.setCellWidget(ligne, self.posColonne("Type"), widget)
+
+        #des regles
+        attributs = regles.listeAttributsAttaques()
+        self.majLigne(ligne, attributs)
+
+        self.afficherDonneesAttaqueZone(ligne, False)
+    
+    def supprimer(self):
+        """supprime l'attaque selectionnee de la liste des attaques du pion"""
+        select = self.ligneSelectionnee()
+        if select:
+            numAttaque = int(self.data(sel,0))
+            reponse = QMessageBox.question(self, 'Message',
+                           "Etes vous sûr de vouloir supprimer cette attaque?", QMessageBox.Yes | 
+                           QMessageBox.No, QMessageBox.No)
+            if reponse == QMessageBox.Yes:   
+                self.removeRow(select)
+
+    def celluleModifiee(self, ligne, colonne):
+        """une cellule de la table a ete modifiee par l'utilisateur,
+            on controle sa validite via la classe Attaque et
+            on retourne la valeur acceptee, ou l'ancienne valeur sinon"""
+        
+        if not self.majEnCours:
+            modeleAttaque = Attaque()
+            
+            if colonne < len(colonnesBase):
+                if colonne == self.posColonne("Nom"):
+                    #maj du nom de l'attaque
+                    nouveauNom = self.texte(ligne, colonne)
+                    modeleAttaque.majNom(nouveauNom)
+                    if modeleAttaque.nom() != nouveauNom:
+                        self.majTexte(ligne, colonne, modeleAttaque.nom())
+                
+                elif colonne == self.posColonne("Type"):
+                    #maj du type de l'attaque (ici, on ne controle pas, mais on met a jour tout l'affichage si besoin)
+                    nouveauType = str(self.cellWidget(ligne, colonne).valeurActuelle().toString())
+                    self.afficherDonneesAttaqueZone(ligne, (nouveauType == "zone"))
+                    
+                elif colonne == self.posColonne("Portee"):
+                    #maj de la portee de l'attaque
+                    nouvellePortee = self.data(ligne, colonne) #! QVariant
+                    modeleAttaque.majPortee(nouvellePortee)
+                    if modeleAttaque.portee() != nouvellePortee:
+                        self.majEnt(ligne, colonne, modeleAttaque.portee())
+
+                elif colonne == self.posColonne("Rayon"):
+                    #maj du rayon de l'attaque
+                    nouveauRayon = self.data(ligne, colonne) #! QVariant
+                    modeleAttaque.majRayon(nouveauRayon)
+                    if modeleAttaque.rayon() != nouveauRayon:
+                        self.majEnt(ligne, colonne, modeleAttaque.rayon())
+    
+            elif colonne >= 10:
+                #colonnes issues des regles
+                index = colonne - 10
+                attribut = regles.ordreAttributsAttaques()[index]
+                valeurAttribut = regles.listeControleAttaques()[attribut].controler(str(self.data(ligne, colonne).toString()))
+                if valeurAttribut == None:
+                    self.majData(ligne, colonne, regles.listeControleAttaques()[attribut].defaut)
+
+    def afficherDonneesAttaqueZone(self, ligne, afficher):
+        """rend modifiables ou non les donnees de base liees aux attaques de zone et modifie l'affichage en consequence"""
+        self.majEnCours = True
+        
+        if afficher:
+            modeleAttaque = Attaque()
+            if self.cellWidget(ligne, self.posColonne("Forme")) == None:
+                self.setCellWidget(ligne, self.posColonne("Forme"), self.listeFormesZone(ligne))
+            item = QTableWidgetItem()
+            item.setData(0, modeleAttaque.rayon())
+            item.setBackgroundColor(QColor("white"))
+            self.setItem(ligne, self.posColonne("Rayon"), item)
+            
+        else:
+            if self.cellWidget(ligne, self.posColonne("Forme")) != None:
+                self.removeCellWidget(ligne, self.posColonne("Forme"))
+                
+            item = QTableWidgetItem(QString.fromUtf8(""))
+            item.setFlags(Qt.NoItemFlags)
+            item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
+            item.setBackgroundColor(QColor(200,200,200))
+            self.setItem(ligne, self.posColonne("Forme"), item)
+            
+            item = QTableWidgetItem(QString.fromUtf8(""))
+            item.setFlags(Qt.NoItemFlags)
+            item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
+            item.setBackgroundColor(QColor(200,200,200))
+            self.setItem(ligne, self.posColonne("Rayon"), item)
+
+        self.majEnCours = False
+
+    def typeAttaqueModifie(self):
+        emetteur = self.sender().objectName()
+        ligne = int(emetteur.replace("cbType_",""))
+        colonne = self.posColonne("Type")
+        self.celluleModifiee(ligne, colonne)
+
+    def formeAttaqueModifiee(self):
+        emetteur = self.sender().objectName()
+        ligne = int(emetteur.replace("cbForme_",""))
+        colonne = self.posColonne("Type")
+        self.celluleModifiee(ligne, colonne)
+  
+    def listeTypesAttaques(self, ligne):
+        """retourne la DmComboBox qui apparait dans la colonne Type d'attaque"""
+        liste = DmComboBox()
+        liste.setObjectName(QString("cbType_{}".format(ligne)))   #sert a reconnaitre l'emetteur du signal apres une modif
+        liste.addItem(QIcon("img\\curseurEpee.png"), QString.fromUtf8("C.à.C"), "cac")
+        liste.addItem(QIcon("img\\arc.png"), QString.fromUtf8("Dist."), "dist")
+        liste.addItem(QIcon("img\\baguette.png"), QString.fromUtf8("Zone"), "zone")
+        self.connect(liste, SIGNAL("currentIndexChanged(int)"), self.typeAttaqueModifie)
+        return liste
+    
+    def listeFormesZone(self, ligne):
+        """retourne la DmComboBox qui apparait dans la colonne forme de zone"""
+        liste = DmComboBox()
+        liste.setObjectName(QString("cbForme_{}".format(ligne)))
+        liste.addItem(QIcon("img\\formeLigne.png"), QString.fromUtf8("Ligne"), "ligne")
+        liste.addItem(QIcon("img\\formeEllipsePlein.png"), QString.fromUtf8("Disque"), "disque")
+        liste.addItem(QIcon("img\\cone.png"), QString.fromUtf8("Cone"), "cone")
+        self.connect(liste, SIGNAL("currentIndexChanged(int)"), self.formeAttaqueModifiee)
+        return liste
+
+
+
+
+
+
+

+ 267 - 35
lib/ui/ecran_editionCombattant.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'editionCombattant.ui'
 #
-# Created: Fri Jun 05 16:46:13 2015
+# Created: Tue Jun 09 17:05:33 2015
 #      by: PyQt4 UI code generator 4.10.4
 #
 # WARNING! All changes made in this file will be lost!
@@ -27,7 +27,7 @@ class Ui_edc_fenetre(object):
     def setupUi(self, edc_fenetre):
         edc_fenetre.setObjectName(_fromUtf8("edc_fenetre"))
         edc_fenetre.setWindowModality(QtCore.Qt.ApplicationModal)
-        edc_fenetre.resize(667, 514)
+        edc_fenetre.resize(657, 484)
         edc_fenetre.setMinimumSize(QtCore.QSize(0, 484))
         edc_fenetre.setMaximumSize(QtCore.QSize(16777215, 10000))
         self.horizontalLayout_2 = QtGui.QHBoxLayout(edc_fenetre)
@@ -212,6 +212,9 @@ class Ui_edc_fenetre(object):
         self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
         self.edc_pages = QtGui.QStackedWidget(edc_fenetre)
         self.edc_pages.setMinimumSize(QtCore.QSize(392, 0))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.edc_pages.setFont(font)
         self.edc_pages.setObjectName(_fromUtf8("edc_pages"))
         self.page_nom = QtGui.QWidget()
         self.page_nom.setObjectName(_fromUtf8("page_nom"))
@@ -544,6 +547,205 @@ class Ui_edc_fenetre(object):
         self.edc_pages.addWidget(self.page_attr)
         self.page_att = QtGui.QWidget()
         self.page_att.setObjectName(_fromUtf8("page_att"))
+        self.edc_attaque_ajouter = QtGui.QToolButton(self.page_att)
+        self.edc_attaque_ajouter.setGeometry(QtCore.QRect(390, 380, 31, 31))
+        icon9 = QtGui.QIcon()
+        icon9.addPixmap(QtGui.QPixmap(_fromUtf8("img/plus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_ajouter.setIcon(icon9)
+        self.edc_attaque_ajouter.setObjectName(_fromUtf8("edc_attaque_ajouter"))
+        self.edc_listeAttaques = DmTableWidget(self.page_att)
+        self.edc_listeAttaques.setGeometry(QtCore.QRect(320, 10, 141, 361))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.edc_listeAttaques.setPalette(palette)
+        font = QtGui.QFont()
+        font.setPointSize(8)
+        self.edc_listeAttaques.setFont(font)
+        self.edc_listeAttaques.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
+        self.edc_listeAttaques.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
+        self.edc_listeAttaques.setObjectName(_fromUtf8("edc_listeAttaques"))
+        self.edc_listeAttaques.setColumnCount(0)
+        self.edc_listeAttaques.setRowCount(0)
+        self.edc_attaque_supprimer = QtGui.QToolButton(self.page_att)
+        self.edc_attaque_supprimer.setGeometry(QtCore.QRect(430, 380, 31, 31))
+        icon10 = QtGui.QIcon()
+        icon10.addPixmap(QtGui.QPixmap(_fromUtf8("img/gomme.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_supprimer.setIcon(icon10)
+        self.edc_attaque_supprimer.setObjectName(_fromUtf8("edc_attaque_supprimer"))
+        self.edc_attaque_panneau = DmEdcPanneauAttaque(self.page_att)
+        self.edc_attaque_panneau.setEnabled(False)
+        self.edc_attaque_panneau.setGeometry(QtCore.QRect(10, 10, 301, 401))
+        self.edc_attaque_panneau.setFrameShape(QtGui.QFrame.StyledPanel)
+        self.edc_attaque_panneau.setFrameShadow(QtGui.QFrame.Sunken)
+        self.edc_attaque_panneau.setObjectName(_fromUtf8("edc_attaque_panneau"))
+        self.edc_attaque_nom = DmLineEdit(self.edc_attaque_panneau)
+        self.edc_attaque_nom.setGeometry(QtCore.QRect(60, 10, 231, 31))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.edc_attaque_nom.setPalette(palette)
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.edc_attaque_nom.setFont(font)
+        self.edc_attaque_nom.setObjectName(_fromUtf8("edc_attaque_nom"))
+        self.edc_attaque_type = DmComboBox(self.edc_attaque_panneau)
+        self.edc_attaque_type.setGeometry(QtCore.QRect(10, 10, 41, 31))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.edc_attaque_type.setFont(font)
+        self.edc_attaque_type.setObjectName(_fromUtf8("edc_attaque_type"))
+        icon11 = QtGui.QIcon()
+        icon11.addPixmap(QtGui.QPixmap(_fromUtf8("img/curseurEpee.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_type.addItem(icon11, _fromUtf8(""))
+        icon12 = QtGui.QIcon()
+        icon12.addPixmap(QtGui.QPixmap(_fromUtf8("img/arc.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_type.addItem(icon12, _fromUtf8(""))
+        icon13 = QtGui.QIcon()
+        icon13.addPixmap(QtGui.QPixmap(_fromUtf8("img/formeLigne.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_type.addItem(icon13, _fromUtf8(""))
+        icon14 = QtGui.QIcon()
+        icon14.addPixmap(QtGui.QPixmap(_fromUtf8("img/formeEllipsePlein.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_type.addItem(icon14, _fromUtf8(""))
+        icon15 = QtGui.QIcon()
+        icon15.addPixmap(QtGui.QPixmap(_fromUtf8("img/cone.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.edc_attaque_type.addItem(icon15, _fromUtf8(""))
+        self.label_6 = QtGui.QLabel(self.edc_attaque_panneau)
+        self.label_6.setGeometry(QtCore.QRect(10, 50, 51, 31))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.label_6.setFont(font)
+        self.label_6.setObjectName(_fromUtf8("label_6"))
+        self.edc_attaque_portee = QtGui.QSpinBox(self.edc_attaque_panneau)
+        self.edc_attaque_portee.setGeometry(QtCore.QRect(70, 50, 41, 31))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.edc_attaque_portee.setPalette(palette)
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.edc_attaque_portee.setFont(font)
+        self.edc_attaque_portee.setMinimum(1)
+        self.edc_attaque_portee.setMaximum(999)
+        self.edc_attaque_portee.setProperty("value", 1)
+        self.edc_attaque_portee.setObjectName(_fromUtf8("edc_attaque_portee"))
+        self.edc_attaque_rayon = QtGui.QSpinBox(self.edc_attaque_panneau)
+        self.edc_attaque_rayon.setGeometry(QtCore.QRect(200, 50, 41, 31))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.edc_attaque_rayon.setPalette(palette)
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.edc_attaque_rayon.setFont(font)
+        self.edc_attaque_rayon.setMinimum(1)
+        self.edc_attaque_rayon.setProperty("value", 1)
+        self.edc_attaque_rayon.setObjectName(_fromUtf8("edc_attaque_rayon"))
+        self.label_7 = QtGui.QLabel(self.edc_attaque_panneau)
+        self.label_7.setGeometry(QtCore.QRect(140, 50, 61, 31))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.label_7.setFont(font)
+        self.label_7.setObjectName(_fromUtf8("label_7"))
+        self.edc_attaque_notes = DmTextEdit(self.edc_attaque_panneau)
+        self.edc_attaque_notes.setGeometry(QtCore.QRect(10, 350, 281, 41))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.edc_attaque_notes.setPalette(palette)
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.edc_attaque_notes.setFont(font)
+        self.edc_attaque_notes.setObjectName(_fromUtf8("edc_attaque_notes"))
+        self.label_19 = QtGui.QLabel(self.edc_attaque_panneau)
+        self.label_19.setGeometry(QtCore.QRect(10, 330, 131, 21))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.label_19.setFont(font)
+        self.label_19.setObjectName(_fromUtf8("label_19"))
+        self.tableWidget = DmTableWidget(self.edc_attaque_panneau)
+        self.tableWidget.setGeometry(QtCore.QRect(10, 110, 281, 211))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.tableWidget.setPalette(palette)
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        font.setPointSize(8)
+        self.tableWidget.setFont(font)
+        self.tableWidget.setGridStyle(QtCore.Qt.DotLine)
+        self.tableWidget.setObjectName(_fromUtf8("tableWidget"))
+        self.tableWidget.setColumnCount(2)
+        self.tableWidget.setRowCount(1)
+        item = QtGui.QTableWidgetItem()
+        self.tableWidget.setVerticalHeaderItem(0, item)
+        item = QtGui.QTableWidgetItem()
+        self.tableWidget.setHorizontalHeaderItem(0, item)
+        item = QtGui.QTableWidgetItem()
+        item.setTextAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+        self.tableWidget.setHorizontalHeaderItem(1, item)
+        item = QtGui.QTableWidgetItem()
+        item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
+        self.tableWidget.setItem(0, 0, item)
+        item = QtGui.QTableWidgetItem()
+        item.setTextAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter|QtCore.Qt.AlignCenter)
+        brush = QtGui.QBrush(QtGui.QColor(250, 250, 250))
+        brush.setStyle(QtCore.Qt.NoBrush)
+        item.setBackground(brush)
+        self.tableWidget.setItem(0, 1, item)
+        self.tableWidget.horizontalHeader().setVisible(False)
+        self.tableWidget.horizontalHeader().setDefaultSectionSize(180)
+        self.tableWidget.horizontalHeader().setMinimumSectionSize(50)
+        self.tableWidget.horizontalHeader().setStretchLastSection(True)
+        self.tableWidget.verticalHeader().setVisible(False)
+        self.label = QtGui.QLabel(self.edc_attaque_panneau)
+        self.label.setGeometry(QtCore.QRect(10, 90, 101, 16))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.label.setFont(font)
+        self.label.setObjectName(_fromUtf8("label"))
         self.edc_pages.addWidget(self.page_att)
         self.page_invent = QtGui.QWidget()
         self.page_invent.setObjectName(_fromUtf8("page_invent"))
@@ -581,9 +783,7 @@ class Ui_edc_fenetre(object):
         self.edc_listeInventaire.verticalHeader().setVisible(False)
         self.edc_inventaire_supprimer = QtGui.QToolButton(self.page_invent)
         self.edc_inventaire_supprimer.setGeometry(QtCore.QRect(380, 360, 21, 20))
-        icon9 = QtGui.QIcon()
-        icon9.addPixmap(QtGui.QPixmap(_fromUtf8("img/gomme.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
-        self.edc_inventaire_supprimer.setIcon(icon9)
+        self.edc_inventaire_supprimer.setIcon(icon10)
         self.edc_inventaire_supprimer.setObjectName(_fromUtf8("edc_inventaire_supprimer"))
         self.label_24 = QtGui.QLabel(self.page_invent)
         self.label_24.setGeometry(QtCore.QRect(20, 20, 131, 20))
@@ -593,27 +793,36 @@ class Ui_edc_fenetre(object):
         self.label_24.setObjectName(_fromUtf8("label_24"))
         self.edc_inventaire_nouveau = QtGui.QToolButton(self.page_invent)
         self.edc_inventaire_nouveau.setGeometry(QtCore.QRect(350, 360, 21, 20))
-        icon10 = QtGui.QIcon()
-        icon10.addPixmap(QtGui.QPixmap(_fromUtf8("img/plus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
-        self.edc_inventaire_nouveau.setIcon(icon10)
+        self.edc_inventaire_nouveau.setIcon(icon9)
         self.edc_inventaire_nouveau.setObjectName(_fromUtf8("edc_inventaire_nouveau"))
         self.edc_pages.addWidget(self.page_invent)
         self.page_notes = QtGui.QWidget()
         self.page_notes.setObjectName(_fromUtf8("page_notes"))
         self.label_23 = QtGui.QLabel(self.page_notes)
-        self.label_23.setGeometry(QtCore.QRect(20, 230, 151, 20))
+        self.label_23.setGeometry(QtCore.QRect(20, 240, 151, 20))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         self.label_23.setFont(font)
         self.label_23.setObjectName(_fromUtf8("label_23"))
         self.edc_notes = QtGui.QTextEdit(self.page_notes)
-        self.edc_notes.setGeometry(QtCore.QRect(20, 257, 381, 171))
+        self.edc_notes.setGeometry(QtCore.QRect(20, 270, 411, 171))
+        palette = QtGui.QPalette()
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
+        brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
+        brush.setStyle(QtCore.Qt.SolidPattern)
+        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
+        self.edc_notes.setPalette(palette)
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         self.edc_notes.setFont(font)
         self.edc_notes.setObjectName(_fromUtf8("edc_notes"))
         self.edc_detail_age = DmLineEdit(self.page_notes)
-        self.edc_detail_age.setGeometry(QtCore.QRect(340, 21, 61, 20))
+        self.edc_detail_age.setGeometry(QtCore.QRect(350, 20, 81, 20))
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -630,21 +839,21 @@ class Ui_edc_fenetre(object):
         self.edc_detail_age.setFont(font)
         self.edc_detail_age.setObjectName(_fromUtf8("edc_detail_age"))
         self.label_16 = QtGui.QLabel(self.page_notes)
-        self.label_16.setGeometry(QtCore.QRect(290, 20, 41, 21))
+        self.label_16.setGeometry(QtCore.QRect(300, 19, 41, 21))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setPointSize(8)
         self.label_16.setFont(font)
         self.label_16.setObjectName(_fromUtf8("label_16"))
         self.label_17 = QtGui.QLabel(self.page_notes)
-        self.label_17.setGeometry(QtCore.QRect(290, 50, 41, 21))
+        self.label_17.setGeometry(QtCore.QRect(300, 49, 41, 21))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setPointSize(8)
         self.label_17.setFont(font)
         self.label_17.setObjectName(_fromUtf8("label_17"))
         self.edc_detail_sexe = DmLineEdit(self.page_notes)
-        self.edc_detail_sexe.setGeometry(QtCore.QRect(340, 50, 61, 20))
+        self.edc_detail_sexe.setGeometry(QtCore.QRect(350, 49, 81, 20))
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -711,14 +920,14 @@ class Ui_edc_fenetre(object):
         self.label_38.setFont(font)
         self.label_38.setObjectName(_fromUtf8("label_38"))
         self.label_39 = QtGui.QLabel(self.page_notes)
-        self.label_39.setGeometry(QtCore.QRect(20, 190, 91, 31))
+        self.label_39.setGeometry(QtCore.QRect(210, 140, 101, 21))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setPointSize(8)
         self.label_39.setFont(font)
         self.label_39.setObjectName(_fromUtf8("label_39"))
         self.edc_detail_cheveux = DmLineEdit(self.page_notes)
-        self.edc_detail_cheveux.setGeometry(QtCore.QRect(100, 200, 91, 20))
+        self.edc_detail_cheveux.setGeometry(QtCore.QRect(320, 140, 91, 20))
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -761,14 +970,14 @@ class Ui_edc_fenetre(object):
         self.label_40.setFont(font)
         self.label_40.setObjectName(_fromUtf8("label_40"))
         self.label_41 = QtGui.QLabel(self.page_notes)
-        self.label_41.setGeometry(QtCore.QRect(290, 80, 41, 21))
+        self.label_41.setGeometry(QtCore.QRect(300, 79, 41, 21))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setPointSize(8)
         self.label_41.setFont(font)
         self.label_41.setObjectName(_fromUtf8("label_41"))
         self.edc_detail_poids = DmLineEdit(self.page_notes)
-        self.edc_detail_poids.setGeometry(QtCore.QRect(340, 81, 61, 20))
+        self.edc_detail_poids.setGeometry(QtCore.QRect(350, 80, 81, 20))
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -835,14 +1044,14 @@ class Ui_edc_fenetre(object):
         self.edc_detail_profession.setText(_fromUtf8(""))
         self.edc_detail_profession.setObjectName(_fromUtf8("edc_detail_profession"))
         self.label_45 = QtGui.QLabel(self.page_notes)
-        self.label_45.setGeometry(QtCore.QRect(290, 110, 41, 21))
+        self.label_45.setGeometry(QtCore.QRect(300, 109, 41, 21))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setPointSize(8)
         self.label_45.setFont(font)
         self.label_45.setObjectName(_fromUtf8("label_45"))
         self.edc_detail_taille = DmLineEdit(self.page_notes)
-        self.edc_detail_taille.setGeometry(QtCore.QRect(340, 110, 61, 21))
+        self.edc_detail_taille.setGeometry(QtCore.QRect(350, 109, 81, 21))
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -885,7 +1094,7 @@ class Ui_edc_fenetre(object):
         self.label_42.setFont(font)
         self.label_42.setObjectName(_fromUtf8("label_42"))
         self.edc_detail_langues = DmLineEdit(self.page_notes)
-        self.edc_detail_langues.setGeometry(QtCore.QRect(210, 170, 191, 51))
+        self.edc_detail_langues.setGeometry(QtCore.QRect(100, 200, 331, 20))
         palette = QtGui.QPalette()
         brush = QtGui.QBrush(QtGui.QColor(248, 248, 248))
         brush.setStyle(QtCore.Qt.SolidPattern)
@@ -897,29 +1106,28 @@ class Ui_edc_fenetre(object):
         brush.setStyle(QtCore.Qt.SolidPattern)
         palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
         self.edc_detail_langues.setPalette(palette)
-        font = QtGui.QFont()
-        font.setFamily(_fromUtf8("Verdana"))
-        self.edc_detail_langues.setFont(font)
-        self.edc_detail_langues.setText(_fromUtf8(""))
         self.edc_detail_langues.setObjectName(_fromUtf8("edc_detail_langues"))
-        self.label_46 = QtGui.QLabel(self.page_notes)
-        self.label_46.setGeometry(QtCore.QRect(210, 140, 101, 31))
+        self.label_47 = QtGui.QLabel(self.page_notes)
+        self.label_47.setGeometry(QtCore.QRect(20, 190, 61, 41))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setPointSize(8)
-        self.label_46.setFont(font)
-        self.label_46.setObjectName(_fromUtf8("label_46"))
+        self.label_47.setFont(font)
+        self.label_47.setObjectName(_fromUtf8("label_47"))
         self.edc_pages.addWidget(self.page_notes)
         self.verticalLayout.addWidget(self.edc_pages)
         self.frame = QtGui.QFrame(edc_fenetre)
         self.frame.setMinimumSize(QtCore.QSize(392, 50))
         self.frame.setMaximumSize(QtCore.QSize(16777215, 50))
+        font = QtGui.QFont()
+        font.setFamily(_fromUtf8("Verdana"))
+        self.frame.setFont(font)
         self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
         self.frame.setFrameShadow(QtGui.QFrame.Raised)
         self.frame.setObjectName(_fromUtf8("frame"))
         self.edc_enregistrer = QtGui.QPushButton(self.frame)
         self.edc_enregistrer.setEnabled(False)
-        self.edc_enregistrer.setGeometry(QtCore.QRect(330, 10, 91, 31))
+        self.edc_enregistrer.setGeometry(QtCore.QRect(370, 10, 91, 31))
         font = QtGui.QFont()
         font.setFamily(_fromUtf8("Verdana"))
         font.setBold(True)
@@ -938,7 +1146,7 @@ class Ui_edc_fenetre(object):
         self.horizontalLayout_2.addLayout(self.horizontalLayout)
 
         self.retranslateUi(edc_fenetre)
-        self.edc_pages.setCurrentIndex(0)
+        self.edc_pages.setCurrentIndex(3)
         QtCore.QObject.connect(self.edc_menu, QtCore.SIGNAL(_fromUtf8("cellClicked(int,int)")), self.edc_pages.setCurrentIndex)
         QtCore.QMetaObject.connectSlotsByName(edc_fenetre)
 
@@ -996,6 +1204,30 @@ class Ui_edc_fenetre(object):
         item = self.edc_listeAttributs.horizontalHeaderItem(1)
         item.setText(_translate("edc_fenetre", "Valeur", None))
         self.label_18.setText(_translate("edc_fenetre", "Attributs / caractéristiques :  ", None))
+        self.edc_attaque_ajouter.setText(_translate("edc_fenetre", "...", None))
+        self.edc_attaque_supprimer.setText(_translate("edc_fenetre", "...", None))
+        self.edc_attaque_type.setItemText(0, _translate("edc_fenetre", "Corps-à-corps", None))
+        self.edc_attaque_type.setItemText(1, _translate("edc_fenetre", "A Distance", None))
+        self.edc_attaque_type.setItemText(2, _translate("edc_fenetre", "Zone : Ligne", None))
+        self.edc_attaque_type.setItemText(3, _translate("edc_fenetre", "Zone : Disque", None))
+        self.edc_attaque_type.setItemText(4, _translate("edc_fenetre", "Zone : Cone", None))
+        self.label_6.setText(_translate("edc_fenetre", "Portée :", None))
+        self.label_7.setText(_translate("edc_fenetre", "Rayon :", None))
+        self.label_19.setText(_translate("edc_fenetre", "Description / Notes :", None))
+        item = self.tableWidget.verticalHeaderItem(0)
+        item.setText(_translate("edc_fenetre", "Nouvelle ligne", None))
+        item = self.tableWidget.horizontalHeaderItem(0)
+        item.setText(_translate("edc_fenetre", "attr", None))
+        item = self.tableWidget.horizontalHeaderItem(1)
+        item.setText(_translate("edc_fenetre", "val", None))
+        __sortingEnabled = self.tableWidget.isSortingEnabled()
+        self.tableWidget.setSortingEnabled(False)
+        item = self.tableWidget.item(0, 0)
+        item.setText(_translate("edc_fenetre", "Bonus à l\'attaque", None))
+        item = self.tableWidget.item(0, 1)
+        item.setText(_translate("edc_fenetre", "8", None))
+        self.tableWidget.setSortingEnabled(__sortingEnabled)
+        self.label.setText(_translate("edc_fenetre", "Attributs :", None))
         item = self.edc_listeInventaire.horizontalHeaderItem(0)
         item.setText(_translate("edc_fenetre", "nombre", None))
         item = self.edc_listeInventaire.horizontalHeaderItem(1)
@@ -1008,8 +1240,7 @@ class Ui_edc_fenetre(object):
         self.label_17.setText(_translate("edc_fenetre", "Sexe : ", None))
         self.label_37.setText(_translate("edc_fenetre", "Yeux :", None))
         self.label_38.setText(_translate("edc_fenetre", "Peau :", None))
-        self.label_39.setText(_translate("edc_fenetre", "Poils /\n"
-"Cheveux :", None))
+        self.label_39.setText(_translate("edc_fenetre", "Poils /Cheveux :", None))
         self.label_40.setText(_translate("edc_fenetre", "Lieu de\n"
 "naissance :", None))
         self.label_41.setText(_translate("edc_fenetre", "Poids : ", None))
@@ -1018,11 +1249,12 @@ class Ui_edc_fenetre(object):
         self.label_45.setText(_translate("edc_fenetre", "Taille : ", None))
         self.label_42.setText(_translate("edc_fenetre", "Religion /\n"
 "Croyances :", None))
-        self.label_46.setText(_translate("edc_fenetre", "Langues parlées :", None))
+        self.label_47.setText(_translate("edc_fenetre", "Langues\n"
+"parlées : ", None))
         self.edc_enregistrer.setText(_translate("edc_fenetre", "Enregistrer", None))
         self.edc_annuler.setText(_translate("edc_fenetre", "Annuler", None))
 
-from dm import DmLabelChoixImage, DmTableMenu, DmLineEdit
+from dm import DmLineEdit, DmEdcPanneauAttaque, DmLabelChoixImage, DmTableMenu, DmTableWidget, DmTextEdit, DmComboBox
 
 if __name__ == "__main__":
     import sys

+ 0 - 233
lib/ui/ecran_editionDecor - Copie.py

@@ -1,233 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'editionDecor.ui'
-#
-# Created: Tue Oct 07 16:41:52 2014
-#      by: PyQt4 UI code generator 4.10.4
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-try:
-    _fromUtf8 = QtCore.QString.fromUtf8
-except AttributeError:
-    def _fromUtf8(s):
-        return s
-
-try:
-    _encoding = QtGui.QApplication.UnicodeUTF8
-    def _translate(context, text, disambig):
-        return QtGui.QApplication.translate(context, text, disambig, _encoding)
-except AttributeError:
-    def _translate(context, text, disambig):
-        return QtGui.QApplication.translate(context, text, disambig)
-
-class Ui_editionDecor(object):
-    def setupUi(self, editionDecor):
-        editionDecor.setObjectName(_fromUtf8("editionDecor"))
-        editionDecor.resize(647, 511)
-        self.nomDecor = QtGui.QLineEdit(editionDecor)
-        self.nomDecor.setGeometry(QtCore.QRect(112, 10, 261, 20))
-        self.nomDecor.setObjectName(_fromUtf8("nomDecor"))
-        self.imgDecor = QtGui.QLineEdit(editionDecor)
-        self.imgDecor.setGeometry(QtCore.QRect(170, 110, 191, 20))
-        self.imgDecor.setObjectName(_fromUtf8("imgDecor"))
-        self.enregistrerDecor = QtGui.QPushButton(editionDecor)
-        self.enregistrerDecor.setEnabled(False)
-        self.enregistrerDecor.setGeometry(QtCore.QRect(120, 460, 81, 23))
-        font = QtGui.QFont()
-        font.setBold(True)
-        font.setWeight(75)
-        self.enregistrerDecor.setFont(font)
-        self.enregistrerDecor.setObjectName(_fromUtf8("enregistrerDecor"))
-        self.escaladeDecor = QtGui.QCheckBox(editionDecor)
-        self.escaladeDecor.setGeometry(QtCore.QRect(430, 50, 81, 17))
-        self.escaladeDecor.setChecked(True)
-        self.escaladeDecor.setObjectName(_fromUtf8("escaladeDecor"))
-        self.couvertDecor = QtGui.QCheckBox(editionDecor)
-        self.couvertDecor.setGeometry(QtCore.QRect(430, 70, 61, 17))
-        self.couvertDecor.setChecked(True)
-        self.couvertDecor.setObjectName(_fromUtf8("couvertDecor"))
-        self.label_3 = QtGui.QLabel(editionDecor)
-        self.label_3.setGeometry(QtCore.QRect(20, 10, 46, 16))
-        self.label_3.setObjectName(_fromUtf8("label_3"))
-        self.label_2 = QtGui.QLabel(editionDecor)
-        self.label_2.setGeometry(QtCore.QRect(110, 80, 41, 21))
-        self.label_2.setObjectName(_fromUtf8("label_2"))
-        self.affichageCouleurDecor = QtGui.QLabel(editionDecor)
-        self.affichageCouleurDecor.setGeometry(QtCore.QRect(100, 40, 51, 21))
-        self.affichageCouleurDecor.setFrameShape(QtGui.QFrame.Box)
-        self.affichageCouleurDecor.setFrameShadow(QtGui.QFrame.Sunken)
-        self.affichageCouleurDecor.setText(_fromUtf8(""))
-        self.affichageCouleurDecor.setObjectName(_fromUtf8("affichageCouleurDecor"))
-        self.franchissableVolDecor = QtGui.QCheckBox(editionDecor)
-        self.franchissableVolDecor.setGeometry(QtCore.QRect(430, 30, 131, 17))
-        self.franchissableVolDecor.setChecked(True)
-        self.franchissableVolDecor.setObjectName(_fromUtf8("franchissableVolDecor"))
-        self.imgLogoDecor = QtGui.QLineEdit(editionDecor)
-        self.imgLogoDecor.setGeometry(QtCore.QRect(170, 80, 191, 20))
-        self.imgLogoDecor.setObjectName(_fromUtf8("imgLogoDecor"))
-        self.label_6 = QtGui.QLabel(editionDecor)
-        self.label_6.setGeometry(QtCore.QRect(430, 110, 101, 21))
-        self.label_6.setObjectName(_fromUtf8("label_6"))
-        self.label_8 = QtGui.QLabel(editionDecor)
-        self.label_8.setGeometry(QtCore.QRect(20, 110, 141, 20))
-        self.label_8.setObjectName(_fromUtf8("label_8"))
-        self.label = QtGui.QLabel(editionDecor)
-        self.label.setGeometry(QtCore.QRect(20, 80, 131, 20))
-        self.label.setObjectName(_fromUtf8("label"))
-        self.supprimerDecor = QtGui.QPushButton(editionDecor)
-        self.supprimerDecor.setEnabled(False)
-        self.supprimerDecor.setGeometry(QtCore.QRect(360, 460, 75, 23))
-        self.supprimerDecor.setObjectName(_fromUtf8("supprimerDecor"))
-        self.label_5 = QtGui.QLabel(editionDecor)
-        self.label_5.setGeometry(QtCore.QRect(170, 40, 191, 21))
-        font = QtGui.QFont()
-        font.setItalic(True)
-        self.label_5.setFont(font)
-        self.label_5.setObjectName(_fromUtf8("label_5"))
-        self.hauteurDecor = QtGui.QDoubleSpinBox(editionDecor)
-        self.hauteurDecor.setGeometry(QtCore.QRect(540, 110, 41, 22))
-        self.hauteurDecor.setPrefix(_fromUtf8(""))
-        self.hauteurDecor.setDecimals(0)
-        self.hauteurDecor.setSingleStep(1.0)
-        self.hauteurDecor.setProperty("value", 1.0)
-        self.hauteurDecor.setObjectName(_fromUtf8("hauteurDecor"))
-        self.label_7 = QtGui.QLabel(editionDecor)
-        self.label_7.setGeometry(QtCore.QRect(110, 110, 41, 21))
-        self.label_7.setObjectName(_fromUtf8("label_7"))
-        self.label_9 = QtGui.QLabel(editionDecor)
-        self.label_9.setGeometry(QtCore.QRect(20, 140, 321, 20))
-        self.label_9.setObjectName(_fromUtf8("label_9"))
-        self.couleurDecor = QtGui.QPushButton(editionDecor)
-        self.couleurDecor.setGeometry(QtCore.QRect(10, 40, 75, 23))
-        self.couleurDecor.setObjectName(_fromUtf8("couleurDecor"))
-        self.franchissablePiedDecor = QtGui.QCheckBox(editionDecor)
-        self.franchissablePiedDecor.setGeometry(QtCore.QRect(430, 10, 151, 20))
-        self.franchissablePiedDecor.setChecked(True)
-        self.franchissablePiedDecor.setObjectName(_fromUtf8("franchissablePiedDecor"))
-        self.vueForme = QtGui.QGraphicsView(editionDecor)
-        self.vueForme.setGeometry(QtCore.QRect(20, 170, 341, 281))
-        self.vueForme.setRenderHints(QtGui.QPainter.Antialiasing|QtGui.QPainter.HighQualityAntialiasing|QtGui.QPainter.TextAntialiasing)
-        self.vueForme.setObjectName(_fromUtf8("vueForme"))
-        self.bruleDecor = QtGui.QCheckBox(editionDecor)
-        self.bruleDecor.setGeometry(QtCore.QRect(430, 90, 61, 17))
-        self.bruleDecor.setChecked(True)
-        self.bruleDecor.setObjectName(_fromUtf8("bruleDecor"))
-        self.groupBox = QtGui.QGroupBox(editionDecor)
-        self.groupBox.setGeometry(QtCore.QRect(370, 160, 141, 291))
-        self.groupBox.setObjectName(_fromUtf8("groupBox"))
-        self.imgAfficherDecor = QtGui.QCheckBox(self.groupBox)
-        self.imgAfficherDecor.setGeometry(QtCore.QRect(100, 10, 21, 21))
-        self.imgAfficherDecor.setText(_fromUtf8(""))
-        self.imgAfficherDecor.setChecked(True)
-        self.imgAfficherDecor.setObjectName(_fromUtf8("imgAfficherDecor"))
-        self.imgPosYDecor = QtGui.QSlider(self.groupBox)
-        self.imgPosYDecor.setGeometry(QtCore.QRect(10, 200, 111, 19))
-        self.imgPosYDecor.setMinimum(-400)
-        self.imgPosYDecor.setMaximum(400)
-        self.imgPosYDecor.setOrientation(QtCore.Qt.Horizontal)
-        self.imgPosYDecor.setObjectName(_fromUtf8("imgPosYDecor"))
-        self.label_12 = QtGui.QLabel(self.groupBox)
-        self.label_12.setGeometry(QtCore.QRect(10, 60, 111, 20))
-        self.label_12.setObjectName(_fromUtf8("label_12"))
-        self.label_13 = QtGui.QLabel(self.groupBox)
-        self.label_13.setGeometry(QtCore.QRect(10, 100, 111, 20))
-        self.label_13.setObjectName(_fromUtf8("label_13"))
-        self.label_14 = QtGui.QLabel(self.groupBox)
-        self.label_14.setGeometry(QtCore.QRect(10, 140, 111, 20))
-        self.label_14.setObjectName(_fromUtf8("label_14"))
-        self.imgTailleXDecor = QtGui.QSlider(self.groupBox)
-        self.imgTailleXDecor.setGeometry(QtCore.QRect(10, 80, 111, 19))
-        self.imgTailleXDecor.setMinimum(0)
-        self.imgTailleXDecor.setProperty("value", 10)
-        self.imgTailleXDecor.setOrientation(QtCore.Qt.Horizontal)
-        self.imgTailleXDecor.setObjectName(_fromUtf8("imgTailleXDecor"))
-        self.imgRotationDecor = QtGui.QSlider(self.groupBox)
-        self.imgRotationDecor.setGeometry(QtCore.QRect(10, 40, 111, 19))
-        self.imgRotationDecor.setMinimum(-180)
-        self.imgRotationDecor.setMaximum(180)
-        self.imgRotationDecor.setOrientation(QtCore.Qt.Horizontal)
-        self.imgRotationDecor.setObjectName(_fromUtf8("imgRotationDecor"))
-        self.label_16 = QtGui.QLabel(self.groupBox)
-        self.label_16.setGeometry(QtCore.QRect(10, 20, 111, 20))
-        self.label_16.setObjectName(_fromUtf8("label_16"))
-        self.imgPosXDecor = QtGui.QSlider(self.groupBox)
-        self.imgPosXDecor.setGeometry(QtCore.QRect(10, 160, 111, 19))
-        self.imgPosXDecor.setMinimum(-400)
-        self.imgPosXDecor.setMaximum(400)
-        self.imgPosXDecor.setOrientation(QtCore.Qt.Horizontal)
-        self.imgPosXDecor.setObjectName(_fromUtf8("imgPosXDecor"))
-        self.label_15 = QtGui.QLabel(self.groupBox)
-        self.label_15.setGeometry(QtCore.QRect(10, 180, 111, 20))
-        self.label_15.setObjectName(_fromUtf8("label_15"))
-        self.imgTailleYDecor = QtGui.QSlider(self.groupBox)
-        self.imgTailleYDecor.setGeometry(QtCore.QRect(10, 120, 111, 19))
-        self.imgTailleYDecor.setMinimum(0)
-        self.imgTailleYDecor.setProperty("value", 10)
-        self.imgTailleYDecor.setOrientation(QtCore.Qt.Horizontal)
-        self.imgTailleYDecor.setObjectName(_fromUtf8("imgTailleYDecor"))
-        self.imgReinitDecor = QtGui.QPushButton(self.groupBox)
-        self.imgReinitDecor.setGeometry(QtCore.QRect(10, 260, 111, 20))
-        self.imgReinitDecor.setObjectName(_fromUtf8("imgReinitDecor"))
-        self.imgPivoteDecor = QtGui.QCheckBox(self.groupBox)
-        self.imgPivoteDecor.setGeometry(QtCore.QRect(10, 220, 101, 17))
-        self.imgPivoteDecor.setObjectName(_fromUtf8("imgPivoteDecor"))
-        self.imgMasqueDecor = QtGui.QCheckBox(self.groupBox)
-        self.imgMasqueDecor.setGeometry(QtCore.QRect(10, 240, 101, 17))
-        self.imgMasqueDecor.setObjectName(_fromUtf8("imgMasqueDecor"))
-        self.idDecor = QtGui.QLineEdit(editionDecor)
-        self.idDecor.setEnabled(False)
-        self.idDecor.setGeometry(QtCore.QRect(42, 10, 31, 20))
-        self.idDecor.setObjectName(_fromUtf8("idDecor"))
-        self.label_4 = QtGui.QLabel(editionDecor)
-        self.label_4.setGeometry(QtCore.QRect(80, 10, 46, 16))
-        self.label_4.setObjectName(_fromUtf8("label_4"))
-        self.annulerDecor = QtGui.QPushButton(editionDecor)
-        self.annulerDecor.setGeometry(QtCore.QRect(460, 460, 81, 23))
-        self.annulerDecor.setObjectName(_fromUtf8("annulerDecor"))
-
-        self.retranslateUi(editionDecor)
-        QtCore.QMetaObject.connectSlotsByName(editionDecor)
-
-    def retranslateUi(self, editionDecor):
-        editionDecor.setWindowTitle(_translate("editionDecor", "Dialog", None))
-        self.enregistrerDecor.setText(_translate("editionDecor", "Enregistrer", None))
-        self.escaladeDecor.setText(_translate("editionDecor", "Escalade", None))
-        self.couvertDecor.setText(_translate("editionDecor", "Couvert", None))
-        self.label_3.setText(_translate("editionDecor", "Id : ", None))
-        self.label_2.setText(_translate("editionDecor", "...img\\", None))
-        self.franchissableVolDecor.setText(_translate("editionDecor", "Franchissable en vol", None))
-        self.label_6.setText(_translate("editionDecor", "Hauteur (en cases)", None))
-        self.label_8.setText(_translate("editionDecor", "Image (.png, .jpg)", None))
-        self.label.setText(_translate("editionDecor", "Logo (.png, .jpg)", None))
-        self.supprimerDecor.setText(_translate("editionDecor", "Supprimer", None))
-        self.label_5.setText(_translate("editionDecor", "(Couleur du décor si pas d\'image)", None))
-        self.label_7.setText(_translate("editionDecor", "...img\\", None))
-        self.label_9.setText(_translate("editionDecor", "Forme du décor : ", None))
-        self.couleurDecor.setText(_translate("editionDecor", "Couleur", None))
-        self.franchissablePiedDecor.setText(_translate("editionDecor", "Franchissable à pied", None))
-        self.bruleDecor.setText(_translate("editionDecor", "Brule", None))
-        self.groupBox.setTitle(_translate("editionDecor", "Image", None))
-        self.label_12.setText(_translate("editionDecor", "Taille (X)", None))
-        self.label_13.setText(_translate("editionDecor", "Taille (Y)", None))
-        self.label_14.setText(_translate("editionDecor", "Position (X)", None))
-        self.label_16.setText(_translate("editionDecor", "Rotation", None))
-        self.label_15.setText(_translate("editionDecor", "Position (Y)", None))
-        self.imgReinitDecor.setText(_translate("editionDecor", "Ré-initialiser", None))
-        self.imgPivoteDecor.setText(_translate("editionDecor", "Image pivote", None))
-        self.imgMasqueDecor.setText(_translate("editionDecor", "Masque auto.", None))
-        self.label_4.setText(_translate("editionDecor", "Nom : ", None))
-        self.annulerDecor.setText(_translate("editionDecor", "Annuler", None))
-
-
-if __name__ == "__main__":
-    import sys
-    app = QtGui.QApplication(sys.argv)
-    editionDecor = QtGui.QDialog()
-    ui = Ui_editionDecor()
-    ui.setupUi(editionDecor)
-    editionDecor.show()
-    sys.exit(app.exec_())
-

+ 529 - 65
lib/ui/editionCombattant.ui

@@ -9,7 +9,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>667</width>
+    <width>657</width>
     <height>484</height>
    </rect>
   </property>
@@ -502,6 +502,11 @@
            <height>0</height>
           </size>
          </property>
+         <property name="font">
+          <font>
+           <family>Verdana</family>
+          </font>
+         </property>
          <property name="currentIndex">
           <number>3</number>
          </property>
@@ -1488,13 +1493,13 @@ image</string>
           </widget>
          </widget>
          <widget class="QWidget" name="page_att">
-          <widget class="QToolButton" name="nouvelleAttaque">
+          <widget class="QToolButton" name="edc_attaque_ajouter">
            <property name="geometry">
             <rect>
              <x>390</x>
-             <y>200</y>
+             <y>380</y>
              <width>31</width>
-             <height>21</height>
+             <height>31</height>
             </rect>
            </property>
            <property name="text">
@@ -1505,13 +1510,13 @@ image</string>
              <normaloff>img/plus.png</normaloff>img/plus.png</iconset>
            </property>
           </widget>
-          <widget class="QTableWidget" name="editionListeAttaques">
+          <widget class="DmTableWidget" name="edc_listeAttaques">
            <property name="geometry">
             <rect>
-             <x>40</x>
-             <y>20</y>
-             <width>421</width>
-             <height>171</height>
+             <x>320</x>
+             <y>10</y>
+             <width>141</width>
+             <height>361</height>
             </rect>
            </property>
            <property name="palette">
@@ -1551,6 +1556,11 @@ image</string>
              </disabled>
             </palette>
            </property>
+           <property name="font">
+            <font>
+             <pointsize>8</pointsize>
+            </font>
+           </property>
            <property name="selectionMode">
             <enum>QAbstractItemView::SingleSelection</enum>
            </property>
@@ -1558,13 +1568,13 @@ image</string>
             <enum>QAbstractItemView::SelectRows</enum>
            </property>
           </widget>
-          <widget class="QToolButton" name="supprimerAttaque">
+          <widget class="QToolButton" name="edc_attaque_supprimer">
            <property name="geometry">
             <rect>
              <x>430</x>
-             <y>200</y>
+             <y>380</y>
              <width>31</width>
-             <height>21</height>
+             <height>31</height>
             </rect>
            </property>
            <property name="text">
@@ -1575,65 +1585,493 @@ image</string>
              <normaloff>img/gomme.png</normaloff>img/gomme.png</iconset>
            </property>
           </widget>
-          <widget class="QTextEdit" name="textEdit">
-           <property name="geometry">
-            <rect>
-             <x>40</x>
-             <y>390</y>
-             <width>421</width>
-             <height>51</height>
-            </rect>
-           </property>
-           <property name="palette">
-            <palette>
-             <active>
-              <colorrole role="Base">
-               <brush brushstyle="SolidPattern">
-                <color alpha="255">
-                 <red>248</red>
-                 <green>248</green>
-                 <blue>248</blue>
-                </color>
-               </brush>
-              </colorrole>
-             </active>
-             <inactive>
-              <colorrole role="Base">
-               <brush brushstyle="SolidPattern">
-                <color alpha="255">
-                 <red>248</red>
-                 <green>248</green>
-                 <blue>248</blue>
-                </color>
-               </brush>
-              </colorrole>
-             </inactive>
-             <disabled>
-              <colorrole role="Base">
-               <brush brushstyle="SolidPattern">
-                <color alpha="255">
-                 <red>240</red>
-                 <green>240</green>
-                 <blue>240</blue>
-                </color>
-               </brush>
-              </colorrole>
-             </disabled>
-            </palette>
+          <widget class="DmEdcPanneauAttaque" name="edc_attaque_panneau">
+           <property name="enabled">
+            <bool>false</bool>
            </property>
-          </widget>
-          <widget class="QLabel" name="label">
            <property name="geometry">
             <rect>
-             <x>40</x>
-             <y>370</y>
-             <width>46</width>
-             <height>13</height>
+             <x>10</x>
+             <y>10</y>
+             <width>301</width>
+             <height>401</height>
             </rect>
            </property>
-           <property name="text">
-            <string>Notes : </string>
+           <property name="frameShape">
+            <enum>QFrame::StyledPanel</enum>
            </property>
+           <property name="frameShadow">
+            <enum>QFrame::Sunken</enum>
+           </property>
+           <widget class="DmLineEdit" name="edc_attaque_nom">
+            <property name="geometry">
+             <rect>
+              <x>60</x>
+              <y>10</y>
+              <width>231</width>
+              <height>31</height>
+             </rect>
+            </property>
+            <property name="palette">
+             <palette>
+              <active>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </active>
+              <inactive>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </inactive>
+              <disabled>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>240</red>
+                  <green>240</green>
+                  <blue>240</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </disabled>
+             </palette>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+           </widget>
+           <widget class="DmComboBox" name="edc_attaque_type">
+            <property name="geometry">
+             <rect>
+              <x>10</x>
+              <y>10</y>
+              <width>41</width>
+              <height>31</height>
+             </rect>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <item>
+             <property name="text">
+              <string>Corps-à-corps</string>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>img/curseurEpee.png</normaloff>img/curseurEpee.png</iconset>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>A Distance</string>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>img/arc.png</normaloff>img/arc.png</iconset>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Zone : Ligne</string>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>img/formeLigne.png</normaloff>img/formeLigne.png</iconset>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Zone : Disque</string>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>img/formeEllipsePlein.png</normaloff>img/formeEllipsePlein.png</iconset>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Zone : Cone</string>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>img/cone.png</normaloff>img/cone.png</iconset>
+             </property>
+            </item>
+           </widget>
+           <widget class="QLabel" name="label_6">
+            <property name="geometry">
+             <rect>
+              <x>10</x>
+              <y>50</y>
+              <width>51</width>
+              <height>31</height>
+             </rect>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <property name="text">
+             <string>Portée :</string>
+            </property>
+           </widget>
+           <widget class="QSpinBox" name="edc_attaque_portee">
+            <property name="geometry">
+             <rect>
+              <x>70</x>
+              <y>50</y>
+              <width>41</width>
+              <height>31</height>
+             </rect>
+            </property>
+            <property name="palette">
+             <palette>
+              <active>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </active>
+              <inactive>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </inactive>
+              <disabled>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>240</red>
+                  <green>240</green>
+                  <blue>240</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </disabled>
+             </palette>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <property name="minimum">
+             <number>1</number>
+            </property>
+            <property name="maximum">
+             <number>999</number>
+            </property>
+            <property name="value">
+             <number>1</number>
+            </property>
+           </widget>
+           <widget class="QSpinBox" name="edc_attaque_rayon">
+            <property name="geometry">
+             <rect>
+              <x>200</x>
+              <y>50</y>
+              <width>41</width>
+              <height>31</height>
+             </rect>
+            </property>
+            <property name="palette">
+             <palette>
+              <active>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </active>
+              <inactive>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </inactive>
+              <disabled>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>240</red>
+                  <green>240</green>
+                  <blue>240</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </disabled>
+             </palette>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <property name="minimum">
+             <number>1</number>
+            </property>
+            <property name="value">
+             <number>1</number>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_7">
+            <property name="geometry">
+             <rect>
+              <x>140</x>
+              <y>50</y>
+              <width>61</width>
+              <height>31</height>
+             </rect>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <property name="text">
+             <string>Rayon :</string>
+            </property>
+           </widget>
+           <widget class="DmTextEdit" name="edc_attaque_notes">
+            <property name="geometry">
+             <rect>
+              <x>10</x>
+              <y>350</y>
+              <width>281</width>
+              <height>41</height>
+             </rect>
+            </property>
+            <property name="palette">
+             <palette>
+              <active>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </active>
+              <inactive>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </inactive>
+              <disabled>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>240</red>
+                  <green>240</green>
+                  <blue>240</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </disabled>
+             </palette>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+           </widget>
+           <widget class="QLabel" name="label_19">
+            <property name="geometry">
+             <rect>
+              <x>10</x>
+              <y>330</y>
+              <width>131</width>
+              <height>21</height>
+             </rect>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <property name="text">
+             <string>Description / Notes :</string>
+            </property>
+           </widget>
+           <widget class="DmTableWidget" name="tableWidget">
+            <property name="geometry">
+             <rect>
+              <x>10</x>
+              <y>110</y>
+              <width>281</width>
+              <height>211</height>
+             </rect>
+            </property>
+            <property name="palette">
+             <palette>
+              <active>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </active>
+              <inactive>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>248</red>
+                  <green>248</green>
+                  <blue>248</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </inactive>
+              <disabled>
+               <colorrole role="Base">
+                <brush brushstyle="SolidPattern">
+                 <color alpha="255">
+                  <red>240</red>
+                  <green>240</green>
+                  <blue>240</blue>
+                 </color>
+                </brush>
+               </colorrole>
+              </disabled>
+             </palette>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+              <pointsize>8</pointsize>
+             </font>
+            </property>
+            <property name="gridStyle">
+             <enum>Qt::DotLine</enum>
+            </property>
+            <attribute name="horizontalHeaderVisible">
+             <bool>false</bool>
+            </attribute>
+            <attribute name="horizontalHeaderDefaultSectionSize">
+             <number>180</number>
+            </attribute>
+            <attribute name="horizontalHeaderMinimumSectionSize">
+             <number>50</number>
+            </attribute>
+            <attribute name="horizontalHeaderStretchLastSection">
+             <bool>true</bool>
+            </attribute>
+            <attribute name="verticalHeaderVisible">
+             <bool>false</bool>
+            </attribute>
+            <row>
+             <property name="text">
+              <string>Nouvelle ligne</string>
+             </property>
+            </row>
+            <column>
+             <property name="text">
+              <string>attr</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>val</string>
+             </property>
+             <property name="textAlignment">
+              <set>AlignLeft|AlignVCenter</set>
+             </property>
+            </column>
+            <item row="0" column="0">
+             <property name="text">
+              <string>Bonus à l'attaque</string>
+             </property>
+             <property name="flags">
+              <set>ItemIsSelectable|ItemIsEnabled</set>
+             </property>
+            </item>
+            <item row="0" column="1">
+             <property name="text">
+              <string>8</string>
+             </property>
+             <property name="textAlignment">
+              <set>AlignHCenter|AlignVCenter|AlignCenter</set>
+             </property>
+             <property name="background">
+              <brush brushstyle="NoBrush">
+               <color alpha="255">
+                <red>250</red>
+                <green>250</green>
+                <blue>250</blue>
+               </color>
+              </brush>
+             </property>
+            </item>
+           </widget>
+           <widget class="QLabel" name="label">
+            <property name="geometry">
+             <rect>
+              <x>10</x>
+              <y>90</y>
+              <width>101</width>
+              <height>16</height>
+             </rect>
+            </property>
+            <property name="font">
+             <font>
+              <family>Verdana</family>
+             </font>
+            </property>
+            <property name="text">
+             <string>Attributs :</string>
+            </property>
+           </widget>
           </widget>
          </widget>
          <widget class="QWidget" name="page_invent">
@@ -2741,6 +3179,11 @@ parlées : </string>
            <height>50</height>
           </size>
          </property>
+         <property name="font">
+          <font>
+           <family>Verdana</family>
+          </font>
+         </property>
          <property name="frameShape">
           <enum>QFrame::StyledPanel</enum>
          </property>
@@ -2812,6 +3255,27 @@ parlées : </string>
    <extends>QLineEdit</extends>
    <header location="global">dm.h</header>
   </customwidget>
+  <customwidget>
+   <class>DmTableWidget</class>
+   <extends>QTableWidget</extends>
+   <header location="global">dm.h</header>
+  </customwidget>
+  <customwidget>
+   <class>DmTextEdit</class>
+   <extends>QTextEdit</extends>
+   <header>dm.h</header>
+  </customwidget>
+  <customwidget>
+   <class>DmComboBox</class>
+   <extends>QComboBox</extends>
+   <header location="global">dm.h</header>
+  </customwidget>
+  <customwidget>
+   <class>DmEdcPanneauAttaque</class>
+   <extends>QFrame</extends>
+   <header location="global">dm.h</header>
+   <container>1</container>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections>