def __init__(self, parent, IDindividu=None, dictFamillesRattachees=None): wx.Dialog.__init__(self, parent, -1, name="DLG_Saisie_contrat_intro", style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX) # Type de contrat self.box_type_staticbox = wx.StaticBox(self, wx.ID_ANY, _(u"Type de contrat")) self.radio_type_classique = wx.RadioButton(self, wx.ID_ANY, _(u"Contrat classique"), style=wx.RB_GROUP) self.radio_type_psu = wx.RadioButton(self, wx.ID_ANY, _(u"Contrat P.S.U.")) # Activité self.box_activite_staticbox = wx.StaticBox( self, wx.ID_ANY, _(u"Sélection de l'activité")) self.ctrl_inscriptions = OL_Inscriptions.ListView( self, IDindividu=IDindividu, dictFamillesRattachees=dictFamillesRattachees, activeDoubleclick=False, 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((20, 20)) self.ctrl_inscriptions.MAJ() # Options self.box_options_staticbox = wx.StaticBox(self, wx.ID_ANY, _(u"Options")) self.radio_option_vierge = wx.RadioButton(self, wx.ID_ANY, _(u"Contrat vierge"), style=wx.RB_GROUP) self.radio_option_modele = wx.RadioButton( self, wx.ID_ANY, _(u"Utiliser le modèle de contrat :")) self.ctrl_modele = CTRL_Modeles(self) self.bouton_modeles = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Mecanisme.png"), wx.BITMAP_TYPE_ANY)) self.radio_option_contrat = wx.RadioButton(self, wx.ID_ANY, _(u"Copier le contrat :")) self.ctrl_contrat = CTRL_Contrats(self) # 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, texte=_(u"Annuler"), cheminImage="Images/32x32/Annuler.png") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioType, self.radio_type_classique) self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioType, self.radio_type_psu) self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioOption, self.radio_option_vierge) self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioOption, self.radio_option_modele) self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioOption, self.radio_option_contrat) self.Bind(wx.EVT_BUTTON, self.OnBoutonModeles, self.bouton_modeles) 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.OnBoutonAnnuler, self.bouton_annuler) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelectionActivite, self.ctrl_inscriptions) self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnSelectionActivite, self.ctrl_inscriptions) # Init self.OnRadioType(None) self.OnRadioOption(None)
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)