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 |
# reports/LayoutEditor.py |
# reports/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) |
def init(self): |
|
self.frame = instance |
|
36 |
self.panelColor = self.GetBackgroundColour() |
self.panelColor = self.GetBackgroundColour() |
37 |
self._instance = instance |
self._instance = self.instance |
38 |
self.rootObject = instance.rootObject |
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 |
|
}) |
49 |
|
|
|
def onCreateObject (self, object, handler): |
|
|
pass |
|
50 |
|
|
51 |
def onModifyObject (self, object, handler, modifications): |
def inventoryObject(self, object): |
52 |
pass |
pass |
53 |
|
|
54 |
def onDeleteObject (self, object, handler): |
def onSetCurrentObject (self, event): |
55 |
pass |
object = event.object |
56 |
|
handler = event.originator |
57 |
|
|
58 |
|
def onCreateObject (self, event): |
59 |
|
object = event.object |
60 |
|
handler = event.originator |
61 |
|
|
62 |
|
def onModifyObject (self, event): |
63 |
|
object = event.object |
64 |
|
handler = event.originator |
65 |
|
modifications = event.modifications |
66 |
|
|
67 |
|
def onDeleteObject (self, event): |
68 |
|
object = event.object |
69 |
|
handler = event.originator |
70 |
|
|
71 |
|
|
72 |
|
|