Author: bugman Date: Thu Feb 4 02:39:17 2010 New Revision: 10640 URL: http://svn.gna.org/viewcvs/relax?rev=10640&view=rev Log: Rewrote the 'File -> About relaxGUI' dialog. This is now a DC widget inheriting from About_base which just sets a white background, sets the size to that of the image, and draws the bitmap. Modified: branches/bieri_gui/gui_bieri/about.py branches/bieri_gui/gui_bieri/relax_gui.py Modified: branches/bieri_gui/gui_bieri/about.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/about.py?rev=10640&r1=10639&r2=10640&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/about.py (original) +++ branches/bieri_gui/gui_bieri/about.py Thu Feb 4 02:39:17 2010 @@ -42,7 +42,7 @@ # Dimensions. dim_x = 400 - dim_y = 100 + dim_y = 600 # Spacer size (px). boarder = 0 @@ -112,6 +112,27 @@ +class About_gui(About_base): + """The about relax GUI dialog.""" + + # The background colour. + colour1 = 'white' + + # Dimensions. + dim_x = 640 + dim_y = 480 + + def build_widget(self): + """Build the about dialog.""" + + # The image. + bitmap = wx.Bitmap(IMAGE_PATH+'start.png', wx.BITMAP_TYPE_ANY) + + # Draw it. + self.dc.DrawBitmap(bitmap, self.boarder, self.boarder, True) + + + class About_relax(About_base): """The about relax dialog.""" @@ -185,56 +206,3 @@ # Draw the text. self.dc.DrawText(text, self.boarder + (self.dim_x - x)/2, 20+168) - - - -class MyFrame(wx.Dialog): - def __init__(self, *args, **kwds): - # begin wxGlade: MyFrame.__init__ - kwds["style"] = wx.CLOSE_BOX|wx.STAY_ON_TOP - wx.Dialog.__init__(self, *args, **kwds) - self.panel_1 = wx.Panel(self, -1) - self.panel_2 = wx.Panel(self, -1) - self.bitmap_1 = wx.StaticBitmap(self.panel_1, -1, wx.Bitmap(IMAGE_PATH+'start.png', wx.BITMAP_TYPE_ANY)) - self.button_1 = wx.Button(self, -1, "Ok") - - self.__set_properties() - self.__do_layout() - - self.Bind(wx.EVT_BUTTON, self.start, self.button_1) - - - def __do_layout(self): - # begin wxGlade: MyFrame.__do_layout - sizer_1 = wx.BoxSizer(wx.VERTICAL) - sizer_2 = wx.BoxSizer(wx.HORIZONTAL) - sizer_1.Add(self.panel_2, 1, wx.EXPAND, 0) - sizer_2.Add(self.bitmap_1, 0, 0, 0) - self.panel_1.SetSizer(sizer_2) - sizer_1.Add(self.panel_1, 0, wx.EXPAND, 0) - sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL, 0) - self.SetSizer(sizer_1) - self.Layout() - self.Centre() - - - def __set_properties(self): - # begin wxGlade: MyFrame.__set_properties - self.SetTitle("relaxGUI") - _icon = wx.EmptyIcon() - _icon.CopyFromBitmap(wx.Bitmap(IMAGE_PATH+'relax_start.gif', wx.BITMAP_TYPE_ANY)) - self.SetIcon(_icon) - self.SetSize((640, 540)) - self.SetBackgroundColour(wx.Colour(0, 0, 0)) - self.panel_2.SetMinSize((640, 30)) - self.panel_2.SetBackgroundColour(wx.Colour(0, 0, 0)) - self.panel_1.SetMinSize((640, 480)) - self.panel_1.SetBackgroundColour(wx.Colour(255, 255, 255)) - self.button_1.SetBackgroundColour(wx.Colour(50, 50, 50)) - self.button_1.SetForegroundColour(wx.Colour(0, 0, 0)) - self.button_1.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Sans")) - - - def start(self, event): # wxGlade: MyFrame.<event_handler> - self.Close() - event.Skip() Modified: branches/bieri_gui/gui_bieri/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/relax_gui.py?rev=10640&r1=10639&r2=10640&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/relax_gui.py (original) +++ branches/bieri_gui/gui_bieri/relax_gui.py Thu Feb 4 02:39:17 2010 @@ -44,7 +44,7 @@ from version import version # relaxGUI module imports. -from about import About_relax +from about import About_gui, About_relax from analyses.auto_model_free import Auto_model_free from analyses.auto_r1 import Auto_r1 from analyses.auto_r2 import Auto_r2 @@ -249,6 +249,7 @@ self.Bind(wx.EVT_BUTTON, self.open_model_results_exe, self.open_model_results) # Pre-build the about dialogs, but do not show them. + self.dialog_about_gui = About_gui(None, -1, "") self.dialog_about_relax = About_relax(None, -1, "") @@ -607,10 +608,14 @@ def about_gui(self, event): - """Create and display the about message for the GUI.""" + """The about message for the relax GUI. + + @param event: The wx event. + @type event: wx event + """ # The dialog. - show_about_gui() + self.dialog_about_gui.Show() # Terminate the event. event.Skip()