Exemplo n.º 1
0
    def __init__(self, parent, bordure=0):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.bordure = bordure

        # Filtres
        self.check_attente_avec_possibilites = wx.CheckBox(self, -1, _(u"Avec disponibilités"))
        self.check_attente_sans_possibilites = wx.CheckBox(self, -1, _(u"Sans disponibilités"))
        self.check_attente_refusees = wx.CheckBox(self, -1, _(u"Refusées"))
        self.check_attente_attribuees = wx.CheckBox(self, -1, _(u"Attribuées"))

        self.check_attente_avec_possibilites.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL))
        self.check_attente_sans_possibilites.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL))
        self.check_attente_refusees.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL))
        self.check_attente_attribuees.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL))

        # Liste des demandes de locations
        self.ctrl_listview = OL_Locations_demandes.ListView(self, id=-1, style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_listview.SetMinSize((50, 50))
        self.ctrl_recherche = OL_Locations_demandes.CTRL_Outils(self, listview=self.ctrl_listview)
        self.ctrl_recherche.SetMinSize((10, -1))

        self.bouton_ajouter = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY))
        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.Bind(wx.EVT_CHECKBOX, self.OnCheckOptions, self.check_attente_avec_possibilites)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckOptions, self.check_attente_sans_possibilites)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckOptions, self.check_attente_refusees)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckOptions, self.check_attente_attribuees)
        self.Bind(wx.EVT_BUTTON, self.ctrl_listview.Ajouter, self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.ctrl_listview.Modifier, self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.ctrl_listview.Supprimer, self.bouton_supprimer)

        self.__set_properties()
        self.__do_layout()

        # Init
        self.check_attente_avec_possibilites.SetValue(True)
        self.check_attente_sans_possibilites.SetValue(True)
    def __init__(self, parent, filtres=[]):
        wx.Panel.__init__(self,
                          parent,
                          id=-1,
                          name="CTRL_Liste_locations_demandes",
                          style=wx.TAB_TRAVERSAL)
        self.parent = parent

        # Liste des locations
        self.listviewAvecFooter = OL_Locations_demandes.ListviewAvecFooter(
            self, kwargs={"checkColonne": True})
        self.ctrl_demandes = self.listviewAvecFooter.GetListview()

        # Commandes de liste
        self.bouton_apercu = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_email = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Emails_exp.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_liste_apercu = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_liste_imprimer = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Imprimante.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_liste_export_texte = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Texte2.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_liste_export_excel = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Excel.png"),
                      wx.BITMAP_TYPE_ANY))

        # Options de liste
        self.ctrl_recherche = OL_Locations_demandes.CTRL_Outils(
            self, listview=self.ctrl_demandes, afficherCocher=True)

        self.check_demandes_actives = wx.CheckBox(
            self, -1, _(u"Afficher uniquement les demandes en cours"))
        self.check_demandes_actives.SetFont(
            wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL))
        self.check_demandes_actives.SetValue(True)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX, self.OnCheckActives,
                  self.check_demandes_actives)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonApercu, self.bouton_apercu)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonEmail, self.bouton_email)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimer, self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonListeApercu,
                  self.bouton_liste_apercu)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonListeImprimer,
                  self.bouton_liste_imprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonListeExportTexte,
                  self.bouton_liste_export_texte)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonListeExportExcel,
                  self.bouton_liste_export_excel)

        # Init contrôles
        self.ctrl_demandes.afficher_uniquement_actives = self.check_demandes_actives.GetValue(
        )
Exemplo n.º 3
0
    def __init__(self, parent, IDfamille=None):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.IDfamille = IDfamille

        # ----------------- Demandes de locations --------------
        self.staticbox_demandes = wx.StaticBox(self, -1,
                                               _(u"Demandes de locations"))
        self.ctrl_demandes = OL_Locations_demandes.ListView(
            self,
            IDfamille=IDfamille,
            id=-1,
            name="OL_Demandes_locations",
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_demandes.SetMinSize((50, 50))

        self.bouton_ajouter_demande = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_modifier_demande = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer_demande = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"),
                      wx.BITMAP_TYPE_ANY))

        # Binds
        self.Bind(wx.EVT_BUTTON, self.ctrl_demandes.Ajouter,
                  self.bouton_ajouter_demande)
        self.Bind(wx.EVT_BUTTON, self.ctrl_demandes.Modifier,
                  self.bouton_modifier_demande)
        self.Bind(wx.EVT_BUTTON, self.ctrl_demandes.Supprimer,
                  self.bouton_supprimer_demande)

        # Propriétés
        self.bouton_ajouter_demande.SetToolTip(
            wx.ToolTip(_(u"Cliquez ici pour saisir une demande de location")))
        self.bouton_modifier_demande.SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour modifier la demande de location sélectionnée"
                  )))
        self.bouton_supprimer_demande.SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour supprimer la demande de location sélectionnée"
                  )))

        # --- Layout ---
        grid_sizer_base = wx.FlexGridSizer(rows=2, cols=1, vgap=0, hgap=0)

        # Demandes
        staticbox_demandes = wx.StaticBoxSizer(self.staticbox_demandes,
                                               wx.VERTICAL)

        grid_sizer_demandes = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5)
        grid_sizer_demandes.Add(self.ctrl_demandes, 1, wx.EXPAND, 0)

        grid_sizer_boutons = wx.FlexGridSizer(rows=3, cols=1, vgap=5, hgap=5)
        grid_sizer_boutons.Add(self.bouton_ajouter_demande, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_modifier_demande, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_supprimer_demande, 0, wx.ALL, 0)
        grid_sizer_demandes.Add(grid_sizer_boutons, 1, wx.ALL, 0)

        grid_sizer_demandes.AddGrowableCol(0)
        grid_sizer_demandes.AddGrowableRow(0)
        staticbox_demandes.Add(grid_sizer_demandes, 1, wx.EXPAND | wx.ALL, 5)
        grid_sizer_base.Add(staticbox_demandes, 1, wx.EXPAND | wx.LEFT, 10)

        self.SetSizer(grid_sizer_base)
        grid_sizer_base.Fit(self)
        grid_sizer_base.AddGrowableCol(0)
        grid_sizer_base.AddGrowableRow(0)
        self.Layout()