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

Painting children before parent

0 views
Skip to first unread message

Maggie

unread,
Sep 18, 2000, 3:00:00 AM9/18/00
to

I have a parent window that has a matrix of static bitmap window
controls I use to display bitmap images (like a puzzle) in the parent.
The child windows do not overlap. I also draw some crosshair lines or
hash lines in the parent window. These hash lines are supposed to be on
top of the image.

The bitmap image(s) always paint over the top of the hash lines. When I
display a single image, you can see the hash lines paint and then the
image paints over the top of the hash lines. Invalidating/UpdateWindow
to either the hash lines or image doesn't fix it. The onPaint for the
parent gets called and painting of the hash lines gets called.
Regardless of the sequence of events, the image static control is always
on top.

It appears to be a z order, but when I check with Spy+, the static
bitmap windows are not on top, the parent is.

Creation of the parent window:
parentWnd.Create(NULL, WS_CHILD|WS_BORDER, rectTmp, ptrDialog,
IDW_PARENT);


Creation of the static bitmap:
staticBitmapWnd.Create(NULL, WS_CHILD|WS_VISIBLE|SS_BITMAP,
singleImgRect, this, NULL);

Any clues?

Maggie

Douglas Peterson

unread,
Sep 18, 2000, 3:00:00 AM9/18/00
to
Why bother with all the child windows? Why not just blit the bitmaps
directly on the [parent] window?

Maggie

unread,
Sep 19, 2000, 3:00:00 AM9/19/00
to
Long story, but I have my reasons. Had it that way initially, but had
to use child windows to prevent the images in the parent from repainting
every time the hash lines were moved. By using blit, I did not get the
performance I was looking for.

Johan Rosengren

unread,
Sep 19, 2000, 3:00:00 AM9/19/00
to

Maggie!

You will always get children on top of a window - otherwise they would be
obscured, and it wouldn't be possible to see anything :(((

Perhaps you could try to create yet another window above all the other
children, with a transparent background, drawing the lines that should be on
top in that window?

Even if you succeeded drawing over the children, the next children-redraw
would erase your lines.

Johan Rosengren
Responsable Informatique
PACTA S.A.

"Maggie" <a...@foxvalley.net> wrote in message
news:39C778A2...@foxvalley.net...

0 new messages