From ad5e081f83e5bc50cb3dae5cc6c483220b88e1ab Mon Sep 17 00:00:00 2001 From: ccremers Date: Fri, 11 Aug 2006 15:43:04 +0000 Subject: [PATCH] - Bugfix: to often recomputation of stuff. --- gui/Gui/Attackwindow.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gui/Gui/Attackwindow.py b/gui/Gui/Attackwindow.py index 9bf62b8..e064fad 100644 --- a/gui/Gui/Attackwindow.py +++ b/gui/Gui/Attackwindow.py @@ -49,10 +49,14 @@ class AttackDisplay(wx.ScrolledWindow): self.Fit() def OnSize(self,event): - self.update() + self.update(False) event.Skip() - def update(self): + def update(self,force=True): + + if not force: + if not self.win.fit: + return self.SetScrollbars(0,0,0,0,0,0) (sw,sh) = self.GetClientSizeTuple() @@ -174,9 +178,9 @@ class AttackWindow(wx.Frame): self.SetSizer(sizer) - def update(self): + def update(self,force=False): for t in self.displays: - t.update() + t.update(force) def OnFit(self,event): @@ -184,24 +188,24 @@ class AttackWindow(wx.Frame): self.fit = False else: self.fit = True - self.update() + self.update(True) def OnRealSize(self): self.fit = False - self.update() + self.update(True) def OnSize(self): self.Refresh() def OnZoom100(self,evt): self.fit = False - self.update() + self.update(True) self.Refresh() def OnZoomFit(self,evt): self.fit = True - self.update() + self.update(True) self.Refresh()