mailr11973 - /branches/bieri_gui/gui_bieri/about.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 27, 2010 - 15:38:
Author: bugman
Date: Mon Dec 27 15:38:32 2010
New Revision: 11973

URL: http://svn.gna.org/viewcvs/relax?rev=11973&view=rev
Log:
Shifted the about_relax draw_title() method to the base class.


Modified:
    branches/bieri_gui/gui_bieri/about.py

Modified: branches/bieri_gui/gui_bieri/about.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/about.py?rev=11973&r1=11972&r2=11973&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/about.py (original)
+++ branches/bieri_gui/gui_bieri/about.py Mon Dec 27 15:38:32 2010
@@ -84,6 +84,23 @@
 
         # Terminate the event.
         event.Skip()
+
+
+    def draw_title(self, text, point_size=14, family=wx.FONTFAMILY_ROMAN):
+        """Draw the title."""
+
+        # Set the font.
+        font = wx.Font(point_size, family, wx.NORMAL, wx.NORMAL)
+        self.dc.SetFont(font)
+
+        # The text extent.
+        x, y = self.dc.GetTextExtent(text)
+
+        # Draw the text, with a spacer.
+        self.dc.DrawText(text, self.boarder + (self.dim_x - x)/2, 
self.offset(15))
+
+        # Add the text extent.
+        self.offset(y)
 
 
     def draw_wrapped_text(self, text, text_size=10, width=69, spacer=10):
@@ -237,7 +254,7 @@
         self.offset(self.boarder)
 
         # Draw all the elements.
-        self.draw_title()
+        self.draw_title(self.info.title + ' ' + self.info.version)
         self.draw_description()
         self.draw_copyright()
         self.draw_link()
@@ -361,26 +378,6 @@
         self.dc.SetTextForeground('black')
 
 
-    def draw_title(self):
-        """Draw the relax title with name and version."""
-
-        # The text.
-        text = self.info.title + ' ' + self.info.version
-
-        # Set the font.
-        font = wx.Font(14, wx.FONTFAMILY_ROMAN, wx.NORMAL, wx.NORMAL)
-        self.dc.SetFont(font)
-
-        # The text extent.
-        x, y = self.dc.GetTextExtent(text)
-
-        # Draw the text, with a spacer.
-        self.dc.DrawText(text, self.boarder + (self.dim_x - x)/2, 
self.offset(15))
-
-        # Add the text extent.
-        self.offset(y)
-
-
     def process_click(self, event):
         """Determine what to do with the mouse click.
 




Related Messages


Powered by MHonArc, Updated Mon Dec 27 16:00:02 2010