コード例 #1
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent, name="recherche_individus", id=-1, style=wx.TAB_TRAVERSAL)
     
     self.toolBar = ToolBar(self)
     self.ctrl_listview = OL_Individus.ListView(self, id=-1, style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL|wx.LC_HRULES|wx.LC_VRULES)
     self.ctrl_recherche = OL_Individus.BarreRecherche(self, historique=True)
     
     self.__set_properties()
     self.__do_layout()
コード例 #2
0
    def __init__(self, parent, IDfamille=None):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           name="DLG_Rattachement",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                           | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
        self.IDfamille = IDfamille
        self.mode = None

        # Adapte taille Police pour Linux
        from Utils import UTILS_Linux
        UTILS_Linux.AdaptePolice(self)

        self.nbreTitulaires = self.GetNbreTitulairesFamille()

        # Bandeau
        titre = _(u"Rattachement d'un individu")
        intro = _(
            u"Commencez par sélectionner une catégorie de rattachement puis saisissez son nom et son prénom. Si l'individu apparait dans la liste, sélectionnez-le. Sinon créez une nouvelle fiche individuelle."
        )
        self.ctrl_bandeau = CTRL_Bandeau.Bandeau(
            self,
            titre=titre,
            texte=intro,
            hauteurHtml=30,
            nomImage="Images/32x32/Famille.png")

        # Categorie
        self.staticbox_categorie_staticbox = wx.StaticBox(
            self, -1, _(u"1. Sélection de la catégorie de rattachement"))
        self.bouton_categorie_1 = wx.ToggleButton(self, 1, _(u"Représentant"))
        self.bouton_categorie_2 = wx.ToggleButton(self, 2, _(u"Enfant"))
        self.bouton_categorie_3 = wx.ToggleButton(self, 3, _(u"Contact"))
        self.ctrl_titulaire = wx.CheckBox(self, -1,
                                          _(u"Titulaire du dossier famille"))
        self.selection_categorie = None

        if self.nbreTitulaires == 0:
            self.bouton_categorie_2.Enable(False)
            self.bouton_categorie_3.Enable(False)

        # Sélection individu
        self.staticbox_selection_staticbox = wx.StaticBox(
            self, -1, _(u"2. Saisie du nom de l'individu"))
        self.ctrl_propositions = OL_Individus.ListView(
            self,
            id=-1,
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_propositions.dictParametres["archives"] = True
        self.label_nom = wx.StaticText(self, -1, _(u"Nom :"))
        self.ctrl_nom = CtrlRecherche(self, numColonne=1)
        self.label_prenom = wx.StaticText(self, -1, _(u"Prénom :"))
        self.ctrl_prenom = wx.TextCtrl(self, -1,
                                       "")  #CtrlRecherche(self, numColonne=2)

        # Txt remarque
        txtRemarque = u"""
        <IMG SRC="Static/Images/16x16/Attention2.png">
        <FONT SIZE=-1>
        Si l'individu à rattacher n'apparaît pas dans cette liste, 
        vous devez cliquez sur ce bouton 
        <A HREF="Saisie">Saisir un nouvel individu</A>
        pour créer une nouvelle fiche individuelle.
        </FONT>
        """
        self.ctrl_html = MyHtml(self, texte=txtRemarque, hauteur=31)

        # Boutons
        self.bouton_aide = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_ok = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Ok"), cheminImage="Images/32x32/Valider.png")
        self.bouton_annuler = CTRL_Bouton_image.CTRL(
            self,
            id=wx.ID_CANCEL,
            texte=_(u"Annuler"),
            cheminImage="Images/32x32/Annuler.png")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_TOGGLEBUTTON, self.OnToggle, self.bouton_categorie_1)
        self.Bind(wx.EVT_TOGGLEBUTTON, self.OnToggle, self.bouton_categorie_2)
        self.Bind(wx.EVT_TOGGLEBUTTON, self.OnToggle, self.bouton_categorie_3)

        self.ActiveControles(False)
        self.ctrl_titulaire.Enable(False)