Exemplo n.º 1
0
    def __init__(self, parent, type="individu"):
        wx.Dialog.__init__(self, parent, -1, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX)
        self.parent = parent      
        self.type = type
        
        intro = _(u"Vous pouvez ici concevoir des questionnaires personnalisés pour les fiches individuelles et familiales. Commencez par créer des catégories puis paramétrez des questions basées sur les contrôles de votre choix en fonction des données à saisir : texte, liste, entier, etc...")
        titre = _(u"Questionnaires")
        self.SetTitle(titre)
        self.ctrl_bandeau = CTRL_Bandeau.Bandeau(self, titre=titre, texte=intro, hauteurHtml=30, nomImage="Images/32x32/Questionnaire.png")
        
        # Type
        self.box_questionnaire_staticbox = wx.StaticBox(self, -1, _(u"Questionnaire"))
        self.box_type_staticbox = wx.StaticBox(self, -1, _(u"Type de fiche"))
        self.label_type = wx.StaticText(self, -1, _(u"Type de fiche :"))
        self.ctrl_type = CTRL_Type(self)
        self.ctrl_type.SetID(self.type)

        # Questionnaire
        self.ctrl_questionnaire = CTRL_Questionnaire.CTRL(self, type=type, menuActif=True, afficherInvisibles=True)
        
        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_monter = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Fleche_haut.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_descendre = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Fleche_bas.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, texte=_(u"Fermer"), cheminImage="Images/32x32/Fermer.png")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHOICE, self.OnChoixType, self.ctrl_type)
        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.OnBoutonMonter, self.bouton_monter)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonDescendre, self.bouton_descendre)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonFermer, self.bouton_fermer)
        
        # Init contrôles
        self.ctrl_questionnaire.MAJ() 
Exemplo n.º 2
0
    def __init__(self, parent, id=-1, IDpersonne=0):
        wx.Panel.__init__(self,
                          parent,
                          id,
                          name="panel_pageQuestionnaire",
                          style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.IDpersonne = IDpersonne
        self.majEffectuee = False

        # Widgets
        self.staticBox_staticbox = wx.StaticBox(self, -1, _(u"Questionnaire"))
        self.ctrl_questionnaire = CTRL_Questionnaire.CTRL(
            self,
            type="individu",
            IDindividu=self.IDpersonne,
            largeurReponse=335)

        self.__do_layout()

        # MAJ
        self.MAJ()
Exemplo n.º 3
0
    def __init__(self, parent, type="individu", IDquestion=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.type = type
        self.IDquestion = IDquestion  
        self.ordre = None
        self.defaut = None
        
        # Généralités
        self.box_generalites_staticbox = wx.StaticBox(self, -1, _(u"Généralités"))
        self.label_label = wx.StaticText(self, -1, _(u"Label :"))
        self.ctrl_label = wx.TextCtrl(self, -1, u"")
        self.label_categorie = wx.StaticText(self, -1, _(u"Catégorie :"))
        self.ctrl_categorie = CTRL_Categorie(self, type=type)
        self.label_controle = wx.StaticText(self, -1, _(u"Contrôle :"))
        self.ctrl_controle = CTRL_Controle(self)
        self.label_visible = wx.StaticText(self, -1, _(u"Visible :"))
        self.ctrl_visible = wx.CheckBox(self, -1, u"")
        self.ctrl_visible.SetValue(True) 
        
        # Apercu
        self.box_apercu_staticbox = wx.StaticBox(self, -1, _(u"Valeurs par defaut"))
        self.ctrl_apercu = CTRL_Questionnaire.CTRL(self, type=type, mode="apercu", afficherInvisibles=True, largeurQuestion=0)
        self.ctrl_apercu.SetMinSize((325, 90))

        # Choix
        self.box_choix_staticbox = wx.StaticBox(self, -1, _(u"Liste de choix"))
        self.ctrl_choix = CTRL_Choix(self, IDquestion=IDquestion)
        self.bouton_ajouter_choix = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_modifier_choix = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"), wx.BITMAP_TYPE_ANY))        
        self.bouton_supprimer_choix = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_monter_choix = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Fleche_haut.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_descendre_choix = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Fleche_bas.png"), wx.BITMAP_TYPE_ANY))

        # Options
        self.box_options_staticbox = wx.StaticBox(self, -1, _(u"Options"))
        self.label_hauteur = wx.StaticText(self, -1, _(u"Hauteur du contrôle :"))
        self.ctrl_hauteur = wx.SpinCtrl(self, -1, "")
        self.ctrl_hauteur.SetRange(-1, 500)
        self.label_valmin = wx.StaticText(self, -1, _(u"Valeur minimale :"))
        self.ctrl_valmin = wx.SpinCtrl(self, -1, "")
        self.ctrl_valmin.SetRange(0, 99999)
        self.label_valmax = wx.StaticText(self, -1, _(u"Valeur maximale :"))
        self.ctrl_valmax = wx.SpinCtrl(self, -1, "")
        self.ctrl_valmax.SetRange(1, 99999)
        
        # 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_SPINCTRL, self.OnChoixHauteur, self.ctrl_hauteur)
        self.Bind(wx.EVT_SPINCTRL, self.OnChoixValmin, self.ctrl_valmin)
        self.Bind(wx.EVT_SPINCTRL, self.OnChoixValmax, self.ctrl_valmax)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAjouterChoix, self.bouton_ajouter_choix)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonModifierChoix, self.bouton_modifier_choix)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimerChoix, self.bouton_supprimer_choix)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonMonterChoix, self.bouton_monter_choix)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonDescendreChoix, self.bouton_descendre_choix)
        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)
        
        # Importation
        if self.IDquestion != None :
            self.Importation() 
            self.ctrl_controle.OnChoix(MAJ=False, insereValeursDefaut=False)
        else:
            self.ctrl_controle.OnChoix(MAJ=False)
            
        # Initialisation des contrôles
        self.ctrl_choix.MAJ() 
        self.ctrl_label.SetFocus()