diff --git a/src/plugins/drawreport/ancestortree.py b/src/plugins/drawreport/ancestortree.py index ab655e38c..75a29d6f7 100644 --- a/src/plugins/drawreport/ancestortree.py +++ b/src/plugins/drawreport/ancestortree.py @@ -127,14 +127,14 @@ class FamilyBox(AncestorBoxBase): # Titles Class(es) # #------------------------------------------------------------------------ -class TitleN(TitleBox): +class TitleN(TitleNoDisplay): """No Title class for the report """ def __init__(self, doc): - TitleBox.__init__(self, doc, "None") + TitleNoDisplay.__init__(self, doc, "AC2-Title") def calc_title(self, center): """Calculate the title of the report""" - return + self.text = _("Ancestor Graph") class TitleA(TitleBox): """Title class for the report """ @@ -235,6 +235,9 @@ class MakeAncestorTree(object): myself.text = self.calc_items.calc_person( index, indi_handle, fams_handle) + myself.add_mark(self.database, + self.database.get_person_from_handle(indi_handle)) + self.canvas.add_box(myself) return myself diff --git a/src/plugins/drawreport/descendtree.py b/src/plugins/drawreport/descendtree.py index 32a4c72fb..548d5622f 100644 --- a/src/plugins/drawreport/descendtree.py +++ b/src/plugins/drawreport/descendtree.py @@ -200,15 +200,15 @@ class DescendantTitleBase(TitleBox): return parents -class TitleNone(TitleBox): +class TitleNone(TitleNoDisplay): """Family Chart Title class for the report """ def __init__(self, dbase, doc): - TitleBox.__init__(self, doc, "None") + TitleNoDisplay.__init__(self, doc, "CG2-Title") def calc_title(self, persons): """Calculate the title of the report""" - return + self.text = 'Descendant Graph' class TitleDPY(DescendantTitleBase): """Descendant (Person yes start with parents) Chart @@ -455,6 +455,9 @@ class RecurseDown: #calculate the text. myself.calc_text(self.database, indi_handle, fams_handle) + myself.add_mark(self.database, + self.database.get_person_from_handle(indi_handle)) + self.add_to_col(myself) self.canvas.add_box(myself) diff --git a/src/plugins/lib/libtreebase.py b/src/plugins/lib/libtreebase.py index 04c999c8b..d85411d00 100644 --- a/src/plugins/lib/libtreebase.py +++ b/src/plugins/lib/libtreebase.py @@ -573,6 +573,7 @@ class BoxBase(object): # (# - which column am I in (zero based) # ,# - Am I a (0)direct descendant/ancestor or (>0)other # , ) - anything else the report needs to run + self.__mark = None #Database person object self.level = (0,0) self.x_cm = 0.0 self.y_cm = 0.0 @@ -587,6 +588,9 @@ class BoxBase(object): self.width *= scale_amount self.height *= scale_amount + def add_mark(self, database, person): + self.__mark = ReportUtils.get_person_mark(database, person) + def display(self): """ display the box accounting for page x, y offsets Ignore any box with 'None' is boxstr """ @@ -602,7 +606,7 @@ class BoxBase(object): doc.draw_box(self.boxstr, text, xbegin, ybegin, - self.width, self.height) + self.width, self.height, self.__mark) #I am responsible for my own lines. Do them here. if self.line_to: @@ -614,7 +618,28 @@ class BoxBase(object): yme = ybegin + self.height/2 doc.draw_line(report_opts.line_str, 0, yme, xbegin, yme) +class TitleNoDisplay(BoxBase): + """ + Holds information about the Title that will print on a TOC + and NOT on the report + """ + def __init__(self, doc, boxstr): + """ initialize the title box """ + BoxBase.__init__(self) + self.doc = doc + self.boxstr = boxstr + + def set_box_height_width(self): + self.width = self.height = 0 + def display(self): + """ display the title box. """ + #Set up the Table of Contents here + + from gen.plug.docgen import (IndexMark, INDEX_TYPE_TOC) # interim, here + mark = IndexMark(self.text, INDEX_TYPE_TOC, 1) + + self.doc.center_text(self.boxstr, '', 0, -100, mark) class TitleBox(BoxBase): """ @@ -649,9 +674,14 @@ class TitleBox(BoxBase): """ display the title box. """ if self.page.y_page_num or self.boxstr == "None": return + + #Set up the Table of Contents here + from gen.plug.docgen import (IndexMark, INDEX_TYPE_TOC) # interim, here + mark = IndexMark(self.text, INDEX_TYPE_TOC, 1) + if self.text: self.doc.center_text(self.boxstr, self.text, - self.width/2, self.y_cm) + self.width/2, self.y_cm, mark) class PageNumberBox(BoxBase): """