Tooltip addtion to report template

svn: r872
This commit is contained in:
Don Allingham 2002-03-29 01:55:52 +00:00
parent d5ae9743bd
commit be36b57a50
2 changed files with 13 additions and 12 deletions

View File

@ -324,7 +324,7 @@ class ReportDialog:
this task."""
pass
def add_option(self,label_text,widget):
def add_option(self,label_text,widget,tooltip=None):
"""Takes a text string and a Gtk Widget, and stores them to be
appended to the Options section of the dialog. The text string
is used to create a label for the passed widget. This allows the
@ -333,8 +333,10 @@ class ReportDialog:
extracting the final value before the report executes. This task
should only be called in the add_user_options task."""
self.widgets.append((label_text,widget))
if tooltip:
self.add_tooltip(widget,tooltip)
def add_frame_option(self,frame_name,label_text,widget):
def add_frame_option(self,frame_name,label_text,widget,tooltip=None):
"""Similar to add_option this method takes a frame_name, a
text string and a Gtk Widget. When the interface is built,
all widgets with the same frame_name are grouped into a
@ -349,7 +351,9 @@ class ReportDialog:
else:
self.frames[frame_name] = [(label_text,widget)]
self.frame_names.append(frame_name)
if tooltip:
self.add_tooltip(widget,tooltip)
#------------------------------------------------------------------------
#
# Functions to create a default output style.

View File

@ -170,21 +170,18 @@ class GraphVizDialog(ReportDialog):
menu.set_active(0)
self.arrowhead_optionmenu.set_menu(menu)
tip = GtkTooltips()
tip.set_tip(self.arrowhead_optionmenu, _("Choose the direction that the arrows point."))
self.add_frame_option(_("GraphViz Options"), _("Arrowhead Options"), self.arrowhead_optionmenu)
self.add_frame_option(_("GraphViz Options"), _("Arrowhead Options"),
self.arrowhead_optionmenu,_("Choose the direction that the arrows point."))
self.includedates_checkbutton = GtkCheckButton(_("Include Birth and Death Dates"))
self.includedates_checkbutton.set_active(1)
tip = GtkTooltips()
tip.set_tip(self.includedates_checkbutton, _("Include the years that the individual was born and/or died in the graph node labels."))
self.add_frame_option(_("GraphViz Options"), ' ', self.includedates_checkbutton)
self.add_frame_option(_("GraphViz Options"), '', self.includedates_checkbutton,
_("Include the years that the individual was born and/or died in the graph node labels."))
self.includeurl_checkbutton = GtkCheckButton(_("Include URLs"))
self.includeurl_checkbutton.set_active(1)
tip = GtkTooltips()
tip.set_tip(self.includeurl_checkbutton, _("Include a URL in each graph node so that PDF and imagemap files can be generated that contain active links to the files generated by the 'Generate Web Site' report."))
self.add_frame_option(_("GraphViz Options"), ' ', self.includeurl_checkbutton)
self.add_frame_option(_("GraphViz Options"), '', self.includeurl_checkbutton,
_("Include a URL in each graph node so that PDF and imagemap files can be generated that contain active links to the files generated by the 'Generate Web Site' report."))
self.tb_margin_adjustment = GtkAdjustment(value=0.5, lower=0.25, upper=100.0, step_incr=0.25)
self.lr_margin_adjustment = GtkAdjustment(value=0.5, lower=0.25, upper=100.0, step_incr=0.25)