[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/designer/src base/Instance.py base/ObjectL...
From: |
Jason Cater |
Subject: |
gnue/designer/src base/Instance.py base/ObjectL... |
Date: |
Fri, 06 Jun 2003 21:11:01 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Branch:
Changes by: Jason Cater <address@hidden> 03/06/06 21:11:01
Modified files:
designer/src/base: Instance.py ObjectList.py ToolDock.py
ToolFrame.py ToolPanel.py
designer/src/base/tools: SchemaNavigator.py
designer/src/forms: Instance.py
Log message:
General bug fixes and code cleanup
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/Instance.py.diff?tr1=1.100&tr2=1.101&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/ObjectList.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/ToolDock.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/ToolFrame.py.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/ToolPanel.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/base/tools/SchemaNavigator.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/Instance.py.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
Patches:
Index: gnue/designer/src/base/Instance.py
diff -c gnue/designer/src/base/Instance.py:1.100
gnue/designer/src/base/Instance.py:1.101
*** gnue/designer/src/base/Instance.py:1.100 Mon Jun 2 20:21:11 2003
--- gnue/designer/src/base/Instance.py Fri Jun 6 21:11:00 2003
***************
*** 28,33 ****
--- 28,35 ----
# NOTES:
#
+ __all__ = ['BaseInstance']
+
import sys, os, time, dircache, string
from wxPython.wx import *
from gnue.common.apps import GDebug
Index: gnue/designer/src/base/ObjectList.py
diff -c gnue/designer/src/base/ObjectList.py:1.4
gnue/designer/src/base/ObjectList.py:1.5
*** gnue/designer/src/base/ObjectList.py:1.4 Wed Jun 4 16:00:52 2003
--- gnue/designer/src/base/ObjectList.py Fri Jun 6 21:11:00 2003
***************
*** 25,44 ****
# Maintains a list of GObjects, keeping it in synch with any
# attribute changes, additions, or deletions.
#
# NOTES:
#
__all__ = ['ObjectList']
- def _dummy(*args, **parms):
- pass
-
class ObjectList:
! def __init__(self, instance, base, nameAttr, updateMethod=_dummy):
self.base = base
self.name = nameAttr
! self.update = updateMethod
self.objects = []
instance.registerEventListeners({
'ObjectCreated' : self.__objectCreated,
--- 25,45 ----
# Maintains a list of GObjects, keeping it in synch with any
# attribute changes, additions, or deletions.
#
+ # Listeners can be notified when this list changes in any way.
+ #
# NOTES:
+ # This list isn't meant for code that needs to finely track
+ # changes to objects, but just need a current list of objects.
#
__all__ = ['ObjectList']
class ObjectList:
! def __init__(self, instance, base, nameAttr, updateMethod=None):
self.base = base
self.name = nameAttr
! self.listeners = updateMethod and [updateMethod] or []
self.objects = []
instance.registerEventListeners({
'ObjectCreated' : self.__objectCreated,
***************
*** 47,52 ****
--- 48,59 ----
})
instance.rootObject.walk(self.__inventory)
+ def addListener(self, listener):
+ self.listeners.append(listener)
+
+ def removeListener(self, listener):
+ self.listeners.remove(listener)
+
def __inventory(self, object):
if isinstance(object, self.base):
self.objects.append(object)
***************
*** 55,73 ****
if isinstance(event.object, self.base) and \
self.name in event.old.keys() or \
self.name in event.new.keys():
! self.update()
def __objectCreated (self, event):
if isinstance(event.object, self.base):
self.objects.append(event.object)
! self.update()
def __objectDeleted (self, event):
try:
self.objects.remove(event.object)
except ValueError:
return
! self.update()
def getDict(self):
rs = {}
--- 62,83 ----
if isinstance(event.object, self.base) and \
self.name in event.old.keys() or \
self.name in event.new.keys():
! for listener in self.listeners:
! listener()
def __objectCreated (self, event):
if isinstance(event.object, self.base):
self.objects.append(event.object)
! for listener in self.listeners:
! listener()
def __objectDeleted (self, event):
try:
self.objects.remove(event.object)
except ValueError:
return
! for listener in self.listeners:
! listener()
def getDict(self):
rs = {}
Index: gnue/designer/src/base/ToolDock.py
diff -c gnue/designer/src/base/ToolDock.py:1.9
gnue/designer/src/base/ToolDock.py:1.10
*** gnue/designer/src/base/ToolDock.py:1.9 Sun May 25 11:55:49 2003
--- gnue/designer/src/base/ToolDock.py Fri Jun 6 21:11:00 2003
***************
*** 28,33 ****
--- 28,35 ----
# NOTES:
#
+ __all__ = ['ToolDock']
+
from wxPython.wx import *
from gnue.common.apps import RuntimeSettings
Index: gnue/designer/src/base/ToolFrame.py
diff -c gnue/designer/src/base/ToolFrame.py:1.21
gnue/designer/src/base/ToolFrame.py:1.22
*** gnue/designer/src/base/ToolFrame.py:1.21 Thu May 29 01:07:22 2003
--- gnue/designer/src/base/ToolFrame.py Fri Jun 6 21:11:00 2003
***************
*** 19,30 ****
# Copyright 2001-2003 Free Software Foundation
#
# FILE:
! # Instance.py
#
# DESCRIPTION:
#
# NOTES:
#
import os, sys, string
from gnue.common.apps import RuntimeSettings
--- 19,32 ----
# Copyright 2001-2003 Free Software Foundation
#
# FILE:
! # ToolFrame.py
#
# DESCRIPTION:
#
# NOTES:
#
+
+ __all__ = ['ToolFrame']
import os, sys, string
from gnue.common.apps import RuntimeSettings
Index: gnue/designer/src/base/ToolPanel.py
diff -c gnue/designer/src/base/ToolPanel.py:1.15
gnue/designer/src/base/ToolPanel.py:1.16
*** gnue/designer/src/base/ToolPanel.py:1.15 Wed May 28 17:08:26 2003
--- gnue/designer/src/base/ToolPanel.py Fri Jun 6 21:11:00 2003
***************
*** 26,31 ****
--- 26,33 ----
# NOTES:
#
+ __all__ = ['ToolPanel','DockedToolPane']
+
from wxPython.wx import *
TITLEBAR_ACTIVE = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_HIGHLIGHT)
Index: gnue/designer/src/base/tools/SchemaNavigator.py
diff -c gnue/designer/src/base/tools/SchemaNavigator.py:1.4
gnue/designer/src/base/tools/SchemaNavigator.py:1.5
*** gnue/designer/src/base/tools/SchemaNavigator.py:1.4 Wed Jun 4 19:24:12 2003
--- gnue/designer/src/base/tools/SchemaNavigator.py Fri Jun 6 21:11:01 2003
***************
*** 44,49 ****
--- 44,52 ----
#
#
#
+
+ __all__ = ['SchemaNavigator']
+
import sys, os, cPickle, traceback, StringIO, string, types
from wxPython.wx import *
from wxPython.gizmos import *
***************
*** 132,138 ****
--- 135,143 ----
dropSource = wxDropSource(self)
dropSource.SetData(do)
+ self.instance.dispatchEvent('BeginUndoGroup')
result = dropSource.DoDragDrop(false)
+ self.instance.dispatchEvent('EndUndoGroup')
def OnBeginRDrag(self, event):
self.OnBeginDrag(event, right=1)
Index: gnue/designer/src/forms/Instance.py
diff -c gnue/designer/src/forms/Instance.py:1.42
gnue/designer/src/forms/Instance.py:1.43
*** gnue/designer/src/forms/Instance.py:1.42 Mon Jun 2 20:21:11 2003
--- gnue/designer/src/forms/Instance.py Fri Jun 6 21:11:01 2003
***************
*** 99,110 ****
self.datasources = ObjectList(self, GDataSource.GDataSource, 'name')
self.blocks = ObjectList(self, GFBlock, 'name')
- # Name mappings, so names can automatically be updated
- self.addNameMapper('GCDataSource','name', 'GFBlock', 'datasource')
- self.addNameMapper('GFBlock','name', 'GFField', 'block')
- ## self.addNameMapper('GCTrigger','name', 'GFField', 'block')
- ## self.addNameMapper('GFField',('name','block'), 'GFEntry', 'datasource')
-
def loadBuffer(self, buffer):
form = GFParser.loadFile (buffer, self, initialize=0)
--- 99,104 ----