def __init__(self, parent, IDfamille=None):
        wx.Panel.__init__(self,
                          parent,
                          id=-1,
                          name="panel_reglements",
                          style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.IDfamille = IDfamille
        self.IDcompte_payeur = None

        self.staticbox_reglements = wx.StaticBox(self, -1, _(u"Règlements"))

        # OL Prestations
        self.listviewAvecFooter = OL_Reglements.ListviewAvecFooter(self,
                                                                   kwargs={})
        self.ctrl_reglements = self.listviewAvecFooter.GetListview()
        self.ctrl_recherche = OL_Reglements.CTRL_Outils(
            self, listview=self.ctrl_reglements)
        self.ctrl_recherche.SetBackgroundColour((255, 255, 255))

        # Commandes boutons
        self.bouton_ajouter = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_modifier = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_rembourser = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Remboursement.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_ventilationAuto = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Magique.png"),
                      wx.BITMAP_TYPE_ANY))
        ##        self.bouton_repartition = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Repartition.png"), wx.BITMAP_TYPE_ANY))

        # Abonnements
        self.ctrl_prelevement = CTRL_Prelevement(self, IDfamille)
        self.ctrl_recu = CTRL_Recu(self, IDfamille)
        self.ctrl_depot = CTRL_Depot(self, IDfamille)

        # Binds
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAjouter, self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonModifier, self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimer, self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonRembourser,
                  self.bouton_rembourser)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonVentilationAuto,
                  self.bouton_ventilationAuto)
        ##        self.Bind(wx.EVT_BUTTON, self.OnBoutonRepartition, self.bouton_repartition)

        # Propriétés
        self.bouton_ajouter.SetToolTipString(
            _(u"Cliquez ici pour saisir un règlement"))
        self.bouton_modifier.SetToolTipString(
            _(u"Cliquez ici pour modifier le règlement sélectionné"))
        self.bouton_supprimer.SetToolTipString(
            _(u"Cliquez ici pour supprimer le règlement sélectionné"))
        self.bouton_rembourser.SetToolTipString(
            _(u"Cliquez ici pour saisir un remboursement"))
        self.bouton_ventilationAuto.SetToolTipString(
            _(u"Cliquez ici pour accéder aux commandes de ventilation automatique"
              ))
        ##        self.bouton_repartition.SetToolTipString(_(u"Cliquez ici pour afficher la ventilation détaillée"))

        # Layout
        grid_sizer_base = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5)
        staticbox_reglements = wx.StaticBoxSizer(self.staticbox_reglements,
                                                 wx.VERTICAL)
        grid_sizer_reglements = wx.FlexGridSizer(rows=2,
                                                 cols=2,
                                                 vgap=5,
                                                 hgap=5)

        grid_sizer_reglements.Add(self.listviewAvecFooter, 1, wx.EXPAND, 0)

        grid_sizer_boutons = wx.FlexGridSizer(rows=6, cols=1, vgap=5, hgap=5)
        grid_sizer_boutons.Add(self.bouton_ajouter, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_modifier, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_supprimer, 0, wx.ALL, 0)
        grid_sizer_boutons.Add((2, 2), 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_rembourser, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_ventilationAuto, 0, wx.ALL, 0)
        ##        grid_sizer_boutons.Add(self.bouton_repartition, 0, wx.ALL, 0)
        grid_sizer_reglements.Add(grid_sizer_boutons, 1, wx.ALL, 0)

        grid_sizer_options = wx.FlexGridSizer(rows=1, cols=8, vgap=5, hgap=5)
        grid_sizer_options.Add(self.ctrl_prelevement, 0,
                               wx.ALL | wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_options.Add(self.ctrl_recu, 0,
                               wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
        grid_sizer_options.Add(self.ctrl_depot, 0,
                               wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
        grid_sizer_options.Add((70, 5), 0, wx.ALL, 0)
        grid_sizer_options.Add(self.ctrl_recherche, 0, wx.EXPAND | wx.ALL, 0)
        grid_sizer_options.AddGrowableCol(4)

        grid_sizer_reglements.Add(grid_sizer_options, 1,
                                  wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)

        grid_sizer_reglements.AddGrowableCol(0)
        grid_sizer_reglements.AddGrowableRow(0)
        staticbox_reglements.Add(grid_sizer_reglements, 1, wx.EXPAND | wx.ALL,
                                 5)

        grid_sizer_base.Add(staticbox_reglements, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(grid_sizer_base)
        grid_sizer_base.Fit(self)
        grid_sizer_base.AddGrowableCol(0)
        grid_sizer_base.AddGrowableRow(0)
Exemplo n.º 2
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                           | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX
                           | wx.THICK_FRAME)
        self.parent = parent

        intro = _(
            u"Vous pouvez ici consulter la liste complète des règlements saisis dans le logiciel."
        )
        titre = _(u"Liste des règlements")
        self.ctrl_bandeau = CTRL_Bandeau.Bandeau(
            self,
            titre=titre,
            texte=intro,
            hauteurHtml=30,
            nomImage="Images/32x32/Reglement.png")

        # Paramètres
        self.staticbox_options_staticbox = wx.StaticBox(
            self, -1, _(u"Filtres"))

        self.label_annee = wx.StaticText(self, -1, _(u"Année :"))
        self.ctrl_annee = CTRL_Annee(self)
        self.ctrl_annee.SetMinSize((60, -1))

        self.label_compte = wx.StaticText(self, -1, _(u"Compte :"))
        self.ctrl_compte = CTRL_Compte(self)
        self.ctrl_compte.SetMinSize((120, -1))

        self.label_mode = wx.StaticText(self, -1, _(u"Mode :"))
        self.ctrl_mode = CTRL_Modes(self)
        self.ctrl_mode.SetMinSize((120, -1))

        self.label_tri = wx.StaticText(self, -1, _(u"Tri :"))
        self.ctrl_tri = wx.Choice(self,
                                  -1,
                                  choices=(_(u"Ordre de saisie"), _(u"Date"),
                                           _(u"Mode de règlement"),
                                           _(u"Emetteur"),
                                           _(u"Numéro de pièce"),
                                           _(u"Nom de payeur"), "Montant"))
        self.ctrl_tri.Select(1)

        self.label_ordre = wx.StaticText(self, -1, _(u"Ordre :"))
        self.ctrl_ordre = wx.Choice(self,
                                    -1,
                                    choices=(_(u"Ascendant"),
                                             _(u"Descendant")))
        self.ctrl_ordre.Select(0)

        # Liste
        self.listviewAvecFooter = OL_Reglements.ListviewAvecFooter(
            self, kwargs={"mode": "liste"})
        self.ctrl_reglements = self.listviewAvecFooter.GetListview()
        self.ctrl_recherche = OL_Reglements.CTRL_Outils(
            self, listview=self.ctrl_reglements)

        self.bouton_modifier = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Modifier.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Supprimer.png"),
                      wx.BITMAP_TYPE_ANY))

        self.bouton_apercu = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Apercu.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_imprimer = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Imprimante.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_texte = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Texte2.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_excel = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Excel.png"),
                      wx.BITMAP_TYPE_ANY))

        self.bouton_aide = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_fermer = CTRL_Bouton_image.CTRL(
            self,
            id=wx.ID_CANCEL,
            texte=_(u"Fermer"),
            cheminImage="Images/32x32/Fermer.png")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.ctrl_reglements.Modifier,
                  self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.ctrl_reglements.Apercu,
                  self.bouton_apercu)
        self.Bind(wx.EVT_BUTTON, self.ctrl_reglements.Imprimer,
                  self.bouton_imprimer)
        self.Bind(wx.EVT_BUTTON, self.ctrl_reglements.ExportTexte,
                  self.bouton_texte)
        self.Bind(wx.EVT_BUTTON, self.ctrl_reglements.ExportExcel,
                  self.bouton_excel)

        self.Bind(wx.EVT_BUTTON, self.ctrl_reglements.Supprimer,
                  self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)

        self.Bind(wx.EVT_CHOICE, self.OnParametre, self.ctrl_annee)
        self.Bind(wx.EVT_CHOICE, self.OnParametre, self.ctrl_compte)
        self.Bind(wx.EVT_CHOICE, self.OnParametre, self.ctrl_mode)
        self.Bind(wx.EVT_CHOICE, self.OnParametre, self.ctrl_tri)
        self.Bind(wx.EVT_CHOICE, self.OnParametre, self.ctrl_ordre)

        # Init contrôles
        self.OnParametre()