Author: bugman Date: Tue Aug 2 13:54:24 2011 New Revision: 14059 URL: http://svn.gna.org/viewcvs/relax?rev=14059&view=rev Log: The Missing_data and Question message dialogs are now always on top. This prevents them from being hidden by other windows. Modified: branches/gui_testing/gui/controller.py branches/gui_testing/gui/message.py Modified: branches/gui_testing/gui/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/controller.py?rev=14059&r1=14058&r2=14059&view=diff ============================================================================== --- branches/gui_testing/gui/controller.py (original) +++ branches/gui_testing/gui/controller.py Tue Aug 2 13:54:24 2011 @@ -75,6 +75,9 @@ # Add the current data pipe info. self.cdp = self.add_text(self, sizer, "Current data pipe:") + + # Create the relaxation curve-fitting specific panel. + self.create_rx(sizer) # Create the model-free specific panel. self.create_mf(sizer) @@ -252,6 +255,25 @@ self.mc_gauge = self.add_gauge(self.panel_mf, panel_sizer, "Monte Carlo simulations:") + def create_rx(self, sizer): + """Create the relaxation curve-fitting specific panel. + + @param sizer: The sizer element to pack the element into. + @type sizer: wx.Sizer instance + """ + + # Create a panel. + self.panel_rx = wx.Panel(self, -1) + sizer.Add(self.panel_rx, 0, wx.ALL|wx.EXPAND, 0) + + # The panel sizer. + panel_sizer = wx.BoxSizer(wx.VERTICAL) + self.panel_rx.SetSizer(panel_sizer) + + # MC sim gauge. + self.mc_gauge = self.add_gauge(self.panel_rx, panel_sizer, "Monte Carlo simulations:") + + def handler_close(self, event): """Event handler for the close window action. @@ -317,6 +339,13 @@ # The analysis type. type = self.gui.analysis.current_analysis_type() + + # Rx fitting auto-analysis. + if type in ['R1', 'R2']: + self.panel_rx.Show() + self.update_rx() + else: + self.panel_rx.Hide() # Model-free auto-analysis. if type == 'model-free': @@ -406,6 +435,24 @@ wx.CallAfter(self.mc_gauge.SetValue, percent) + def update_rx(self): + """Update the model-free specific elements.""" + + # The analysis key. + key = self.analysis_key() + if not key or not status.auto_analysis.has_key(key): + return + + # Monte Carlo simulations. + if status.auto_analysis[key].mc_number: + # The simulation number as a percentage. + percent = int(100 * (status.auto_analysis[key].mc_number + 2) / cdp.sim_number) + if percent > 100: + percent = 100 + + # Update the progress bar. + wx.CallAfter(self.mc_gauge.SetValue, percent) + class Redirect_text(object): Modified: branches/gui_testing/gui/message.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/message.py?rev=14059&r1=14058&r2=14059&view=diff ============================================================================== --- branches/gui_testing/gui/message.py (original) +++ branches/gui_testing/gui/message.py Tue Aug 2 13:54:24 2011 @@ -93,7 +93,7 @@ """ # Initialise the base class. - wx.Dialog.__init__(self, None, title='Missing data', style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) + wx.Dialog.__init__(self, None, title='Missing data', style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.STAY_ON_TOP) # Set up the window icon. self.SetIcons(relax_icons) @@ -183,7 +183,7 @@ self.answer = wx.ID_NO # Initialise the base class. - wx.Dialog.__init__(self, parent, title=title, size=size, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) + wx.Dialog.__init__(self, parent, title=title, size=size, style=wx.DEFAULT_DIALOG_STYLE|wx.STAY_ON_TOP) # Set up the window icon. self.SetIcons(relax_icons)