def populatepropgrid(self, pg): #Geometry Properties pg.Append(wxpg.PropertyCategory("Geometry")) normalID = pg.Append(wxpg.StringProperty("Center", value="<composed>")) pg.AppendIn(normalID, wxpg.FloatProperty("X", value=self.x)) pg.AppendIn(normalID, wxpg.FloatProperty("Y", value=self.y)) pg.AppendIn(normalID, wxpg.FloatProperty("Z", value=self.z)) normalID2 = pg.Append( wxpg.StringProperty("Center2", value="<composed>")) pg.AppendIn(normalID2, wxpg.FloatProperty("X", value=self.x2)) pg.AppendIn(normalID2, wxpg.FloatProperty("Y", value=self.y2)) pg.AppendIn(normalID2, wxpg.FloatProperty("Z", value=self.z2)) pg.Append(wxpg.FloatProperty("Radius", value=self.r)) #Material Properties pg.Append(wxpg.PropertyCategory("Material")) pg.Append(wxpg.FloatProperty("Reflectivity", value=self.reflectivity)) pg.Append(wxpg.BoolProperty("Cast Shadows", value=self.cast)) pg.SetPropertyAttribute("Cast Shadows", "UseCheckbox", True) pg.Append(wxpg.BoolProperty("Recieve Shadows", value=self.recieve)) pg.SetPropertyAttribute("Recieve Shadows", "UseCheckbox", True)
def initialize_fixed_properties(self, pg): pg.Append(wxpg.StringProperty(self.SLIDE_RANGE)) pg.Append( wxpg.EnumProperty(self.IMAGE_TYPE, labels=["GIF", "JPEG", "PNG", "TIF"], value=1)) pg.Append(wxpg.DirProperty(self.OUTPUT_DIR)) pg.Append(wxpg.BoolProperty(self.CLEANUP_OUTPUT_DIR)) pg.Append(wxpg.BoolProperty(self.TRANSPARENT_IMAGE)) pg.Append(wxpg.ColourProperty(self.TRANSPARENT_COLOR))
def _create_dummy_content(self): # some dummy content from the wxPython demo import wx.propgrid as wxpg pg = self.widget pg.AddPage( "Page 1 - Dummy" ) pg.Append( wxpg.PropertyCategory("1 - Basic Properties") ) pg.Append( wxpg.StringProperty("String",value="Some Text") ) sp = pg.Append( wxpg.StringProperty('StringProperty w/ Password flag', value='ABadPassword') ) sp.SetAttribute('Hint', 'This is a hint') sp.SetAttribute('Password', True) pg.Append( wxpg.IntProperty("Int",value=123) ) pg.Append( wxpg.FloatProperty("Float",value=123.4) ) pg.Append( wxpg.BoolProperty("Bool",value=True) ) pg.Append( wxpg.BoolProperty("Bool_with_Checkbox",value=True) ) pg.SetPropertyAttribute( "Bool_with_Checkbox", "UseCheckbox", True) pg.Append( wxpg.PropertyCategory("2 - More Properties") ) pg.Append( wxpg.LongStringProperty("LongString", value="This is a\nmulti-line string\nwith\ttabs\nmixed\tin.")) pg.Append( wxpg.DirProperty("Dir",value=r"C:\Windows") ) pg.Append( wxpg.FileProperty("File",value=r"C:\Windows\system.ini") ) pg.Append( wxpg.ArrayStringProperty("ArrayString",value=['A','B','C']) ) pg.Append( wxpg.EnumProperty("Enum","Enum", ['wxPython Rules', 'wxPython Rocks', 'wxPython Is The Best'], [10,11,12], 0) ) pg.Append( wxpg.EditEnumProperty("EditEnum","EditEnumProperty", ['A','B','C'], [0,1,2], "Text Not in List") ) pg.Append( wxpg.PropertyCategory("3 - Advanced Properties") ) pg.Append( wxpg.DateProperty("Date",value=wx.DateTime.Now()) ) pg.Append( wxpg.FontProperty("Font",value=self.widget.GetFont()) ) pg.Append( wxpg.ColourProperty("Colour", value=self.widget.GetBackgroundColour()) ) pg.Append( wxpg.SystemColourProperty("SystemColour") ) pg.Append( wxpg.ImageFileProperty("ImageFile") ) pg.Append( wxpg.MultiChoiceProperty("MultiChoice", choices=['wxWidgets','QT','GTK+']) ) pg.Append( wxpg.PropertyCategory("4 - Additional Properties") ) pg.Append( wxpg.IntProperty("IntWithSpin",value=256) ) pg.SetPropertyEditor("IntWithSpin","SpinCtrl") pg.SetPropertyAttribute( "File", wxpg.PG_FILE_SHOW_FULL_PATH, 0 ) pg.SetPropertyAttribute( "File", wxpg.PG_FILE_INITIAL_PATH, r"C:\Program Files\Internet Explorer" ) if compat.IS_PHOENIX: pg.SetPropertyAttribute( "Date", wxpg.PG_DATE_PICKER_STYLE, wx.adv.DP_DROPDOWN|wx.adv.DP_SHOWCENTURY ) pg.AddPage( "Page 2 - Almost Empty" ) pg.Append( wxpg.PropertyCategory("1 - Basic Properties") ) pg.Append( wxpg.StringProperty("String 2",value="Some Text") )
def getPropertyForType(self, stg, pid, dt): if dt == "str": pgp = wxpg.StringProperty(pid, value="") elif dt == "float": pgp = wxpg.FloatProperty(pid, value=0.0) elif dt in ["int", "extruder"]: pgp = wxpg.IntProperty(pid, value=0) elif dt == "bool": pgp = wxpg.BoolProperty(pid, value=False) elif dt == "enum": opts = [str(x) for x in stg.getOptions()] pgp = wxpg.EnumProperty(pid, labels=opts, values=range(len(opts)), value=0) else: self.log("taking default action for unknown data type: %s" % dt) pgp = wxpg.StringProperty(pid, value="") return pgp
def add_bool_property(self, name, key, value, status=None, enabled=True, **kwargs): """ Add boolean property. :param name: :param key: :param value: :param status: status bar string :param enabled: :param kwargs: :return: """ item = propgrid.BoolProperty(name, key, value=value) self.Append(item) self.SetPropertyAttribute(key, "UseCheckbox", True) if status: self.SetPropertyHelpString(key, status) if enabled: self.EnableProperty(key) else: self.DisableProperty(key) return item
def AddProperty(self, property, parent_property=None): self.inAddProperty += 1 # add a cad.property, optionally to an existing wx.PGProperty if property.GetType() == cad.PROPERTY_TYPE_STRING: new_prop = wxpg.StringProperty(property.GetTitle(), value=property.GetString()) elif property.GetType() == cad.PROPERTY_TYPE_LONG_STRING: #new_prop = wxpg.LongStringProperty("MultipleButtons", wxpg.PG_LABEL) new_prop = wxpg.StringProperty(property.GetTitle(), value=property.GetString()) elif property.GetType() == cad.PROPERTY_TYPE_DOUBLE: new_prop = wxpg.FloatProperty(property.GetTitle(), value=property.GetDouble()) elif property.GetType() == cad.PROPERTY_TYPE_LENGTH: new_prop = wxpg.FloatProperty(property.GetTitle(), value=property.GetDouble() / cad.GetUnits()) elif property.GetType() == cad.PROPERTY_TYPE_INT: new_prop = wxpg.IntProperty(property.GetTitle(), value=property.GetInt()) elif property.GetType() == cad.PROPERTY_TYPE_COLOR: col = property.GetColor() wcol = wx.Colour(col.red, col.green, col.blue) new_prop = wxpg.ColourProperty(property.GetTitle(), value=wcol) elif property.GetType() == cad.PROPERTY_TYPE_CHOICE: new_prop = wxpg.EnumProperty(property.GetTitle(), labels=property.GetChoices(), value=property.GetInt()) elif property.GetType() == cad.PROPERTY_TYPE_CHECK: new_prop = wxpg.BoolProperty(property.GetTitle(), value=property.GetBool()) new_prop.SetAttribute(wxpg.PG_BOOL_USE_CHECKBOX, True) elif property.GetType() == cad.PROPERTY_TYPE_LIST: new_prop = wxpg.StringProperty(property.GetTitle(), value='<composed>') elif property.GetType() == cad.PROPERTY_TYPE_FILE: new_prop = wxpg.FileProperty(property.GetTitle(), value=property.GetString()) else: wx.MessageBox('invalid property type: ' + str(property.GetType())) return if not property.editable: new_prop.ChangeFlag(wxpg.PG_PROP_READONLY, True) self.Append(parent_property, new_prop, property) if property.GetType() == cad.PROPERTY_TYPE_LIST: plist = property.GetProperties() for p in plist: self.AddProperty(p, new_prop) new_prop.ChangeFlag(wxpg.PG_PROP_COLLAPSED, True) elif property.GetType() == cad.PROPERTY_TYPE_LONG_STRING: # Change property to use editor created in the previous code segment #self.pg.SetPropertyEditor("MultipleButtons", self.multiButtonEditor) self.pg.SetPropertyEditor(new_prop, "TrivialPropertyEditor") self.inAddProperty -= 1
def initialize_fixed_properties(self, pg): pg.Append(wxpg.PropertyCategory(_("1 - Range specification"))) pg.Append(wxpg.StringProperty(self.SLIDE_RANGE)) pg.Append(wxpg.StringProperty(self.REPEAT_RANGE)) pg.Append(wxpg.PropertyCategory(_("2 - Text to find and replace"))) pg.Append(wxpg.StringProperty(self.FIND_TEXT)) pg.Append(wxpg.LongStringProperty(self.REPLACE_TEXT)) pg.Append(wxpg.LongStringProperty(self.PREPROCESS_SCRIPT)) pg.Append(wxpg.PropertyCategory(_("3 - Archive processing"))) pg.Append(wxpg.BoolProperty(self.ARCHIVE_LYRIC_FILES)) pg.Append(wxpg.StringProperty(self.OPTION_SPLIT_LINE_AT_EVERY)) pg.Append(wxpg.PropertyCategory(_("4 - Word wrap archive text"))) pg.Append(wxpg.BoolProperty(self.ENABLE_WORDWRAP)) pg.Append(wxpg.FontProperty(self.WORDWRAP_FONT)) pg.Append(wxpg.IntProperty(self.PAGE_WITDH))
def Remplissage(self): # Heure min affichée propriete = wxpg.StringProperty(label=_(u"Heure minimale affichée"), name="heure_min", value="08:30") propriete.SetHelpString(_(u"Saisissez une heure")) propriete.SetEditor("EditeurHeure") propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Heure max affichée propriete = wxpg.StringProperty(label=_(u"Heure maximale affichée"), name="heure_max", value="22:30") propriete.SetHelpString(_(u"Saisissez une heure")) propriete.SetEditor("EditeurHeure") propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Intervalle souris propriete = wxpg.StringProperty(label=_(u"Pas de la souris"), name="temps_arrondi", value="00:30") propriete.SetHelpString(_(u"Saisissez un temps")) propriete.SetEditor("EditeurHeure") propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Durée minimale barre propriete = wxpg.StringProperty(label=_(u"Durée minimale location"), name="barre_duree_minimale", value="00:30") propriete.SetHelpString(_(u"Saisissez une durée")) propriete.SetEditor("EditeurHeure") propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Hauteur de ligne propriete = wxpg.IntProperty(label=_(u"Hauteur de ligne"), name="case_hauteur", value=50) propriete.SetHelpString( _(u"Saisissez une hauteur de ligne (50 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("case_hauteur", "SpinCtrl") # Autoriser changement de ligne propriete = wxpg.BoolProperty( label=_(u"Autoriser le changement de ligne"), name="autoriser_changement_ligne", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez pouvoir changer de ligne")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete)
def __init__(self, *args, **kwds): # begin wxGlade: MainPannel.__init__ #kwds["style"] = wx.TAB_TRAVERSAL|wx.BORDER_DEFAULT|wx.CLOSE_BOX wx.Dialog.__init__(self, *args, **kwds) self.grid = wxpg.PropertyGrid(self, wx.ID_ANY) self.grid.Append( wxpg.IntProperty(_("Password Length"), "plen", value=16)) self.grid.Append( wxpg.BoolProperty(_("Use lowercause letters"), "lowercase", value=True)) self.grid.SetPropertyAttribute("lowercase", "UseCheckbox", True) self.grid.Append( wxpg.BoolProperty(_("Use Uppercase letters"), "uppercase", value=True)) self.grid.SetPropertyAttribute("uppercase", "UseCheckbox", True) self.grid.Append( wxpg.BoolProperty(_("Use digits"), "digit", value=True)) self.grid.SetPropertyAttribute("digit", "UseCheckbox", True) self.grid.Append( wxpg.BoolProperty(_("Use punctions"), "punction", value=True)) self.grid.SetPropertyAttribute("punction", "UseCheckbox", True) self.grid.Append( wxpg.StringProperty(_("Use custom letters"), "custom", value="")) self.passwd = u"" self.__set_properties() self.__do_layout() okb = self.bsizer.GetAffirmativeButton() canb = self.bsizer.GetCancelButton() self.Bind(wx.EVT_BUTTON, self.OnOK, okb) self.Bind(wx.EVT_BUTTON, self.OnCancel, canb) self.Centre()
def _create_plot_properties(self): pg = self.property_grid_1 # pg.AddPage("Page 1 - Plot Settings") # if pages are needed, use PropertyGridManger instead dir_path = os.path.dirname(os.path.realpath(__file__)) pg.Append(wxpg.PropertyCategory("1 - Basic Properties")) pg.Append(wxpg.StringProperty(label="Title", value="Title")) pg.Append(wxpg.StringProperty(label="X Label", value="X Label")) pg.Append(wxpg.StringProperty(label="Y Label", value="Y Label")) pg.Append(wxpg.BoolProperty(label="Grid", value=True)) pg.SetPropertyAttribute(id="Grid", attrName="UseCheckbox", value=True) pg.Append(wxpg.PropertyCategory("2 - Data")) # https://discuss.wxpython.org/t/wxpython-pheonix-4-0-2-question-regarding-multichoiceproperty-and-setting-the-selection-of-the-choices/30044 # https://discuss.wxpython.org/t/how-to-set-propertygrid-values/30152/4 pg.Append( wxpg.EnumProperty( label="Scale", labels=['Linear', 'SemilogX', 'SemilogY', 'LogLog'])) pg.Append( wxpg.EnumProperty(label="X Data", name="X Data", labels=['NaN'], values=[0])) pg.Append( wxpg.MultiChoiceProperty(label="Y Data", name='Y Data', choices=['NaN'], value=['NaN'])) pg.Append( wxpg.EnumProperty(label="Data Labels", name="Data Labels", labels=['NaN'], values=[0])) pg.Append(wxpg.PropertyCategory("3 - Optional Static Plot Overlay")) pg.Append(wxpg.FileProperty(label="Overlay Plot", value=rf"{dir_path}")) pg.Append(wxpg.EnumProperty(label="X Axis Variable", labels=[''])) pg.Append(wxpg.EnumProperty(label="Y Axis Variable", labels=[''])) pg.Append(wxpg.PropertyCategory("4 - Advanced Properties")) pg.Append(wxpg.ArrayStringProperty(label="xLim", value=['0', '100'])) pg.Append(wxpg.ArrayStringProperty(label="yLim", value=['0', '100'])) pg.Append(wxpg.DateProperty(label="Date", value=wx.DateTime.Now())) pg.Append(wxpg.ColourProperty(label="Line Colour", value='#1f77b4')) pg.Append(wxpg.FontProperty(label="Font", value=self.GetFont())) pg.Grid.FitColumns()
def _set_property_ctrl(self, k, v, page=None): """ :param prefix: Any, :param k: key, :param v: value """ if not page: page = self.PGMPage if isinstance(v, (list)): page.Append(wxpg.ArrayStringProperty(k, name=k, value=v)) elif isinstance(v, (bool)): page.Append(wxpg.BoolProperty(label=k, name=k, value=v)) page.SetPropertyAttribute(k, "UseCheckbox", True) else: page.Append(wxpg.StringProperty(label=k, name=k, value=str(v)))
def update(): global currentselection while evtloop.Pending(): evtloop.Dispatch() #time.sleep(0.10) app.ProcessIdle() newselection = None for obj in scene.objects.values(): if obj.selected: newselection = obj break if currentselection != newselection: if currentselection != None: currentselection.pg = None currentselection = newselection editframe.panel.pg.Clear() if currentselection == None: editframe.SetTitle("Properties Window") editframe.panel.delete.Hide() else: currentselection.pg = editframe.panel.pg currentselection.pg.Bind(wxpg.EVT_PG_CHANGED, currentselection.PropertyChange) editframe.SetTitle("Properties of " + currentselection.name) editframe.panel.delete.Show() pg = editframe.panel.pg pg.Append(wxpg.PropertyCategory("General")) pg.Append( wxpg.StringProperty("Object Name", value=currentselection.name)) pg.Append( wxpg.BoolProperty("Uniform", value=currentselection.uniform)) pg.SetPropertyAttribute("Uniform", "UseCheckbox", True) currentselection.populatepropgrid(pg)
def populatepropgrid(self, pg): #Geometry Properties pg.Append(wxpg.PropertyCategory("Geometry")) minID = pg.Append(wxpg.StringProperty("Minimum", value="<composed>")) pg.AppendIn(minID, wxpg.FloatProperty("X", value=self.min[0])) pg.AppendIn(minID, wxpg.FloatProperty("Y", value=self.min[1])) pg.AppendIn(minID, wxpg.FloatProperty("Z", value=self.min[2])) maxID = pg.Append(wxpg.StringProperty("Maximum", value="<composed>")) pg.AppendIn(maxID, wxpg.FloatProperty("X", value=self.max[0])) pg.AppendIn(maxID, wxpg.FloatProperty("Y", value=self.max[1])) pg.AppendIn(maxID, wxpg.FloatProperty("Z", value=self.max[2])) #Material Properties pg.Append(wxpg.PropertyCategory("Material")) pg.Append(wxpg.BoolProperty("Cast Shadows", value=self.cast)) pg.SetPropertyAttribute("Cast Shadows", "UseCheckbox", True)
def initialize_fixed_properties(self, pg): pg.Append( wxpg.EnumProperty(self.FILE_TYPE, labels=self.FILE_TYPE_LIST, value=2)) pg.Append(wxpg.PropertyCategory(_("1 - Slide settings"))) pg.Append(wxpg.StringProperty(self.SLIDE_REPEAT_RANGE)) pg.Append(wxpg.StringProperty(self.SLIDE_SEPARATOR_SLIDES)) pg.Append(wxpg.PropertyCategory(_("2 - Lyric settings"))) pg.Append(wxpg.StringProperty(self.LYRIC_REPEAT_RANGE)) pg.Append(wxpg.StringProperty(self.LYRIC_SEPARATOR_SLIDES)) pg.Append(wxpg.StringProperty(self.LYRIC_PATTERN)) pg.Append(wxpg.BoolProperty(self.ARCHIVE_LYRIC_FILES)) pg.Append(wxpg.PropertyCategory( _("3 - List of lyric files to insert")))
def fill_property_grid(self): print('Filling property grid') pair = self.wxprop_layerconf_pair pg = self.property_grid_1 lc = self.layer_config pg.Append(wxpg.PropertyCategory("1 - Basic Properties")) if len(lc.keys()): for p in lc.keys(): # print(' property <<%s>>'%p) proper = lc[p] # Конфигурационный объект потомок CommonProp value = lc[p]() curprop = None # p - parametr name # value - default value of parametr if isinstance(proper, layers_opt.BoolProp): # дискретный параметр curprop = pg.Append(wxpg.BoolProperty(p, value=value)) # объект wx elif isinstance(proper, layers_opt.RealRangeProp): # вещественный параметр curprop = pg.Append(wxpg.FloatProperty(p, value=value)) elif isinstance(proper, layers_opt.IntRangeProp): # целочисленый параметр curprop = pg.Append(wxpg.IntProperty(p, value=value)) elif isinstance(proper, layers_opt.SelectOneProp): # выбор один из многих choices = wxpg.PGChoices() for choice in proper: choices.Add(label=choice, value=wxpg.PG_INVALID_VALUE) default_coice = choices.GetIndicesForStrings([value,])[0] # print(default_coice) curprop = pg.Append(wxpg.EnumProperty(label=p, name=p, choices=choices)) curprop.SetChoiceSelection(default_coice) if curprop is not None: curprop.SetHelpString(proper.__doc__) pair[curprop] = proper # свойство wx, свойство CommonProp else: # no properties print(' No properties') empty_prop = pg.Append(wxpg.StringProperty(label='No editable property', value='May be for a while')) empty_prop.SetHelpString('Nothing to tweek here') pg.Enable(False) print('End of filling property grid')
def init_view(self, items, para, preview=False, modal=True, app=None): self.para, self.modal = para, modal self.pg = pg = wxpg.PropertyGridManager( self, style=wxpg.PG_SPLITTER_AUTO_CENTER) sizer = wx.BoxSizer(wx.VERTICAL) # Show help as tooltips pg.SetExtraStyle(wxpg.PG_EX_HELP_AS_TOOLTIPS) pg.Bind(wxpg.EVT_PG_CHANGED, self.OnPropGridChange) pg.Bind(wxpg.EVT_PG_SELECTED, self.OnPropGridSelect) pg.AddPage('') for i in items: if i[0] == 'lab': pg.Append(wxpg.PropertyCategory(i[2])) if i[0] == int: pg.Append(wxpg.IntProperty(i[1], value=int(para[i[1]]) or 0)) if i[0] == float: pg.Append( wxpg.FloatProperty(i[1], value=float(para[i[1]]) or 0)) if i[0] == str: pg.Append(wxpg.StringProperty(i[1], value=para[i[1]] or '')) if i[0] == 'txt': pg.Append(wxpg.LongStringProperty(i[1], value=para[i[1]] or '')) if i[0] == bool: pg.Append(wxpg.BoolProperty(i[1])) if i[0] == 'date': pg.Append(wxpg.DateProperty(i[1], value=wx.DateTime.Now())) #if i[0] == 'list': pg.Append( wxpg.EnumProperty(i[1], i[1], [i.strip() for i in i[2][1:-1].split(',')])) #if i[0] == 'img': pg.Append( wxpg.EnumProperty(v[1], v[1], ['a','b','c'])) #if i[0] == 'tab': pg.Append( wxpg.EnumProperty(v[1], v[1], ['a','b','c'])) #if preview:self.add_ctrl_(Check, 'preview', ('preview',), app=app) #self.reset(para) sizer.Add(pg, 1, wx.EXPAND) self.SetSizer(sizer) self.add_confirm(modal) self.Layout() self.Fit() wx.Dialog.Bind(self, wx.EVT_WINDOW_DESTROY, self.OnDestroy) #wx.Dialog.Bind(self, wx.EVT_IDLE, lambda e: self.reset()) print('bind close')
def refereshView(self): #referesh the grid based on self.confList confdir=(_("Configuration File Location"),[(("confDir"),{"desc":_("Configuration Directory"), "value":os.path.dirname(self.confPath),"type":"directory"})]) self.confList.insert(0,confdir) for cgroup in self.confList: self.grid.Append(wxpg.PropertyCategory(cgroup[0])) for conf in cgroup[1]: if conf[1]['type']=='directory': self.grid.Append(wxpg.DirProperty(conf[1]['desc'],conf[0],conf[1]['value'])) continue if conf[1]['type']=='string': self.grid.Append(wxpg.StringProperty(conf[1]['desc'],conf[0],conf[1]['value'])) continue if conf[1]['type']=='int': self.grid.Append(wxpg.IntProperty(conf[1]['desc'],conf[0],conf[1]['value'])) continue if conf[1]['type']=='float': self.grid.Append(wxpg.FloatProperty(conf[1]['desc'],conf[0],conf[1]['value'])) continue if conf[1]['type']=='bool': self.grid.Append(wxpg.BoolProperty(conf[1]['desc'],conf[0],conf[1]['value'])) continue self.grid.CenterSplitter(False)
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 500,395 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ): wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_propertyGridManager1 = pg.PropertyGridManager(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.propgrid.PG_DESCRIPTION|wx.propgrid.PG_SPLITTER_AUTO_CENTER|wx.propgrid.PG_TOOLBAR|wx.propgrid.PG_TOOLTIPS|wx.TAB_TRAVERSAL) self.m_propertyGridManager1.SetExtraStyle( wx.propgrid.PG_EX_AUTO_UNSPECIFIED_VALUES|wx.propgrid.PG_EX_MODE_BUTTONS|wx.propgrid.PG_EX_NO_FLAT_TOOLBAR|wx.propgrid.PG_EX_NO_TOOLBAR_DIVIDER ) self.m_propertyGridPage1 = self.m_propertyGridManager1.AddPage( u"Page", wx.ArtProvider.GetBitmap( wx.ART_REPORT_VIEW, wx.ART_BUTTON ) ); self.Item1 = self.m_propertyGridPage1.Append( pg.PropertyCategory( u"Directory of Work", u"Directory of Work" ) ) self.Item2 = self.m_propertyGridPage1.Append( pg.DirProperty( u"Database and Sql files", u"Database and Sql files" ) ) self.Item3 = self.m_propertyGridPage1.Append( pg.DirProperty( u"Utility and Plugin", u"Utility and Plugin" ) ) self.Item4 = self.m_propertyGridPage1.Append( pg.DirProperty( u"Server and Local Network", u"Server and Local Network" ) ) self.m_propertyGridPage1.SetPropertyHelpString( Item4, u"Directory of Local Network that Database and Main File here and other client get Data from it" ) self.Item5 = self.m_propertyGridPage1.Append( pg.DirProperty( u"Other and Temp", u"Other and Temp" ) ) self.Item6 = self.m_propertyGridPage1.Append( pg.PropertyCategory( u"General parameter", u"General parameter" ) ) self.Item7 = self.m_propertyGridPage1.Append( pg.DateProperty( u"Date of Today ", u"Date of Today " ) ) self.Item8 = self.m_propertyGridPage1.Append( pg.EnumProperty( u"Language", u"Language" ) ) self.Item9 = self.m_propertyGridPage1.Append( pg.BoolProperty( u"Show Clock", u"Show Clock" ) ) self.Item10 = self.m_propertyGridPage1.Append( pg.FontProperty( u"Font", u"Font" ) ) self.Item11 = self.m_propertyGridPage1.Append( pg.FlagsProperty( u"Size", u"Size" ) ) self.Item12 = self.m_propertyGridPage1.Append( pg.StringProperty( u"position", u"position" ) ) self.m_propertyGridPage2 = self.m_propertyGridManager1.AddPage( u"Page", wx.ArtProvider.GetBitmap( wx.ART_LIST_VIEW, wx.ART_TOOLBAR ) ); self.Item13 = self.m_propertyGridPage2.Append( pg.PropertyCategory( u"Other Status", u"Other Status" ) ) self.Item14 = self.m_propertyGridPage2.Append( pg.StringProperty( u"Toolbar", u"Toolbar" ) ) self.Item15 = self.m_propertyGridPage2.Append( pg.StringProperty( u"Pan Input", u"Pan Input" ) ) self.Item16 = self.m_propertyGridPage2.Append( pg.StringProperty( u"Pan Status", u"Pan Status" ) ) self.Item17 = self.m_propertyGridPage2.Append( pg.ImageFileProperty( u"Background", u"Background" ) ) self.Item18 = self.m_propertyGridPage2.Append( pg.CursorProperty( u"Cursor", u"Cursor" ) ) self.Item19 = self.m_propertyGridPage2.Append( pg.LongStringProperty( u"Help", u"Help" ) ) bSizer1.Add( self.m_propertyGridManager1, 1, wx.ALL|wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout()
def Remplissage(self): # Affichage self.Append(wxpg.PropertyCategory(_(u"Affichage"))) # Période à afficher # date_debut = DICT_INFOS_IMPRESSION["date_debut"] # date_fin = DICT_INFOS_IMPRESSION["date_fin"] # if date_debut != None and date_fin != None : # # propriete = wxpg.StringProperty(label=_(u"Date de début"), name="date_debut", value=UTILS_Dates.DateDDEnFr(date_debut)) # propriete.SetEditor("EditeurDate") # self.Append(propriete) # # propriete = wxpg.StringProperty(label=_(u"Date de fin"), name="date_fin", value=UTILS_Dates.DateDDEnFr(date_fin)) # propriete.SetEditor("EditeurDate") # self.Append(propriete) # Masquer dates anciennes propriete = wxpg.BoolProperty(label=_(u"Masquer les anciennes dates"), name="masquer_dates_anciennes", value=False) propriete.SetHelpString( _(u"Cochez cette case pour masquer les dates passées")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher observations propriete = wxpg.BoolProperty(label=_(u"Afficher les observations"), name="afficher_observations", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher les observations")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Page self.Append(wxpg.PropertyCategory(_(u"Page"))) # Orientation page propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Orientation de la page"), name="orientation", liste_choix=[("portrait", _(u"Portrait")), ("paysage", _(u"Paysage"))], valeur="portrait") propriete.SetEditor("EditeurChoix") propriete.SetHelpString(_(u"Sélectionnez l'orientation de la page")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.Append(wxpg.PropertyCategory(_(u"Couleurs de fond"))) # Couleur propriete = wxpg.ColourProperty(label=_(u"Fond entêtes"), name="couleur_fond_entetes", value=wx.Colour(230, 230, 230)) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Fond colonne total"), name="couleur_fond_total", value=wx.Colour(245, 245, 245)) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.Append(wxpg.PropertyCategory(_(u"Texte"))) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="taille_texte", value=7) propriete.SetHelpString( _(u"Saisissez une taille de texte (7 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte", "SpinCtrl") # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte du titre"), name="taille_texte_titre", value=9) propriete.SetHelpString( _(u"Saisissez une taille de texte (9 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte", "SpinCtrl") self.Append(wxpg.PropertyCategory(_(u"Colonnes"))) # Largeur automatique propriete = wxpg.BoolProperty(label=_(u"Largeur auto ajustée"), name="largeur_colonnes_auto", value=True) propriete.SetHelpString( _(u"Cochez cette case pour laisser Noethys ajuster la largeur des colonnes automatiquement" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Largeur colonne labels propriete = wxpg.IntProperty(label=_(u"Largeur colonne date"), name="largeur_colonne_date", value=110) propriete.SetHelpString( _(u"Saisissez la largeur pour la colonne date (110 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_date", "SpinCtrl")
def Remplissage(self): listeChampsPiedsPages = [ "{DATE_JOUR}", "{TITRE_DOCUMENT}", "{NOM_ORGANISATEUR}", "{NUM_PAGE}", "{NBRE_PAGES}" ] # --------------------------- Divers ------------------------------------------ self.Append(wxpg.PropertyCategory("Divers")) # Inclure les images propriete = wxpg.BoolProperty(label=INCLURE_IMG_LABEL, name="inclure_images", value=True) propriete.SetHelpString(INCLURE_IMG_HELP) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Entete de colonne sur chaque page propriete = wxpg.BoolProperty(label=AFFICHER_ENTETE_LABEL, name="entetes_toutes_pages", value=True) propriete.SetHelpString(AFFICHER_ENTETE_HELP) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Qualité de l'impression propriete = wxpg.EnumProperty(label=CHOIX_QUALITE_LABEL, name="qualite_impression", labels=CHOIX_QUALITE_LABELS, values=CHOIX_QUALITE_VALEURS, value=wx.PRINT_QUALITY_MEDIUM) propriete.SetHelpString(CHOIX_QUALITE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Marges ------------------------------------------ self.Append(wxpg.PropertyCategory("Marges")) # Gauche propriete = wxpg.IntProperty(label=MARGE_GAUCHE_LABEL, name="marge_gauche", value=5) propriete.SetHelpString(TAILLE_MARGE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_gauche", "SpinCtrl") # Droite propriete = wxpg.IntProperty(label=MARGE_DROITE_LABEL, name="marge_droite", value=5) propriete.SetHelpString(TAILLE_MARGE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_droite", "SpinCtrl") # Haut propriete = wxpg.IntProperty(label=MARGE_HAUT_LABEL, name="marge_haut", value=5) propriete.SetHelpString(TAILLE_MARGE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_haut", "SpinCtrl") # Bas propriete = wxpg.IntProperty(label=MARGE_BAS_LABEL, name="marge_bas", value=5) propriete.SetHelpString(TAILLE_MARGE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_bas", "SpinCtrl") # --------------------------- Quadrillage ------------------------------------------ self.Append(wxpg.PropertyCategory("Quadrillage")) # Epaisseur de trait propriete = wxpg.FloatProperty(label=EPAISSEUR_TRAIT_LABEL, name="grille_trait_epaisseur", value=0.25) propriete.SetHelpString(EPAISSEUR_TRAIT_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur de trait propriete = wxpg.ColourProperty(label=COULEUR_TRAIT_LABEL, name="grille_trait_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TRAIT_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Titre de liste ------------------------------------------ self.Append(wxpg.PropertyCategory("Titre")) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="titre_taille_texte", value=16) propriete.SetHelpString(TAILLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("titre_taille_texte", "SpinCtrl") # Style propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="titre_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_BOLD) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="titre_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = ["Gauche", "Centre", "Droite"] propriete = wxpg.EnumProperty(label=ALIGNEMENT_TEXTE_LABEL, name="titre_alignement", labels=ALIGNEMENT_TEXTE_LABELS, values=ALIGNEMENT_TEXTE_VALUES, value=wx.ALIGN_LEFT) propriete.SetHelpString(ALIGNEMENT_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Intro ------------------------------------------ self.Append(wxpg.PropertyCategory("Introduction")) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="intro_taille_texte", value=7) propriete.SetHelpString(TAILLE_TEXTE_INTRO_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("intro_taille_texte", "SpinCtrl") # Style propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="intro_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="intro_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement propriete = wxpg.EnumProperty(label=ALIGNEMENT_TEXTE_LABEL, name="intro_alignement", labels=ALIGNEMENT_TEXTE_LABELS, values=ALIGNEMENT_TEXTE_VALUES, value=wx.ALIGN_LEFT) propriete.SetHelpString(ALIGNEMENT_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Titre de colonne ------------------------------------------ self.Append(wxpg.PropertyCategory("Entête de colonne")) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="titre_colonne_taille_texte", value=8) propriete.SetHelpString(TAILLE_TEXTE_TITRE_COL_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("titre_colonne_taille_texte", "SpinCtrl") # Style propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="titre_colonne_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="titre_colonne_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement propriete = wxpg.EnumProperty(label=ALIGNEMENT_TEXTE_LABEL, name="titre_colonne_alignement", labels=ALIGNEMENT_TEXTE_LABELS, values=ALIGNEMENT_TEXTE_VALUES, value=wx.ALIGN_CENTER) propriete.SetHelpString(ALIGNEMENT_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur de fond propriete = wxpg.ColourProperty(label=COULEUR_FOND_LABEL, name="titre_colonne_couleur_fond", value=wx.Colour(240, 240, 240)) propriete.SetHelpString(COULEUR_FOND_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Ligne ------------------------------------------ self.Append(wxpg.PropertyCategory("Ligne")) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="ligne_taille_texte", value=8) propriete.SetHelpString(TAILLE_TEXTE_LIGNE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("ligne_taille_texte", "SpinCtrl") # Style labels = ["Normal", "Light", "Gras"] valeurs = [ wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD ] propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="ligne_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="ligne_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Multilignes autorisé propriete = wxpg.BoolProperty(label=AUTORISER_SAUT_LIGNE_LABEL, name="ligne_multilignes", value=True) propriete.SetHelpString(AUTORISER_SAUT_LIGNE_HELP) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # --------------------------- Pied de page ------------------------------------------ self.Append(wxpg.PropertyCategory("Pied de page")) # Texte de gauche valeur = "{DATE_JOUR}" propriete = wxpg.StringProperty(label=PIED_TEXTE_GAUCHE_LABEL, name="pied_page_texte_gauche", value=valeur) propriete.SetHelpString( "Saisissez le texte de gauche du pied de page (Par défaut '%s'). Vous pouvez intégrer les mots-clés suivants : %s" % (valeur, ", ".join(listeChampsPiedsPages))) self.Append(propriete) # Texte du milieu valeur = "{TITRE_DOCUMENT} - {NOM_ORGANISATEUR}" propriete = wxpg.StringProperty(label=PIED_TEXTE_MILIEU_LABEL, name="pied_page_texte_milieu", value=valeur) propriete.SetHelpString( "Saisissez le texte du milieu du pied de page (Par défaut '%s'). Vous pouvez intégrer les mots-clés suivants : %s" % (valeur, ", ".join(listeChampsPiedsPages))) self.Append(propriete) # Texte de droite valeur = "{NUM_PAGE} / {NBRE_PAGES}" propriete = wxpg.StringProperty(label=PIED_TEXTE_DROITE_LABEL, name="pied_page_texte_droite", value=valeur) propriete.SetHelpString( "Saisissez le texte de droite du pied de page (Par défaut '%s'). Vous pouvez intégrer les mots-clés suivants : %s" % (valeur, ", ".join(listeChampsPiedsPages))) self.Append(propriete) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="pied_page_taille_texte", value=8) propriete.SetHelpString(TAILLE_TEXTE_PIED_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("pied_page_taille_texte", "SpinCtrl") # Style labels = ["Normal", "Light", "Gras"] valeurs = [ wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD ] propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="pied_page_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="pied_page_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Pied de colonne ------------------------------------------ self.Append(wxpg.PropertyCategory("Pied de colonne")) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="pied_colonne_taille_texte", value=8) propriete.SetHelpString(TAILLE_TEXTE_PIED_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("pied_colonne_taille_texte", "SpinCtrl") # Style labels = ["Normal", "Light", "Gras"] valeurs = [ wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD ] propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="pied_colonne_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="pied_colonne_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = ["Gauche", "Centre", "Droite"] propriete = wxpg.EnumProperty(label=ALIGNEMENT_TEXTE_LABEL, name="pied_colonne_alignement", labels=ALIGNEMENT_TEXTE_LABELS, values=ALIGNEMENT_TEXTE_VALUES, value=wx.ALIGN_CENTER) propriete.SetHelpString(ALIGNEMENT_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur de fond propriete = wxpg.ColourProperty(label=COULEUR_FOND_LABEL, name="pied_colonne_couleur_fond", value=wx.Colour(240, 240, 240)) propriete.SetHelpString(COULEUR_FOND_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Pied de liste ------------------------------------------ self.Append(wxpg.PropertyCategory("Conclusion")) # Taille police propriete = wxpg.IntProperty(label=TAILLE_TEXTE_LABEL, name="conclusion_taille_texte", value=7) propriete.SetHelpString(TAILLE_TEXTE_CONCL_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("conclusion_taille_texte", "SpinCtrl") # Style propriete = wxpg.EnumProperty(label=STYLE_TEXTE_LABEL, name="conclusion_style", labels=STYLE_TEXTE_LABELS, values=STYLE_TEXTE_VALEURS, value=wx.FONTWEIGHT_BOLD) propriete.SetHelpString(STYLE_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=COULEUR_TEXTE_LABEL, name="conclusion_couleur", value=wx.BLACK) propriete.SetHelpString(COULEUR_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = ["Gauche", "Centre", "Droite"] propriete = wxpg.EnumProperty(label=ALIGNEMENT_TEXTE_LABEL, name="conclusion_alignement", labels=ALIGNEMENT_TEXTE_LABELS, values=ALIGNEMENT_TEXTE_VALUES, value=wx.ALIGN_LEFT) propriete.SetHelpString(ALIGNEMENT_TEXTE_HELP) propriete.SetAttribute("obligatoire", True) self.Append(propriete)
def Remplissage(self): listeChamps = [ "{SIGNATAIRE_GENRE}", "{SIGNATAIRE_NOM}", "{SIGNATAIRE_FONCTION}", "{NUM_ATTESTATION}", "{DATE_DEBUT}", "{DATE_FIN}", "{DATE_EDITION}", "{LIEU_EDITION}", "{NOMS_INDIVIDUS}", "{DESTINATAIRE_NOM}", "{DESTINATAIRE_RUE}", "{DESTINATAIRE_VILLE}", "{TOTAL_PERIODE}", "{TOTAL_REGLE}", "{SOLDE_DU}", "{ORGANISATEUR_NOM}", "{ORGANISATEUR_RUE}", "{ORGANISATEUR_CP}", "{ORGANISATEUR_VILLE}", "{ORGANISATEUR_TEL}", "{ORGANISATEUR_FAX}", "{ORGANISATEUR_MAIL}", "{ORGANISATEUR_SITE}", "{ORGANISATEUR_AGREMENT}", "{ORGANISATEUR_SIRET}", "{ORGANISATEUR_APE}", ] # Catégorie self.Append(wxpg.PropertyCategory(_(u"Modèle"))) propriete = wxpg.EnumProperty(label=_(u"Modèle de document"), name="IDmodele", value=0) propriete.SetHelpString( _(u"Sélectionnez le modèle de document à utiliser")) propriete.SetEditor("EditeurComboBoxAvecBoutons") propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.MAJ_modeles() # Catégorie self.Append(wxpg.PropertyCategory(_(u"Signataire"))) propriete = wxpg.EnumProperty(label=_(u"Signataire du document"), name="signataire", value=0) propriete.SetHelpString( _(u"Sélectionnez le signataire du document (à renseigner au préalable dans le paramétrage de l'activité)" )) propriete.SetAttribute("obligatoire", True) propriete.SetAttribute("reinitialisation_interdite", True) self.Append(propriete) self.MAJ_signataires() # Catégorie self.Append(wxpg.PropertyCategory(_(u"Mémorisation"))) # Mémorisation des paramètres propriete = wxpg.BoolProperty(label=_(u"Mémoriser les paramètres"), name="memoriser_parametres", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez mémoriser les paramètres de cette liste" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Répertoire de sauvegarde propriete = wxpg.DirProperty(label=_(u"Répertoire pour copie unique"), name="repertoire_copie", value="") propriete.SetHelpString( _(u"Enregistrer une copie unique de chaque document dans le répertoire sélectionné. Sinon laissez vide ce champ." )) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Titre"))) # Afficher le titre propriete = wxpg.BoolProperty(label=_(u"Afficher le titre"), name="afficher_titre", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher le titre du le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Titre du document"), name="texte_titre", value=_(u"Attestation de présence")) propriete.SetHelpString( _(u"Saisissez le titre du document (Par défaut 'Attestation de présence'). Vous pouvez intégrer les mots-clés suivants : %s" ) % ", ".join(listeChamps)) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.IntProperty(label=_(u"Taille de texte du titre"), name="taille_texte_titre", value=19) propriete.SetHelpString( _(u"Saisissez la taille de texte du titre (29 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_titre", "SpinCtrl") propriete = wxpg.BoolProperty( label=_(u"Afficher la période de facturation"), name="afficher_periode", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher la période de facturation dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.IntProperty( label=_(u"Taille de texte de la période"), name="taille_texte_periode", value=8) propriete.SetHelpString( _(u"Saisissez la taille de texte de la période (8 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_periode", "SpinCtrl") # Catégorie self.Append(wxpg.PropertyCategory(_(u"Tableau des prestations"))) # Affichage condensé ou détaillé propriete = wxpg.EnumProperty( label=_(u"Affichage des prestations"), name="affichage_prestations", labels=[_(u"Détaillé"), _(u"Condensé")], values=[0, 1], value=0) propriete.SetHelpString(_(u"Sélectionnez un type d'affichage")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Intitulés des prestations labels = [ _(u"Intitulé original"), _(u"Intitulé original + état 'Absence injustifiée'"), _(u"Nom du tarif"), _(u"Nom de l'activité") ] propriete = wxpg.EnumProperty(label=_(u"Intitulés des prestations"), name="intitules", labels=labels, values=[0, 1, 2, 3], value=0) propriete.SetHelpString( _(u"Sélectionnez le type d'intitulé à afficher pour les prestations" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur 1 propriete = wxpg.ColourProperty(label=_(u"Couleur de fond 1"), name="couleur_fond_1", value=wx.Colour(204, 204, 255)) propriete.SetHelpString(_(u"Sélectionnez la couleur 1")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur 2 propriete = wxpg.ColourProperty(label=_(u"Couleur de fond 2"), name="couleur_fond_2", value=wx.Colour(234, 234, 255)) propriete.SetHelpString(_(u"Sélectionnez la couleur 2")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Largeur colonne Date propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Date (ou Qté)"), name="largeur_colonne_date", value=50) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Date (50 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_date", "SpinCtrl") # Largeur colonne Montant HT propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Montant HT"), name="largeur_colonne_montant_ht", value=50) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Montant HT (50 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_montant_ht", "SpinCtrl") # Largeur colonne Montant TVA propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Montant TVA"), name="largeur_colonne_montant_tva", value=50) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Montant TVA (50 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_montant_tva", "SpinCtrl") # Largeur colonne Montant TTC propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Montant TTC"), name="largeur_colonne_montant_ttc", value=70) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Montant TTC (70 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_montant_ttc", "SpinCtrl") # Taille de texte du nom de l'individu propriete = wxpg.IntProperty(label=_(u"Taille de texte de l'individu"), name="taille_texte_individu", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte de l'individu (9 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_individu", "SpinCtrl") # Taille de texte du nom de l'activité propriete = wxpg.IntProperty( label=_(u"Taille de texte de l'activité"), name="taille_texte_activite", value=6) propriete.SetHelpString( _(u"Saisissez la taille de texte de l'activité (6 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_activite", "SpinCtrl") # Taille de texte des noms de colonnes propriete = wxpg.IntProperty( label=_(u"Taille de texte des noms de colonnes"), name="taille_texte_noms_colonnes", value=5) propriete.SetHelpString( _(u"Saisissez la taille de texte des noms de colonnes (5 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_noms_colonnes", "SpinCtrl") # Taille de texte des prestations propriete = wxpg.IntProperty( label=_(u"Taille de texte des prestations"), name="taille_texte_prestation", value=7) propriete.SetHelpString( _(u"Saisissez la taille de texte des prestations (7 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_prestation", "SpinCtrl") # Taille de texte des messages propriete = wxpg.IntProperty(label=_(u"Taille de texte des messages"), name="taille_texte_messages", value=7) propriete.SetHelpString( _(u"Saisissez la taille de texte des messages (7 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_messages", "SpinCtrl") # Taille de texte des labels totaux propriete = wxpg.IntProperty( label=_(u"Taille de texte des labels totaux"), name="taille_texte_labels_totaux", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte des labels totaux (9 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_labels_totaux", "SpinCtrl") # Taille de texte des totaux propriete = wxpg.IntProperty( label=_(u"Taille de texte des montants totaux"), name="taille_texte_montants_totaux", value=10) propriete.SetHelpString( _(u"Saisissez la taille de texte des montants totaux (10 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_montants_totaux", "SpinCtrl") # Catégorie self.Append(wxpg.PropertyCategory(_(u"Prestations antérieures"))) # Taille de texte propriete = wxpg.IntProperty( label=_(u"Taille de texte du commentaire"), name="taille_texte_prestations_anterieures", value=5) propriete.SetHelpString( _(u"Saisissez la taille de texte du commentaire de bas de tableaux (5 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_prestations_anterieures", "SpinCtrl") # Texte d'information propriete = wxpg.LongStringProperty( label=_(u"Texte d'information"), name="texte_prestations_anterieures", value= _(u"Des prestations antérieures ont été reportées sur cette attestation." )) propriete.SetHelpString( _(u"Saisissez un texte d'information pour les prestations antérieures" )) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Texte d'introduction"))) propriete = wxpg.LongStringProperty(label=_(u"Texte d'introduction"), name="texte_introduction", value=TEXTE_INTRO) propriete.SetHelpString( _(u"Saisissez un texte d'introduction. Vous pouvez intégrer les mots-clés suivants : %s" ) % ", ".join(listeChamps)) self.Append(propriete) propriete = wxpg.IntProperty( label=_(u"Taille de texte d'introduction"), name="taille_texte_introduction", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte d'introduction (9 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_introduction", "SpinCtrl") propriete = wxpg.EnumProperty(label=_(u"Style de texte introduction"), name="style_texte_introduction", labels=[ _(u"Normal"), _(u"Italique"), "Gras", _(u"Italique + Gras") ], values=[0, 1, 2, 3], value=1) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.ColourProperty( label=_(u"Couleur de fond introduction"), name="couleur_fond_introduction", value=wx.Colour(255, 255, 255)) propriete.SetHelpString( _(u"Sélectionnez une couleur de fond pour le texte d'introduction" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.ColourProperty( label=_(u"Couleur de bord introduction"), name="couleur_bord_introduction", value=wx.Colour(255, 255, 255)) propriete.SetHelpString( _(u"Sélectionnez une couleur de bord pour le texte d'introduction" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.EnumProperty( label=_(u"Alignement du texte d'introduction"), name="alignement_texte_introduction", labels=[_(u"Gauche"), _(u"Centre"), _(u"Droite")], values=[0, 1, 2], value=1) propriete.SetHelpString( _(u"Sélectionnez un type d'alignement pour le texte d'introduction" )) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Texte de conclusion"))) propriete = wxpg.LongStringProperty(label=_(u"Texte de conclusion"), name="texte_conclusion", value=u"") propriete.SetHelpString( _(u"Saisissez un texte de conclusion (Aucun par défaut). Vous pouvez intégrer les mots-clés suivants : %s" ) % ", ".join(listeChamps)) self.Append(propriete) propriete = wxpg.IntProperty(label=_(u"Taille de texte de conclusion"), name="taille_texte_conclusion", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte de conclusion (9 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_texte_conclusion", "SpinCtrl") propriete = wxpg.EnumProperty(label=_(u"Style de texte conclusion"), name="style_texte_conclusion", labels=[ _(u"Normal"), _(u"Italique"), "Gras", _(u"Italique + Gras") ], values=[0, 1, 2, 3], value=0) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.ColourProperty(label=_(u"Couleur de fond conclusion"), name="couleur_fond_conclusion", value=wx.Colour(255, 255, 255)) propriete.SetHelpString( _(u"Sélectionnez une couleur de fond pour le texte de conclusion") ) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.ColourProperty(label=_(u"Couleur de bord conclusion"), name="couleur_bord_conclusion", value=wx.Colour(255, 255, 255)) propriete.SetHelpString( _(u"Sélectionnez une couleur de bord pour le texte de conclusion") ) propriete.SetAttribute("obligatoire", True) self.Append(propriete) propriete = wxpg.EnumProperty( label=_(u"Alignement du texte de conclusion"), name="alignement_texte_conclusion", labels=[_(u"Gauche"), _(u"Centre"), _(u"Droite")], values=[0, 1, 2], value=0) propriete.SetHelpString( _(u"Sélectionnez un type d'alignement pour le texte de conclusion" )) self.Append(propriete) # Signature self.Append(wxpg.PropertyCategory(_(u"Signature"))) propriete = wxpg.ImageFileProperty(label=_(u"Image de signature"), name="image_signature") propriete.SetHelpString( _(u"Sélectionnez l'image d'une signature à insérer en fin de document" )) self.Append(propriete) propriete = wxpg.IntProperty(label=_(u"Taille de l'image (en %)"), name="taille_image_signature", value=100) propriete.SetHelpString( _(u"Saisissez la taille de l'image en pourcentage (100 par défaut)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("taille_image_signature", "SpinCtrl") propriete = wxpg.EnumProperty( label=_(u"Alignement de l'image"), name="alignement_image_signature", labels=[_(u"Gauche"), _(u"Centre"), _(u"Droite")], values=[0, 1, 2], value=0) propriete.SetHelpString( _(u"Sélectionnez un type d'alignement pour l'image de signature")) self.Append(propriete)
def __init__(self, RunForm, parent ): wx.Notebook.__init__(self, parent, style=wx.BK_DEFAULT, size=(500, 50) ) # Create panels and pages for each of the three notebook tabs. parameterGridPanel = wx.Panel(self, -1) settingsPanel = wx.Panel(self, -1) executionPanel = wx.Panel(self, -1) self.AddPage(parameterGridPanel, "Parameter Grid") self.AddPage(settingsPanel, "Run Configuration") self.AddPage(executionPanel, "Resources and Execution") # ***** PARAMETER GRID TAB ***** parameterGridSizer = wx.BoxSizer( wx.HORIZONTAL ) RunForm.speciesGrid = ParameterGrid( parameterGridPanel, RunForm.run ) parameterGridSizer.Add( RunForm.speciesGrid, 1, wx.EXPAND ) parameterGridPanel.SetSizerAndFit( parameterGridSizer ) # Create the parameter grid control. RunForm.speciesGrid.CreateGrid( RunForm.run.species.numRows, RunForm.run.species.numColumns ) RunForm.speciesGrid.SetColLabelValue( 0, "Parameter" ) RunForm.speciesGrid.SetColLabelValue( 1, "Type") RunForm.speciesGrid.SetColLabelValue( 2, "Value(s)") RunForm.speciesGrid.SetColLabelValue( 3, "Directory Order") RunForm.speciesGrid.SetColSize( 3, 100 ) # ***** RUN SETTINGS TAB ***** runSettingsSizer = wx.BoxSizer( wx.VERTICAL ) RunForm.runPropertiesGrid = wx_propgrid.PropertyGrid( settingsPanel, size=(300, 300) ) runSettingsSizer.Add( RunForm.runPropertiesGrid, 2, wx.EXPAND ) settingsPanel.SetSizerAndFit( runSettingsSizer ) RunForm.runPropertiesGrid.Append( wx_propgrid.PropertyCategory( "Basic Script Properties" ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.StringProperty( "Script filename", "scriptFilename", RunForm.run.runSettings.scriptFilename ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.DirProperty( "Script output location", "scriptLocation", RunForm.run.runSettings.scriptLocation ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.LongStringProperty( "Run notes", "runNotes", RunForm.run.runNotes ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.PropertyCategory( "Executable Properties" ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.FileProperty( "Executable filename", "executableFilename", RunForm.run.runSettings.executableFilename ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.FileProperty( "Output filename", "outputFilename", RunForm.run.runSettings.outputFilename ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.FileProperty( "Input filename", "inputFilename", RunForm.run.runSettings.inputFilename ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.DirProperty( "Source path", "sourcePath", RunForm.run.runSettings.sourcePath ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.PropertyCategory( "Basic Script Tasks" ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.BoolProperty("Compile executable from source", "optionCompileSource", RunForm.run.runSettings.optionCompileSource ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.BoolProperty("Build directory structure", "optionBuildDirectoryStructure", RunForm.run.runSettings.optionBuildDirectoryStructure ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.BoolProperty("Disable input redirection", "optionDisableInputRedirection", RunForm.run.runSettings.optionDisableInputRedirection ) ) RunForm.runPropertiesGrid.Append( wx_propgrid.BoolProperty("Generate status check script", "optionGenerateCheckStatusScript", RunForm.run.runSettings.optionGenerateCheckStatusScript ) ) # ***** RESOURCES AND EXECUTION PANEL ***** executionSettingsSizer = wx.BoxSizer( wx.VERTICAL ) RunForm.singleMachinePropertyGrid = wx_propgrid.PropertyGrid( executionPanel ) RunForm.executionChoiceBook = wx.Choicebook( executionPanel, id=wx.ID_ANY ) executionSettingsSizer.Add( RunForm.executionChoiceBook, 1, wx.EXPAND ) executionPanel.SetSizerAndFit( executionSettingsSizer ) panelSingleMachine = wx.Panel( RunForm.executionChoiceBook ) panelPBS = wx.Panel( RunForm.executionChoiceBook ) panelSingleMachineMPI = wx.Panel( RunForm.executionChoiceBook ) panelPBSMPI = wx.Panel( RunForm.executionChoiceBook ) RunForm.executionChoiceBook.AddPage( panelSingleMachine, "Single Machine or Interactive Job (Recovery Enabled)") RunForm.executionChoiceBook.AddPage( panelPBS, "PBS Scheduler on Cluster") #RunForm.executionChoiceBook.AddPage( panelSingleMachineMPI, "Single Machine or Interactive Job using MPI") #RunForm.executionChoiceBook.AddPage( panelPBSMPI, "PBS Scheduler on Cluster using MPI") # SINGLE MACHINE SETTINGS RunForm.propertyGridSingleMachine = wx_propgrid.PropertyGrid( panelSingleMachine ) sizerGridSingleMachine = wx.BoxSizer( wx.VERTICAL ) sizerGridSingleMachine.Add( RunForm.propertyGridSingleMachine, 1, wx.EXPAND ) panelSingleMachine.SetSizerAndFit( sizerGridSingleMachine ) RunForm.propertyGridSingleMachine.Append( wx_propgrid.PropertyCategory( "Resources" ) ) RunForm.propertyGridSingleMachine.Append( wx_propgrid.IntProperty( "Number of simultaneous runs", "numSimRuns", RunForm.run.availableModules.SingleMachineResourceManager.numSimRuns ) ) RunForm.propertyGridSingleMachine.Append( wx_propgrid.IntProperty( "Process status check delay (seconds)", "procCheckWaitTime", RunForm.run.availableModules.SingleMachineResourceManager.procCheckWaitTime ) ) RunForm.propertyGridSingleMachine.Append( wx_propgrid.PropertyCategory( "Additional Commands" ) ) RunForm.propertyGridSingleMachine.Append( wx_propgrid.LongStringProperty( "Additional pre-execution commands", "additionalPreExecutionCommands", RunForm.run.availableModules.SingleMachineResourceManager.additionalPreExecutionCommands ) ) RunForm.propertyGridSingleMachine.Append( wx_propgrid.LongStringProperty( "Additional post-execution commands", "additionalPostExecutionCommands", RunForm.run.availableModules.SingleMachineResourceManager.additionalPostExecutionCommands ) ) # PBS SETTINGS RunForm.propertyGridPBS = wx_propgrid.PropertyGrid( panelPBS ) sizerGridPBS = wx.BoxSizer( wx.VERTICAL ) sizerGridPBS.Add( RunForm.propertyGridPBS, 1, wx.EXPAND ) panelPBS.SetSizerAndFit( sizerGridPBS ) RunForm.propertyGridPBS.Append( wx_propgrid.PropertyCategory( "PBS Settings" ) ) RunForm.propertyGridPBS.Append( wx_propgrid.IntProperty( "Number of nodes", "numNodes", RunForm.run.availableModules.PBSResourceManager.numNodes ) ) RunForm.propertyGridPBS.Append( wx_propgrid.IntProperty( "Processors per node (ppn)", "processorsPerNode", RunForm.run.availableModules.PBSResourceManager.processorsPerNode ) ) RunForm.propertyGridPBS.Append( wx_propgrid.StringProperty( "Walltime", "walltime", RunForm.run.availableModules.PBSResourceManager.walltime ) ) RunForm.propertyGridPBS.Append( wx_propgrid.PropertyCategory( "Additional Commands" ) ) RunForm.propertyGridPBS.Append( wx_propgrid.LongStringProperty( "Additional pre-execution commands", "additionalPreExecutionCommands", RunForm.run.availableModules.PBSResourceManager.additionalPreExecutionCommands ) ) RunForm.propertyGridPBS.Append( wx_propgrid.LongStringProperty( "Additional post-execution commands", "additionalPostExecutionCommands", RunForm.run.availableModules.PBSResourceManager.additionalPostExecutionCommands ) )
def Remplissage(self): listeChampsPiedsPages = ["{DATE_JOUR}", "{TITRE_DOCUMENT}", "{NUM_PAGE}", "{NBRE_PAGES}"] # --------------------------- Divers ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Divers")) ) # Inclure les images propriete = wxpg.BoolProperty(label=_(u"Inclure les images"), name="inclure_images", value=True) propriete.SetHelpString(_(u"Cochez cette case pour inclure les images")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Entete de colonne sur chaque page propriete = wxpg.BoolProperty(label=_(u"Afficher les entêtes sur chaque page"), name="entetes_toutes_pages", value=True) propriete.SetHelpString(_(u"Cochez cette case pour afficher les entêtes de colonne sur chaque page")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Qualité de l'impression labels = [_(u"Brouillon"), _(u"Basse"), _(u"Moyenne"), _(u"Haute")] propriete = wxpg.EnumProperty(label=_(u"Qualité d'impression"), name="qualite_impression", labels=labels, values=[wx.PRINT_QUALITY_DRAFT, wx.PRINT_QUALITY_LOW, wx.PRINT_QUALITY_MEDIUM, wx.PRINT_QUALITY_HIGH] , value=wx.PRINT_QUALITY_MEDIUM) propriete.SetHelpString(_(u"Sélectionnez la qualité d'impression (Moyenne par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Marges ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Marges")) ) # Gauche propriete = wxpg.IntProperty(label=_(u"Gauche"), name="marge_gauche", value=5) propriete.SetHelpString(_(u"Saisissez une taille de marge")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_gauche", "SpinCtrl") # Droite propriete = wxpg.IntProperty(label=_(u"Droite"), name="marge_droite", value=5) propriete.SetHelpString(_(u"Saisissez une taille de marge")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_droite", "SpinCtrl") # Haut propriete = wxpg.IntProperty(label=_(u"Haut"), name="marge_haut", value=5) propriete.SetHelpString(_(u"Saisissez une taille de marge")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_haut", "SpinCtrl") # Bas propriete = wxpg.IntProperty(label=_(u"Bas"), name="marge_bas", value=5) propriete.SetHelpString(_(u"Saisissez une taille de marge")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("marge_bas", "SpinCtrl") # --------------------------- Quadrillage ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Quadrillage")) ) # Epaisseur de trait propriete = wxpg.FloatProperty(label=_(u"Epaisseur de trait"), name="grille_trait_epaisseur", value=0.25) propriete.SetHelpString(_(u"Saisissez une épaisseur de trait (Par défaut '0.25')")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur de trait propriete = wxpg.ColourProperty(label=_(u"Couleur de trait"), name="grille_trait_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur de trait")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Titre de liste ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Titre")) ) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="titre_taille_texte", value=16) propriete.SetHelpString(_(u"Saisissez une taille de texte (16 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("titre_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="titre_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_BOLD) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="titre_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = [_(u"Gauche"), _(u"Centre"), _(u"Droite")] propriete = wxpg.EnumProperty(label=_(u"Alignement du texte"), name="titre_alignement", labels=labels, values=[wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_RIGHT] , value=wx.ALIGN_LEFT) propriete.SetHelpString(_(u"Sélectionnez le type d'alignement")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Intro ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Introduction")) ) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="intro_taille_texte", value=7) propriete.SetHelpString(_(u"Saisissez une taille de texte (7 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("intro_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="intro_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="intro_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = [_(u"Gauche"), _(u"Centre"), _(u"Droite")] propriete = wxpg.EnumProperty(label=_(u"Alignement du texte"), name="intro_alignement", labels=labels, values=[wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_RIGHT] , value=wx.ALIGN_LEFT) propriete.SetHelpString(_(u"Sélectionnez le type d'alignement")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Titre de colonne ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Entête de colonne")) ) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="titre_colonne_taille_texte", value=8) propriete.SetHelpString(_(u"Saisissez une taille de texte (8 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("titre_colonne_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="titre_colonne_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="titre_colonne_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = [_(u"Gauche"), _(u"Centre"), _(u"Droite")] propriete = wxpg.EnumProperty(label=_(u"Alignement du texte"), name="titre_colonne_alignement", labels=labels, values=[wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_RIGHT] , value=wx.ALIGN_CENTER) propriete.SetHelpString(_(u"Sélectionnez le type d'alignement")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur de fond propriete = wxpg.ColourProperty(label=_(u"Couleur de fond"), name="titre_colonne_couleur_fond", value=wx.Colour(240, 240, 240)) propriete.SetHelpString(_(u"Sélectionnez une couleur de fond")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Ligne ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Ligne")) ) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="ligne_taille_texte", value=8) propriete.SetHelpString(_(u"Saisissez une taille de texte (8 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("ligne_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="ligne_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="ligne_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Multilignes autorisé propriete = wxpg.BoolProperty(label=_(u"Autoriser saut à la ligne"), name="ligne_multilignes", value=True) propriete.SetHelpString(_(u"Cochez cette case pour autoriser le saut à la ligne en cas de colonne trop étroite")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # --------------------------- Pied de page ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Pied de page")) ) # Texte de gauche valeur = "{DATE_JOUR}" propriete = wxpg.StringProperty(label=_(u"Texte de gauche"), name="pied_page_texte_gauche", value=valeur) propriete.SetHelpString(_(u"Saisissez le texte de gauche du pied de page (Par défaut '%s'). Vous pouvez intégrer les mots-clés suivants : %s") % (valeur, ", ".join(listeChampsPiedsPages))) self.Append(propriete) # Texte du milieu valeur = "{TITRE_DOCUMENT}" propriete = wxpg.StringProperty(label=_(u"Texte du milieu"), name="pied_page_texte_milieu", value=valeur) propriete.SetHelpString(_(u"Saisissez le texte du milieu du pied de page (Par défaut '%s'). Vous pouvez intégrer les mots-clés suivants : %s") % (valeur, ", ".join(listeChampsPiedsPages))) self.Append(propriete) # Texte de droite valeur = "{NUM_PAGE} / {NBRE_PAGES}" propriete = wxpg.StringProperty(label=_(u"Texte de droite"), name="pied_page_texte_droite", value=valeur) propriete.SetHelpString(_(u"Saisissez le texte de droite du pied de page (Par défaut '%s'). Vous pouvez intégrer les mots-clés suivants : %s") % (valeur, ", ".join(listeChampsPiedsPages))) self.Append(propriete) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="pied_page_taille_texte", value=8) propriete.SetHelpString(_(u"Saisissez une taille de texte (8 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("pied_page_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="pied_page_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="pied_page_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Pied de colonne ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Pied de colonne")) ) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="pied_colonne_taille_texte", value=8) propriete.SetHelpString(_(u"Saisissez une taille de texte (8 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("pied_colonne_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="pied_colonne_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_NORMAL) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="pied_colonne_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = [_(u"Gauche"), _(u"Centre"), _(u"Droite")] propriete = wxpg.EnumProperty(label=_(u"Alignement du texte"), name="pied_colonne_alignement", labels=labels, values=[wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_RIGHT] , value=wx.ALIGN_CENTER) propriete.SetHelpString(_(u"Sélectionnez le type d'alignement")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur de fond propriete = wxpg.ColourProperty(label=_(u"Couleur de fond"), name="pied_colonne_couleur_fond", value=wx.Colour(240, 240, 240)) propriete.SetHelpString(_(u"Sélectionnez une couleur de fond")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # --------------------------- Pied de liste ------------------------------------------ self.Append( wxpg.PropertyCategory(_(u"Conclusion")) ) # Taille police propriete = wxpg.IntProperty(label=_(u"Taille de texte"), name="conclusion_taille_texte", value=7) propriete.SetHelpString(_(u"Saisissez une taille de texte (7 par défaut)")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) self.SetPropertyEditor("conclusion_taille_texte", "SpinCtrl") # Style labels = [_(u"Normal"), _(u"Light"), "Gras"] valeurs = [wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT, wx.FONTWEIGHT_BOLD] propriete = wxpg.EnumProperty(label=_(u"Style de texte"), name="conclusion_style", labels=labels, values=valeurs, value=wx.FONTWEIGHT_BOLD) propriete.SetHelpString(_(u"Sélectionnez un style de texte")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur propriete = wxpg.ColourProperty(label=_(u"Couleur de texte"), name="conclusion_couleur", value=wx.BLACK) propriete.SetHelpString(_(u"Sélectionnez une couleur")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Alignement labels = [_(u"Gauche"), _(u"Centre"), _(u"Droite")] propriete = wxpg.EnumProperty(label=_(u"Alignement du texte"), name="conclusion_alignement", labels=labels, values=[wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_RIGHT] , value=wx.ALIGN_LEFT) propriete.SetHelpString(_(u"Sélectionnez le type d'alignement")) propriete.SetAttribute("obligatoire", True) self.Append(propriete)
def Remplissage(self): # Regroupement self.Append(wxpg.PropertyCategory(_(u"Regroupement"))) # Regroupement principal liste_regroupements = [ ("aucun", _(u"Aucun")), ("jour", _(u"Jour")), ("mois", _(u"Mois")), ("annee", _(u"Année")), ("activite", _(u"Activité")), ("groupe", _(u"Groupe")), ("evenement", _(u"Evènement")), ("evenement_date", _(u"Evènement (avec date)")), ("etiquette", _(u"Etiquette")), ("unite_conso", _(u"Unité de consommation")), ("categorie_tarif", _(u"Catégorie de tarif")), ("ville_residence", _(u"Ville de résidence")), ("secteur", _(u"Secteur géographique")), ("genre", _(u"Genre (M/F)")), ("age", _(u"Age")), ("ville_naissance", _(u"Ville de naissance")), ("nom_ecole", _(u"Ecole")), ("nom_classe", _(u"Classe")), ("nom_niveau_scolaire", _(u"Niveau scolaire")), ("individu", _(u"Individu")), ("famille", _(u"Famille")), ("regime", _(u"Régime social")), ("caisse", _(u"Caisse d'allocations")), ("qf_perso", _(u"Quotient familial (tranches personnalisées)")), ("qf_tarifs", _(u"Quotient familial (tranches paramétrées)")), ("qf_100", _(u"Quotient familial (tranches de 100)")), ("categorie_travail", _(u"Catégorie de travail")), ("categorie_travail_pere", _(u"Catégorie de travail du père")), ("categorie_travail_mere", _(u"Catégorie de travail de la mère")), ] # Intégration des questionnaires q = UTILS_Questionnaires.Questionnaires() for public in ("famille", "individu"): for dictTemp in q.GetQuestions(public): label = _(u"Question %s. : %s") % (public[:3], dictTemp["label"]) code = "question_%s_%d" % (public, dictTemp["IDquestion"]) liste_regroupements.append((code, label)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Regroupement principal"), name="regroupement_principal", liste_choix=liste_regroupements, valeur="aucun") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez un niveau de regroupement principal")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Tranches d'âge propriete = CTRL_Propertygrid.Propriete_liste( label=_(u"Regroupement par tranches d'âge"), name="regroupement_age", liste_selections=[]) propriete.SetHelpString( _(u"Saisissez les tranches d'âge souhaitées séparées par des virgules. Exemple : '3, 6, 12'" )) propriete.SetAttribute("obligatoire", False) self.Append(propriete) # Tranches de QF perso propriete = CTRL_Propertygrid.Propriete_liste( label=_(u"Regroupement par tranches de QF"), name="tranches_qf_perso", liste_selections=[]) propriete.SetHelpString( _(u"Attention, à utiliser avec le regroupement principal 'Quotient familial (tranches personnalisées)'. Saisissez les tranches de QF souhaitées séparées par des virgules. Exemple : '650, 800, 1200'" )) propriete.SetAttribute("obligatoire", False) self.Append(propriete) # Afficher les périodes détaillées propriete = wxpg.BoolProperty( label=_(u"Regroupement par périodes détaillées"), name="periodes_detaillees", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher les périodes détaillées")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Données self.Append(wxpg.PropertyCategory(_(u"Données"))) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Format des données"), name="format_donnees", liste_choix=[("horaire", _(u"Horaire")), ("decimal", _(u"Décimal"))], valeur="horaire") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez le format d'affichage des données")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Afficher l'avertissement 'familles sans régime' propriete = wxpg.BoolProperty( label=_(u"Avertissement si régime famille inconnu"), name="afficher_regime_inconnu", value=True) propriete.SetHelpString( _(u"Cochez cette case pour afficher un avertissement si le régime d'une ou plusieurs familles est inconnu" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Associer régime inconnu DB = GestionDB.DB() req = """SELECT IDregime, nom FROM regimes ORDER BY nom;""" DB.ExecuterReq(req) liste_regimes = DB.ResultatReq() DB.Close() liste_regimes.insert(0, ("non", _(u"Non"))) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Associer régime inconnu à un régime"), name="associer_regime_inconnu", liste_choix=liste_regimes, valeur="non") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez le régime dans lequel vous souhaitez inclure les familles au régime inconnu" )) propriete.SetAttribute("obligatoire", False) self.Append(propriete) # Plafond journalier par individu propriete = wxpg.IntProperty( label=_(u"Plafond journalier par individu (en minutes)"), name="plafond_journalier_individu", value=0) propriete.SetHelpString( _(u"Saisissez un plafond journalier (en minutes) par individu, toutes activités confondues (0 = désactivé). Exemple : une valeur de 120 (minutes) plafonnera le temps retenu pour chaque individu à hauteur de 2 heures." )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Filtres self.Append(wxpg.PropertyCategory(_(u"Filtres"))) # Jours hors vacances liste_jours = [(0, _(u"Lundi")), (1, _(u"Mardi")), (2, _(u"Mercredi")), (3, _(u"Jeudi")), (4, _(u"Vendredi")), (5, _(u"Samedi")), (6, _(u"Dimanche"))] propriete = CTRL_Propertygrid.Propriete_multichoix( label=_(u"Jours hors vacances"), name="jours_hors_vacances", liste_choix=liste_jours, liste_selections=[0, 1, 2, 3, 4, 5, 6]) propriete.SetHelpString( _(u"Sélectionnez les jours hors vacances à inclure dans les calculs. Cliquez sur le bouton à droite du champ de saisie pour accéder à la fenêtre de sélection." )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Jours de vacances propriete = CTRL_Propertygrid.Propriete_multichoix( label=_(u"Jours de vacances"), name="jours_vacances", liste_choix=liste_jours, liste_selections=[0, 1, 2, 3, 4, 5, 6]) propriete.SetHelpString( _(u"Sélectionnez les jours de vacances à inclure dans les calculs. Cliquez sur le bouton à droite du champ de saisie pour accéder à la fenêtre de sélection." )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Etat des consommations self.liste_codes_etats = [ "reservation", "present", "absentj", "absenti" ] liste_etats = [(0, _(u"Pointage en attente")), (1, _(u"Présent")), (2, _(u"Absence justifiée")), (3, _(u"Absence injustifiée"))] propriete = CTRL_Propertygrid.Propriete_multichoix( label=_(u"Etat des consommations"), name="etat_consommations", liste_choix=liste_etats, liste_selections=[0, 1, 2, 3]) propriete.SetHelpString( _(u"Sélectionnez les états de consommations à inclure dans les calculs. Cliquez sur le bouton à droite du champ de saisie pour accéder à la fenêtre de sélection." )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Affichage self.Append(wxpg.PropertyCategory(_(u"Affichage"))) # Orientation page propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Orientation de la page"), name="orientation", liste_choix=[("portrait", _(u"Portrait")), ("paysage", _(u"Paysage"))], valeur="portrait") propriete.SetEditor("EditeurChoix") propriete.SetHelpString(_(u"Sélectionnez l'orientation de la page")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur Ligne tranche d'âge propriete = wxpg.ColourProperty( label=_(u"Couleur de la ligne tranche d'âge"), name="couleur_ligne_age", value=wx.Colour(192, 192, 192)) propriete.SetHelpString( _(u"Sélectionnez la couleur de la ligne tranche d'âge")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur Ligne total propriete = wxpg.ColourProperty(label=_(u"Couleur de la ligne total"), name="couleur_ligne_total", value=wx.Colour(234, 234, 234)) propriete.SetHelpString( _(u"Sélectionnez la couleur de la ligne total")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur case regroupement principal propriete = wxpg.ColourProperty( label=_(u"Couleur de la case regroupement principal"), name="couleur_case_regroupement", value=wx.Colour(0, 0, 0)) propriete.SetHelpString( _(u"Sélectionnez la couleur de la case regroupement principal")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur texte regroupement principal propriete = wxpg.ColourProperty( label=_(u"Couleur du texte regroupement principal"), name="couleur_texte_regroupement", value=wx.Colour(255, 255, 255)) propriete.SetHelpString( _(u"Sélectionnez la couleur du texte regroupement principal")) propriete.SetAttribute("obligatoire", True) self.Append(propriete)
def __init__(self, parent, log): wx.Panel.__init__(self, parent, wx.ID_ANY) self.log = log self.panel = panel = wx.Panel(self, wx.ID_ANY) topsizer = wx.BoxSizer(wx.VERTICAL) # Difference between using PropertyGridManager vs PropertyGrid is that # the manager supports multiple pages and a description box. self.pg = pg = wxpg.PropertyGridManager( panel, style=wxpg.PG_SPLITTER_AUTO_CENTER | wxpg.PG_AUTO_SORT | wxpg.PG_TOOLBAR) # Show help as tooltips pg.SetExtraStyle(wxpg.PG_EX_HELP_AS_TOOLTIPS) pg.Bind(wxpg.EVT_PG_CHANGED, self.OnPropGridChange) pg.Bind(wxpg.EVT_PG_PAGE_CHANGED, self.OnPropGridPageChange) pg.Bind(wxpg.EVT_PG_SELECTED, self.OnPropGridSelect) pg.Bind(wxpg.EVT_PG_RIGHT_CLICK, self.OnPropGridRightClick) # # Let's use some simple custom editor # # NOTE: Editor must be registered *before* adding a property that # uses it. if not getattr(sys, '_PropGridEditorsRegistered', False): pg.RegisterEditor(TrivialPropertyEditor) pg.RegisterEditor(SampleMultiButtonEditor) pg.RegisterEditor(LargeImageEditor) # ensure we only do it once sys._PropGridEditorsRegistered = True # # Add properties # pg.AddPage("Page 1 - Testing All") pg.Append(wxpg.PropertyCategory("1 - Basic Properties")) pg.Append(wxpg.StringProperty("String", value="Some Text")) sp = pg.Append( wxpg.StringProperty('StringProperty w/ Password flag', value='ABadPassword')) sp.SetAttribute('Hint', 'This is a hint') sp.SetAttribute('Password', True) pg.Append(wxpg.IntProperty("Int", value=100)) pg.Append(wxpg.FloatProperty("Float", value=100.0)) pg.Append(wxpg.BoolProperty("Bool", value=True)) boolprop = pg.Append( wxpg.BoolProperty("Bool_with_Checkbox", value=True)) pg.SetPropertyAttribute( "Bool_with_Checkbox", # You can find the property by name, #boolprop, # or give the property object itself. "UseCheckbox", True) # The attribute name and value pg.Append(wxpg.PropertyCategory("2 - More Properties")) pg.Append( wxpg.LongStringProperty( "LongString", value="This is a\nmulti-line string\nwith\ttabs\nmixed\tin.")) pg.Append(wxpg.DirProperty("Dir", value=r"C:\Windows")) pg.Append(wxpg.FileProperty("File", value=r"C:\Windows\system.ini")) pg.Append( wxpg.ArrayStringProperty("ArrayString", value=['A', 'B', 'C'])) pg.Append( wxpg.EnumProperty( "Enum", "Enum", ['wxPython Rules', 'wxPython Rocks', 'wxPython Is The Best'], [10, 11, 12], 0)) pg.Append( wxpg.EditEnumProperty("EditEnum", "EditEnumProperty", ['A', 'B', 'C'], [0, 1, 2], "Text Not in List")) pg.Append(wxpg.PropertyCategory("3 - Advanced Properties")) pg.Append(wxpg.DateProperty("Date", value=wx.DateTime.Now())) pg.Append(wxpg.FontProperty("Font", value=panel.GetFont())) pg.Append( wxpg.ColourProperty("Colour", value=panel.GetBackgroundColour())) pg.Append(wxpg.SystemColourProperty("SystemColour")) pg.Append(wxpg.ImageFileProperty("ImageFile")) pg.Append( wxpg.MultiChoiceProperty("MultiChoice", choices=['wxWidgets', 'QT', 'GTK+'])) pg.Append(wxpg.PropertyCategory("4 - Additional Properties")) #pg.Append( wxpg.PointProperty("Point",value=panel.GetPosition()) ) pg.Append(SizeProperty("Size", value=panel.GetSize())) #pg.Append( wxpg.FontDataProperty("FontData") ) pg.Append(wxpg.IntProperty("IntWithSpin", value=256)) pg.SetPropertyEditor("IntWithSpin", "SpinCtrl") pg.SetPropertyAttribute("File", wxpg.PG_FILE_SHOW_FULL_PATH, 0) pg.SetPropertyAttribute("File", wxpg.PG_FILE_INITIAL_PATH, r"C:\Program Files\Internet Explorer") pg.SetPropertyAttribute("Date", wxpg.PG_DATE_PICKER_STYLE, wx.adv.DP_DROPDOWN | wx.adv.DP_SHOWCENTURY) pg.Append(wxpg.PropertyCategory("5 - Custom Properties and Editors")) pg.Append(IntProperty2("IntProperty2", value=1024)) pg.Append(PyObjectProperty("PyObjectProperty")) pg.Append(DirsProperty("Dirs1", value=['C:/Lib', 'C:/Bin'])) pg.Append(DirsProperty("Dirs2", value=['/lib', '/bin'])) # Test another type of delimiter pg.SetPropertyAttribute("Dirs2", "Delimiter", '"') # SampleMultiButtonEditor pg.Append(wxpg.LongStringProperty("MultipleButtons")) pg.SetPropertyEditor("MultipleButtons", "SampleMultiButtonEditor") pg.Append(SingleChoiceProperty("SingleChoiceProperty")) # Custom editor samples prop = pg.Append( wxpg.StringProperty("StringWithCustomEditor", value="test value")) pg.SetPropertyEditor(prop, "TrivialPropertyEditor") pg.Append(wxpg.ImageFileProperty("ImageFileWithLargeEditor")) pg.SetPropertyEditor("ImageFileWithLargeEditor", "LargeImageEditor") # When page is added, it will become the target page for AutoFill # calls (and for other property insertion methods as well) pg.AddPage("Page 2 - Results of AutoFill will appear here") topsizer.Add(pg, 1, wx.EXPAND) rowsizer = wx.BoxSizer(wx.HORIZONTAL) but = wx.Button(panel, -1, "SetPropertyValues") but.Bind(wx.EVT_BUTTON, self.OnSetPropertyValues) rowsizer.Add(but, 1) but = wx.Button(panel, -1, "GetPropertyValues") but.Bind(wx.EVT_BUTTON, self.OnGetPropertyValues) rowsizer.Add(but, 1) topsizer.Add(rowsizer, 0, wx.EXPAND) rowsizer = wx.BoxSizer(wx.HORIZONTAL) but = wx.Button(panel, -1, "GetPropertyValues(as_strings=True)") but.Bind(wx.EVT_BUTTON, self.OnGetPropertyValues2) rowsizer.Add(but, 1) but = wx.Button(panel, -1, "AutoFill") but.Bind(wx.EVT_BUTTON, self.OnAutoFill) rowsizer.Add(but, 1) topsizer.Add(rowsizer, 0, wx.EXPAND) rowsizer = wx.BoxSizer(wx.HORIZONTAL) but = wx.Button(panel, -1, "Delete") but.Bind(wx.EVT_BUTTON, self.OnDeleteProperty) rowsizer.Add(but, 1) but = wx.Button(panel, -1, "Run Tests") but.Bind(wx.EVT_BUTTON, self.RunTests) rowsizer.Add(but, 1) topsizer.Add(rowsizer, 0, wx.EXPAND) panel.SetSizer(topsizer) topsizer.SetSizeHints(panel) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(panel, 1, wx.EXPAND) self.SetSizer(sizer) self.SetAutoLayout(True)
def __init__(self, parent, IDfamille=None): wxpg.PropertyGrid.__init__(self, parent, -1, style=wxpg.PG_SPLITTER_AUTO_CENTER) self.IDfamille = IDfamille self.Bind(wxpg.EVT_PG_CHANGED, self.OnPropGridChange) # Définition des éditeurs personnalisés self.SetExtraStyle(wxpg.PG_EX_HELP_AS_TOOLTIPS) # Données Tiers pour Hélios self.Append(wxpg.PropertyCategory(_(u"Données tiers pour Hélios"))) propriete = wxpg.EnumProperty(label=_(u"Titulaire"), name="titulaire_helios") propriete.SetHelpString( _(u"Sélectionnez le titulaire du compte pour Hélios (Trésor Public)" )) self.Append(propriete) ## self.MAJ_titulaire_helios() propriete = wxpg.StringProperty(label=_(u"Identifiant national"), name="idtiers_helios", value=u"") propriete.SetHelpString( _(u"[Facultatif] Saisissez l'identifiant national (SIRET ou SIREN ou FINESS ou NIR)" )) self.Append(propriete) listeLabels, listeID = GetDonneesListe(LISTE_TYPES_ID_TIERS) propriete = wxpg.EnumProperty(label=_(u"Type d'identifiant national"), name="natidtiers_helios", labels=listeLabels, values=listeID, value=9999) propriete.SetHelpString( _(u"[Facultatif] Sélectionnez le type d'identifiant national du tiers pour Hélios (Trésor Public)" )) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Référence locale"), name="reftiers_helios", value="") propriete.SetHelpString( _(u"[Facultatif] Saisissez la référence locale du tiers")) self.Append(propriete) listeLabels, listeID = GetDonneesListe(LISTE_CATEGORIES_TIERS) propriete = wxpg.EnumProperty(label=_(u"Catégorie"), name="cattiers_helios", labels=listeLabels, values=listeID, value=1) propriete.SetHelpString( _(u"Sélectionnez la catégorie de tiers pour Hélios (Trésor Public)" )) self.Append(propriete) listeLabels, listeID = GetDonneesListe(LISTE_NATURES_JURIDIQUES) propriete = wxpg.EnumProperty(label=_(u"Nature juridique"), name="natjur_helios", labels=listeLabels, values=listeID, value=1) propriete.SetHelpString( _(u"Sélectionnez la nature juridique du tiers pour Hélios (Trésor Public)" )) self.Append(propriete) # Facturation self.Append(wxpg.PropertyCategory(_(u"Facturation"))) # Autre adresse de facturation propriete = wxpg.BoolProperty(label=_(u"Autre adresse de facturation"), name="autre_adresse_facturation", value=False) propriete.SetHelpString( _(u"Cochez cette case pour activer une autre adresse de facturation" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Autre adresse - Nom"), name="adresse_nom", value="") propriete.SetHelpString(_(u"Saisissez un nom de destinataire")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Autre adresse - Rue"), name="adresse_rue", value="") propriete.SetHelpString(_(u"Saisissez la rue de l'adresse")) self.Append(propriete) propriete = wxpg.StringProperty( label=_(u"Autre adresse - Code postal"), name="adresse_cp", value="") propriete.SetHelpString(_(u"Saisissez le code postal de l'adresse")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Autre adresse - Ville"), name="adresse_ville", value="") propriete.SetHelpString(_(u"Saisissez la ville de l'adresse")) self.Append(propriete) # Comptabilité self.Append(wxpg.PropertyCategory(_(u"Comptabilité"))) propriete = wxpg.StringProperty(label=_(u"Code comptable"), name="code_comptable", value=u"") propriete.SetHelpString( _(u"Saisissez le code comptable de la famille (Utilisé pour les exports vers logiciels de compta)" )) self.Append(propriete)
def Remplissage(self): # Bordereau self.Append(wxpg.PropertyCategory(_(u"Bordereau"))) propriete = wxpg.IntProperty(label=_(u"Exercice"), name="exercice", value=datetime.date.today().year) propriete.SetHelpString(_(u"Saisissez l'année de l'exercice")) self.Append(propriete) self.SetPropertyEditor("exercice", "SpinCtrl") listeMois = [ u"_", _(u"Janvier"), _(u"Février"), _(u"Mars"), _(u"Avril"), _(u"Mai"), _(u"Juin"), _(u"Juillet"), _(u"Août"), _(u"Septembre"), _(u"Octobre"), _(u"Novembre"), _(u"Décembre") ] propriete = wxpg.EnumProperty(label=_(u"Mois"), name="mois", labels=listeMois, values=range(0, 13), value=datetime.date.today().month) propriete.SetHelpString(_(u"Sélectionnez le mois")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Objet"), name="objet_dette", value=u"") propriete.SetHelpString( _(u"Saisissez l'objet du bordereau (Ex : 'Centre de Loisirs')")) self.Append(propriete) # Dates self.Append(wxpg.PropertyCategory(_(u"Dates"))) if 'phoenix' in wx.PlatformInfo: now = wx.DateTime.Now() else: now = wx.DateTime_Now() propriete = wxpg.DateProperty(label=_(u"Date d'émission"), name="date_emission", value=now) propriete.SetAttribute(wxpg.PG_DATE_PICKER_STYLE, DP_DROPDOWN | DP_SHOWCENTURY) self.Append(propriete) propriete = wxpg.DateProperty(label=_(u"Date du prélèvement"), name="date_prelevement", value=now) propriete.SetAttribute(wxpg.PG_DATE_PICKER_STYLE, DP_DROPDOWN | DP_SHOWCENTURY) self.Append(propriete) propriete = wxpg.DateProperty(label=_(u"Avis d'envoi"), name="date_envoi", value=now) propriete.SetAttribute(wxpg.PG_DATE_PICKER_STYLE, DP_DROPDOWN | DP_SHOWCENTURY) self.Append(propriete) # Collectivité self.Append(wxpg.PropertyCategory(_(u"Identification"))) propriete = wxpg.StringProperty(label=_(u"ID Bordereau"), name="id_bordereau", value=u"") propriete.SetHelpString(_(u"Saisissez l'ID du bordereau")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"ID Poste"), name="id_poste", value=u"") propriete.SetHelpString(_(u"Saisissez l'ID du bordereau")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"ID Collectivité"), name="id_collectivite", value=u"") propriete.SetHelpString(_(u"Saisissez l'ID de la collectivité")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Code Collectivité"), name="code_collectivite", value=u"") propriete.SetHelpString(_(u"Saisissez le code Collectivité")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Code Budget"), name="code_budget", value=u"") propriete.SetHelpString(_(u"Saisissez le code Budget")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Code Produit Local"), name="code_prodloc", value=u"") propriete.SetHelpString(_(u"Saisissez le code Produit Local")) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Code Etablissement"), name="code_etab", value=u"") propriete.SetHelpString( _(u"Saisissez le code Etablissement (3 caractères max). Nécessaire pour le datamatrix. Ce code apparaît dans les paramètres de flux dans Hélios." )) self.Append(propriete) # Libellés self.Append(wxpg.PropertyCategory(_(u"Libellés"))) propriete = wxpg.StringProperty( label=_(u"Objet de la pièce"), name="objet_piece", value=_(u"FACTURE NUM{NUM_FACTURE} {MOIS_LETTRES} {ANNEE}")) propriete.SetHelpString( _(u"Saisissez l'objet de la pièce (en majuscules et sans accents). Vous pouvez personnaliser ce libellé grâce aux mots-clés suivants : {NOM_ORGANISATEUR} {NUM_FACTURE} {LIBELLE_FACTURE} {MOIS} {MOIS_LETTRES} {ANNEE}." )) self.Append(propriete) propriete = wxpg.StringProperty( label=_(u"Libellé du prélèvement"), name="prelevement_libelle", value=u"{NOM_ORGANISATEUR} - {OBJET_PIECE}") propriete.SetHelpString( _(u"Saisissez le libellé du prélèvement qui apparaîtra sur le relevé de compte de la famille. Vous pouvez personnaliser ce libellé grâce aux mots-clés suivants : {NOM_ORGANISATEUR} {OBJET_PIECE} {NUM_FACTURE} {LIBELLE_FACTURE} {MOIS} {MOIS_LETTRES} {ANNEE}." )) self.Append(propriete) # Pièces jointes self.Append(wxpg.PropertyCategory(_(u"Pièces jointes"))) propriete = wxpg.BoolProperty( label=_(u"Inclure les factures en pièces jointes"), name="inclure_pieces_jointes", value=False) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez que Noethys intègre les factures en temps que pièces jointes au bordereau" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.StringProperty( label=_(u"Format des noms de fichiers"), name="format_nom_fichier", value=_(u"F{NUM_FACTURE}_{NOM_TITULAIRES_MAJ}")) propriete.SetHelpString( _(u"Saisissez le format des noms de fichiers (en majuscules et sans espaces ni accents). Vous pouvez personnaliser ce libellé grâce aux mots-clés suivants : {NUM_FACTURE} {NOM_TITULAIRES} {NOM_TITULAIRES_MAJ}." )) self.Append(propriete) # Règlement automatique self.Append(wxpg.PropertyCategory(_(u"Règlement automatique"))) propriete = wxpg.BoolProperty(label=_(u"Régler automatiquement"), name="reglement_auto", value=False) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez que Noethys créé un règlement automatiquement pour les prélèvements" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.EnumProperty(label=_(u"Compte à créditer"), name="IDcompte") propriete.SetHelpString( _(u"Sélectionnez le compte bancaire à créditer dans le cadre du règlement automatique" )) propriete.SetEditor("EditeurComboBoxAvecBoutons") self.Append(propriete) self.MAJ_comptes() propriete = wxpg.EnumProperty(label=_(u"Mode de règlement"), name="IDmode") propriete.SetHelpString( _(u"Sélectionnez le mode de règlement à utiliser dans le cadre du règlement automatique" )) propriete.SetEditor("EditeurComboBoxAvecBoutons") self.Append(propriete) self.MAJ_modes() # Préférences self.SetPropertyValue( "inclure_pieces_jointes", UTILS_Parametres.Parametres(mode="get", categorie="export_pes", nom="inclure_pieces_jointes", valeur=False))
def Remplissage(self): # Catégorie self.Append(wxpg.PropertyCategory(_(u"Tests"))) # CTRL Heure propriete = wxpg.StringProperty(label=_(u"Heure"), name="heure") propriete.SetHelpString(_(u"Sélectionnez une heure")) propriete.SetEditor("EditeurHeure") self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Mémorisation"))) # Mémorisation des paramètres propriete = wxpg.EnumProperty(label=_(u"Mémoriser les paramètres"), name="memoriser_parametres", labels=[ _(u"Non"), _(u"Uniquement sur cet ordinateur"), _(u"Pour tous les ordinateurs") ], values=[0, 1, 3], value=3) propriete.SetHelpString(_(u"Mémoriser les paramètres")) self.Append(propriete) # Répertoire de sauvegarde propriete = wxpg.DirProperty(label=_(u"Répertoire pour copie unique"), name="repertoire_copie", value="") propriete.SetHelpString( _(u"Enregistrer une copie unique de chaque document dans le répertoire sélectionné" )) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Eléments à afficher"))) # Afficher les coupons-réponse propriete = wxpg.BoolProperty(label=_(u"Afficher le coupon-réponse"), name="coupon_reponse", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher un coupon-réponse dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher les messages propriete = wxpg.BoolProperty(label=_(u"Afficher les messages"), name="messages", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher les messages dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher le rappel des impayés propriete = wxpg.BoolProperty( label=_(u"Afficher le rappel des impayés"), name="impayes", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher le rappel des impayés dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher les codes-barres propriete = wxpg.BoolProperty(label=_(u"Afficher les codes-barres"), name="codes_barres", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher les codes-barres dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher les avis de prélèvements propriete = wxpg.BoolProperty( label=_(u"Afficher les avis de prélèvements"), name="avis_prelevements", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher les avis de prélèvements dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Titre"))) # Afficher le titre propriete = wxpg.BoolProperty(label=_(u"Afficher le titre"), name="afficher_titre", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher le titre du le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.StringProperty(label=_(u"Titre du document"), name="titre_document", value=_(u"Facture")) propriete.SetHelpString( _(u"Saisissez le titre du document (Par défaut 'Facture')")) self.Append(propriete) propriete = wxpg.IntProperty(label=_(u"Taille de texte du titre"), name="taille_texte_titre", value=19) propriete.SetHelpString( _(u"Saisissez la taille de texte du titre (29 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_titre", "SpinCtrl") propriete = wxpg.BoolProperty( label=_(u"Afficher la période de facturation"), name="afficher_periode", value=True) propriete.SetHelpString( _(u"Cochez cette case si vous souhaitez afficher la période de facturation dans le document" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) propriete = wxpg.IntProperty( label=_(u"Taille de texte de la période"), name="taille_texte_periode", value=8) propriete.SetHelpString( _(u"Saisissez la taille de texte de la période (8 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_periode", "SpinCtrl") # Catégorie self.Append(wxpg.PropertyCategory(_(u"Tableau des prestations"))) # Affichage condensé ou détaillé propriete = wxpg.EnumProperty( label=_(u"Affichage des prestations"), name="affichage_prestations", labels=[_(u"Détaillé"), _(u"Condensé")], values=[0, 1], value=0) propriete.SetHelpString(_(u"Sélectionnez un type d'affichage")) self.Append(propriete) # Intitulés des prestations labels = [ _(u"Intitulé original"), _(u"Intitulé original + état 'Absence injustifiée'"), _(u"Nom du tarif"), _(u"Nom de l'activité") ] propriete = wxpg.EnumProperty(label=_(u"Intitulés des prestations"), name="intitules", labels=labels, values=[0, 1, 2, 3], value=0) propriete.SetHelpString( _(u"Sélectionnez le type d'intitulé à afficher pour les prestations" )) self.Append(propriete) # Couleur 1 propriete = wxpg.ColourProperty(label=_(u"Couleur de fond 1"), name="couleur_fond_1", value=wx.Colour(255, 0, 0)) propriete.SetHelpString(_(u"Sélectionnez la couleur 1")) self.Append(propriete) # Couleur 2 propriete = wxpg.ColourProperty(label=_(u"Couleur de fond 2"), name="couleur_fond_2", value=wx.Colour(255, 0, 0)) propriete.SetHelpString(_(u"Sélectionnez la couleur 2")) self.Append(propriete) # Largeur colonne Date propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Date (ou Qté)"), name="largeur_colonne_date", value=50) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Date (50 par défaut)")) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_date", "SpinCtrl") # Largeur colonne Montant HT propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Montant HT"), name="largeur_colonne_montant_ht", value=50) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Montant HT (50 par défaut)" )) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_montant_ht", "SpinCtrl") # Largeur colonne Montant TVA propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Montant TVA"), name="largeur_colonne_montant_tva", value=50) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Montant TVA (50 par défaut)" )) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_montant_tva", "SpinCtrl") # Largeur colonne Montant TTC propriete = wxpg.IntProperty( label=_(u"Largeur de la colonne Montant TTC"), name="largeur_colonne_montant_ttc", value=70) propriete.SetHelpString( _(u"Saisissez la largeur de la colonne Montant TTC (70 par défaut)" )) self.Append(propriete) self.SetPropertyEditor("largeur_colonne_montant_ttc", "SpinCtrl") # Taille de texte du nom de l'individu propriete = wxpg.IntProperty(label=_(u"Taille de texte de l'individu"), name="taille_texte_individu", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte de l'individu (9 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_individu", "SpinCtrl") # Taille de texte du nom de l'activité propriete = wxpg.IntProperty( label=_(u"Taille de texte de l'activité"), name="taille_texte_activite", value=6) propriete.SetHelpString( _(u"Saisissez la taille de texte de l'activité (6 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_activite", "SpinCtrl") # Taille de texte des noms de colonnes propriete = wxpg.IntProperty( label=_(u"Taille de texte des noms de colonnes"), name="taille_texte_noms_colonnes", value=5) propriete.SetHelpString( _(u"Saisissez la taille de texte des noms de colonnes (5 par défaut)" )) self.Append(propriete) self.SetPropertyEditor("taille_texte_noms_colonnes", "SpinCtrl") # Taille de texte des prestations propriete = wxpg.IntProperty( label=_(u"Taille de texte de des prestations"), name="taille_texte_prestation", value=7) propriete.SetHelpString( _(u"Saisissez la taille de texte des prestations (7 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_prestation", "SpinCtrl") # Catégorie self.Append(wxpg.PropertyCategory(_(u"Autres textes"))) propriete = wxpg.LongStringProperty(label=_(u"Texte d'introduction"), name="texte_introduction", value=u"") propriete.SetHelpString( _(u"Saisissez un texte d'introduction (Aucun par défaut)")) self.Append(propriete) propriete = wxpg.IntProperty( label=_(u"Taille de texte d'introduction"), name="taille_texte_introduction", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte d'introduction (9 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_introduction", "SpinCtrl") propriete = wxpg.LongStringProperty(label=_(u"Texte de conclusion"), name="texte_conclusion", value=u"") propriete.SetHelpString( _(u"Saisissez un texte de conclusion (Aucun par défaut)")) self.Append(propriete) propriete = wxpg.IntProperty(label=_(u"Taille de texte de conclusion"), name="taille_texte_conclusion", value=9) propriete.SetHelpString( _(u"Saisissez la taille de texte de conclusion (9 par défaut)")) self.Append(propriete) self.SetPropertyEditor("taille_texte_conclusion", "SpinCtrl")
def test_propgridprops07(self): pg.PG_PROP_USE_CHECKBOX pg.PG_PROP_USE_DCC p = pg.BoolProperty()
def Remplissage(self): # Catégorie self.Append(wxpg.PropertyCategory(_(u"Page"))) # Orientation page propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Orientation de la page"), name="orientation", liste_choix=[("automatique", _(u"Automatique")), ("portrait", _(u"Portrait")), ("paysage", _(u"Paysage"))], valeur="automatique") propriete.SetEditor("EditeurChoix") propriete.SetHelpString(_(u"Sélectionnez l'orientation de la page")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Lignes"))) # Tri liste_choix = [("nom", _(u"Nom")), ("prenom", _(u"Prénom")), ("age", _(u"Âge"))] propriete = CTRL_Propertygrid.Propriete_choix(label=_(u"Tri"), name="tri", liste_choix=liste_choix, valeur="nom") propriete.SetEditor("EditeurChoix") propriete.SetHelpString(_(u"Sélectionnez le tri")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Ordre liste_choix = [("croissant", _(u"Croissant")), ("decroissant", _(u"Décroissant"))] propriete = CTRL_Propertygrid.Propriete_choix(label=_(u"Ordre"), name="ordre", liste_choix=liste_choix, valeur="croissant") propriete.SetEditor("EditeurChoix") propriete.SetHelpString(_(u"Sélectionnez l'ordre")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Afficher lignes vierges propriete = wxpg.IntProperty(label=_(u"Lignes vierges"), name="nbre_lignes_vierges", value=3) propriete.SetEditor("SpinCtrl") propriete.SetHelpString( _(u"Nombre de lignes vierges à afficher en fin de liste")) propriete.SetAttribute("obligatoire", True) propriete.SetAttribute("Min", 0) self.Append(propriete) # Afficher tous les inscrits propriete = wxpg.BoolProperty(label=_(u"Afficher tous les inscrits"), name="afficher_inscrits", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher tous les inscrits")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Hauteur ligne individu liste_choix = [ ("automatique", _(u"Automatique")), ] for x in range(5, 205, 5): liste_choix.append((str(x), "%d pixels" % x)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Hauteur de la ligne Individu"), name="hauteur_ligne_individu", liste_choix=liste_choix, valeur="automatique") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez la hauteur de la ligne de l'individu (en pixels)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur du fond de titre propriete = wxpg.ColourProperty(label=_(u"Couleur ligne de titre"), name="couleur_fond_titre", value=wx.Colour(208, 208, 208)) propriete.SetHelpString( _(u"Sélectionnez la couleur de fond de la ligne de titre")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur du fond d'entête de colonne propriete = wxpg.ColourProperty(label=_(u"Couleur ligne des entêtes"), name="couleur_fond_entetes", value=wx.Colour(240, 240, 240)) propriete.SetHelpString( _(u"Sélectionnez la couleur de fond de la ligne des entêtes")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Couleur du fond de total propriete = wxpg.ColourProperty(label=_(u"Couleur ligne de total"), name="couleur_fond_total", value=wx.Colour(208, 208, 208)) propriete.SetHelpString( _(u"Sélectionnez la couleur de fond de la ligne de total")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Taille nom activité propriete = wxpg.IntProperty( label=_(u"Taille de police du nom d'activité"), name="activite_taille_nom", value=5) propriete.SetEditor("SpinCtrl") propriete.SetHelpString(_(u"Taille de police du nom d'activité")) propriete.SetAttribute("obligatoire", True) propriete.SetAttribute("Min", 0) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Colonne Photo"))) # Afficher les photos liste_choix = [("non", _(u"Non")), ("petite", _(u"Petite taille")), ("moyenne", _(u"Moyenne taille")), ("grande", _(u"Grande taille"))] propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Afficher les photos"), name="afficher_photos", liste_choix=liste_choix, valeur="non") propriete.SetEditor("EditeurChoix") propriete.SetHelpString(_(u"Afficher les photos individuelles")) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Colonne Individu"))) # Largeur colonne nom liste_choix = [ ("automatique", _(u"Automatique")), ] for x in range(5, 305, 5): liste_choix.append((str(x), "%d pixels" % x)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Largeur de la colonne"), name="largeur_colonne_nom", liste_choix=liste_choix, valeur="automatique") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez la largeur de la colonne Nom de l'individu (en pixels)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Colonne Âge"))) # Afficher l'âge des individus propriete = wxpg.BoolProperty(label=_(u"Afficher la colonne"), name="afficher_age", value=True) propriete.SetHelpString( _(u"Cochez cette case pour afficher de la colonne de l'âge des individus" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Largeur colonne âge liste_choix = [ ("automatique", _(u"Automatique")), ] for x in range(5, 305, 5): liste_choix.append((str(x), "%d pixels" % x)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Largeur de la colonne"), name="largeur_colonne_age", liste_choix=liste_choix, valeur="automatique") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez la largeur de la colonne Âge de l'individu (en pixels)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Colonnes des unités"))) # Afficher les évènements propriete = wxpg.BoolProperty(label=_(u"Afficher les évènements"), name="afficher_evenements", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher les évènements")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher les étiquettes propriete = wxpg.BoolProperty(label=_(u"Afficher les étiquettes"), name="afficher_etiquettes", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher les étiquettes")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Masquer les consommations propriete = wxpg.BoolProperty(label=_(u"Masquer les consommations"), name="masquer_consommations", value=False) propriete.SetHelpString( _(u"Cochez cette case pour masquer les consommations")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Largeur colonne unités liste_choix = [ ("automatique", _(u"Automatique")), ] for x in range(5, 105, 5): liste_choix.append((str(x), "%d pixels" % x)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Largeur de la colonne"), name="largeur_colonne_unite", liste_choix=liste_choix, valeur="automatique") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez la largeur de chaque colonne unité (en pixels)") ) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Colonnes personnalisées"))) # Largeur colonne unités liste_choix = [] for x in range(5, 105, 5): liste_choix.append((str(x), "%d pixels" % x)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Largeur par défaut des colonnes"), name="largeur_colonne_perso", liste_choix=liste_choix, valeur="40") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez la largeur par défaut de toutes les colonnes personnalisées (en pixels)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete) # Catégorie self.Append(wxpg.PropertyCategory(_(u"Colonne Informations"))) # Afficher les informations propriete = wxpg.BoolProperty(label=_(u"Afficher la colonne"), name="afficher_informations", value=True) propriete.SetHelpString( _(u"Cochez cette case pour afficher la colonne Informations")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Masquer les informations propriete = wxpg.BoolProperty(label=_(u"Masquer les informations"), name="masquer_informations", value=False) propriete.SetHelpString( _(u"Cochez cette case pour masquer le contenu de la colonne Informations" )) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher les cotisations manquantes propriete = wxpg.BoolProperty( label=_(u"Afficher les cotisations manquantes"), name="afficher_cotisations_manquantes", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher les cotisations manquantes")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Afficher les pièces manquantes propriete = wxpg.BoolProperty( label=_(u"Afficher les pièces manquantes"), name="afficher_pieces_manquantes", value=False) propriete.SetHelpString( _(u"Cochez cette case pour afficher les pièces manquantes")) propriete.SetAttribute("UseCheckbox", True) self.Append(propriete) # Largeur colonne informations liste_choix = [ ("automatique", _(u"Automatique")), ] for x in range(5, 505, 5): liste_choix.append((str(x), "%d pixels" % x)) propriete = CTRL_Propertygrid.Propriete_choix( label=_(u"Largeur de la colonne"), name="largeur_colonne_informations", liste_choix=liste_choix, valeur="automatique") propriete.SetEditor("EditeurChoix") propriete.SetHelpString( _(u"Sélectionnez la largeur de la colonne Informations (en pixels)" )) propriete.SetAttribute("obligatoire", True) self.Append(propriete)