enable a report graphic style object to have a "description"

This commit is contained in:
Paul Franklin 2017-03-18 22:30:23 -07:00
parent ef3f1718b6
commit 7d907c5d63
2 changed files with 17 additions and 1 deletions

View File

@ -95,6 +95,7 @@ class GraphicsStyle:
self.fill_color = obj.fill_color self.fill_color = obj.fill_color
self.lwidth = obj.lwidth self.lwidth = obj.lwidth
self.lstyle = obj.lstyle self.lstyle = obj.lstyle
self.description = obj.description
else: else:
self.para_name = "" self.para_name = ""
self.shadow = 0 self.shadow = 0
@ -103,6 +104,19 @@ class GraphicsStyle:
self.color = (0, 0, 0) self.color = (0, 0, 0)
self.fill_color = (255, 255, 255) self.fill_color = (255, 255, 255)
self.lstyle = SOLID self.lstyle = SOLID
self.description = ""
def set_description(self, text):
"""
Set the desciption of the graphics object
"""
self.description = text
def get_description(self):
"""
Return the desciption of the graphics object
"""
return self.description
def set_line_width(self, val): def set_line_width(self, val):
""" """

View File

@ -336,7 +336,9 @@ class StyleEditor(ManagedWindow):
self.pname.set_text( '<span size="larger" weight="bold">%s</span>' % self.pname.set_text( '<span size="larger" weight="bold">%s</span>' %
self.current_name) self.current_name)
self.pname.set_use_markup(True) self.pname.set_use_markup(True)
self.pdescription.set_text(_("No description available") )
descr = g.get_description()
self.pdescription.set_text(descr or _("No description available"))
self.top.get_object("line_style").set_active(g.get_line_style()) self.top.get_object("line_style").set_active(g.get_line_style())
self.top.get_object("line_width").set_value(g.get_line_width()) self.top.get_object("line_width").set_value(g.get_line_width())