Exemplo n.º 1
0
    def __init__(self, parent, dictOptions={}):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        
        # Orientation
        self.box_orientation_staticbox = wx.StaticBox(self, -1, _(u"Orientation"))
        self.ctrl_radio_portrait = wx.RadioButton(self, -1, u"", style=wx.RB_GROUP)
        self.ctrl_image_portrait = wx.StaticBitmap(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/32x32/Orientation_vertical.png"), wx.BITMAP_TYPE_ANY))
        self.ctrl_radio_paysage = wx.RadioButton(self, -1, u"")
        self.ctrl_image_paysage = wx.StaticBitmap(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/32x32/Orientation_horizontal.png"), wx.BITMAP_TYPE_ANY))
        
        # Textes
        self.box_document_staticbox = wx.StaticBox(self, -1, _(u"Document"))
        self.label_titre = wx.StaticText(self, -1, _(u"Titre :"))
        self.ctrl_titre = wx.TextCtrl(self, -1, u"")
        self.label_introduction = wx.StaticText(self, -1, _(u"Introduction :"))
        self.ctrl_introduction = wx.TextCtrl(self, -1, u"")
        self.label_conclusion = wx.StaticText(self, -1, _(u"Conclusion :"))
        self.ctrl_conclusion = wx.TextCtrl(self, -1, u"")
        
        # Paramètres généraux
        self.box_options_staticbox = wx.StaticBox(self, -1, _(u"Options d'impression"))
        self.ctrl_parametres = CTRL_Parametres(self)
        self.ctrl_parametres.Importation() 
        self.bouton_reinitialisation = CTRL_Propertygrid.Bouton_reinitialisation(self, self.ctrl_parametres)
        self.bouton_sauvegarde = CTRL_Propertygrid.Bouton_sauvegarde(self, self.ctrl_parametres)
        self.ctrl_parametres.SetMinSize((440, 120)) 
        
        self.__do_layout()
        
        # Properties
        self.ctrl_radio_portrait.SetToolTip(wx.ToolTip(_(u"Cliquez ici pour sélectionner une orientation portrait")))
        self.ctrl_image_portrait.SetToolTip(wx.ToolTip(_(u"Cliquez ici pour sélectionner une orientation portrait")))
        self.ctrl_radio_paysage.SetToolTip(wx.ToolTip(_(u"Cliquez ici pour sélectionner une orientation paysage")))
        self.ctrl_image_paysage.SetToolTip(wx.ToolTip(_(u"Cliquez ici pour sélectionner une orientation paysage")))
        self.ctrl_titre.SetToolTip(wx.ToolTip(_(u"Vous pouvez modifier ici le titre du document")))
        self.ctrl_introduction.SetToolTip(wx.ToolTip(_(u"Vous pouvez modifier ici l'introduction du document")))
        self.ctrl_conclusion.SetToolTip(wx.ToolTip(_(u"Vous pouvez modifier ici la conclusion du document")))

        # Bind
        self.ctrl_image_portrait.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDownPortrait)
        self.ctrl_image_paysage.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDownPaysage)
        
        # Init contrôle
        if "titre" in dictOptions and dictOptions["titre"] != None : 
            self.ctrl_titre.SetValue(dictOptions["titre"])
        if "introduction" in dictOptions and dictOptions["introduction"] != None : 
            self.ctrl_introduction.SetValue(dictOptions["introduction"])
        if "conclusion" in dictOptions and dictOptions["conclusion"] != None : 
            self.ctrl_conclusion.SetValue(dictOptions["conclusion"])
        if "orientation" in dictOptions and dictOptions["orientation"] != None : 
            self.SetOrientation(dictOptions["orientation"])
Exemplo n.º 2
0
 def __init__(self, parent, listeActivites=[]):
     wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
     self.parent = parent
             
     # Paramètres
     self.box_options_staticbox = wx.StaticBox(self, -1, _(u"Options d'impression"))
     self.ctrl_parametres = CTRL_Parametres(self, listeActivites=listeActivites)
     self.ctrl_parametres.Importation() 
     self.bouton_reinitialisation = CTRL_Propertygrid.Bouton_reinitialisation(self, self.ctrl_parametres)
     self.bouton_sauvegarde = CTRL_Propertygrid.Bouton_sauvegarde(self, self.ctrl_parametres)
     self.ctrl_parametres.SetMinSize((440, 120)) 
             
     self.__do_layout()
Exemplo n.º 3
0
    def __init__(self, parent, clsbase=None):
        wx.Panel.__init__(self, parent, id=-1, name="Page_Parametres", style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.clsbase = clsbase
        self.MAJ_effectuee = False

        # Paramètres
        self.staticbox_parametres_staticbox = wx.StaticBox(self, -1, _(u"1. Renseignez les paramètres"))
        self.ctrl_parametres = CTRL_Parametres(self)
        self.ctrl_parametres.Importation()
        self.bouton_reinitialisation = CTRL_Propertygrid.Bouton_reinitialisation(self, self.ctrl_parametres)
        self.bouton_sauvegarde = CTRL_Propertygrid.Bouton_sauvegarde(self, self.ctrl_parametres)

        self.__set_properties()
        self.__do_layout()
Exemplo n.º 4
0
 def __init__(self, parent, affichage="horizontal"):
     wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
     self.parent = parent
     self.affichage = affichage
             
     # Paramètres
     self.box_options_staticbox = wx.StaticBox(self, -1, _(u"Options d'impression"))
     self.ctrl_parametres = CTRL_Parametres(self)
     self.ctrl_parametres.Importation() 
     self.bouton_reinitialisation = CTRL_Propertygrid.Bouton_reinitialisation(self, self.ctrl_parametres)
     self.bouton_sauvegarde = CTRL_Propertygrid.Bouton_sauvegarde(self, self.ctrl_parametres)
     self.ctrl_parametres.SetMinSize((440, 120)) 
     
     # Messages
     self.box_messages_staticbox = wx.StaticBox(self, -1, _(u"Messages"))
     self.ctrl_messages = CTRL_Messages(self)
     self.ctrl_messages.SetMinSize((200, -1)) 
     
     self.__do_layout()
Exemplo n.º 5
0
    def __init__(self, parent, categorie="", ctrl=None):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.categorie = categorie

        # Paramètres généraux
        self.box_options_staticbox = wx.StaticBox(self, -1,
                                                  _(u"Options d'impression"))
        if ctrl == None:
            self.ctrl_parametres = CTRL_Parametres(self, categorie=categorie)
        else:
            self.ctrl_parametres = ctrl(self)
        self.ctrl_parametres.Importation()
        self.bouton_reinitialisation = CTRL_Propertygrid.Bouton_reinitialisation(
            self, self.ctrl_parametres)
        self.bouton_sauvegarde = CTRL_Propertygrid.Bouton_sauvegarde(
            self, self.ctrl_parametres)
        self.ctrl_parametres.SetMinSize((50, 50))

        self.__do_layout()
    def __init__(self, parent, ctrl_tableau=None):
        wx.Panel.__init__(self, parent, id=-1, style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.ctrl_tableau = ctrl_tableau

        # Période
        self.staticBox_periode = wx.StaticBox(self, -1,
                                              _(u"Sélection de la période"))
        self.ctrl_periode = CTRL_Selection_periode_simple.CTRL(
            self, callback=self.OnChangePeriode)

        # Catégories de produits
        self.staticBox_categories = wx.StaticBox(self, -1,
                                                 _(u"Catégories de produits"))
        self.ctrl_categories = CTRL_Categories(self)

        # Options
        self.staticbox_parametres_staticbox = wx.StaticBox(
            self, -1, _(u"Paramètres"))
        self.ctrl_parametres = CTRL_Parametres(self)
        self.ctrl_parametres.SetMinSize((400, 80))
        self.bouton_reinitialisation = CTRL_Propertygrid.Bouton_reinitialisation(
            self, self.ctrl_parametres)
        self.bouton_sauvegarde = CTRL_Propertygrid.Bouton_sauvegarde(
            self, self.ctrl_parametres)

        # Binds
        self.Bind(wx.EVT_CHECKLISTBOX, self.OnCheckCategories,
                  self.ctrl_categories)

        # Layout
        grid_sizer_base = wx.FlexGridSizer(1, 4, 10, 10)

        # Période
        staticBox_periode = wx.StaticBoxSizer(self.staticBox_periode,
                                              wx.HORIZONTAL)
        staticBox_periode.Add(self.ctrl_periode, 1, wx.EXPAND | wx.ALL, 5)
        grid_sizer_base.Add(staticBox_periode, 1, wx.EXPAND, 0)

        # Catégories
        staticBox_categories = wx.StaticBoxSizer(self.staticBox_categories,
                                                 wx.HORIZONTAL)
        staticBox_categories.Add(self.ctrl_categories, 1, wx.EXPAND | wx.ALL,
                                 5)
        grid_sizer_base.Add(staticBox_categories, 1, wx.EXPAND, 0)

        # Paramètres
        box_parametres = wx.StaticBoxSizer(self.staticbox_parametres_staticbox,
                                           wx.VERTICAL)
        grid_sizer_parametres = wx.FlexGridSizer(rows=1,
                                                 cols=2,
                                                 vgap=5,
                                                 hgap=5)
        grid_sizer_parametres.Add(self.ctrl_parametres, 1, wx.EXPAND, 0)

        grid_sizer_boutons = wx.FlexGridSizer(rows=3, cols=1, vgap=5, hgap=5)
        grid_sizer_boutons.Add(self.bouton_reinitialisation, 0, 0, 0)
        grid_sizer_boutons.Add(self.bouton_sauvegarde, 0, 0, 0)

        grid_sizer_parametres.Add(grid_sizer_boutons, 0, 0, 0)
        grid_sizer_parametres.AddGrowableRow(0)
        grid_sizer_parametres.AddGrowableCol(0)
        box_parametres.Add(grid_sizer_parametres, 1, wx.EXPAND | wx.ALL, 5)
        grid_sizer_base.Add(box_parametres, 1, wx.EXPAND | wx.ALL, 0)

        grid_sizer_base.AddGrowableCol(1)
        self.SetSizer(grid_sizer_base)
        self.Layout()

        # Configuration
        dict_parametres = UTILS_Config.GetParametre("dlg_locations_tableau",
                                                    {})
        if "periode" in dict_parametres:
            self.ctrl_periode.SetModePeriode(dict_parametres["periode"])
        if "case_largeur" in dict_parametres:
            self.ctrl_tableau.slider_largeur.SetValue(
                dict_parametres["case_largeur"])
            self.ctrl_tableau.OnSliderLargeur()