コード例 #1
0
    def __init__(self, parent, titre=_(u"Fiche individuelle"), IDpersonne=0):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           name="FicheIndividuelle",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                           | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
        self.IDpersonne = IDpersonne
        self.contratEnCours = None
        self.AnnulationImpossible = False
        self.barre_problemes = None
        self.photo = None

        import locale
        self.locale = wx.Locale(wx.LANGUAGE_FRENCH)

        try:
            locale.setlocale(locale.LC_ALL, 'FR')
        except:
            pass

        self.panel_1 = wx.Panel(self, -1)
        self.label_hd_CatId = wx.StaticText(self.panel_1, -1, u"")
        self.static_line_1 = wx.StaticLine(self.panel_1, -1)
        self.label_hd_nomPrenom = wx.StaticText(self.panel_1, -1,
                                                _(u"NOM, Prénom"))
        self.label_hd_adresse = wx.StaticText(
            self.panel_1, -1,
            _(u"Résidant 42 rue des oiseaux 29870 LANNILIS"))
        self.label_hd_naiss = wx.StaticText(
            self.panel_1, -1, _(u"Date et lieu de naissance inconnus"))
        self.bitmap_photo = CTRL_Photo.CTRL_Photo(self.panel_1,
                                                  style=wx.SUNKEN_BORDER)
        self.bitmap_photo.SetPhoto(
            IDindividu=None,
            nomFichier=Chemins.GetStaticPath("Images/128x128/Personne.png"),
            taillePhoto=(128, 128),
            qualite=100)

        self.bitmap_button_aide = CTRL_Bouton_image.CTRL(
            self.panel_1,
            texte=_(u"Aide"),
            cheminImage=Chemins.GetStaticPath("Images/32x32/Aide.png"))
        self.bitmap_button_Ok = CTRL_Bouton_image.CTRL(
            self.panel_1,
            texte=_(u"Ok"),
            cheminImage=Chemins.GetStaticPath("Images/32x32/Valider.png"))
        self.bitmap_button_annuler = CTRL_Bouton_image.CTRL(
            self.panel_1,
            texte=_(u"Annuler"),
            cheminImage=Chemins.GetStaticPath("Images/32x32/Annuler.png"))

        # NoteBook
        self.notebook = Notebook(self.panel_1, IDpersonne=self.IDpersonne)
        if self.nouvelleFiche == True:
            self.notebook.AfficheAutresPages(False)

        # Recherche s'il y a un contrat en cours ou à venir pour savoir s'il faut afficher la barre des problèmes
        if self.IDpersonne in FonctionsPerso.Recherche_ContratsEnCoursOuAVenir(
        ):
            self.barre_problemes = True
        else:
            self.barre_problemes = False

        # Récupération de la liste des problèmes de la personne
        self.bitmap_problemes_G = wx.StaticBitmap(
            self.panel_1, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/Special/Problemes_G.png"),
                      wx.BITMAP_TYPE_PNG))
        self.bitmap_problemes_D = wx.StaticBitmap(
            self.panel_1, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/Special/Problemes_D.png"),
                      wx.BITMAP_TYPE_PNG))
        self.txtDefilant = Ticker(self.panel_1,
                                  size=(-1, 18),
                                  fgcolor=(255, 255, 255),
                                  bgcolor=(255, 60, 60))
        self.txtPbPersonne = self.Recup_txt_pb_personne()
        self.txtDefilant.SetText(self.txtPbPersonne)

        # Mise à jour des infos du bandeau supérieur de la fiche
        self.MaJ_header()

        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bitmap_button_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bitmap_button_Ok)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAnnuler,
                  self.bitmap_button_annuler)
        self.txtDefilant.Bind(wx.EVT_MOTION, self.OnMotionTxtDefilant)
        self.txtDefilant.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveTxtDefilant)
        self.Bind(wx.EVT_CLOSE, self.OnClose)

        self.__set_properties()
        self.__do_layout()

        self.Affichage_barre_problemes()
コード例 #2
0
 def MAJ_barre_problemes(self):
     if self.IDpersonne in FonctionsPerso.Recherche_ContratsEnCoursOuAVenir() :
         self.parent.GetGrandParent().barre_problemes = True
     else:
         self.parent.GetGrandParent().barre_problemes = False
     self.parent.GetGrandParent().MAJ_barre_problemes()