* src/plugins/DescendChart.py: include blank pages option
* src/plugins/AncestorChart2.py: include blank pages option svn: r8184
This commit is contained in:
parent
a0d4ea5ab8
commit
0a2d871480
@ -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>
|
||||
* src/Editors/_EditPlace.py: note list support
|
||||
* src/Editors/_EditAddress.py: note list support
|
||||
|
@ -111,11 +111,8 @@ class GenChart:
|
||||
return (x,y)
|
||||
|
||||
def get(self,index):
|
||||
try:
|
||||
(x,y) = self.index_to_xy(index)
|
||||
return self.array[y][x]
|
||||
except:
|
||||
return None
|
||||
(x,y) = self.index_to_xy(index)
|
||||
return self.get_xy(x,y)
|
||||
|
||||
def get_xy(self,x,y):
|
||||
value = 0
|
||||
@ -130,7 +127,7 @@ class GenChart:
|
||||
self.array[y][x] = value
|
||||
|
||||
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):
|
||||
new_map = {}
|
||||
@ -183,6 +180,7 @@ class AncestorChart(Report):
|
||||
pagebbg - Whether to include page breaks between generations.
|
||||
dispf - Display format for the output box.
|
||||
singlep - Whether to scale to fit on a single page.
|
||||
indblank - Whether to include blank pages.
|
||||
compress - Whether to compress chart.
|
||||
"""
|
||||
Report.__init__(self,database,person,options_class)
|
||||
@ -191,6 +189,7 @@ class AncestorChart(Report):
|
||||
= options_class.get_report_generations()
|
||||
self.display = options_class.handler.options_dict['dispf']
|
||||
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']
|
||||
|
||||
name = NameDisplay.displayer.display_formal(person)
|
||||
@ -348,6 +347,16 @@ class AncestorChart(Report):
|
||||
self.doc.add_draw_style("AC2-line",g)
|
||||
|
||||
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()
|
||||
if self.title and self.force_fit:
|
||||
@ -415,7 +424,7 @@ class AncestorChart(Report):
|
||||
self.genchart.set_xy(px-1,py,3)
|
||||
for ty in range(y+1,py):
|
||||
self.genchart.set_xy(x,ty,2)
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -434,12 +443,16 @@ class AncestorChartOptions(ReportOptions):
|
||||
# Options specific for this report
|
||||
self.options_dict = {
|
||||
'singlep' : 1,
|
||||
'incblank' : 1,
|
||||
'compress' : 1,
|
||||
}
|
||||
self.options_help = {
|
||||
'singlep' : ("=0/1","Whether to scale to fit on a single page.",
|
||||
["Do not scale to fit","Scale to fit"],
|
||||
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.",
|
||||
["Do not compress chart","Compress chart"],
|
||||
True),
|
||||
@ -469,6 +482,10 @@ class AncestorChartOptions(ReportOptions):
|
||||
self.scale.set_active(self.options_dict['singlep'])
|
||||
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.set_active(self.options_dict['compress'])
|
||||
dialog.add_option('',self.compress)
|
||||
@ -478,6 +495,7 @@ class AncestorChartOptions(ReportOptions):
|
||||
Parses the custom options that we have added.
|
||||
"""
|
||||
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 ())
|
||||
|
||||
def make_default_style(self,default_style):
|
||||
|
@ -130,6 +130,7 @@ class DescendChart(Report):
|
||||
= options_class.get_report_generations()
|
||||
self.display = options_class.handler.options_dict['dispf']
|
||||
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']
|
||||
|
||||
name = NameDisplay.displayer.display_formal(person)
|
||||
@ -325,6 +326,16 @@ class DescendChart(Report):
|
||||
|
||||
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()
|
||||
if self.title and self.force_fit:
|
||||
self.doc.center_text('DC2-title',self.title,self.doc.get_usable_width()/2,0)
|
||||
@ -357,7 +368,6 @@ class DescendChart(Report):
|
||||
xnext = (phys_x+1)*self.delta
|
||||
self.doc.draw_line('DC2-line', xlast, ystart, xlast, ystop)
|
||||
self.doc.draw_line('DC2-line', xlast, ystop, xnext, ystop)
|
||||
|
||||
|
||||
if x%2:
|
||||
phys_x +=1
|
||||
@ -389,11 +399,15 @@ class DescendChartOptions(ReportOptions):
|
||||
self.options_dict = {
|
||||
'singlep' : 1,
|
||||
'maxgen' : 32,
|
||||
'incblank' : 1,
|
||||
}
|
||||
self.options_help = {
|
||||
'singlep' : ("=0/1","Whether to scale to fit on a single page.",
|
||||
["Do not scale to fit","Scale to fit"],
|
||||
True),
|
||||
'incblank' : ("=0/1","Whether to include pages that are blank.",
|
||||
["Do not include blank pages","Include blank pages"],
|
||||
True),
|
||||
}
|
||||
|
||||
def enable_options(self):
|
||||
@ -417,6 +431,10 @@ class DescendChartOptions(ReportOptions):
|
||||
self.scale = gtk.CheckButton(_('Sc_ale to fit on a single page'))
|
||||
self.scale.set_active(self.options_dict['singlep'])
|
||||
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.set_value(self.options_dict['maxgen'])
|
||||
@ -428,6 +446,7 @@ class DescendChartOptions(ReportOptions):
|
||||
Parses the custom options that we have added.
|
||||
"""
|
||||
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())
|
||||
|
||||
def make_default_style(self,default_style):
|
||||
|
Loading…
Reference in New Issue
Block a user