The code.ill.fr has been recreated and upgraded with the latest version this weekend, If you encounter any problem please inform the Helpdesk.

Commit 2439e178 authored by Remi Perenon's avatar Remi Perenon
Browse files

Solving GUI freeze by suppressing 'Quit' button in dialog frames

parent e4e6f4fb
......@@ -35,7 +35,6 @@ class ImageSettingsDialog(wx.Dialog, UnitsSettingsDialog):
wx.Dialog.__init__(self, parent, wx.ID_ANY, title="Image Settings", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX)
self.parent = parent
self.build_dialog()
self.Bind(wx.EVT_CLOSE, self.on_close)
def build_dialog(self):
......@@ -134,9 +133,7 @@ class ImageSettingsDialog(wx.Dialog, UnitsSettingsDialog):
hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
self.apply_button = wx.Button(self, wx.ID_ANY, label="Apply")
self.quit_button = wx.Button(self, wx.ID_ANY, label="Quit")
hsizer1.Add(self.apply_button, 0, wx.EXPAND, 0)
hsizer1.Add(self.quit_button, 0, wx.EXPAND, 0)
Sizer.Add(hsizer1, 0, wx.ALIGN_RIGHT|wx.RIGHT|wx.ALL, 5)
......@@ -144,8 +141,7 @@ class ImageSettingsDialog(wx.Dialog, UnitsSettingsDialog):
Sizer.Fit(self)
self.Layout()
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.Bind(wx.EVT_BUTTON, self.on_close, self.quit_button)
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.get_settings()
......@@ -189,17 +185,13 @@ class ImageSettingsDialog(wx.Dialog, UnitsSettingsDialog):
self.parent.color_bar.update_normal(self.parent.ax)
self.parent.canvas.draw()
def on_close(self, event = None):
self.MakeModal(False)
self.Destroy()
class GeneralSettingsDialog(wx.Dialog):
def __init__(self, parent=None):
wx.Dialog.__init__(self, parent, wx.ID_ANY, title="General Settings", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX)
self.parent = parent
self.build_dialog()
self.Bind(wx.EVT_CLOSE, self.on_close)
def build_dialog(self):
self.legend_location_choice = ['best' , 'upper right' , 'upper left' ,\
......@@ -292,9 +284,7 @@ class GeneralSettingsDialog(wx.Dialog):
hsizer5 = wx.BoxSizer(wx.HORIZONTAL)
self.apply_button = wx.Button(self, wx.ID_ANY, label="Apply")
self.quit_button = wx.Button(self, wx.ID_ANY, label="Quit")
hsizer5.Add(self.apply_button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALIGN_RIGHT, 0)
hsizer5.Add(self.quit_button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALIGN_RIGHT, 0)
Sizer.Add(sbsizer0, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
Sizer.Add(sbsizer1, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
......@@ -305,8 +295,7 @@ class GeneralSettingsDialog(wx.Dialog):
Sizer.Fit(self)
self.Layout()
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.Bind(wx.EVT_BUTTON, self.on_close, self.quit_button)
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.get_settings()
......@@ -365,9 +354,6 @@ class GeneralSettingsDialog(wx.Dialog):
self.parent.canvas.draw()
def on_close(self, event = None):
self.MakeModal(False)
self.Destroy()
class AxesSettingsDialog(wx.Dialog, UnitsSettingsDialog):
......@@ -376,7 +362,6 @@ class AxesSettingsDialog(wx.Dialog, UnitsSettingsDialog):
wx.Dialog.__init__(self, parent, wx.ID_ANY, title="Axes Settings", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX)
self.parent = parent
self.build_dialog()
self.Bind(wx.EVT_CLOSE, self.on_close)
def build_dialog(self):
......@@ -447,9 +432,7 @@ class AxesSettingsDialog(wx.Dialog, UnitsSettingsDialog):
hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
self.apply_button = wx.Button(self, wx.ID_ANY, label="Apply")
self.quit_button = wx.Button(self, wx.ID_ANY, label="Quit")
hsizer1.Add(self.apply_button, 0, wx.EXPAND, 0)
hsizer1.Add(self.quit_button, 0, wx.EXPAND, 0)
Sizer.Add(hsizer0, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
Sizer.Add(hsizer1, 0, wx.ALIGN_RIGHT|wx.RIGHT|wx.ALL, 5)
......@@ -459,8 +442,7 @@ class AxesSettingsDialog(wx.Dialog, UnitsSettingsDialog):
self.Layout()
self.Bind(wx.EVT_BUTTON, self.auto_fit, self.auto_fit_button)
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.Bind(wx.EVT_BUTTON, self.on_close, self.quit_button)
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.get_settings()
......@@ -516,9 +498,6 @@ class AxesSettingsDialog(wx.Dialog, UnitsSettingsDialog):
self.Xmax.SetValue(str(self.parent.Xmax))
self.Ymax.SetValue(str(self.parent.Ymax))
def on_close(self, event = None):
self.MakeModal(False)
self.Destroy()
class LinesSettingsDialog(wx.Dialog):
......@@ -527,7 +506,6 @@ class LinesSettingsDialog(wx.Dialog):
self.parent = parent
self.current_line = None
self.build_dialog()
self.Bind(wx.EVT_CLOSE, self.on_close)
def build_dialog(self):
......@@ -574,9 +552,7 @@ class LinesSettingsDialog(wx.Dialog):
hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
self.apply_button = wx.Button(self, wx.ID_ANY, label="Apply")
self.quit_button = wx.Button(self, wx.ID_ANY, label="Quit")
hsizer1.Add(self.apply_button, 0, wx.EXPAND, 0)
hsizer1.Add(self.quit_button, 0, wx.EXPAND, 0)
Sizer.Add(bagSizer, 0, wx.EXPAND|wx.ALL, 5)
Sizer.Add(hsizer1, 0, wx.ALIGN_RIGHT|wx.RIGHT|wx.ALL, 5)
......@@ -585,9 +561,8 @@ class LinesSettingsDialog(wx.Dialog):
Sizer.Fit(self)
self.Layout()
self.Bind(wx.EVT_BUTTON, self.delete_line, self.del_button)
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.Bind(wx.EVT_BUTTON, self.on_close, self.quit_button)
self.Bind(wx.EVT_BUTTON, self.delete_line, self.del_button)
self.Bind(wx.EVT_BUTTON, self.set_settings, self.apply_button)
self.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.on_select_item, self.lines)
self.set_lines()
......@@ -673,12 +648,3 @@ class LinesSettingsDialog(wx.Dialog):
return
self.parent.delete_line(self.current_line)
self.set_lines()
def on_close(self, event = None):
self.MakeModal(False)
# unselect selection
if self.parent.selectedLine is not None:
self.parent.selectedLine.set_alpha(1.0)
self.parent.selectedLine.figure.canvas.draw()
self.parent.selectedLine = None
self.Destroy()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment