Working with Delphi Controls within a SimpleGraph

Please discuss general Delphi programming topics here.

Working with Delphi Controls within a SimpleGraph

Postby Maybel » April 21st, 2008, 7:21 pm

What event handles the controls painting on a SimpleGraph?
I made a new TGraphNode, that has a TCategoryButtons inside a RoundRect Region, it draws well (the region border and the Delphi Control inside)and I can drag them fine too, but when I scroll the Graph, then the TCategoryButtons doesn't move, stays in the same position and have not found yet where painting controls is handled (not even the class that handles that), to put on that even the code I use in dragging, for moving the contorl with the RoundRect Region.
I would appreciate a lot if someone could help me
Thanks
Maybel
Active Member
Active Member
 
Posts: 5
Joined: April 21st, 2008, 7:09 pm

Postby Kambiz » April 24th, 2008, 11:50 am

I think the best place to reposition your control is inside WM_VSCROLL and WM_HSCROLL windows message handlers of SG.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Maybel » April 24th, 2008, 12:05 pm

thank you very much for you to reply.. I will try that ... but maybe you could tell me if is this right: I create the control into the round Rect area and then, on graggin , what I do is just MoveWindow and when I write some code in any event.. what I am trying to do is MoveWindow again.. do you think that is right??? any way will try that first
Thank you a lot
Maybel
Active Member
Active Member
 
Posts: 5
Joined: April 21st, 2008, 7:09 pm

Postby Maybel » April 24th, 2008, 12:43 pm

Well I tried and it doesn't work, I guess has something to do with the fact that after WM_VSCROLL and WM_HSCROLL then is called WM_PAINT and there every control that is owned by the SG is repainted, or something like taht by RepaintControls and that procedure doesn't belong to SG but Windows. so the final result is that the SG scrolls under the controls and the control stays like before, doesn't move not even a pixel until, if I keep scrolling the window, the RoundRect region desappears of the screen, then the controls move keeping the distance reached by scrolling before... Can I send to you the code or the exe for you to see what does really happen?
Maybel
Active Member
Active Member
 
Posts: 5
Joined: April 21st, 2008, 7:09 pm

Postby Kambiz » April 25th, 2008, 6:39 am

Yes please send the code. I'll try to find a solution.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Kambiz » April 25th, 2008, 8:01 pm

Beside scrolling, the embedded control does not zoom with other parts of the graph.

The only solution that I can propose is to take a snapshot of the control (metafile has better quality for zooming) and draw it as the background of the node. Then, when mouse cursor is over the node, you have to redirect mouse events to the control, and probably update the snapshot. It’s lot of work I guess.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Maybel » April 28th, 2008, 2:14 pm

I already sent you the source.. thank you a lot
Maybel
Active Member
Active Member
 
Posts: 5
Joined: April 21st, 2008, 7:09 pm

Postby Maybel » April 28th, 2008, 2:22 pm

Oh! I have not seen the last reply you posted.. sorry, I will try and see if it behaves as I need...
Thank you a lot for your time!
I will let you know if it works
Maybel
Active Member
Active Member
 
Posts: 5
Joined: April 21st, 2008, 7:09 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron