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 contrats générés dans le logiciel. Les commandes proposées vous permettent de modifier, supprimer ou imprimer des contrats. Pour supprimer un lot de contrats, cochez-les et utilisez le bouton Supprimer.") titre = _(u"Liste des contrats") self.ctrl_bandeau = CTRL_Bandeau.Bandeau(self, titre=titre, texte=intro, hauteurHtml=30, nomImage="Images/32x32/Contrat.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)) # Liste self.listviewAvecFooter = OL_Contrats.ListviewAvecFooter(self, kwargs={}) self.ctrl_listview = self.listviewAvecFooter.GetListview() self.ctrl_recherche = OL_Contrats.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) # Init contrôles wx.CallAfter(self.MAJ)
def __init__(self, parent, IDindividu=None, dictFamillesRattachees={}): wx.Panel.__init__(self, parent, id=-1, name="panel_inscriptions", style=wx.TAB_TRAVERSAL) self.parent = parent self.IDindividu = IDindividu self.dictFamillesRattachees = dictFamillesRattachees # Inscriptions self.staticbox_inscriptions = wx.StaticBox(self, -1, _(u"Inscriptions")) self.ctrl_inscriptions = OL_Inscriptions.ListView(self, IDindividu=IDindividu, dictFamillesRattachees=self.dictFamillesRattachees, id=-1, name="OL_inscriptions", style=wx.LC_HRULES|wx.LC_VRULES|wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL) self.ctrl_inscriptions.SetMinSize((150, 50)) self.bouton_ajouter_inscription = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY)) self.bouton_modifier_inscription = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"), wx.BITMAP_TYPE_ANY)) self.bouton_supprimer_inscription = 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)) self.bouton_forfait = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Forfait.png"), wx.BITMAP_TYPE_ANY)) # Contrats self.staticbox_contrats = wx.StaticBox(self, -1, _(u"Contrats")) self.ctrl_contrats = OL_Contrats.ListView(self, IDindividu=IDindividu, dictFamillesRattachees=self.dictFamillesRattachees, id=-1, name="OL_contrats", style=wx.LC_HRULES|wx.LC_VRULES|wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL) self.ctrl_contrats.SetMinSize((150, 90)) self.bouton_ajouter_contrat = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY)) self.bouton_modifier_contrat = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"), wx.BITMAP_TYPE_ANY)) self.bouton_supprimer_contrat = 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_inscriptions.Ajouter, self.bouton_ajouter_inscription) self.Bind(wx.EVT_BUTTON, self.ctrl_inscriptions.Modifier, self.bouton_modifier_inscription) self.Bind(wx.EVT_BUTTON, self.ctrl_inscriptions.Supprimer, self.bouton_supprimer_inscription) self.Bind(wx.EVT_BUTTON, self.OnBoutonImprimer, self.bouton_imprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonForfait, self.bouton_forfait) self.Bind(wx.EVT_BUTTON, self.ctrl_contrats.Ajouter, self.bouton_ajouter_contrat) self.Bind(wx.EVT_BUTTON, self.ctrl_contrats.Modifier, self.bouton_modifier_contrat) self.Bind(wx.EVT_BUTTON, self.ctrl_contrats.Supprimer, self.bouton_supprimer_contrat) # Propriétés self.bouton_ajouter_inscription.SetToolTipString(_(u"Cliquez ici pour inscrire l'individu à une activité")) self.bouton_modifier_inscription.SetToolTipString(_(u"Cliquez ici pour modifier l'inscription sélectionnée")) self.bouton_supprimer_inscription.SetToolTipString(_(u"Cliquez ici pour supprimer l'inscription sélectionnée")) self.bouton_forfait.SetToolTipString(_(u"Cliquez ici pour saisir manuellement des forfaits datés")) self.bouton_ajouter_contrat.SetToolTipString(_(u"Cliquez ici pour créer un contrat pour cet individu")) self.bouton_modifier_contrat.SetToolTipString(_(u"Cliquez ici pour modifier le contrat sélectionné")) self.bouton_supprimer_contrat.SetToolTipString(_(u"Cliquez ici pour supprimer le contrat sélectionné")) # Layout grid_sizer_base = wx.FlexGridSizer(rows=2, cols=1, vgap=0, hgap=0) # Inscriptions staticbox_inscriptions = wx.StaticBoxSizer(self.staticbox_inscriptions, wx.VERTICAL) grid_sizer_inscriptions = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5) grid_sizer_inscriptions.Add(self.ctrl_inscriptions, 1, wx.EXPAND, 0) grid_sizer_boutons = wx.FlexGridSizer(rows=6, cols=1, vgap=5, hgap=5) grid_sizer_boutons.Add(self.bouton_ajouter_inscription, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_modifier_inscription, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_supprimer_inscription, 0, wx.ALL, 0) grid_sizer_boutons.Add( (5, 5), 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_imprimer, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_forfait, 0, wx.ALL, 0) grid_sizer_inscriptions.Add(grid_sizer_boutons, 1, wx.ALL, 0) grid_sizer_inscriptions.AddGrowableCol(0) grid_sizer_inscriptions.AddGrowableRow(0) staticbox_inscriptions.Add(grid_sizer_inscriptions, 1, wx.EXPAND|wx.ALL, 5) grid_sizer_base.Add(staticbox_inscriptions, 1, wx.EXPAND|wx.ALL, 5) # Contrats staticbox_contrats = wx.StaticBoxSizer(self.staticbox_contrats, wx.VERTICAL) grid_sizer_contrats = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5) grid_sizer_contrats.Add(self.ctrl_contrats, 1, wx.EXPAND, 0) grid_sizer_boutons = wx.FlexGridSizer(rows=7, cols=1, vgap=5, hgap=5) grid_sizer_boutons.Add(self.bouton_ajouter_contrat, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_modifier_contrat, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_supprimer_contrat, 0, wx.ALL, 0) grid_sizer_contrats.Add(grid_sizer_boutons, 1, wx.ALL, 0) grid_sizer_contrats.AddGrowableCol(0) grid_sizer_contrats.AddGrowableRow(0) staticbox_contrats.Add(grid_sizer_contrats, 1, wx.EXPAND|wx.ALL, 5) grid_sizer_base.Add(staticbox_contrats, 1, wx.EXPAND|wx.ALL, 5) self.SetSizer(grid_sizer_base) grid_sizer_base.AddGrowableCol(0) grid_sizer_base.AddGrowableRow(0) grid_sizer_base.Fit(self)