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 

Prevent MDI Child from going outside visible area of parent?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Segal
Guest





PostPosted: Fri May 20, 2005 4:02 pm    Post subject: Prevent MDI Child from going outside visible area of parent? Reply with quote



I've been looking every where for a solution (docs (cpp, vcl, win32
sdk), google (groups, www)) but can't seem to find anything useful.

I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area. I've
seen some apps do this, and even have a snapping/magnet effect when one
of the child's edges are very close to one of the inner edges of the
parent.

How is this done?

Thank you very much.


Back to top
Kent
Guest





PostPosted: Sat May 21, 2005 4:16 am    Post subject: Re: Prevent MDI Child from going outside visible area of par Reply with quote



One way is to handle the WM_MOVING message for the child form and
compare the child form's BoundsRect to the parent form's ClientRect.

Kent



Back to top
Hans Galema
Guest





PostPosted: Sat May 21, 2005 6:22 pm    Post subject: Re: Prevent MDI Child from going outside visible area of par Reply with quote



Segal wrote:

Quote:
I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area. I've
seen some apps do this, and even have a snapping/magnet effect when one
of the child's edges are very close to one of the inner edges of the
parent.

Intercept the WM_MOVE message (maybe its called WM_MOVING or so).
Examples how to prevent a window to move or to restrict its position
have been posted before.

Google: Advanced Groups Search
http://www.google.com/advanced_group_search?hl=en
for groups: *cppbuilder* and words
WM_MOVE (and so)

Hans.

Back to top
Segal
Guest





PostPosted: Sat May 21, 2005 7:04 pm    Post subject: Re: Prevent MDI Child from going outside visible area of par Reply with quote

Hans Galema wrote:
Quote:
Segal wrote:

I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area.
I've seen some apps do this, and even have a snapping/magnet effect
when one of the child's edges are very close to one of the inner
edges of the parent.

Intercept the WM_MOVE message (maybe its called WM_MOVING or so).
Examples how to prevent a window to move or to restrict its position
have been posted before.

Google: Advanced Groups Search
http://www.google.com/advanced_group_search?hl=en
for groups: *cppbuilder* and words
WM_MOVE (and so)

Hans.

Thank you very much.



Back to top
Segal
Guest





PostPosted: Mon May 23, 2005 12:05 am    Post subject: Re: Prevent MDI Child from going outside visible area of par Reply with quote

Hans Galema wrote:
Quote:
Segal wrote:

I want to prevent my MDI chidden from being able to move outside the
visible portion. In other words cage them inside the viewable area.
I've seen some apps do this, and even have a snapping/magnet effect
when one of the child's edges are very close to one of the inner
edges of the parent.

Intercept the WM_MOVE message (maybe its called WM_MOVING or so).
Examples how to prevent a window to move or to restrict its position
have been posted before.

Google: Advanced Groups Search
http://www.google.com/advanced_group_search?hl=en
for groups: *cppbuilder* and words
WM_MOVE (and so)

Thank you I was able to get it to work, much appreciated :)



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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.