mailr10617 - in /branches/bieri_gui/gui_bieri: about.py relax_gui.py


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

Header


Content

Posted by edward on February 02, 2010 - 16:37:
Author: bugman
Date: Tue Feb  2 16:37:47 2010
New Revision: 10617

URL: http://svn.gna.org/viewcvs/relax?rev=10617&view=rev
Log:
Created a basic, incomplete dialog class for the 'Help -> About relax' menu 
entry.

The class About_relax has been added and is initialised in the GUI main 
class.  This basic dialog
has no window decorations and automatically closes when clicked with the left 
mouse button.


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=10617&r1=10616&r2=10617&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/about.py (original)
+++ branches/bieri_gui/gui_bieri/about.py Tue Feb  2 16:37:47 2010
@@ -35,6 +35,37 @@
 
     # Temporary disabling of the splash screen - for easier debugging!
     #about.ShowModal()
+
+
+
+class About_relax(wx.Dialog):
+    """The about relax dialog."""
+
+    def __init__(self, *args, **kwds):
+        """Build the dialog."""
+
+        # Change the dialog style.
+        kwds["style"] = wx.BORDER_NONE
+
+        # Execute the base class __init__() method.
+        super(self.__class__, self).__init__(*args, **kwds)
+
+        # Let the dialog be 
+        self.Bind(wx.EVT_LEFT_DOWN, self.close, self)
+
+
+    def close(self, event):
+        """Close the dialog.
+
+        @param event:   The wx event.
+        @type event:    wx event
+        """
+
+        # Close.
+        self.Close()
+
+        # Terminate the event.
+        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=10617&r1=10616&r2=10617&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/relax_gui.py (original)
+++ branches/bieri_gui/gui_bieri/relax_gui.py Tue Feb  2 16:37:47 2010
@@ -44,7 +44,7 @@
 from version import version
 
 # relaxGUI module imports.
-from about import show_about_gui
+from about import About_relax, show_about_gui
 from analyses.auto_model_free import Auto_model_free
 from analyses.auto_r1 import Auto_r1
 from analyses.auto_r2 import Auto_r2
@@ -247,6 +247,9 @@
         self.Bind(wx.EVT_BUTTON, self.open_rx_results_exe, 
self.open_rx_results)
         self.Bind(wx.EVT_LISTBOX_DCLICK, self.open_model_results_exe, 
self.list_modelfree)
         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_relax = About_relax(None, -1, "")
 
 
     def __do_layout(self):
@@ -620,8 +623,8 @@
         @type event:    wx event
         """
 
-        # Open the relax webpage.
-        webbrowser.open_new('http://www.nmr-relax.com')
+        # The dialog.
+        self.dialog_about_relax.Show()
 
         # Terminate the event.
         event.Skip()




Related Messages


Powered by MHonArc, Updated Tue Feb 02 17:00:02 2010