You should create a CompositDrawObject that contains the bitmap and text as sub object. The _Draw method of the Composit must then call the _Draw of the sub objects.
You can then create a composit object, add some sub objects to the composit, add the composit to the canvas. Moving the composit object will the all sub object (text and bitmap) If you still make both (composit and text) hitable (both have to be added to the canvas) it is possible to make is so that the text for example can be moved independently of the bitmap, but both are moved when the bitmap is moved. CompositObjects adds a lot of flexibility it is worth implementing it. Hope this helps Retief Gerber Lektor Lecturer Departement Elektriese en Elektroniese Ingenieurswese Department of Electrical and Electronic Engineering Tel: +27 21 808 4011 I Faks/Fax: +27 21 808 4981 E-pos/E-mail: [EMAIL PROTECTED] Universiteit Stellenbosch University Privaat Sak/Private Bag X1 Matieland 7602 Suid-Afrika/South Africa www.eng.sun.ac.za > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:floatcanvas- > [EMAIL PROTECTED] On Behalf Of Marco Meoni - Sbaush > Sent: 24 May 2007 12:42 PM > To: Mailing List for the wxPython Float Canvas. > Subject: [fc] Link two Binding Object > > Hi all. > Using the new MovingElements.py written by Chris in a previous mail i > draw a map with draggable bitmaps and draggable text > > For bitmaps i use this lines: > > self.shape=MovingBitmap (self.bmp, self.point, Height = 3.5, Position = > "bc") > self.Canvas.AddObject(self.shape) > self.shape.Bind(FC.EVT_FC_LEFT_DOWN, parent.ObjectHit) > > And for the text i use: > > self.text = MovingText (testo, self.textPoint, Size = 1, Position = > "tc") > self.Canvas.AddObject(self.text) > self.text.Bind(FC.EVT_FC_LEFT_DOWN, parent.ObjectHit) > > I wrote MovingText class like MovingBitmaps and like all > MovingElements... > class MovingText(FC.ScaledText, MovingObjectMixin, > ConnectorObjectMixin): > pass > > So i have a bitmap and a text. I can drag and move these on the > canvas, and this works perfectly. > > Now i have a problem... > > How can i "link" the drag&move of the elements? > Explaining, i have the bitmap in a Point, like (x,y). > The text is under the bitmap, self.textPoint=(x,y-1). > I would that moving the bitmap, also the text could move itself, going > under the bitmap. > How can i do this? Is possible? > > Please ask if you don't have understand from my bad english. > -- > Marco Meoni (Sbaush) > _______________________________________________ > FloatCanvas mailing list > [email protected] > http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
