* src/WriteGedcom.py (get_option_box): Make filters inclusive.

* src/plugins/merge.glade: Switch button order to comply with HIG.
* src/mergedata.glade: Switch button order to comply with HIG.
* src/plugins/RelGraph.py (get_default_basename): Add function.
* src/plugins/AncestorReport.py (write_report): Translate
string properly.
* src/EventEdit.py (update_event): Use transtable.
* src/EditPerson.py (on_event_add_clicked, on_edit_birth_clicked,
on_edit_death_clicked, on_event_update_clicked):
Pass TransTable to the event editor.
* src/Marriage.py (on_add_clicked, on_event_update_clicked):
Pass TransTable to the event editor.
* src/plugins/FtmStyleAncestors.py,
src/plugins/FtmStyleDescendants.py:
Remove extra space between vars in "%(.*_place)s %(.*_notes)s"
* src/plugins/verify.glade: Translate button label.
* src/plugins/IndivSummary.py: Proper handling of translation.
* src/docgen/OpenOfficeDoc.py (pt2cm): Add function;
(draw_text): Convert points to cm for the box width;
 Use self.string_width() method.
* src/BaseDoc.py (string_width): Add a method to compute width.
* src/docgen/LPRDoc.py (string_width): Override method.
* src/docgen/PdfDoc.py: Use self.string_width() method.
* src/docgen/SvgDrawDoc.py: Use self.string_width() method.
* src/plugins/AncestorChart2.py: Use self.doc.string_width() method.
* src/plugins/AncestorChart.py: Use self.doc.string_width() method.
* src/plugins/DesGraph.py: Use self.doc.string_width() method.
* src/plugins/FanChart.py: Use self.doc.string_width() method.
* src/plugins/TimeLine.py: Use self.doc.string_width() method.
* src/plugins/eval.glade: HIG compliance.


svn: r3453
This commit is contained in:
Alex Roitman
2004-08-20 21:26:51 +00:00
parent 0dd92d0a5c
commit fe4427adf8
24 changed files with 135 additions and 82 deletions

View File

@@ -550,6 +550,10 @@ class LPRDoc(BaseDoc.BaseDoc):
#
#------------------------------------------------------------------------
def string_width(self,fontstyle,text):
"Override generic Fontscale-based width."
return get_text_width(text,fontstyle)
def line_break(self):
"Forces a line break within a paragraph."
# Add previously held text to the paragraph,

View File

@@ -876,7 +876,7 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
if box_style.get_width():
sw = box_style.get_width()
else:
sw = FontScale.string_width(font,text)*1.3
sw = pt2cm(FontScale.string_width(font,text))*1.3
self.f.write('<draw:text-box draw:style-name="%s" ' % style)
@@ -963,6 +963,14 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
self.f.write('</text:p>\n')
self.f.write('</draw:text-box>\n')
#------------------------------------------------------------------------
#
# point to centimeter convertion
#
#------------------------------------------------------------------------
def pt2cm(val):
return (float(val)/28.3465)
#--------------------------------------------------------------------------
#
# Register plugins

View File

@@ -29,7 +29,6 @@ import BaseDoc
import Plugins
import Errors
import ImgManip
import FontScale
import GrampsMime
from gettext import gettext as _
@@ -454,7 +453,7 @@ class PdfDoc(BaseDoc.BaseDoc):
fc = make_color(font.get_color())
fnt = self.pdf_set_font(font)
if p.get_alignment() == BaseDoc.PARA_ALIGN_CENTER:
twidth = ((FontScale.string_width(font,enc(text)))/2.0)*cm
twidth = ((self.string_width(font,enc(text)))/2.0)*cm
xcm = (stype.get_width() - x) - twidth
else:
xcm = x * cm

View File

@@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
# Copyright (C) 2000-2004 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#-------------------------------------------------------------------------
#
# python modules
@@ -35,7 +37,6 @@ import Plugins
from gettext import gettext as _
import BaseDoc
import Errors
import FontScale
#-------------------------------------------------------------------------
#
@@ -91,14 +92,14 @@ class SvgDrawDoc(BaseDoc.BaseDoc):
width = 0
for line in text:
width = max(width,FontScale.string_width(font,line))
width = max(width,self.string_width(font,line))
# rangle = -((pi/180.0) * angle)
centerx,centery = units((x+self.lmargin,y+self.tmargin))
yh = 0
for line in text:
xw = FontScale.string_width(font,line)
xw = self.string_width(font,line)
xpos = (centerx - (xw/2.0))
ypos = (centery)