16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2002 Free Software Foundation |
# Copyright 2002-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# schema/LayoutEditor.py |
# schema/LayoutEditor.py |
28 |
# |
# |
29 |
|
|
30 |
from wxPython.wx import * |
from wxPython.wx import * |
31 |
|
from gnue.designer.base.ToolPanel import ToolPanel |
32 |
|
|
33 |
class LayoutEditor (wxPanel): |
class LayoutEditor (ToolPanel): |
34 |
def __init__(self, instance, parentWindow): |
|
35 |
wxPanel.__init__(self,parentWindow,-1) |
runtime_section = 'SchemaLayoutEditor' |
36 |
self.frame = instance |
|
37 |
|
def init(self): |
38 |
self.panelColor = self.GetBackgroundColour() |
self.panelColor = self.GetBackgroundColour() |
|
self._instance = instance |
|
|
self.rootObject = instance.rootObject |
|
39 |
self._app = instance._app |
self._app = instance._app |
40 |
self.rootObject.walk(self.inventoryObject) |
self.rootObject.walk(self.inventoryObject) |
41 |
|
|
42 |
def inventoryObject(self, object): |
# EventAware provided by ToolPanel |
43 |
pass |
self.registerEventListeners({ |
44 |
|
'ObjectSelected' : self.onSetCurrentObject, |
45 |
def onSetCurrentObject (self, object, handler): |
'ObjectCreated' : self.onCreateObject, |
46 |
pass |
'ObjectModified' : self.onModifyObject, |
47 |
|
'ObjectDeleted' : self.onDeleteObject, |
48 |
def onCreateObject (self, object, handler): |
}) |
|
pass |
|
|
|
|
|
def onModifyObject (self, object, handler, modifications): |
|
|
pass |
|
49 |
|
|
50 |
def onDeleteObject (self, object, handler): |
def inventoryObject(self, object): |
51 |
pass |
pass |
52 |
|
|
53 |
|
def onSetCurrentObject (self, event): |
54 |
|
object = event.object |
55 |
|
handler = event.originator |
56 |
|
|
57 |
|
def onCreateObject (self, event): |
58 |
|
object = event.object |
59 |
|
handler = event.originator |
60 |
|
|
61 |
|
def onModifyObject (self, event): |
62 |
|
object = event.object |
63 |
|
handler = event.originator |
64 |
|
|
65 |
|
def onDeleteObject (self, event): |
66 |
|
object = event.object |
67 |
|
handler = event.originator |
68 |
|
|