def __init__(self, parent): wx.Dialog.__init__(self, parent, -1, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX) self.parent = parent intro = _(u"Vous pouvez ici consulter la liste complète des prestations créées dans le logiciel. Les commandes proposées vous permettent de modifier, supprimer ou imprimer des prestations. Pour supprimer un lot de prestations, cochez-les et utilisez le bouton Supprimer.") titre = _(u"Liste des prestations") self.ctrl_bandeau = CTRL_Bandeau.Bandeau(self, titre=titre, texte=intro, hauteurHtml=30, nomImage="Images/32x32/Euro.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_activite = wx.StaticText(self, -1, _(u"Activité :")) self.ctrl_activite = CTRL_Activite(self) self.ctrl_activite.SetMinSize((200, -1)) self.label_facture = wx.StaticText(self, -1, _(u"Facturée :")) self.ctrl_facture = wx.Choice(self, -1, choices = (_(u"Toutes"), _(u"Oui"), _(u"Non"))) self.ctrl_facture.Select(0) # Liste self.listviewAvecFooter = OL_Prestations.ListviewAvecFooter(self, kwargs={}) self.ctrl_listview = self.listviewAvecFooter.GetListview() self.ctrl_recherche = OL_Prestations.CTRL_Outils(self, listview=self.ctrl_listview) 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_ouvrir_fiche = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Famille.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_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.OuvrirFiche, self.bouton_ouvrir_fiche) self.Bind(wx.EVT_BUTTON, self.Apercu, self.bouton_apercu) self.Bind(wx.EVT_BUTTON, self.Imprimer, self.bouton_imprimer) self.Bind(wx.EVT_BUTTON, self.Modifier, self.bouton_modifier) self.Bind(wx.EVT_BUTTON, self.Supprimer, self.bouton_supprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide) self.Bind(wx.EVT_CHOICE, self.MAJ, self.ctrl_annee) self.Bind(wx.EVT_CHOICE, self.MAJ, self.ctrl_activite) self.Bind(wx.EVT_CHOICE, self.MAJ, self.ctrl_facture) # Init contrôles wx.CallAfter(self.MAJ)
def __init__(self, parent, IDfamille=None): wx.Panel.__init__(self, parent, id=-1, name="panel_prestations", style=wx.TAB_TRAVERSAL) self.parent = parent self.IDfamille = IDfamille self.staticbox_prestations = wx.StaticBox(self, -1, _(u"Prestations")) # OL Prestations self.listviewAvecFooter = OL_Prestations.ListviewAvecFooter( self, kwargs={"IDfamille": IDfamille}) self.ctrl_prestations = self.listviewAvecFooter.GetListview() self.ctrl_recherche = OL_Prestations.CTRL_Outils( self, listview=self.ctrl_prestations, afficherCocher=True) self.ctrl_recherche.SetBackgroundColour((255, 255, 255)) # Options d'affichage hyperliens ## self.ctrl_regroupement = wx.CheckBox(self, -1, _(u"Regrouper par ")) ## self.ctrl_regroupement.SetValue(False) ## self.hyper_regroupement = Hyperlien_regroupement(self, label=_(u"Date"), infobulle=_(u"Cliquez ici pour choisir une catégorie de regroupement"), URL="regroupement", listeChoix=[], indexChoixDefaut=None) ## self.hyper_regroupement.Enable(False) ## ## self.label_filtres_1 = wx.StaticText(self, -1, _(u"Afficher ")) ## self.hyper_periodes = Hyperlien_periodes(self, label=_(u"Toutes les périodes"), infobulle=_(u"Cliquez ici pour filtrer les périodes"), URL="periodes") ## self.label_filtres_2 = wx.StaticText(self, -1, u" | ") ## self.hyper_individus = Hyperlien(self, label=_(u"Tous les individus"), infobulle=_(u"Cliquez ici pour filtrer les individus"), URL="individus", listeChoix=[], indexChoixDefaut=None, labelDefaut=_(u"Tous les individus"), champFiltre="prestations.IDindividu") ## self.label_filtres_3 = wx.StaticText(self, -1, u" | ") ## self.hyper_activites = Hyperlien(self, label=_(u"Toutes les activités"), infobulle=_(u"Cliquez ici pour fitrer les activités"), URL="activites", listeChoix=[], indexChoixDefaut=None, labelDefaut=_(u"Toutes les activités"), champFiltre="prestations.IDactivite") ## self.label_filtres_4 = wx.StaticText(self, -1, u" | ") ## self.hyper_factures = Hyperlien(self, label=_(u"Toutes les factures"), infobulle=_(u"Cliquez ici pour filtrer les factures"), URL="factures", listeChoix=[], indexChoixDefaut=None, labelDefaut=_(u"Toutes les factures"), champFiltre="prestations.IDfacture") ## ## self.ctrl_total = wx.StaticText(self, -1, _(u"Total = 0.00 %s") % SYMBOLE) ## self.ctrl_total.Show(False) # 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_imprimer = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Imprimante.png"), wx.BITMAP_TYPE_ANY)) # 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.OnBoutonImprimer, self.bouton_imprimer) ## self.Bind(wx.EVT_CHECKBOX, self.OnCheckRegroupement, self.ctrl_regroupement) # Propriétés self.bouton_ajouter.SetToolTipString( _(u"Cliquez ici pour saisir une prestation")) self.bouton_modifier.SetToolTipString( _(u"Cliquez ici pour modifier la prestation sélectionnée")) self.bouton_supprimer.SetToolTipString( _(u"Cliquez ici pour supprimer la prestation sélectionnée")) # Layout grid_sizer_base = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5) staticbox_prestations = wx.StaticBoxSizer(self.staticbox_prestations, wx.VERTICAL) grid_sizer_prestations = wx.FlexGridSizer(rows=2, cols=2, vgap=5, hgap=5) grid_sizer_prestations.Add(self.listviewAvecFooter, 1, wx.EXPAND, 0) grid_sizer_boutons = wx.FlexGridSizer(rows=5, 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((10, 10), 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_imprimer, 0, wx.ALL, 0) grid_sizer_prestations.Add(grid_sizer_boutons, 1, wx.ALL, 0) grid_sizer_prestations.Add(self.ctrl_recherche, 0, wx.EXPAND | wx.ALL, 0) ## grid_sizer_options = wx.FlexGridSizer(rows=1, cols=13, vgap=0, hgap=0) ## grid_sizer_options.Add(self.ctrl_regroupement, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.hyper_regroupement, 0, wx.ALL, 0) ## grid_sizer_options.Add( (30, 5), 0, wx.ALL, 0) ## grid_sizer_options.Add(self.label_filtres_1, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.hyper_periodes, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.label_filtres_2, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.hyper_individus, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.label_filtres_3, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.hyper_activites, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.label_filtres_4, 0, wx.ALL, 0) ## grid_sizer_options.Add(self.hyper_factures, 0, wx.ALL, 0) ## grid_sizer_options.Add( (20, 5), 0, wx.EXPAND|wx.ALL, 0) ## grid_sizer_options.Add(self.ctrl_total, 0, wx.ALL, 0) ## grid_sizer_options.AddGrowableCol(11) ## self.grid_sizer_options = grid_sizer_options ## grid_sizer_prestations.Add(grid_sizer_options, 1, wx.EXPAND|wx.ALL, 0) grid_sizer_prestations.AddGrowableCol(0) grid_sizer_prestations.AddGrowableRow(0) staticbox_prestations.Add(grid_sizer_prestations, 1, wx.EXPAND | wx.ALL, 5) grid_sizer_base.Add(staticbox_prestations, 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)
def __init__(self, parent, IDfamille=None): wx.Panel.__init__(self, parent, id=-1, name="panel_prestations", style=wx.TAB_TRAVERSAL) self.parent = parent self.IDfamille = IDfamille self.staticbox_prestations = wx.StaticBox(self, -1, _(u"Prestations")) # OL Prestations self.listviewAvecFooter = OL_Prestations.ListviewAvecFooter( self, kwargs={"IDfamille": IDfamille}) self.ctrl_prestations = self.listviewAvecFooter.GetListview() self.ctrl_recherche = OL_Prestations.CTRL_Outils( self, listview=self.ctrl_prestations, afficherCocher=True) 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_modele = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Magique.png"), wx.BITMAP_TYPE_ANY)) # Binds self.Bind(wx.EVT_BUTTON, self.ctrl_prestations.Ajouter, self.bouton_ajouter) self.Bind(wx.EVT_BUTTON, self.ctrl_prestations.Modifier, self.bouton_modifier) self.Bind(wx.EVT_BUTTON, self.ctrl_prestations.Supprimer, self.bouton_supprimer) self.Bind(wx.EVT_BUTTON, self.ctrl_prestations.Appliquer_modele, self.bouton_modele) # Propriétés self.bouton_ajouter.SetToolTip( wx.ToolTip(_(u"Cliquez ici pour saisir une prestation"))) self.bouton_modifier.SetToolTip( wx.ToolTip( _(u"Cliquez ici pour modifier la prestation sélectionnée"))) self.bouton_supprimer.SetToolTip( wx.ToolTip( _(u"Cliquez ici pour supprimer la prestation sélectionnée"))) self.bouton_modele.SetToolTip( wx.ToolTip( _(u"Cliquez ici pour saisir une prestation à partir d'un modèle de prestation" ))) # Layout grid_sizer_base = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5) staticbox_prestations = wx.StaticBoxSizer(self.staticbox_prestations, wx.VERTICAL) grid_sizer_prestations = wx.FlexGridSizer(rows=2, cols=2, vgap=5, hgap=5) grid_sizer_prestations.Add(self.listviewAvecFooter, 1, wx.EXPAND, 0) grid_sizer_boutons = wx.FlexGridSizer(rows=5, 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((10, 10), 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_modele, 0, wx.ALL, 0) grid_sizer_prestations.Add(grid_sizer_boutons, 1, wx.ALL, 0) grid_sizer_prestations.Add(self.ctrl_recherche, 0, wx.EXPAND | wx.ALL, 0) grid_sizer_prestations.AddGrowableCol(0) grid_sizer_prestations.AddGrowableRow(0) staticbox_prestations.Add(grid_sizer_prestations, 1, wx.EXPAND | wx.ALL, 5) grid_sizer_base.Add(staticbox_prestations, 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)