Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-07

UML Designer program

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Osvaldo Filho

Hi all.
Where can i find information for create a designer with control of entities: redesign, move entities (squares), like uml designer.

Like IbEasy Designer.

Any code sample for download?

Thanks

Reply by email

Leslie Kaye
to Osvaldo Filho
Osvaldo Filho wrote
Hi all. Where can i find information for create a designer with control of entities: redesign, move entities (squares), like uml designer.

To move components around at run time, first create the drawing surface
- a TPanel for example and place a sample entity like a another TPanel on it, then set its events.
Use MouseDown to

* confirm you have a left mouse click and set an EntityIsDragging Boolean variable to True
* identify the component being moved (which you get from TWinControl(Sender) )
* store the component's starting Top and Left position and the starting mouse position

Use MouseMove check if EntityIsDragging then change the component's Top and Left according to the new mouse position
Use MouseUp to set EntityIsDragging to False

You can then delete the sample entity component that you have created.

At run time you will allow the user to create new entities. You will need to set the Mouse events of the new entities to the code you created (hence the importance of identifying the active entity from the Sender passed in the Mouse down event).

You may wish to create new entities by drag and drop for instance from a list of buttons or whatever on a sidebar (like allowed with the Delphi tool palette and it would be nice to have in Lazarus!!). You use the Drag and Drop methods in a very similar way, just remembering to set your design surface DragOver event to include
Accept := True;

Show quoted text 9 lines
Like IbEasy Designer. Any code sample for download? Thanks

Reply by email