diff --git a/gui/mainFrame.py b/gui/mainFrame.py index c3f5a2baa..53e690bb4 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -450,7 +450,7 @@ class MainFrame(wx.Frame): filePath = saveDialog.GetPath() if '.' not in os.path.basename(filePath): filePath += ".xml" - self.waitDialog = WaitDialog(self) + self.waitDialog = animUtils.WaitDialog(self) sFit.backupFits(filePath, self.closeWaitDialog) self.waitDialog.ShowModal() @@ -482,19 +482,3 @@ class MainFrame(wx.Frame): wnd = self InspectionTool().Show(wnd, True) - -class WaitDialog(wx.Dialog): - def __init__(self, parent): - wx.Dialog.__init__ (self, parent, id=wx.ID_ANY, title=u"Please wait ...", size=(300,30), - style=wx.NO_BORDER) - mainSizer = wx.BoxSizer( wx.HORIZONTAL ) - - self.progress = animUtils.LoadAnimation(self,label = "Processing", size=(300,30)) - mainSizer.Add( self.progress, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 0 ) - self.SetSizer( mainSizer ) - self.Layout() - self.Bind(wx.EVT_CLOSE,self.OnClose) - self.CenterOnParent() - - def OnClose(self, event): - pass diff --git a/gui/utils/animUtils.py b/gui/utils/animUtils.py index c225d0b13..deaa1c70d 100644 --- a/gui/utils/animUtils.py +++ b/gui/utils/animUtils.py @@ -84,3 +84,18 @@ class LoadAnimation(wx.Window): dc.SetTextForeground(textColor) dc.DrawLabel(self.label,rect,wx.ALIGN_CENTER) +class WaitDialog(wx.Dialog): + def __init__(self, parent, title = "Processing"): + wx.Dialog.__init__ (self, parent, id=wx.ID_ANY, title = title, size=(300,30), + style=wx.NO_BORDER) + mainSizer = wx.BoxSizer( wx.HORIZONTAL ) + + self.progress = LoadAnimation(self,label = title, size=(300,30)) + mainSizer.Add( self.progress, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 0 ) + self.SetSizer( mainSizer ) + self.Layout() + self.Bind(wx.EVT_CLOSE,self.OnClose) + self.CenterOnParent() + + def OnClose(self, event): + pass