Draw rectangle on canvas and attach elements to it [message #555901] |
Mon, 30 August 2010 07:24 |
Cedric Moonen Messages: 274 Registered: August 2009 |
Senior Member |
|
|
Hello,
I am currently designing a graphical editor which allow the user to place components on the diagram. These components have input ports and ouptut ports. The user can then connect the different elements via those ports (so, something very similar as an electronic logic diagram). All the elements have a predefined number of input/output ports but one element is a "composite" element: the user can add any number of input/output ports and double-click the component to open it in another diagram. The user can then add elements ("sub-elements") to this diagram.
I have been able to fulfill most of my requirements but now I am looking for something specific for this composite element. When the element is opened in another diagram, I would like to draw a rectangle on the canvas (which represents the component borders). This rectangle could be resized by the user if needed (it has a default size which might be too small for instance). Then, the input ports are affixed on the left side of the rectangle and the ouptut ports are affixed on the right side of the rectangle (they can be moved, but only on those two sides).
Any idea how I can achieve something like that ?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.04464 seconds