commit-gnue
[Top][All Lists]
Advanced

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

gnue/designer BUGS src/LayoutEditor.py src/Popu...


From: Jason Cater
Subject: gnue/designer BUGS src/LayoutEditor.py src/Popu...
Date: Sun, 18 Nov 2001 23:38:12 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/11/18 23:38:11

Modified files:
        designer       : BUGS 
        designer/src   : LayoutEditor.py PopupMenu.py PropertyEditor.py 
                         TreeView.py 

Log message:
        many Win32-specific bugfixes; page layout screen uses a Notebook-style 
display now; several speed improvements from code cleanup; more object reuse; 
1/2 bottle of aspirin; updated list of BUGS (still several)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/BUGS.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/LayoutEditor.py.diff?cvsroot=OldCVS&tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/PopupMenu.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/PropertyEditor.py.diff?cvsroot=OldCVS&tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TreeView.py.diff?cvsroot=OldCVS&tr1=1.15&tr2=1.16&r1=text&r2=text

Patches:
Index: gnue/designer/BUGS
diff -u gnue/designer/BUGS:1.9 gnue/designer/BUGS:1.10
--- gnue/designer/BUGS:1.9      Sat Nov 10 17:01:08 2001
+++ gnue/designer/BUGS  Sun Nov 18 23:38:11 2001
@@ -9,7 +9,7 @@
 not other similar forms?)
 ****************************************************
 
-These are known issues with Designer 0.1.0
+These are known issues with Designer 0.1.0  
 
 * Designer occasionally seg faults when clicking on the Tree View. I cannot
   find any pattern to the segfaulting and it usually only happens to me once
@@ -23,9 +23,11 @@
   or a limitation of wxPython.
 
 * If you are viewing a page and then, using the Tree View, select an object
-  on another page, the Layout Editor does not switch to the other page.  You
+  on another page, the Layout Editor may not switch to the other page.  You
   have to first select the other page in the Tree View first, then select the
   object to modify. Sometimes doing this will produce a segmentation fault.
+  (Update: I think this is fixed for the 0.1.0 release, but am not 100% 
+  positive... if no more cases pop up, this listing will be removed.)
 
 * The Events tab on the "Property Editor" window is not functional.
   It currently displays the same information as on the "Properties"
@@ -42,6 +44,33 @@
   then save it, the form will be written as:
       <?xml version="1.0"?>
   This will affect our international customers.
+
+* You cannot delete an object (Page or Block) as long as it has child 
+  objects;  i.e., to delete a page, you must first delete all blocks and 
+  labels.
+
+* When modifying a page's attributes, the page's notebook panel does not 
+  redraw correctly. You will have to select another object and then 
+  reselect the page.
+
+* (GTK Only) The "Property Editor" grid, when scrollbars are present, 
+  doesn't always show the "pulldown" control on its Combo Boxes. 
+
+* (Win32 Only) The "Property Editor" grid has several issues under 
+  Windows 9x/2000: 
+
+    * If the properties grid displays Scrollbars, then you will not be 
+      able to edit the property's values.  This is an issue with the Win32 
+      version of wxWindows. Currently, the workaround is to make your 
+      Properties Editor window large enough to not require Scrollbars. 
+
+    * If your monitor is at a high resolution and you place the Properties 
+      Editor window in the lower-right corner, then the Grid will not 
+      refresh correctly.  The solution is to place the window in another 
+      corner of your monitor.  (This one truly baffles us!)
+
+* (Win32 Only) The "New..." submenus do not work.
+
 
 
 The following aren't technically bugs, but may bite none-the-less:
Index: gnue/designer/src/LayoutEditor.py
diff -u gnue/designer/src/LayoutEditor.py:1.26 
gnue/designer/src/LayoutEditor.py:1.27
--- gnue/designer/src/LayoutEditor.py:1.26      Sun Nov  4 22:21:11 2001
+++ gnue/designer/src/LayoutEditor.py   Sun Nov 18 23:38:11 2001
@@ -1,4 +1,4 @@
-        #
+#
 # Copyright 2001 Free Software Foundation
 #
 # This file is part of GNU Enterprise.
@@ -45,33 +45,48 @@
     self.widgets.update(UIwxpython.WIDGETS)
     del self.widgets['GFPage']
 
-    self.toolpanel = wxPanel(self, -1, pos=wxPoint(0,0), size=wxSize(32,32), 
style=wxRAISED_BORDER|wxCLIP_CHILDREN)
+    self.notebook = wxNotebook(self, -1, pos=wxPoint(4, 4), size=wxSize(32,32))
 
-    # TODO: self.workspace needs to have SetScrollbars called with
-    # TODO: reasonable values based on size and position of self.panel
-    self.workspace = wxScrolledWindow(self, -1, pos=wxPoint(0,32), 
style=wxCLIP_CHILDREN|wxHSCROLL|wxVSCROLL)
 
     # TODO: There must be a better way of calculating a lighter shade
     # TODO: for the workspace. What happens if a color value > (255-32)?
-    self.workspace.SetBackgroundColour(wxColour(self.panelColor.Red()+32,
-                 self.panelColor.Green()+32,    
-                 self.panelColor.Blue()+32))
+    self.backcolor = wxColour(self.panelColor.Red()+32,
+                         self.panelColor.Green()+32,    
+                         self.panelColor.Blue()+32)
 
     self.page = None
-    self.pageNameLabel = wxStaticText(self.toolpanel, -1, "Page: ", 
pos=wxPoint(4,6))
-    self.pageCombo = wxComboBox(self.toolpanel, -1, 
pos=wxPoint(self.pageNameLabel.GetSize().width + 10,4), style=wxCB_READONLY)
-    self.blockNameLabel = wxStaticText(self.toolpanel, -1, "Block:", 
pos=wxPoint(self.pageCombo.GetPosition().x + self.pageCombo.GetSize().width + 
20,6))
-    self.blockCombo = wxComboBox(self.toolpanel, -1, 
pos=wxPoint(self.blockNameLabel.GetPosition().x + 
self.blockNameLabel.GetSize().width + 11,4), style=wxCB_READONLY)
 
     self.propBar = PropertyBar(self)
+
+    EVT_NOTEBOOK_PAGE_CHANGED(self,self.notebook.GetId(), self.OnPageSelected)
 
-    EVT_COMBOBOX(self, self.pageCombo.GetId(), self.OnPageSelected)
-    EVT_COMBOBOX(self, self.blockCombo.GetId(), self.OnBlockSelected)
     EVT_SIZE(self, self.OnSize)
 
+
     self.panel = None
     self._pageList = []  # Needed by UIwxpython
 
+    self._notebookMap = {}
+    instance._form.walk (self.inventoryObject)
+
+
+  def inventoryObject(self, object): 
+    if object._type == 'GFPage': 
+      index = self.notebook.GetPageCount()
+      self._notebookMap[object] = index
+      self._notebookMap[index] = object
+
+      # TODO: self.workspace needs to have SetScrollbars called with
+      # TODO: reasonable values based on size and position of self.panel
+      self.workspace = wxScrolledWindow(self.notebook, -1, pos=wxPoint(0,0), 
+         style=wxCLIP_CHILDREN|wxHSCROLL|wxVSCROLL|wxSUNKEN_BORDER)
+      self.workspace.SetScrollbars(20,20,50,50)
+      self.workspace.SetBackgroundColour(self.backcolor)
+      self.notebook.AddPage(self.workspace,object.name)
+      object.__workspace = self.workspace
+      self.drawPage(object)
+      
+
   def onSetCurrentObject (self, object, handler):
     self._currentObject = object
     if object == None: 
@@ -81,51 +96,72 @@
     if hasattr(object, '_widgetHandler'): 
       self.propBar.setCurrentObject(object)
     if handler != __name__: 
-      self.getPages()
       self._setCurrentPage(object)
 
+
   def _setCurrentPage(self, object): 
-    if isinstance(object, GFObjects.GFPage) and object != self.page: 
-      if self.panel != None: 
-        self.panel.Destroy()
-        self.drawPage(object)
-    else: 
-      for o in self._currentSelection.keys():
-        o.setSelected(0)
-      object.walk(self.__setCurrentObject)
+
+    page = isinstance(object, GFObjects.GFPage) and object or \
+           object.findParentOfType('GFPage')
+
+    if page != None and page != self.page: 
+      self.page = page 
+      self.notebook.SetSelection(self._notebookMap[page])
+      try: 
+        self.workspace = page.__workspacee
+      except AttributeError: 
+        # This simply means we are setting up 
+        # our notebook for the first time. 
+        pass
+
 
   def __setCurrentObject(self,object): 
     if hasattr(object, '_widgetHandler'): 
       self._currentSelection[object._widgetHandler] = 1
       object._widgetHandler.setSelected(1)
 
+
   def onCreateObject (self, object, handler):
     self._currentSelection = {}
     if object == None: 
       return
     if handler != __name__:
       if object.findParentOfType('GFPage') == self.page: 
-        self.__getBlocks(object)
+#        self.__getBlocks(object)
         self.__drawItem(object)
+
+      origpage = self.page
+      self.inventoryObject(object)
+      self._setCurrentPage(origpage)
 
-      if isinstance(object, GFObjects.GFPage): 
-        self.getPages()
 
   def onModifyObject (self, object, handler, modifications):
     if object == None: 
       return
     self.propBar.onModifyObject(object, handler, modifications)
     if handler != __name__:
+      if object._type == 'GFPage': 
+        self.notebook.SetPageText(self._notebookMap[object],object.name)
+        self.notebook.SetSelection(self.notebook.GetSelection())
       if object in (self._form, self.page) or object in self.widgetList: 
         self.drawPage(self.page)
 
+
   def onDeleteObject (self, object, handler):
     if object == None: 
       return
     if handler != __name__:
+      if object._type == 'GFPage': 
+        index = self._notebookMap[object]
+        for i in range(index+1, len(self._notebookMap.keys())/2): 
+          self._notebookMap[i-1] = self._notebookMap[i]
+        del self._notebookMap[int(len(self._notebookMap.keys())/2)-1]
+        del self._notebookMap[object]
+        self.notebook.DeletePage(index)
       if hasattr(object, '_widgetHandler') and object._widgetHandler != None:
         object._widgetHandler.Destroy()
 
+
   def drawPage(self, page): 
     self._currentSelection = {}
     self.page = page
@@ -176,7 +212,6 @@
 
     page.walk(self.__drawItem)
 
-    self.getBlocks()
 
     EVT_CHAR(self.panel, self.keyTrap)
 #    EVT_LEFT_UP(self.panel, self.OnLeftUp)
@@ -184,28 +219,6 @@
     EVT_RIGHT_UP(self.panel, self.OnRightUp)
 #    EVT_MOTION(self.panel, self.OnMotion)
 
-  def getPages(self): 
-    self.pageCombo.Clear()
-    i = 0
-    selected = 0
-    for p in self._instance._pages: 
-      if p == self.page: 
-        selected = i
-      self.pageCombo.Append(p.name)
-      i = i + 1
-
-    self.pageCombo.SetSelection(selected)
-
-  def getBlocks(self): 
-    self.blockCombo.Clear()
-    self.blockList = []
-    self.page.walk(self.__getBlocks)
-    self.blockCombo.SetSelection(0)
-
-  def __getBlocks(self, object): 
-    if object.getObjectType() == 'GFBlock': 
-      self.blockList.append(object)
-      self.blockCombo.Append(object.name)
 
   def __drawItem(self, object): 
     if self.widgets.has_key(object.getObjectType()) and \
@@ -226,13 +239,12 @@
       self.widgetList.append(object)
 
   def OnSize(self, event): 
-    self.toolpanel.SetSize(wxSize(self.GetClientSize().x, 
self.toolpanel.GetSize().y))
     self.propBar.SetSize(wxSize(self.GetClientSize().x, 
self.propBar.GetSize().y))
     self.propBar.SetPosition(wxPoint(0, self.GetClientSize().y - 
self.propBar.GetSize().y))
-    self.workspace.SetSize(wxSize(self.GetClientSize().x, 
self.GetClientSize().y - self.toolpanel.GetSize().y - self.propBar.GetSize().y))
+    self.notebook.SetSize(wxSize(self.GetClientSize().x-8, 
self.GetClientSize().y - 8 - self.propBar.GetSize().y))
 
   def OnPageSelected(self, event): 
-    p = self._instance._pages[event.GetSelection()]
+    p = self._notebookMap[self.notebook.GetSelection()]
     if p != self.page:
       self._instance.onSetCurrentObject(p, __name__)
     self._setCurrentPage(p)
Index: gnue/designer/src/PopupMenu.py
diff -u gnue/designer/src/PopupMenu.py:1.4 gnue/designer/src/PopupMenu.py:1.5
--- gnue/designer/src/PopupMenu.py:1.4  Sun Jul 29 16:18:55 2001
+++ gnue/designer/src/PopupMenu.py      Sun Nov 18 23:38:11 2001
@@ -258,6 +258,9 @@
       # New >
 
       menu = wxMenu("New...")
+      self._newMenu = menu
+
+      self._holdingArea = []
  
       tag = string.lower(object.getObjectType()[2:])
       if Incubator.elementMapping.has_key(tag): 
@@ -273,7 +276,8 @@
               string.lower(descr[8:])
 
           menu.Append(tid, descr) 
-          EVT_MENU(menu, tid, self.OnCreateObject)
+          EVT_MENU(self, tid, self.OnCreateObject)
+
         self.AppendMenu(wxNewId(), "&New", menu)
   
       # Properties
Index: gnue/designer/src/PropertyEditor.py
diff -u gnue/designer/src/PropertyEditor.py:1.14 
gnue/designer/src/PropertyEditor.py:1.15
--- gnue/designer/src/PropertyEditor.py:1.14    Fri Nov 16 20:00:21 2001
+++ gnue/designer/src/PropertyEditor.py Sun Nov 18 23:38:11 2001
@@ -48,10 +48,17 @@
     self.object = None
     self.objectList = []
     self.objectMap = {}
+
+    # Set up our grid
     self.grid = wxGrid(self.panel, -1, pos=wxPoint(0,0))
     self.grid.CreateGrid(1,1)
+    self.grid.SetColLabelSize(0)
+
+    EVT_GRID_CELL_CHANGE(self.grid, self.OnCellChange)
+    EVT_GRID_CELL_LEFT_DCLICK(self.grid, self.OnLeftDClick)
     EVT_SIZE(self, self.onSize)
 
+
   def onSetCurrentObject (self, object, handler):
     if object == None: 
       return
@@ -65,11 +72,12 @@
 
       self.elements = elements[string.lower(object.getObjectType()[2:])]
 
-      # This is a nasty temporary way of refreshing grid
-      if self.grid: 
-        self.grid.Destroy()
-      self.grid = wxGrid(self.panel, -1, pos=wxPoint(0,0))
 
+      self.grid.BeginBatch()
+
+      self.grid.DeleteRows(0,self.grid.GetNumberRows())
+
+
       self.rowList = self.attributes.keys()
       self.rowList.sort()
 
@@ -86,26 +94,30 @@
           self.rowList.pop(i)
         else: 
           i = i + 1
-
 
-      self.grid.CreateGrid(len(self.rowList),1)
-      self.grid.SetColLabelSize(0)
+      self.grid.InsertRows(0,len(self.rowList))
 
       i = 0
 
       for key in self.rowList:
+  
+        words = string.split(key,'_')
+        for j in range(len(words)): 
+          try:
+            words[j] = string.upper(words[j][0]) + string.lower(words[j][1:])
+          except IndexError: 
+            words[j] = string.upper(words[j])
+        self.grid.SetRowLabelValue(i,string.join(words,' '))
 
-        self.grid.SetRowLabelValue(i, string.upper(key[0]) + 
string.lower(key[1:]))
-
         if self.attributes[key].has_key('ValueSet'): 
-          self.grid.SetCellEditor(i, 0, 
RestrictedCellEditor(self.attributes[key]))
+          self.grid.SetCellEditor(i, 0, 
RestrictedCellEditor(self.grid,self.attributes[key]))
         elif self.attributes[key]['Typecast'] == GTypecast.boolean: 
-          self.grid.SetCellEditor(i, 0, BoolCellEditor(self.attributes[key]))
+          self.grid.SetCellEditor(i, 0, 
BoolCellEditor(self.grid,self.attributes[key]))
         elif self.attributes[key]['Typecast'] in (GTypecast.integer, 
                 GTypecast.number, GTypecast.whole):
-          self.grid.SetCellEditor(i, 0, IntCellEditor(self.attributes[key]))
+          self.grid.SetCellEditor(i, 0, 
IntCellEditor(self.grid,self.attributes[key]))
         else: 
-          self.grid.SetCellEditor(i, 0, CharCellEditor(self.attributes[key]))
+           self.grid.SetCellEditor(i, 0, 
CharCellEditor(self.grid,self.attributes[key]))
 
         if hasattr(object, key): 
           if self.attributes[key]['Typecast'] == GTypecast.boolean:
@@ -113,12 +125,14 @@
               self.grid.SetCellValue(i,0,"TRUE")
             else: 
               self.grid.SetCellValue(i,0,"FALSE")
+              pass
           else: 
             self.grid.SetCellValue(i,0, "%s" % object.__dict__[key])
+            pass
         i = i + 1
-      self.onSize(None)
-      EVT_GRID_CELL_CHANGE(self.grid, self.OnCellChange)
-      self.grid.Refresh()
+
+      self.grid.EndBatch()
+      self.grid.ForceRefresh()
 
   def onCreateObject (self, object, handler):
     pass
@@ -141,9 +155,16 @@
     x,y = self.GetClientSizeTuple()
     self.panel.SetSize((x-12,y-12))
     self.grid.SetSize(self.panel.GetClientSizeTuple())
-    w,h = self.grid.GetClientSizeTuple()
+    w,h = self.grid.GetSizeTuple()
     self.grid.SetColSize(0, w - self.grid.GetRowLabelSize())
+    self.grid.ForceRefresh()
 
+
+  # Force a grid cell into Edit mode when Double-Clicked
+  def OnLeftDClick(self,evt): 
+    if self.grid.CanEnableCellControl(): 
+      self.grid.EnableCellEditControl()
+
   def OnCellChange(self, evt):
     attr = self.rowList[evt.GetRow()]
     value = self.grid.GetCellValue(evt.GetRow(), evt.GetCol())
@@ -159,11 +180,16 @@
 #
 #
 class CharCellEditor (wxPyGridCellEditor):
-  def __init__(self, attributes): 
+  def __init__(self, grid, attributes): 
     wxPyGridCellEditor.__init__(self)
+    self.grid = grid
     self.attributes = attributes
+    self.__created = 0
+
 
   def Create(self, parent, id, evtHandler):
+    self.__created = 1
+    GDebug.printMesg(10,'Creating CharCellEditor')
     self._tc = wxTextCtrl(parent, id, "")
     self._tc.SetInsertionPoint(0)
     self.SetControl(self._tc)
@@ -213,6 +239,7 @@
 
 
   def StartingKey(self, evt):
+    GDebug.printMesg(10, "Starting Key; created=%s" % self.__created)
     key = evt.GetKeyCode()
     ch = None
     if key in [WXK_NUMPAD0, WXK_NUMPAD1, WXK_NUMPAD2, WXK_NUMPAD3, WXK_NUMPAD4,
@@ -227,8 +254,9 @@
     if ch is not None:
       # For this example, replace the text.  Normally we would append it.
       #self._tc.AppendText(ch)
-      self._tc.SetValue(ch)
-      self._tc.SetInsertionPointEnd()
+#      self._tc.SetValue(ch)
+ #     self._tc.SetInsertionPointEnd()
+      pass
     else:
       evt.Skip()
 
@@ -239,10 +267,13 @@
   def Destroy(self):
     self.base_Destroy()
 
+  def Clone(self): 
+    return CharCellEditor(self.attributes)
 
+
 class IntCellEditor (CharCellEditor):
-  def __init__(self, attributes): 
-    CharCellEditor.__init__(self, attributes)
+  def __init__(self, grid, attributes): 
+    CharCellEditor.__init__(self, grid, attributes)
 
   def Create(self, parent, id, evtHandler):
     CharCellEditor.Create(self, parent, id, evtHandler)
@@ -254,10 +285,31 @@
         evt.KeyCode() < 32 or evt.KeyCode() > 126): 
       evt.Skip()
 
+  def StartingKey(self, evt):
+    key = evt.GetKeyCode()
+    ch = None
+    if key in [WXK_NUMPAD0, WXK_NUMPAD1, WXK_NUMPAD2, WXK_NUMPAD3, WXK_NUMPAD4,
+               WXK_NUMPAD5, WXK_NUMPAD6, WXK_NUMPAD7, WXK_NUMPAD8, 
WXK_NUMPAD9]:
+        ch = ch = chr(ord('0') + key - WXK_NUMPAD0)
+
+    elif key < 256 and key >= 0 and chr(key):
+      ch = chr(key)
+      if not evt.ShiftDown():
+        ch = string.lower(ch)
 
+    if '0' <= ch <= '9':
+      # For this example, replace the text.  Normally we would append it.
+      #self._tc.AppendText(ch)
+      pass
+#      self._tc.SetValue(ch)
+#      self._tc.SetInsertionPointEnd()
+    else:
+      evt.Skip()
+
+
 class RestrictedCellEditor (CharCellEditor):
-  def __init__(self, attributes): 
-    CharCellEditor.__init__(self, attributes)
+  def __init__(self, grid, attributes): 
+    CharCellEditor.__init__(self, grid, attributes)
     self.valueList = attributes['ValueSet'].keys()
       
     self.valueList.sort()
@@ -278,6 +330,7 @@
     self.valueList.insert(0, '')
 
   def Create(self, parent, id, evtHandler):
+    GDebug.printMesg(10,'Creating CharCellEditor')
     self._tc = wxComboBox(parent, id, "", style=wxCB_READONLY, 
                           choices=self.selectionList)
     self.SetControl(self._tc)
@@ -330,8 +383,8 @@
 
 
 class BoolCellEditor (CharCellEditor):
-  def __init__(self, attributes): 
-    CharCellEditor.__init__(self, attributes)
+  def __init__(self, grid, attributes): 
+    CharCellEditor.__init__(self, grid, attributes)
       
     self.selectionList = ['FALSE','TRUE']
 
@@ -498,16 +551,16 @@
   def __init__(self, instance, title): 
     ToolFrame.__init__(self, instance, "Property Editor")
 
-    self.toolpanel = wxPanel(self, -1, pos=wxPoint(0,0), size=wxSize(32,32), 
+    self.backpanel = wxPanel(self, -1, pos=wxPoint(0,0), 
size=self.GetClientSize())
+#    self.backpanel = self
+    self.toolpanel = wxPanel(self.backpanel, -1, pos=wxPoint(0,0), 
size=wxSize(32,32), 
          style=wxRAISED_BORDER|wxCLIP_CHILDREN)
 
-    self.notebook = wxNotebook(self, -1, pos=wxPoint(6, 37), 
size=wxSize(32,32))
+    self.notebook = wxNotebook(self.backpanel, -1, pos=wxPoint(6, 37), 
size=wxSize(32,32))
 
     self.propertyEditor = PropertyEditor(
          self.notebook, instance, instance._form)
 
-    self.temp = wxPanel(self.notebook, -1)
-
     self.eventEditor = EventEditor(
          self.notebook, instance, instance._form)
 
@@ -524,7 +577,7 @@
 
     EVT_SIZE(self, self.onSize)
 
-    self.objectList = []
+    self.objectList = [instance._form]
 
     instance._form.walk (self.inventoryObject)
     self.generateObjectMap()
@@ -558,6 +611,7 @@
 
   def onSize(self, event):
     w,h = self.GetClientSizeTuple()
+    self.backpanel.SetSize(wxSize(w,h))
     self.toolpanel.SetSize(wxSize(w,32))
     self.notebook.SetSize(wxSize(w-12,h-44))
 
Index: gnue/designer/src/TreeView.py
diff -u gnue/designer/src/TreeView.py:1.15 gnue/designer/src/TreeView.py:1.16
--- gnue/designer/src/TreeView.py:1.15  Tue Nov 13 17:12:49 2001
+++ gnue/designer/src/TreeView.py       Sun Nov 18 23:38:11 2001
@@ -74,7 +74,7 @@
 
     form.walk(self.inventoryLoadedItems)
 
-    EVT_RIGHT_UP(self, self.OnRightUp)
+    EVT_RIGHT_DOWN(self, self.OnRightDown)
     EVT_LEFT_DCLICK(self, self.OnEditProperties)
 
 
@@ -115,12 +115,12 @@
           icon = 'properties'
         elif object.getObjectType() in ('GFEntry',): 
           icon = 'entry'
-        elif len(object.getObjectType()) >= 8 and object.getObjectType()[:8] 
== 'GFImport': 
+        elif len(object.getObjectType()) >= 8 and \
+             object.getObjectType()[:8] == 'GFImport': 
           icon = 'import'
         elif object.findParentOfType('GFPage') != None: 
           icon = 'pagewidget'
  
-          
          
         object._treeItem = self.AppendItem(parentTreeItem, 
             "%s" % object.getDescription())
@@ -145,7 +145,7 @@
     if object == None: 
       return
     if handler != __name__:
-      print "Adding %s (%s)" % (object.name, object.getObjectType())
+      GDebug.printMesg(4,"Adding %s (%s)" % (object.name, 
object.getObjectType()))
       self.inventoryLoadedItems(object)
 
   def onModifyObject (self, object, handler, modifications):
@@ -177,13 +177,13 @@
   def OnTreeItemSelected(self, event): 
     if self.__handler == None: 
       object = self.GetPyData(event.GetItem())
-
       if object != None and not isinstance(object, ObjectMenu): 
         self.instance.onSetCurrentObject(object, __name__)
       else: 
         self.instance.onSetCurrentObject(None, __name__)
+   
 
-  def OnRightUp(self, event):
+  def OnRightDown(self, event):
     id, flags = self.HitTest(event.GetPosition())
     object = self.GetPyData(id)
     self.EnsureVisible(id)
@@ -193,6 +193,7 @@
     elif object != None: 
       self.PopupMenu(object._popupMenu, event.GetPosition())
       
+
   def OnEditProperties(self, event): 
 
     id, flags = self.HitTest(event.GetPosition())



reply via email to

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