Ejemplo n.º 1
0
    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))

        # Onglets
        self.ctrl_onglets = CTRL_Onglets(self, self.IDproduit)
        self.ctrl_onglets.SetMinSize((750, 400))

        # 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.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.ctrl_logo.Visualiser,
                  self.bouton_visualiser)

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

        self.ctrl_onglets.GetPageAvecCode("locations").MAJ()
        self.ctrl_onglets.GetPageAvecCode("chronologie").ctrl_timeline.MAJ()
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
    def __init__(self, parent, empecheAnnulation=False):
        wx.Dialog.__init__(self, parent, -1, style=wx.DEFAULT_DIALOG_STYLE)
        self.parent = parent
        self.empecheAnnulation = empecheAnnulation

        self.logo = None

        intro = _(
            u"Saisissez ici les informations concernant l'organisateur. Ces données seront utilisées dans les différents documents édités par le logiciel."
        )
        titre = _(u"L'organisateur")
        self.ctrl_bandeau = CTRL_Bandeau.Bandeau(
            self,
            titre=titre,
            texte=intro,
            hauteurHtml=30,
            nomImage="Images/32x32/Organisateur.png")

        self.staticbox_nom_staticbox = wx.StaticBox(
            self, -1, _(u"Nom de l'organisateur"))
        self.label_nom = wx.StaticText(self, -1, _(u"Nom :"))
        self.ctrl_nom = wx.TextCtrl(self, -1, u"")

        self.staticbox_coords_staticbox = wx.StaticBox(self, -1,
                                                       _(u"Coordonnées"))
        self.label_rue = wx.StaticText(self, -1, _(u"Rue :"))
        self.ctrl_rue = wx.TextCtrl(self, -1, u"", style=wx.TE_MULTILINE)
        self.label_adresse = wx.StaticText(self, -1, _(u"C.P. :"))
        self.ctrl_adresse = CTRL_Saisie_adresse.Adresse(self)
        self.label_tel = wx.StaticText(self, -1, _(u"Tél :"))
        self.ctrl_tel = CTRL_Saisie_tel.Tel(self, intitule=_(u"siège"))
        self.label_mail = wx.StaticText(self, -1, _(u"Email :"))
        self.ctrl_mail = CTRL_Saisie_mail.Mail(self)
        self.label_fax = wx.StaticText(self, -1, _(u"Fax :"))
        self.ctrl_fax = CTRL_Saisie_tel.Tel(self, intitule=_(u"fax"))
        self.label_site = wx.StaticText(self, -1, _(u"Site internet :"))
        self.ctrl_site = wx.TextCtrl(self, -1, u"")

        self.staticbox_numeros_staticbox = wx.StaticBox(
            self, -1, _(u"Numéros d'identification"))
        self.label_agrement = wx.StaticText(self, -1,
                                            _(u"Numéro agrément :"))
        self.ctrl_agrement = wx.TextCtrl(self, -1, u"")
        self.label_siret = wx.StaticText(self, -1, _(u"Numéro SIRET :"))
        self.ctrl_siret = wx.TextCtrl(self, -1, u"")
        self.label_ape = wx.StaticText(self, -1, _(u"Code APE :"))
        self.ctrl_ape = wx.TextCtrl(self, -1, u"")

        self.staticbox_logo_staticbox = wx.StaticBox(self, -1, _(u"Logo"))
        self.ctrl_logo = CTRL_Logo.CTRL(self,
                                        qualite=100,
                                        couleurFond=wx.Colour(255, 255, 255),
                                        size=(83, 83))
        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_visualiser = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Loupe.png"),
                      wx.BITMAP_TYPE_ANY))

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

        # Empêche l'annulation
        if self.empecheAnnulation == True:
            self.bouton_annuler.Show(False)
            self.EnableCloseButton(False)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonModifierLogo,
                  self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimerLogo,
                  self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonVisualiserLogo,
                  self.bouton_visualiser)

        self.Importation()
    def __init__(self, parent, IDactivite=None, nouvelleActivite=False):
        wx.Panel.__init__(self,
                          parent,
                          id=-1,
                          name="panel_generalites",
                          style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.IDactivite = IDactivite

        self.listeInitialeGroupes = []

        # Nom Activité
        self.staticbox_nom_staticbox = wx.StaticBox(self, -1,
                                                    _(u"Nom de l'activité"))
        self.label_nom_complet = wx.StaticText(self, -1, _(u"Nom complet :"))
        self.ctrl_nom_complet = wx.TextCtrl(self, -1, u"")
        self.label_nom_abrege = wx.StaticText(self, -1, _(u"Nom abrégé :"))
        self.ctrl_nom_abrege = wx.TextCtrl(self, -1, u"")

        # Coords
        self.staticbox_coords_staticbox = wx.StaticBox(self, -1,
                                                       _(u"Coordonnées"))
        self.radio_coords_org = wx.RadioButton(self,
                                               -1,
                                               u"",
                                               style=wx.RB_GROUP)
        self.label_coords_org = wx.StaticText(
            self, -1, _(u"Identique à l'organisateur"))
        self.radio_coords_autres = wx.RadioButton(self, -1, u"")
        self.label_coords_autres = wx.StaticText(self, -1,
                                                 _(u"Autres coordonnées :"))
        self.label_rue = wx.StaticText(self, -1, _(u"Rue :"))
        self.ctrl_rue = wx.TextCtrl(self, -1, u"", style=wx.TE_MULTILINE)
        self.label_ville = wx.StaticText(self, -1, _(u"C.P. :"))
        self.ctrl_ville = CTRL_Saisie_adresse.Adresse(self)
        self.label_tel = wx.StaticText(self, -1, _(u"Tél :"))
        self.ctrl_tel = CTRL_Saisie_tel.Tel(
            self, intitule=_(u"contact pour cette activité"))
        self.label_mail = wx.StaticText(self, -1, _(u"Email :"))
        self.ctrl_mail = CTRL_Saisie_mail.Mail(self)
        self.label_fax = wx.StaticText(self, -1, _(u"Fax :"))
        self.ctrl_fax = CTRL_Saisie_tel.Tel(self, intitule=_(u"fax"))
        self.label_site = wx.StaticText(self, -1, _(u"Site internet :"))
        self.ctrl_site = wx.TextCtrl(self, -1, u"")

        # Responsables
        self.staticbox_responsables_staticbox = wx.StaticBox(
            self, -1, _(u"Responsables de l'activité"))
        self.ctrl_responsables = OL_Responsables_activite.ListView(
            self,
            IDactivite=IDactivite,
            id=-1,
            name="OL_responsables",
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_responsables.SetMinSize((-1, 40))
        self.ctrl_responsables.MAJ()
        self.bouton_ajouter_responsable = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_modifier_responsable = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer_responsable = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_defaut_responsable = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ok.png"),
                      wx.BITMAP_TYPE_ANY))

        # Code comptable
        self.staticbox_code_comptable_staticbox = wx.StaticBox(
            self, -1, _(u"Code comptable"))
        self.ctrl_code_comptable = wx.TextCtrl(self, -1, "")

        # Groupes d'activités
        self.staticbox_groupes_staticbox = wx.StaticBox(
            self, -1, _(u"Regroupement d'activités"))
        self.ctrl_groupes = CTRL_Groupes_activite(self)
        self.ctrl_groupes.SetMinSize((-1, 40))

        # Logo
        self.staticbox_logo_staticbox = wx.StaticBox(self, -1, _(u"Logo"))
        self.radio_logo_org = wx.RadioButton(self, -1, u"", style=wx.RB_GROUP)
        self.label_logo_org = wx.StaticText(self, -1,
                                            _(u"Identique a l'organisateur"))
        self.radio_logo_autre = wx.RadioButton(self, -1, u"")
        self.label_logo_autre = wx.StaticText(self, -1, _(u"Autre logo :"))
        self.ctrl_logo = CTRL_Logo.CTRL(self,
                                        qualite=100,
                                        couleurFond=wx.Colour(255, 255, 255),
                                        size=(83, 83))
        self.bouton_modifier_logo = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer_logo = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_visualiser_logo = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Loupe.png"),
                      wx.BITMAP_TYPE_ANY))

        # Validité
        self.staticbox_validite_staticbox = wx.StaticBox(
            self, -1, _(u"Dates de validité"))
        self.radio_illimitee = wx.RadioButton(self, -1, u"", style=wx.RB_GROUP)
        self.label_illimitee = wx.StaticText(self, -1, _(u"Illimitée"))
        self.radio_limitee = wx.RadioButton(self, -1, u"")
        self.label_validite_du = wx.StaticText(self, -1, u"Du")
        self.ctrl_validite_du = CTRL_Saisie_date.Date(self)
        self.label_validite_au = wx.StaticText(self, -1, _(u"au"))
        self.ctrl_validite_au = CTRL_Saisie_date.Date(self)

        # Public
        self.staticbox_public_staticbox = wx.StaticBox(self, -1, _(u"Public"))
        self.ctrl_public = CTRL_Public(self)
        listePublic = [
            (1, _(u"Représentants"), False),
            (2, _(u"Enfants"), False),
        ]
        self.ctrl_public.SetData(listePublic)
        self.ctrl_public.SetMinSize((-1, 40))

        # Nombre max d'inscrits
        self.staticbox_limitation_inscrits_staticbox = wx.StaticBox(
            self, -1, _(u"Limitation du nombre d'inscrits"))
        self.check_limitation_inscrits = wx.CheckBox(
            self, -1, _(u"Nombre d'inscrits max. :"))
        self.ctrl_limitation_inscrits = wx.SpinCtrl(self,
                                                    -1,
                                                    size=(80, -1),
                                                    min=1,
                                                    max=99999)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioCoords,
                  self.radio_coords_org)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioCoords,
                  self.radio_coords_autres)
        self.Bind(wx.EVT_BUTTON, self.OnAjouterResponsable,
                  self.bouton_ajouter_responsable)
        self.Bind(wx.EVT_BUTTON, self.OnModifierResponsable,
                  self.bouton_modifier_responsable)
        self.Bind(wx.EVT_BUTTON, self.OnSupprimerResponsable,
                  self.bouton_supprimer_responsable)
        self.Bind(wx.EVT_BUTTON, self.OnResponsableDefaut,
                  self.bouton_defaut_responsable)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioLogo, self.radio_logo_org)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioLogo, self.radio_logo_autre)
        self.Bind(wx.EVT_BUTTON, self.OnModifierLogo,
                  self.bouton_modifier_logo)
        self.Bind(wx.EVT_BUTTON, self.OnSupprimerLogo,
                  self.bouton_supprimer_logo)
        self.Bind(wx.EVT_BUTTON, self.OnVisualiserLogo,
                  self.bouton_visualiser_logo)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioValidite,
                  self.radio_illimitee)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioValidite, self.radio_limitee)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckLimitationInscrits,
                  self.check_limitation_inscrits)

        # Importation
        if nouvelleActivite == False:
            self.Importation()

        # Initialisation des contrôles
        self.OnRadioCoords(None)
        self.OnRadioLogo(None)
        self.OnRadioValidite(None)
        self.OnCheckLimitationInscrits(None)
Ejemplo n.º 5
0
    def __init__(self,
                 parent,
                 IDlocation=None,
                 IDfamille=None,
                 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.IDlocation = IDlocation
        self.liste_initiale_IDprestation = []

        if self.IDlocation == None:
            self.SetTitle(_(u"Saisie d'une location"))
        else:
            self.SetTitle(_(u"Modification d'une location"))

        # Généralités
        self.staticbox_generalites_staticbox = wx.StaticBox(
            self, -1, _(u"Généralités"))
        self.label_loueur = wx.StaticText(self, -1, _(u"Loueur :"))
        self.ctrl_loueur = CTRL_Loueur(self)
        self.ctrl_loueur.SetFont(
            wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                    wx.FONTWEIGHT_BOLD, False, 'Arial'))
        self.bouton_loueur = wx.Button(self, -1, _(u"Sélectionner"))

        self.label_produit = wx.StaticText(self, -1, _(u"Produit :"))
        self.ctrl_produit = CTRL_Produit(self)
        self.ctrl_produit.SetFont(
            wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                    wx.FONTWEIGHT_BOLD, False, 'Arial'))
        self.bouton_produit = wx.Button(self, -1, _(u"Sélectionner"))

        self.label_observations = wx.StaticText(self, -1, _(u"Notes :"))
        self.ctrl_observations = wx.TextCtrl(self,
                                             -1,
                                             u"",
                                             style=wx.TE_MULTILINE)

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

        # Période
        self.staticbox_periode_staticbox = wx.StaticBox(
            self, -1, _(u"Période de location"))
        self.label_date_debut = wx.StaticText(self, -1, _(u"Début :"))
        self.ctrl_date_debut = CTRL_Saisie_date.Date2(self)
        self.ctrl_heure_debut = CTRL_Saisie_heure.Heure(self)
        self.check_date_fin = wx.CheckBox(self, -1, _(u"Fin :"))
        self.ctrl_date_fin = CTRL_Saisie_date.Date2(self)
        self.ctrl_heure_fin = CTRL_Saisie_heure.Heure(self)

        # Quantité
        self.staticbox_quantite_staticbox = wx.StaticBox(
            self, -1, _(u"Quantité"))
        self.ctrl_quantite = wx.SpinCtrl(self, -1, min=1, max=99999)
        self.ctrl_quantite.SetMinSize((80, -1))
        self.ctrl_quantite.SetValue(1)

        # Paramètres
        self.ctrl_parametres = CTRL_Parametres(self, self.IDlocation)
        self.ctrl_parametres.SetMinSize((650, 270))

        # Boutons
        self.bouton_aide = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_outils = CTRL_Bouton_image.CTRL(
            self,
            texte=_(u"Outils"),
            cheminImage="Images/32x32/Configuration.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_CHECKBOX, self.OnCheckDateFin, self.check_date_fin)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOutils, self.bouton_outils)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)
        self.Bind(wx.EVT_BUTTON, self.ctrl_logo.Visualiser,
                  self.bouton_visualiser)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonLoueur, self.bouton_loueur)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonProduit, self.bouton_produit)

        # Init contrôles
        maintenant = datetime.datetime.now()
        self.ctrl_date_debut.SetDate(
            datetime.datetime.strftime(maintenant, "%Y-%m-%d"))
        self.ctrl_heure_debut.SetHeure(
            datetime.datetime.strftime(maintenant, "%H:%M"))

        if self.IDlocation != None:
            self.Importation()

        if IDfamille != None:
            self.ctrl_loueur.SetIDfamille(IDfamille)
            self.bouton_loueur.Show(False)

        if IDproduit != None:
            self.ctrl_produit.SetIDproduit(IDproduit)

        self.ctrl_parametres.GetPageAvecCode(
            "questionnaire").ctrl_questionnaire.MAJ()
        self.OnCheckDateFin()
Ejemplo n.º 6
0
    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

        if self.IDproduit == None:
            self.SetTitle(_(u"Saisie d'un produit"))
        else:
            self.SetTitle(_(u"Modification d'un produit"))

        # Généralités
        self.staticbox_generalites_staticbox = wx.StaticBox(
            self, -1, _(u"Généralités"))
        self.label_nom = wx.StaticText(self, -1, _(u"Nom :"))
        self.ctrl_nom = wx.TextCtrl(self, -1, u"")
        self.label_categorie = wx.StaticText(self, -1, _(u"Catégorie :"))
        self.ctrl_categorie = CTRL_Categorie(self)
        self.bouton_categories = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Mecanisme.png"),
                      wx.BITMAP_TYPE_ANY))
        self.label_observations = wx.StaticText(self, -1, _(u"Notes :"))
        self.ctrl_observations = wx.TextCtrl(self,
                                             -1,
                                             u"",
                                             style=wx.TE_MULTILINE)

        # 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_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_visualiser = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Loupe.png"),
                      wx.BITMAP_TYPE_ANY))

        # Questionnaire
        self.staticbox_questionnaire_staticbox = wx.StaticBox(
            self, -1, _(u"Questionnaire"))
        self.ctrl_questionnaire = CTRL_Questionnaire.CTRL(
            self, type="produit", IDdonnee=self.IDproduit)
        self.ctrl_questionnaire.SetMinSize((620, 250))

        # Options
        # self.staticbox_options_staticbox = wx.StaticBox(self, -1, _(u"Options"))
        # self.label_image_interactive = wx.StaticText(self, -1, _(u"Image interactive :"))
        # self.ctrl_image_interactive = wx.TextCtrl(self, -1, u"Non fonctionnelle")

        # 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.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)
        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)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonCategories,
                  self.bouton_categories)

        if self.IDproduit != None:
            self.Importation()
        else:
            self.ImportationDernierProduit()

        self.ctrl_questionnaire.MAJ()
        self.ctrl_nom.SetFocus()