Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MDI - how to limit the client area available to MDI children ?

0 views
Skip to first unread message

David Moody

unread,
Jul 23, 1995, 3:00:00 AM7/23/95
to
I'm using BC++ 3.1 with Win3.1x. The program I am writing is using
OWL.

I am trying to discover how to limit the area within the client area
that MDI children may use.

Borland use this method themselves in the BC++ 3.1 Windows IDE. The
vertical toolbar and the status lines are both protected.

The child windows are always positioned as if the client does not
include the tool and status bars.
The child windows appear to glide *behind* the bars, and MDI child
positioning via the Window popup menu takes account of the offset too.

I've tried using ExcludeClipRect(), but unless I can use the same DC
as TMDIClient::WMPaint() or TWindow::DefWndProc(), I can't see any
other way to do it.

Is it a case of intercepting/redefining the behaviour of the MDI
client painting procedure ?

Alternatively, should I be assign a DC to the WNDCLASS itself, so that
the effects of ExcludeClipRect() remain across WM_PAINT messages ?

Also, on a similar note, I would be interested in any experiences in
painting the Application Workspace in an MDI app, because I want to
paint a metafile depicting a flat map of the world, which the user
will be able to place small flags on,

I think that a bitmap would not be useful, because resizing would
spoil the resolution even using StretchDIB.

Any other experiences of MDI programming, espeically with Borland OWL
would be welcome.

Thank you in advance.
David Moody, the dude that can always **** it up!


David Webber

unread,
Jul 23, 1995, 3:00:00 AM7/23/95
to
In article <8065214...@zzapps.demon.co.uk>
Da...@zzApps.demon.co.uk "David Moody" writes:

> I'm using BC++ 3.1 with Win3.1x. The program I am writing is using
> OWL.
>
> I am trying to discover how to limit the area within the client area
> that MDI children may use.
>
> Borland use this method themselves in the BC++ 3.1 Windows IDE. The
> vertical toolbar and the status lines are both protected.
>
> The child windows are always positioned as if the client does not

> include the tool and status bars.....

The MDI children are managed by a Client Window which has no caption
bar and sits over the client area of the MDI frame window which is
its parent. Check it out with Spy (or Borland's equivalent). By
changing the size of the Client Window to exclude tool bars and
status bars you achieve the effect you're looking for.

Dave
--
+---------------------------+-----------------------------------+
| Dave Webber da...@musical.demon.co.uk |
| Author of MOZART, the Windows 3.1 shareware Music Processor |
| and member of the Association of Shareware Professionals |
+---------------------------+-----------------------------------+

Clifford Stabbert

unread,
Jul 25, 1995, 3:00:00 AM7/25/95
to
Da...@zzApps.demon.co.uk (David Moody) wrote:

<snip>

>The child windows are always positioned as if the client does not
>include the tool and status bars.

Can't help you too much with this, but the abovie is correct. The
client area does not in fact include the tool and status bars. I
haven't messed with this stuff so I'm not completely clear on how
they do it, but the client is taking up whatever space is left after
the toolbars/statusbars/etc. are inserted.

I do recall seeing messages here to the effect of "don't go try
messing with the client's rectangle yourself to do this".

Looking at the Win API help file, it appears overriding the
DefFrameProc for the WM_SIZE message might be viable.

cps


David Webber

unread,
Jul 26, 1995, 3:00:00 AM7/26/95
to
In article <3v1nig$c...@dockmaster.phantom.com>
c...@phantom.com "Clifford Stabbert" writes:


> I do recall seeing messages here to the effect of "don't go try
> messing with the client's rectangle yourself to do this".
>
> Looking at the Win API help file, it appears overriding the
> DefFrameProc for the WM_SIZE message might be viable.

No you have to mess with the winsdow sizes to achieve this
- at least using the raw API.

I wrote the status bar in my music processor MOZART myself -
it is all done with the raw API.

On getting a WM_SIZE in the frame window I:

ask the status bar window how big it is;
calculate the remaining size;
use MoveWindow() to position the status bar and the client
window within the frame.

I wrote this bit years ago and haven't touched it since as
it works fine.

These days I'm switching to MFC which does it all for me - but it
is very useful to do it once yourself - you get to know how it
works.

0 new messages