Thread: Developing 2 D graphics apps in firemonkey
 |
This question is answered.
Helpful answers available: 1.
Correct answers available: 1.
|
|
Replies:
8
-
Last Post:
Sep 18, 2015 7:32 PM
Last Post By: Douglas Rudd
|
|
|
Posts:
11
Registered:
10/8/15
|
|
Hi,
I have a cross-platform project where I need to develop an application similar to a ERD (entity relationship diagram) where entities can be created on the fly, and each entity can be linked to another, dragged around, and dropped, etc, and then saved. There might be in theory thousands of entities (I'm not sure how many) so speed will be an issue I imagine when displaying them. It needs to be lightening fast.
Each entity on the screen is basically a rectangle with some other bits of information displayed in it (name, description, etc). The entity must be selectable (receive focus) and be capable of being dragged around, etc, so that the connectors paint properly. The area where the rectangles are drawn must be zoomable.
If anyone has done something like this, I would appreciate some guidance on this. We're at the very beginning of the project so any feedback/tips on possible directions will be much appreciated.
At the moment, my initial thoughts are to use TShape. I expect this might change
Thanks
|
|
|
Posts:
1,346
Registered:
11/9/13
|
|
|
|
|
Posts:
11
Registered:
10/8/15
|
|
Thanks for the reply
I've been playing around with some code. The thing I'm struggling with at the moment is the difference between firemonkey and delphi drag and drop. Stuff I would do in Delphi doesn't seem to work in Firemonkey. Do you have any experience writing firemonkey apps where the user is able to move controls around?
|
|
|
|
Posts:
15
Registered:
10/3/99
|
|
Derek Seymour wrote:
[...]
Do you have any experience writing firemonkey apps where the user is able to move controls around?
Have a look at TSelection. You would create a TShape with the TSelection as parent (set the shape to alClient). Set the Shape's HitTest to pass mouse actions through to the Selection object. TSelection has grab handles built in, you can show/hide those as desired. Use the Selection's HitTest property to prevent or allow movement and resizing. In essence, you're moving/resizing the Selection onscreen, and the Shape goes with it. (Note: this is based on XE4 experience. Some aspects may have changed in newer FMX versions.)
hth,
John
|
|
|
|
Posts:
1
Registered:
11/17/07
|
|
Take a look at TMS Diagram Studio. I needed similar features years ago and Diagram Studio worked great.
http://www.tmssoftware.com/site/diagram.asp
Hi,
I have a cross-platform project where I need to develop an application similar to a ERD (entity relationship diagram) where entities can be created on the fly, and each entity can be linked to another, dragged around, and dropped, etc, and then saved. There might be in theory thousands of entities (I'm not sure how many) so speed will be an issue I imagine when displaying them. It needs to be lightening fast.
Each entity on the screen is basically a rectangle with some other bits of information displayed in it (name, description, etc). The entity must be selectable (receive focus) and be capable of being dragged around, etc, so that the connectors paint properly. The area where the rectangles are drawn must be zoomable.
If anyone has done something like this, I would appreciate some guidance on this. We're at the very beginning of the project so any feedback/tips on possible directions will be much appreciated.
At the moment, my initial thoughts are to use TShape. I expect this might change
Thanks
|
|
|
|
Posts:
314
Registered:
5/16/97
|
|
|
|
|
Posts:
11
Registered:
10/8/15
|
|
Thanks!! I have no speech. This is exactly what I need and provides an unbelievable jumping off point. Thanks
|
|
|
|
Posts:
23
Registered:
11/7/99
|
|
Updating HitTest for all rectangles every time a drag operation starts doesn't look like the best option. What works better is capturing the mouse inside a control and handle mouse events from there.
To capture the mouse use code like this: DraggableObject.Root.Captured := DraggableObject;
DraggableObject will now receive all mouse events.
|
|
|
|
Posts:
314
Registered:
5/16/97
|
|
Good idea.
I added some more features to the example.
|
|
|
|
Legend
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|
Connect with Us