/[papo]/gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py
ViewVC logotype

Diff of /gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by styxman, Fri Nov 8 16:46:03 2002 UTC revision 1.4.4.1 by anthonyl, Tue Mar 4 22:11:40 2003 UTC
# Line 16  Line 16 
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 2001-2002 Free Software Foundation  # Copyright 2001-2003 Free Software Foundation
20  #  #
21  # FILE:  # FILE:
22  # DisplayDropTarget.py  # DisplayDropTarget.py
# Line 29  from wxPython.wx import * Line 29  from wxPython.wx import *
29  import sys, string  import sys, string
30  from Utils import *  from Utils import *
31  from gnue.common import GDebug  from gnue.common import GDebug
 from gnue.designer.forms import Incubator  
32    
33  import cPickle  import cPickle
34    
# Line 61  class DisplayDropTarget(wxPyDropTarget): Line 60  class DisplayDropTarget(wxPyDropTarget):
60    # do something with it.    # do something with it.
61    def OnData(self, x, y, d):    def OnData(self, x, y, d):
62    
63        instance = self.editor.instance
64    
65      # copy the data from the drag source to our data object      # copy the data from the drag source to our data object
66      if self.GetData():      if self.GetData():
67        # convert it back to our format        # convert it back to our format
# Line 110  class DisplayDropTarget(wxPyDropTarget): Line 111  class DisplayDropTarget(wxPyDropTarget):
111                    return d # TODO: This should actually return a failure                    return d # TODO: This should actually return a failure
112    
113                  # Create a parent block                  # Create a parent block
114                  parent = Incubator.createObject(                  parent = instance.incubator.createObject(
115                              self.editor._instance,                              instance.rootObject,
                             self.editor._instance.rootObject,  
116                              'block',                              'block',
117                              parent=self.editor.page,                              self.editor.page,
118                              attributes={'datasource':datasource})                              attributes={'datasource':datasource})
119              else:              else:
120                for child in self.editor.page._children:                for child in self.editor.page._children:
# Line 161  class DisplayDropTarget(wxPyDropTarget): Line 161  class DisplayDropTarget(wxPyDropTarget):
161                  y += 1                  y += 1
162    
163              # Create a label              # Create a label
164              Incubator.createObject(              instance.incubator.createObject(
165                      self.editor._instance,                      instance.rootObject,
                     self.editor._instance.rootObject,  
166                      'label',                      'label',
167                      parent=self.editor.page,                      self.editor.page,
168                      attributes={'x': lx,                      attributes={'x': lx,
169                                  'y': ly,                                  'y': ly,
170                                  'width': len(label),                                  'width': len(label),
# Line 194  class DisplayDropTarget(wxPyDropTarget): Line 193  class DisplayDropTarget(wxPyDropTarget):
193          # Create our new object          # Create our new object
194          #          #
195          if not params['Type'] in ('selectedWidgets',):          if not params['Type'] in ('selectedWidgets',):
196            object = Incubator.createObject(            object = instance.incubator.createObject(
197              self.editor._instance,              instance.rootObject,
             self.editor._instance.rootObject,  
198              params['Type'],              params['Type'],
199              parent=parent,              parent,
200              attributes=attributes)              attributes=attributes)
201    
202            if params['Type'] in ('entry',):            if params['Type'] in ('entry',):
# Line 218  class DisplayDropTarget(wxPyDropTarget): Line 216  class DisplayDropTarget(wxPyDropTarget):
216    
217    
218                if triggertext:                if triggertext:
219                  Incubator.createObject(                  instance.incubator.createObject(
220                      self.editor._instance,                      instance.rootObject,
                     self.editor._instance.rootObject,  
221                      'trigger',                      'trigger',
222                      parent = object,                      object,
223                      attributes = {                      attributes = {
224                        '_content_': triggertext,                        '_content_': triggertext,
225                        'type': 'PRE-INSERT',                        'type': 'PRE-INSERT',

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.4.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26