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

wm_paint event (pbm_paint)

158 views
Skip to first unread message

Benoit ROUGE-PULLON

unread,
Jan 12, 1999, 3:00:00 AM1/12/99
to
Hi,

I need to draw some figures (lines, rectangles ...) with win32 API
functions.
So I define the event pbm_paint (WM_PAINT) in a visual user and I put the
drawing code in it (all functions are external API functions); the code look
like this:

os_paintstruct los_paint
BeginPaint(handle(this),los_paint)
Rectangle(los_paint.hdc,10,10,100,100)
EndPaint(handle(this),los_paint)

But it doesn't work !, nothing is drawing (however it's the good way to
proceed in SDK !)

How works pbm_paint in PB ? does PB fire WM_PAINT event before calling
pbm_paint event ?
When I look at the paintstruct rectangle returned by BeginPaint function the
coordinate are setted to 0 instead of map the region to redraw. (even I make
an InvalidateRect to the windows's handle)

Does anyone have a response to my problem ?
Thanks in advance.

Benoit.


Bruce Armstrong [TeamPS]

unread,
Jan 12, 1999, 3:00:00 AM1/12/99
to
The pbm_paint event is the wm_paint message. It doesn't call it, it responds
to it.

If you want to paint objects, you might look at the Create option for a
datawindow, or the OpenUserObject function for user objects. Within PB,
that's probably the best way to do it natively.

On Tue, 12 Jan 1999 13:50:12 +0100,
in powersoft.public.powerbuilder.powerscript

--
Bruce Armstrong [TeamPS] | Romac/Source International
mailto:Bruce.A...@eudoramail.com | mailto:jo...@sourcela.com
| http://www.romac-source.com

Preach the gospel at all times. If necessary, use words. [Francis of Assisi]
http://www.harvest.org/text/knowgod.html

Benoit ROUGE-PULLON

unread,
Jan 12, 1999, 3:00:00 AM1/12/99
to
Sorry, but I don't understand your answer ?
I know the wm_paint event is called when a part of a window (user object)
need to be refresh, but the DC passed by PB is set to 0 and the DC returned
by BeginPaint function has no region to repaint (althought I call
InvalidateRect function for redraw a part of the user object) so I can't use
these DC for drawing. I have to use GetDC function but the drawing region is
the entire client area instead of region specified by InvalidateRect
function !
I think the pbm_paint event is fired after Windows has refreshed the region,
then there is no more region to refresh when I get the paint DC in pbm_paint
event !
What can I do for resolve this problem ?

Thanks a lot
Benoit.


Bruce Armstrong [TeamPS] wrote in message
<8F1xpzjP#GA....@forums.powersoft.com>...

Bruce Armstrong [TeamPS]

unread,
Jan 12, 1999, 3:00:00 AM1/12/99
to
See the original reply about using PB native methods rather than API
methods. In the end (IMHO), you'll be much happier with the result.

On Tue, 12 Jan 1999 16:57:52 +0100,

0 new messages