浏览代码

wxGUI/animation: disable tools when no animation loaded

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54204 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 年之前
父节点
当前提交
c9ba20d145
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      gui/wxpython/animation/toolbars.py

+ 8 - 2
gui/wxpython/animation/toolbars.py

@@ -80,6 +80,7 @@ class AnimationToolbar(BaseToolbar):
         self.Realize()
 
         self.isPlayingForward = True
+        self.EnableAllTools(False)
         
         
     def _toolbarData(self):
@@ -143,8 +144,6 @@ class AnimationToolbar(BaseToolbar):
             self.EnableTool(self.playForward, not self.isPlayingForward)
             self.EnableTool(self.playBack, self.isPlayingForward)
 
-
-
     def OnStop(self, event):
         self.Stop()
         self.parent.OnStop(event)
@@ -180,6 +179,13 @@ class AnimationToolbar(BaseToolbar):
         self.ToggleTool(self.oneDirectionReplay, one)
         self.ToggleTool(self.bothDirectionReplay, both)
 
+    def EnableAnimTools(self, enable):
+        """!Enable or diable animation tools"""
+        self.EnableTool(self.playForward, enable)
+        self.EnableTool(self.playBack, enable)
+        self.EnableTool(self.pause, enable)
+        self.EnableTool(self.stop, enable)
+
 class MiscToolbar(BaseToolbar):
     """!Toolbar with miscellaneous tools related to app
     """