BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PaintBox invalidation and movable panel

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
dpap
Guest





PostPosted: Wed Jul 05, 2006 10:53 pm    Post subject: PaintBox invalidation and movable panel Reply with quote



Hi,
in my application i use a paintbox to plot a large design. In the onpaint
event i wrote code that draws the apropriate part of the design and works
right. Now i put some movable panels (JvPanel) at spesific places over the
paintbox. Draging the panel with mouse works fine but, i want to move the
panel progarmmatically together with the desined area. Placing the
statements Panel.left := x; Panel.top := y in the onpaint event makes the
paintbox to infinitally draws itself. What is the right place or method to
move the panels without redrawing the paintbox (as it happens when i mouve
them by mouse) ?

thanks in advance
Back to top
Charles Hacker
Guest





PostPosted: Thu Jul 06, 2006 4:29 am    Post subject: Re: PaintBox invalidation and movable panel Reply with quote



dpap wrote:
Quote:

in my application i use a paintbox to plot a large design. In the onpaint
event i wrote code that draws the apropriate part of the design and works
right. Now i put some movable panels (JvPanel) at spesific places over the
paintbox. Draging the panel with mouse works fine but, i want to move the
panel progarmmatically together with the desined area. Placing the
statements Panel.left := x; Panel.top := y in the onpaint event makes the
paintbox to infinitally draws itself. What is the right place or method to
move the panels without redrawing the paintbox (as it happens when i mouve
them by mouse) ?

Well from the above it is hard to really know what you are trying to
achieve.
Perhaps you could post some sample code, or place a demo app in
'attachments' newsgroup, so we can take a look.

However, from what I can detemrmine from the above information, I am
guessing there may be a better way to achieve your desired outcome.


--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia
Back to top
Peter Below (TeamB)
Guest





PostPosted: Thu Jul 06, 2006 10:55 pm    Post subject: Re: PaintBox invalidation and movable panel Reply with quote



dpap wrote:

Quote:
Hi,
in my application i use a paintbox to plot a large design. In the
onpaint event i wrote code that draws the apropriate part of the
design and works right. Now i put some movable panels (JvPanel) at
spesific places over the paintbox. Draging the panel with mouse works
fine but, i want to move the panel progarmmatically together with the
desined area. Placing the statements Panel.left := x; Panel.top := y
in the onpaint event makes the paintbox to infinitally draws itself.
What is the right place or method to move the panels without
redrawing the paintbox (as it happens when i mouve them by mouse) ?

You cannot do it in the OnPaint event since moving the panel forces the
paintbox to redraw, so you get recursion. You have to do it from
elsewhere, but from your description it is not evident how the panels
connect to the displayed "design".



--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Back to top
dpap
Guest





PostPosted: Fri Jul 07, 2006 4:11 am    Post subject: Re: PaintBox invalidation and movable panel Reply with quote

Quote:
You cannot do it in the OnPaint event since moving the panel forces the
paintbox to redraw, so you get recursion. You have to do it from
elsewhere, but from your description it is not evident how the panels
connect to the displayed "design".

I want to draw a tablet at a speific place of the drawing to include some

information about this point (X,Y coords, etc). Thie tablet must be movable
with the mouse, to be able to reposition by user, but also must be moved
(programmatically) when the user scrolls the drawing. I use JvPanel (Jedi 3)
but i don't know how to reposition it so to accompany the drawind at every
place.
I realize that it wasn't the better way so i change my code do the same
without panels, just plotting commands, and i have achieve it but i'm still
curious.
thanks
Back to top
Peter Below (TeamB)
Guest





PostPosted: Fri Jul 07, 2006 11:28 pm    Post subject: Re: PaintBox invalidation and movable panel Reply with quote

dpap wrote:

Quote:
You cannot do it in the OnPaint event since moving the panel forces
the paintbox to redraw, so you get recursion. You have to do it from
elsewhere, but from your description it is not evident how the
panels connect to the displayed "design".

I want to draw a tablet at a speific place of the drawing to include
some information about this point (X,Y coords, etc). Thie tablet must
be movable with the mouse, to be able to reposition by user, but also
must be moved (programmatically) when the user scrolls the drawing. I
use JvPanel (Jedi 3) but i don't know how to reposition it so to
accompany the drawind at every place. I realize that it wasn't the
better way so i change my code do the same without panels, just
plotting commands, and i have achieve it but i'm still curious.
thanks

In this case you would have to detect the scroll event and reposition
the panels there. If your paintbox sits in a scrollbox you should be
able to just parent the panels to the scrollbox to get them scrolled
with the paintbox.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.