mailr14608 - in /1.3/gui: controller.py pipe_editor.py results_viewer.py


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

Header


Content

Posted by edward on September 08, 2011 - 11:55:
Author: bugman
Date: Thu Sep  8 11:55:53 2011
New Revision: 14608

URL: http://svn.gna.org/viewcvs/relax?rev=14608&view=rev
Log:
Fixes for the relax controller and pipe editor and results viewer windows 
under MS Windows.

These windows were all dark grey, the default frame colour under MS Windows.  
Now all elements are
packed into a wx.Panel which sits inside the wx.Frame.


Modified:
    1.3/gui/controller.py
    1.3/gui/pipe_editor.py
    1.3/gui/results_viewer.py

Modified: 1.3/gui/controller.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/controller.py?rev=14608&r1=14607&r2=14608&view=diff
==============================================================================
--- 1.3/gui/controller.py (original)
+++ 1.3/gui/controller.py Thu Sep  8 11:55:53 2011
@@ -73,10 +73,10 @@
         sizer.AddSpacer(20)
 
         # Add the current analysis info.
-        self.name = self.add_text(self, sizer, "Current GUI analysis:")
+        self.name = self.add_text(self.main_panel, sizer, "Current GUI 
analysis:")
 
         # Add the current data pipe info.
-        self.cdp = self.add_text(self, sizer, "Current data pipe:")
+        self.cdp = self.add_text(self.main_panel, sizer, "Current data 
pipe:")
 
         # Create the relaxation curve-fitting specific panel.
         self.create_rx(sizer)
@@ -85,13 +85,13 @@
         self.create_mf(sizer)
 
         # Add the main execution gauge.
-        self.main_gauge = self.add_gauge(self, sizer, "Execution progress:", 
tooltip="This gauge will pulse while relax is executing an auto-analysis 
(when the execution lock is turned on) and will be set to 100% once the 
analysis is complete.")
+        self.main_gauge = self.add_gauge(self.main_panel, sizer, "Execution 
progress:", tooltip="This gauge will pulse while relax is executing an 
auto-analysis (when the execution lock is turned on) and will be set to 100% 
once the analysis is complete.")
 
         # Initialise a queue for log messages.
         self.log_queue = Queue()
 
         # Add the log panel.
-        self.log_panel = LogCtrl(self, log_queue=self.log_queue, id=-1)
+        self.log_panel = LogCtrl(self.main_panel, log_queue=self.log_queue, 
id=-1)
         sizer.Add(self.log_panel, 1, wx.EXPAND|wx.ALL, 0)
 
         # IO redirection.
@@ -163,7 +163,7 @@
         """
 
         # The logo.
-        logo = wx.StaticBitmap(self, -1, wx.Bitmap(IMAGE_PATH+'relax.gif', 
wx.BITMAP_TYPE_ANY))
+        logo = wx.StaticBitmap(self.main_panel, -1, 
wx.Bitmap(IMAGE_PATH+'relax.gif', wx.BITMAP_TYPE_ANY))
 
         # Add the relax logo.
         sizer.Add(logo, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 0)
@@ -199,7 +199,7 @@
         field = wx.TextCtrl(parent, -1, '', style=wx.ALIGN_LEFT)
         field.SetEditable(False)
         field.SetFont(font.normal)
-        colour = self.GetBackgroundColour()
+        colour = self.main_panel.GetBackgroundColour()
         field.SetOwnBackgroundColour(colour)
         sub_sizer.Add(field, 3, wx.ALIGN_CENTER_VERTICAL, 0)
 
@@ -243,7 +243,7 @@
         """
 
         # Create a panel.
-        self.panel_mf = wx.Panel(self, -1)
+        self.panel_mf = wx.Panel(self.main_panel, -1)
         sizer.Add(self.panel_mf, 0, wx.ALL|wx.EXPAND, 0)
 
         # The panel sizer.
@@ -268,7 +268,7 @@
         """
 
         # Create a panel.
-        self.panel_rx = wx.Panel(self, -1)
+        self.panel_rx = wx.Panel(self.main_panel, -1)
         sizer.Add(self.panel_rx, 0, wx.ALL|wx.EXPAND, 0)
 
         # The panel sizer.
@@ -318,11 +318,12 @@
         # Set up the window icon.
         self.SetIcons(relax_icons)
 
+       # Place all elements within a panel (to remove the dark grey in MS 
Windows).
+        self.main_panel = wx.Panel(self, -1)
+
         # Use a grid sizer for packing the elements.
         main_sizer = wx.BoxSizer(wx.VERTICAL)
-
-        # Pack the sizer into the frame.
-        self.SetSizer(main_sizer)
+        self.main_panel.SetSizer(main_sizer)
 
         # Build the central sizer, with borders.
         sizer = add_border(main_sizer, border=self.border, 
packing=wx.VERTICAL)
@@ -380,7 +381,7 @@
         wx.CallAfter(self.update_gauge)
 
         # Re-layout the window.
-        wx.CallAfter(self.Layout)
+        wx.CallAfter(self.main_panel.Layout)
 
 
     def update_gauge(self):

Modified: 1.3/gui/pipe_editor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/pipe_editor.py?rev=14608&r1=14607&r2=14608&view=diff
==============================================================================
--- 1.3/gui/pipe_editor.py (original)
+++ 1.3/gui/pipe_editor.py Thu Sep  8 11:55:53 2011
@@ -73,11 +73,12 @@
         self.SetMinSize((size_x, size_y))
         self.SetSize((size_x, size_y))
 
-        # The main box sizer.
+       # Place all elements within a panel (to remove the dark grey in MS 
Windows).
+        self.main_panel = wx.Panel(self, -1)
+
+        # Pack a sizer into the panel.
         main_sizer = wx.BoxSizer(wx.VERTICAL)
-
-        # Pack the sizer into the frame.
-        self.SetSizer(main_sizer)
+       self.main_panel.SetSizer(main_sizer)
 
         # Build the central sizer, with borders.
         sizer = add_border(main_sizer, border=border, packing=wx.VERTICAL)
@@ -170,20 +171,20 @@
         menu = wx.Menu()
 
         # Menu entry:  delete the data pipe.
-        item = build_menu_item(menu, parent=self, text="&Delete the pipe", 
icon=icon_16x16.remove, fn=self.pipe_delete)
+        item = build_menu_item(menu, parent=self.main_panel, text="&Delete 
the pipe", icon=icon_16x16.remove, fn=self.pipe_delete)
         menu.AppendItem(item)
         if status.exec_lock.locked():
             item.Enable(False)
  
         # Menu entry:  switch to this data pipe.
-        item = build_menu_item(menu, parent=self, text="&Switch to this 
pipe", icon=icon_16x16.pipe_switch, fn=self.pipe_switch)
+        item = build_menu_item(menu, parent=self.main_panel, text="&Switch 
to this pipe", icon=icon_16x16.pipe_switch, fn=self.pipe_switch)
         menu.AppendItem(item)
         if status.exec_lock.locked():
             item.Enable(False)
  
         # Menu entry:  new auto-analysis tab.
         if self.gui.analysis.page_index_from_pipe(self.selected_pipe) == 
None and pipe_type in ['noe', 'r1', 'r2', 'mf']:
-            item = build_menu_item(menu, parent=self, text="&Associate with 
a new auto-analysis", icon=icon_16x16.new, fn=self.associate_auto)
+            item = build_menu_item(menu, parent=self.main_panel, 
text="&Associate with a new auto-analysis", icon=icon_16x16.new, 
fn=self.associate_auto)
             menu.AppendItem(item)
             if status.exec_lock.locked():
                 item.Enable(False)
@@ -208,7 +209,7 @@
         sizer.Add(button_sizer, 0, wx.ALL|wx.EXPAND, 0)
 
         # The create button.
-        self.button_create = wx.lib.buttons.ThemedGenBitmapTextButton(self, 
-1, None, " Create")
+        self.button_create = 
wx.lib.buttons.ThemedGenBitmapTextButton(self.main_panel, -1, None, " Create")
         self.button_create.SetBitmapLabel(wx.Bitmap(icon_22x22.add, 
wx.BITMAP_TYPE_ANY))
         self.button_create.SetFont(font.normal)
         self.button_create.SetToolTipString("Create a new data pipe.")
@@ -216,7 +217,7 @@
         self.Bind(wx.EVT_BUTTON, self.gui.user_functions.pipe.create, 
self.button_create)
 
         # The copy button.
-        self.button_copy = wx.lib.buttons.ThemedGenBitmapTextButton(self, 
-1, None, " Copy")
+        self.button_copy = 
wx.lib.buttons.ThemedGenBitmapTextButton(self.main_panel, -1, None, " Copy")
         self.button_copy.SetBitmapLabel(wx.Bitmap(icon_22x22.copy, 
wx.BITMAP_TYPE_ANY))
         self.button_copy.SetFont(font.normal)
         self.button_copy.SetToolTipString("Copy a data pipe.")
@@ -224,7 +225,7 @@
         self.Bind(wx.EVT_BUTTON, self.gui.user_functions.pipe.copy, 
self.button_copy)
 
         # The delete button.
-        self.button_delete = wx.lib.buttons.ThemedGenBitmapTextButton(self, 
-1, None, " Delete")
+        self.button_delete = 
wx.lib.buttons.ThemedGenBitmapTextButton(self.main_panel, -1, None, " Delete")
         self.button_delete.SetBitmapLabel(wx.Bitmap(icon_22x22.list_remove, 
wx.BITMAP_TYPE_ANY))
         self.button_delete.SetFont(font.normal)
         self.button_delete.SetToolTipString("Delete a data pipe.")
@@ -232,7 +233,7 @@
         self.Bind(wx.EVT_BUTTON, self.gui.user_functions.pipe.delete, 
self.button_delete)
 
         # The hybridise button.
-        self.button_hybrid = wx.lib.buttons.ThemedGenBitmapTextButton(self, 
-1, None, " Hybridise")
+        self.button_hybrid = 
wx.lib.buttons.ThemedGenBitmapTextButton(self.main_panel, -1, None, " 
Hybridise")
         self.button_hybrid.SetBitmapLabel(wx.Bitmap(icon_22x22.pipe_hybrid, 
wx.BITMAP_TYPE_ANY))
         self.button_hybrid.SetFont(font.normal)
         self.button_hybrid.SetToolTipString("Hybridise data pipes.")
@@ -240,7 +241,7 @@
         self.Bind(wx.EVT_BUTTON, self.gui.user_functions.pipe.hybridise, 
self.button_hybrid)
 
         # The switch button.
-        self.button_switch = wx.lib.buttons.ThemedGenBitmapTextButton(self, 
-1, None, " Switch")
+        self.button_switch = 
wx.lib.buttons.ThemedGenBitmapTextButton(self.main_panel, -1, None, " Switch")
         self.button_switch.SetBitmapLabel(wx.Bitmap(icon_22x22.pipe_switch, 
wx.BITMAP_TYPE_ANY))
         self.button_switch.SetFont(font.normal)
         self.button_switch.SetToolTipString("Switch data pipes.")
@@ -256,7 +257,7 @@
         """
 
         # The pipe logo.
-        logo = wx.StaticBitmap(self, -1, 
wx.Bitmap(WIZARD_IMAGE_PATH+'pipe_200x90.png', wx.BITMAP_TYPE_ANY))
+        logo = wx.StaticBitmap(self.main_panel, -1, 
wx.Bitmap(WIZARD_IMAGE_PATH+'pipe_200x90.png', wx.BITMAP_TYPE_ANY))
 
         # Pack the logo.
         box.Add(logo, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
@@ -270,7 +271,7 @@
         """
 
         # Grid of all data pipes.
-        self.grid = wx.grid.Grid(self, -1)
+        self.grid = wx.grid.Grid(self.main_panel, -1)
 
         # Initialise to a single row and 4 columns.
         self.grid.CreateGrid(1, 4)

Modified: 1.3/gui/results_viewer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/results_viewer.py?rev=14608&r1=14607&r2=14608&view=diff
==============================================================================
--- 1.3/gui/results_viewer.py (original)
+++ 1.3/gui/results_viewer.py Thu Sep  8 11:55:53 2011
@@ -68,9 +68,12 @@
         self.SetTitle("Results viewer")
         self.SetSize(self.size)
 
+       # Place all elements within a panel (to remove the dark grey in MS 
Windows).
+        self.main_panel = wx.Panel(self, -1)
+
         # Pack a sizer into the panel.
         box_main = wx.BoxSizer(wx.HORIZONTAL)
-        self.SetSizer(box_main)
+        self.main_panel.SetSizer(box_main)
 
         # Build the central sizer, with borders.
         box_centre = add_border(box_main, border=self.border, 
packing=wx.VERTICAL)
@@ -88,12 +91,16 @@
         box_centre.AddSpacer(self.border)
 
         # Add the open button.
-        self.button_open = buttons.ThemedGenBitmapTextButton(self, -1, None, 
" Open")
+        self.button_open = 
buttons.ThemedGenBitmapTextButton(self.main_panel, -1, None, " Open")
         self.button_open.SetBitmapLabel(wx.Bitmap(icon_22x22.document_open, 
wx.BITMAP_TYPE_ANY))
         self.button_open.SetFont(font.normal)
         self.button_open.SetMinSize((103, 33))
         self.gui.Bind(wx.EVT_BUTTON, self.open_result_file, self.button_open)
         box_centre.Add(self.button_open, 0, 
wx.ALIGN_RIGHT|wx.ADJUST_MINSIZE, 5)
+
+        # Relayout the main panel.
+       self.main_panel.Layout()
+       self.main_panel.Refresh()
 
         # Bind some events.
         self.Bind(wx.EVT_COMBOBOX, self.switch_pipes, self.pipe_name)
@@ -154,7 +161,7 @@
         """
 
         # Initialise the list box.
-        self.file_list = wx.ListCtrl(self, -1, 
style=wx.BORDER_SUNKEN|wx.LC_REPORT)
+        self.file_list = wx.ListCtrl(self.main_panel, -1, 
style=wx.BORDER_SUNKEN|wx.LC_REPORT)
 
         # Properties.
         self.file_list.SetFont(font.normal)
@@ -186,7 +193,7 @@
         sizer = wx.BoxSizer(wx.HORIZONTAL)
 
         # The text.
-        label = wx.StaticText(self, -1, "Data pipe selection")
+        label = wx.StaticText(self.main_panel, -1, "Data pipe selection")
 
         # The font and label properties.
         label.SetFont(font.subtitle)
@@ -198,7 +205,7 @@
         sizer.AddSpacer(self.border)
 
         # A combo box.
-        self.pipe_name = wx.ComboBox(self, -1, value='', 
style=wx.CB_DROPDOWN|wx.CB_READONLY, choices=[])
+        self.pipe_name = wx.ComboBox(self.main_panel, -1, value='', 
style=wx.CB_DROPDOWN|wx.CB_READONLY, choices=[])
         self.pipe_name.SetMinSize((50, 27))
         sizer.Add(self.pipe_name, 1, 
wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
 




Related Messages


Powered by MHonArc, Updated Thu Sep 08 12:20:01 2011