* src/plugins/DescendChart.py: include blank pages option
* src/plugins/AncestorChart2.py: include blank pages option svn: r8184
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2007-02-19 Brian Matherly <brian@gramps-project.org>
|
||||||
|
* src/plugins/DescendChart.py: include blank pages option
|
||||||
|
* src/plugins/AncestorChart2.py: include blank pages option
|
||||||
|
|
||||||
2007-02-19 Don Allingham <don@gramps-project.org>
|
2007-02-19 Don Allingham <don@gramps-project.org>
|
||||||
* src/Editors/_EditPlace.py: note list support
|
* src/Editors/_EditPlace.py: note list support
|
||||||
* src/Editors/_EditAddress.py: note list support
|
* src/Editors/_EditAddress.py: note list support
|
||||||
|
|||||||
@@ -111,11 +111,8 @@ class GenChart:
|
|||||||
return (x,y)
|
return (x,y)
|
||||||
|
|
||||||
def get(self,index):
|
def get(self,index):
|
||||||
try:
|
|
||||||
(x,y) = self.index_to_xy(index)
|
(x,y) = self.index_to_xy(index)
|
||||||
return self.array[y][x]
|
return self.get_xy(x,y)
|
||||||
except:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def get_xy(self,x,y):
|
def get_xy(self,x,y):
|
||||||
value = 0
|
value = 0
|
||||||
@@ -130,7 +127,7 @@ class GenChart:
|
|||||||
self.array[y][x] = value
|
self.array[y][x] = value
|
||||||
|
|
||||||
def dimensions(self):
|
def dimensions(self):
|
||||||
return (max(self.array.keys()),self.max_x+1)
|
return (max(self.array.keys())+1,self.max_x+1)
|
||||||
|
|
||||||
def compress(self):
|
def compress(self):
|
||||||
new_map = {}
|
new_map = {}
|
||||||
@@ -183,6 +180,7 @@ class AncestorChart(Report):
|
|||||||
pagebbg - Whether to include page breaks between generations.
|
pagebbg - Whether to include page breaks between generations.
|
||||||
dispf - Display format for the output box.
|
dispf - Display format for the output box.
|
||||||
singlep - Whether to scale to fit on a single page.
|
singlep - Whether to scale to fit on a single page.
|
||||||
|
indblank - Whether to include blank pages.
|
||||||
compress - Whether to compress chart.
|
compress - Whether to compress chart.
|
||||||
"""
|
"""
|
||||||
Report.__init__(self,database,person,options_class)
|
Report.__init__(self,database,person,options_class)
|
||||||
@@ -191,6 +189,7 @@ class AncestorChart(Report):
|
|||||||
= options_class.get_report_generations()
|
= options_class.get_report_generations()
|
||||||
self.display = options_class.handler.options_dict['dispf']
|
self.display = options_class.handler.options_dict['dispf']
|
||||||
self.force_fit = options_class.handler.options_dict['singlep']
|
self.force_fit = options_class.handler.options_dict['singlep']
|
||||||
|
self.incblank = options_class.handler.options_dict['incblank']
|
||||||
self.compress = options_class.handler.options_dict['compress']
|
self.compress = options_class.handler.options_dict['compress']
|
||||||
|
|
||||||
name = NameDisplay.displayer.display_formal(person)
|
name = NameDisplay.displayer.display_formal(person)
|
||||||
@@ -349,6 +348,16 @@ class AncestorChart(Report):
|
|||||||
|
|
||||||
def print_page(self,startx,stopx,starty,stopy,colx,coly):
|
def print_page(self,startx,stopx,starty,stopy,colx,coly):
|
||||||
|
|
||||||
|
if not self.incblank:
|
||||||
|
blank = True
|
||||||
|
for y in range(starty,stopy):
|
||||||
|
for x in range(startx,stopx):
|
||||||
|
if self.genchart.get_xy(x,y) != 0:
|
||||||
|
blank = False
|
||||||
|
break
|
||||||
|
if not blank: break
|
||||||
|
if blank: return
|
||||||
|
|
||||||
self.doc.start_page()
|
self.doc.start_page()
|
||||||
if self.title and self.force_fit:
|
if self.title and self.force_fit:
|
||||||
self.doc.center_text('AC2-title',self.title,self.doc.get_usable_width()/2,0)
|
self.doc.center_text('AC2-title',self.title,self.doc.get_usable_width()/2,0)
|
||||||
@@ -434,12 +443,16 @@ class AncestorChartOptions(ReportOptions):
|
|||||||
# Options specific for this report
|
# Options specific for this report
|
||||||
self.options_dict = {
|
self.options_dict = {
|
||||||
'singlep' : 1,
|
'singlep' : 1,
|
||||||
|
'incblank' : 1,
|
||||||
'compress' : 1,
|
'compress' : 1,
|
||||||
}
|
}
|
||||||
self.options_help = {
|
self.options_help = {
|
||||||
'singlep' : ("=0/1","Whether to scale to fit on a single page.",
|
'singlep' : ("=0/1","Whether to scale to fit on a single page.",
|
||||||
["Do not scale to fit","Scale to fit"],
|
["Do not scale to fit","Scale to fit"],
|
||||||
True),
|
True),
|
||||||
|
'incblank' : ("=0/1","Whether to include pages that are blank.",
|
||||||
|
["Do not include blank pages","Include blank pages"],
|
||||||
|
True),
|
||||||
'compress' : ("=0/1","Whether to compress chart.",
|
'compress' : ("=0/1","Whether to compress chart.",
|
||||||
["Do not compress chart","Compress chart"],
|
["Do not compress chart","Compress chart"],
|
||||||
True),
|
True),
|
||||||
@@ -469,6 +482,10 @@ class AncestorChartOptions(ReportOptions):
|
|||||||
self.scale.set_active(self.options_dict['singlep'])
|
self.scale.set_active(self.options_dict['singlep'])
|
||||||
dialog.add_option('',self.scale)
|
dialog.add_option('',self.scale)
|
||||||
|
|
||||||
|
self.blank = gtk.CheckButton(_('Include Blank Pages'))
|
||||||
|
self.blank.set_active(self.options_dict['incblank'])
|
||||||
|
dialog.add_option('',self.blank)
|
||||||
|
|
||||||
self.compress = gtk.CheckButton(_('Co_mpress chart'))
|
self.compress = gtk.CheckButton(_('Co_mpress chart'))
|
||||||
self.compress.set_active(self.options_dict['compress'])
|
self.compress.set_active(self.options_dict['compress'])
|
||||||
dialog.add_option('',self.compress)
|
dialog.add_option('',self.compress)
|
||||||
@@ -478,6 +495,7 @@ class AncestorChartOptions(ReportOptions):
|
|||||||
Parses the custom options that we have added.
|
Parses the custom options that we have added.
|
||||||
"""
|
"""
|
||||||
self.options_dict['singlep'] = int(self.scale.get_active ())
|
self.options_dict['singlep'] = int(self.scale.get_active ())
|
||||||
|
self.options_dict['incblank'] = int(self.blank.get_active())
|
||||||
self.options_dict['compress'] = int(self.compress.get_active ())
|
self.options_dict['compress'] = int(self.compress.get_active ())
|
||||||
|
|
||||||
def make_default_style(self,default_style):
|
def make_default_style(self,default_style):
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class DescendChart(Report):
|
|||||||
= options_class.get_report_generations()
|
= options_class.get_report_generations()
|
||||||
self.display = options_class.handler.options_dict['dispf']
|
self.display = options_class.handler.options_dict['dispf']
|
||||||
self.force_fit = options_class.handler.options_dict['singlep']
|
self.force_fit = options_class.handler.options_dict['singlep']
|
||||||
|
self.incblank = options_class.handler.options_dict['incblank']
|
||||||
self.max_gen = options_class.handler.options_dict['maxgen']
|
self.max_gen = options_class.handler.options_dict['maxgen']
|
||||||
|
|
||||||
name = NameDisplay.displayer.display_formal(person)
|
name = NameDisplay.displayer.display_formal(person)
|
||||||
@@ -325,6 +326,16 @@ class DescendChart(Report):
|
|||||||
|
|
||||||
def print_page(self,startx,stopx,starty,stopy,colx,coly):
|
def print_page(self,startx,stopx,starty,stopy,colx,coly):
|
||||||
|
|
||||||
|
if not self.incblank:
|
||||||
|
blank = True
|
||||||
|
for y in range(starty,stopy):
|
||||||
|
for x in range(startx,stopx):
|
||||||
|
if self.genchart.get_xy(x,y) != 0:
|
||||||
|
blank = False
|
||||||
|
break
|
||||||
|
if not blank: break
|
||||||
|
if blank: return
|
||||||
|
|
||||||
self.doc.start_page()
|
self.doc.start_page()
|
||||||
if self.title and self.force_fit:
|
if self.title and self.force_fit:
|
||||||
self.doc.center_text('DC2-title',self.title,self.doc.get_usable_width()/2,0)
|
self.doc.center_text('DC2-title',self.title,self.doc.get_usable_width()/2,0)
|
||||||
@@ -358,7 +369,6 @@ class DescendChart(Report):
|
|||||||
self.doc.draw_line('DC2-line', xlast, ystart, xlast, ystop)
|
self.doc.draw_line('DC2-line', xlast, ystart, xlast, ystop)
|
||||||
self.doc.draw_line('DC2-line', xlast, ystop, xnext, ystop)
|
self.doc.draw_line('DC2-line', xlast, ystop, xnext, ystop)
|
||||||
|
|
||||||
|
|
||||||
if x%2:
|
if x%2:
|
||||||
phys_x +=1
|
phys_x +=1
|
||||||
phys_y += 1
|
phys_y += 1
|
||||||
@@ -389,11 +399,15 @@ class DescendChartOptions(ReportOptions):
|
|||||||
self.options_dict = {
|
self.options_dict = {
|
||||||
'singlep' : 1,
|
'singlep' : 1,
|
||||||
'maxgen' : 32,
|
'maxgen' : 32,
|
||||||
|
'incblank' : 1,
|
||||||
}
|
}
|
||||||
self.options_help = {
|
self.options_help = {
|
||||||
'singlep' : ("=0/1","Whether to scale to fit on a single page.",
|
'singlep' : ("=0/1","Whether to scale to fit on a single page.",
|
||||||
["Do not scale to fit","Scale to fit"],
|
["Do not scale to fit","Scale to fit"],
|
||||||
True),
|
True),
|
||||||
|
'incblank' : ("=0/1","Whether to include pages that are blank.",
|
||||||
|
["Do not include blank pages","Include blank pages"],
|
||||||
|
True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def enable_options(self):
|
def enable_options(self):
|
||||||
@@ -418,6 +432,10 @@ class DescendChartOptions(ReportOptions):
|
|||||||
self.scale.set_active(self.options_dict['singlep'])
|
self.scale.set_active(self.options_dict['singlep'])
|
||||||
dialog.add_option('',self.scale)
|
dialog.add_option('',self.scale)
|
||||||
|
|
||||||
|
self.blank = gtk.CheckButton(_('Include Blank Pages'))
|
||||||
|
self.blank.set_active(self.options_dict['incblank'])
|
||||||
|
dialog.add_option('',self.blank)
|
||||||
|
|
||||||
self.max_gen = gtk.SpinButton(gtk.Adjustment(1,1,100,1))
|
self.max_gen = gtk.SpinButton(gtk.Adjustment(1,1,100,1))
|
||||||
self.max_gen.set_value(self.options_dict['maxgen'])
|
self.max_gen.set_value(self.options_dict['maxgen'])
|
||||||
dialog.add_option(_('Generations'),self.max_gen)
|
dialog.add_option(_('Generations'),self.max_gen)
|
||||||
@@ -428,6 +446,7 @@ class DescendChartOptions(ReportOptions):
|
|||||||
Parses the custom options that we have added.
|
Parses the custom options that we have added.
|
||||||
"""
|
"""
|
||||||
self.options_dict['singlep'] = int(self.scale.get_active ())
|
self.options_dict['singlep'] = int(self.scale.get_active ())
|
||||||
|
self.options_dict['incblank'] = int(self.blank.get_active())
|
||||||
self.options_dict['maxgen'] = int(self.max_gen.get_value_as_int())
|
self.options_dict['maxgen'] = int(self.max_gen.get_value_as_int())
|
||||||
|
|
||||||
def make_default_style(self,default_style):
|
def make_default_style(self,default_style):
|
||||||
|
|||||||
Reference in New Issue
Block a user