commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/designer/src/base Instance.py MenuBar.py T...


From: Jason Cater
Subject: gnue/designer/src/base Instance.py MenuBar.py T...
Date: Fri, 04 Apr 2003 22:41:55 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    03/04/04 22:41:55

Modified files:
        designer/src/base: Instance.py MenuBar.py TemplateParser.py 

Log message:
        disable menu items for docked tool panels (quick fix for release)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/Instance.py.diff?tr1=1.88&tr2=1.89&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/MenuBar.py.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/TemplateParser.py.diff?tr1=1.29&tr2=1.30&r1=text&r2=text

Patches:
Index: gnue/designer/src/base/Instance.py
diff -c gnue/designer/src/base/Instance.py:1.88 
gnue/designer/src/base/Instance.py:1.89
*** gnue/designer/src/base/Instance.py:1.88     Fri Apr  4 15:56:55 2003
--- gnue/designer/src/base/Instance.py  Fri Apr  4 22:41:55 2003
***************
*** 299,312 ****
            window = ToolFrame(self, title)
            control = baseclass(self, self.rootObject, window)
            window.control = control
          else:
            # Docked type
            pane = panemap[pos]
            control = pane.AddTool(title, baseclass, self.rootObject, self)
            window = pane.GetWindow()
  
          # Add ourselves to the Window menu
!         control._menutool = self._menubar.addTool(window, title, hotkey)
  
          self.__dict__["%sWindow" % id] = window
          self.__dict__[id] = control
--- 299,314 ----
            window = ToolFrame(self, title)
            control = baseclass(self, self.rootObject, window)
            window.control = control
+           enableMenu = 1
          else:
            # Docked type
            pane = panemap[pos]
            control = pane.AddTool(title, baseclass, self.rootObject, self)
            window = pane.GetWindow()
+           enableMenu = 0
  
          # Add ourselves to the Window menu
!         control._menutool = self._menubar.addTool(window, title, hotkey, 
enableMenu)
  
          self.__dict__["%sWindow" % id] = window
          self.__dict__[id] = control
Index: gnue/designer/src/base/MenuBar.py
diff -c gnue/designer/src/base/MenuBar.py:1.40 
gnue/designer/src/base/MenuBar.py:1.41
*** gnue/designer/src/base/MenuBar.py:1.40      Fri Apr  4 22:40:55 2003
--- gnue/designer/src/base/MenuBar.py   Fri Apr  4 22:41:55 2003
***************
*** 200,205 ****
--- 200,207 ----
                           tool.tooltip, tool.checkable)
         tool.menu = menu
         self._tools.AppendItem(menu)
+        if not tool.enable:
+          self._tools.Enable(menu.GetId(), 0)
         self.__addMenuEvent('%s|%s' % (location, tool.title),
                             tool.wxId, tool.run)
         tool.finalize()
***************
*** 269,274 ****
--- 271,280 ----
             # Data is a location pointer
             wizard = self._menuMappings[data]
             menu.Append(wizard.wxId, wizard.title, wizard.tooltip)
+ 
+            if not wizard.enable:
+              menu.Enable(wizard.wxId,0)
+ 
             self.__addMenuEvent('%s|%s' % (location, wizard.title),
                                 wizard.wxId, wizard.run)
  
***************
*** 304,312 ****
  
  
  
!   def addTool(self, toolFrame, title, hotkey=None):
      location = 'Tools|%s' % title
!     self._menuMappings[location] = ToolRunner(toolFrame, title, hotkey)
      self._toolMenuOrder.append(location)
      return self._menuMappings[location]
  
--- 310,318 ----
  
  
  
!   def addTool(self, toolFrame, title, hotkey=None, enabled=1):
      location = 'Tools|%s' % title
!     self._menuMappings[location] = ToolRunner(toolFrame, title, hotkey, 
enabled)
      self._toolMenuOrder.append(location)
      return self._menuMappings[location]
  
***************
*** 323,334 ****
  
  
  class ToolRunner:
!   def __init__(self, toolFrame, title, hotkey):
       self.toolFrame = toolFrame
  
       self.hotkey = hotkey
       self.wxId = wxNewId()
       self.title = title + (hotkey and '\t%s'% hotkey or '')
       self.checkable = 1
       self.tooltip = _("Show or hide the %s") % title
  
--- 329,342 ----
  
  
  class ToolRunner:
!   def __init__(self, toolFrame, title, hotkey, enabled):
       self.toolFrame = toolFrame
  
+ 
       self.hotkey = hotkey
       self.wxId = wxNewId()
       self.title = title + (hotkey and '\t%s'% hotkey or '')
+      self.enable = enabled
       self.checkable = 1
       self.tooltip = _("Show or hide the %s") % title
  
Index: gnue/designer/src/base/TemplateParser.py
diff -c gnue/designer/src/base/TemplateParser.py:1.29 
gnue/designer/src/base/TemplateParser.py:1.30
*** gnue/designer/src/base/TemplateParser.py:1.29       Mon Feb 17 02:32:51 2003
--- gnue/designer/src/base/TemplateParser.py    Fri Apr  4 22:41:55 2003
***************
*** 633,638 ****
--- 633,639 ----
       self.wxId = wxNewId()
       self.title = title
       self.checkable = 0
+      self.enable = 1
       try:
         self.tooltip = template['Description']
       except KeyError:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]