Exemple #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

        self.ctrl_listview = OL_Locations.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.CTRL_Outils(
            self, listview=self.ctrl_listview)
        self.ctrl_recherche.SetMinSize((10, -1))

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

        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.bouton_configuration = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Mecanisme.png"),
                      wx.BITMAP_TYPE_ANY))

        self.__set_properties()
        self.__do_layout()

        # Binds
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckActives,
                  self.check_locations_actives)
        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.Bind(wx.EVT_BUTTON, self.ctrl_listview.MenuConfigurerListe,
                  self.bouton_configuration)

        # Init contrôles
        self.ctrl_listview.afficher_uniquement_actives = self.check_locations_actives.GetValue(
        )
    def __init__(self, parent, filtres=[]):
        wx.Panel.__init__(self, parent, id=-1, name="CTRL_Liste_locations", style=wx.TAB_TRAVERSAL)
        self.parent = parent
        
        # Liste des locations
        self.listviewAvecFooter = OL_Locations.ListviewAvecFooter(self, kwargs={"checkColonne" : True})
        self.ctrl_locations = 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.CTRL_Outils(self, listview=self.ctrl_locations, afficherCocher=True)

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

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX, self.OnCheckActives, self.check_locations_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_locations.afficher_uniquement_actives = self.check_locations_actives.GetValue()
    def __init__(self, parent, IDproduit=None):
        wx.Dialog.__init__(self, parent, -1, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX)
        self.parent = parent
        self.IDproduit = IDproduit
        self.logo = None
        self.SetTitle(_(u"Fiche produit"))

        # Généralités
        self.staticbox_generalites_staticbox = wx.StaticBox(self, -1, _(u"Caractéristiques"))
        self.ctrl_produit = MyHtml(self)

        # Logo
        self.staticbox_logo_staticbox = wx.StaticBox(self, -1, _(u"Image"))
        self.ctrl_logo = CTRL_Logo.CTRL(self, qualite=100, couleurFond=wx.Colour(255, 255, 255), size=(110, 110) )
        self.bouton_visualiser = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Loupe.png"), wx.BITMAP_TYPE_ANY))

        # Locations
        self.staticbox_locations = wx.StaticBox(self, -1, _(u"Locations"))
        self.ctrl_locations = OL_Locations.ListView(self, IDproduit=IDproduit, id=-1, name="OL_locations", style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_locations.SetMinSize((500, 200))

        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))

        # Boutons
        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/Annuler.png")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Ajouter, self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Modifier, self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Supprimer, self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.ctrl_logo.Ajouter, self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.ctrl_logo.MAJ, self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.ctrl_logo.Visualiser, self.bouton_visualiser)

        # Init
        if self.IDproduit != None :
            self.Importation()

        self.ctrl_locations.MAJ()
Exemple #4
0
    def __init__(self, parent, IDproduit=None):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.IDproduit = IDproduit

        self.ctrl_locations = OL_Locations.ListView(
            self,
            IDproduit=self.IDproduit,
            id=-1,
            name="OL_locations",
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_locations.SetMinSize((500, 200))

        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))

        # Properties
        self.bouton_ajouter.SetToolTip(
            wx.ToolTip(_(u"Cliquez ici pour ajouter une location")))
        self.bouton_modifier.SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour modifier la location sélectionnée dans la liste"
                  )))
        self.bouton_supprimer.SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour supprimer la location sélectionnée dans la liste"
                  )))

        # Bind
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Ajouter,
                  self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Modifier,
                  self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Supprimer,
                  self.bouton_supprimer)

        # Layout
        sizer_base = wx.BoxSizer(wx.VERTICAL)

        grid_sizer_base = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5)
        grid_sizer_base.Add(self.ctrl_locations, 0, wx.EXPAND, 0)
        grid_sizer_boutons = wx.FlexGridSizer(rows=4, cols=1, vgap=5, hgap=5)
        grid_sizer_boutons.Add(self.bouton_ajouter, 0, 0, 0)
        grid_sizer_boutons.Add(self.bouton_modifier, 0, 0, 0)
        grid_sizer_boutons.Add(self.bouton_supprimer, 0, 0, 0)
        grid_sizer_base.Add(grid_sizer_boutons, 0, 0, 0)
        grid_sizer_base.AddGrowableCol(0)
        grid_sizer_base.AddGrowableRow(0)

        sizer_base.Add(grid_sizer_base, 1, wx.EXPAND | wx.ALL, 10)
        self.SetSizer(sizer_base)
        self.Layout()
Exemple #5
0
    def __init__(self, parent, IDfamille=None):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.IDfamille = IDfamille

        # ------------------- Locations -------------------------
        self.staticbox_locations = wx.StaticBox(self, -1, _(u"Locations"))
        self.ctrl_locations = OL_Locations.ListView(
            self,
            IDfamille=IDfamille,
            id=-1,
            name="OL_locations",
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_locations.SetMinSize((50, 50))

        self.bouton_ajouter_location = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_modifier_location = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer_location = 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_locations.Ajouter,
                  self.bouton_ajouter_location)
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Modifier,
                  self.bouton_modifier_location)
        self.Bind(wx.EVT_BUTTON, self.ctrl_locations.Supprimer,
                  self.bouton_supprimer_location)

        # Propriétés
        self.bouton_ajouter_location.SetToolTip(
            wx.ToolTip(_(u"Cliquez ici pour saisir une location")))
        self.bouton_modifier_location.SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour modifier la location sélectionnée")))
        self.bouton_supprimer_location.SetToolTip(
            wx.ToolTip(
                _(u"Cliquez ici pour supprimer la location sélectionnée")))

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

        # Locations
        staticbox_locations = wx.StaticBoxSizer(self.staticbox_locations,
                                                wx.VERTICAL)

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

        grid_sizer_boutons = wx.FlexGridSizer(rows=3, cols=1, vgap=5, hgap=5)
        grid_sizer_boutons.Add(self.bouton_ajouter_location, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_modifier_location, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.bouton_supprimer_location, 0, wx.ALL, 0)
        grid_sizer_locations.Add(grid_sizer_boutons, 1, wx.ALL, 0)

        grid_sizer_locations.AddGrowableCol(0)
        grid_sizer_locations.AddGrowableRow(0)
        staticbox_locations.Add(grid_sizer_locations, 1, wx.EXPAND | wx.ALL, 5)
        grid_sizer_base.Add(staticbox_locations, 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()