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

Losing Canvas

0 views
Skip to first unread message

Craig Shipman

unread,
May 19, 2000, 3:00:00 AM5/19/00
to
I have a TPanel with it's Canvas enabled (Thanks to Remy Lebeau).

class TCraigPanel : public TPanel
{
public:
__property Canvas;
};

I can fill and see the Canvas just fine. My problem is when another window
opens above it. The canvas data is gone when the above window is closed. How
can I detect when the hiding window goes away, so I can reload the canvas?
Thanks,
Craig

Remy Lebeau

unread,
May 19, 2000, 3:00:00 AM5/19/00
to
Override the virtual Paint() function with your own, and do some Canvas
painting from there (make sure you call the inherited Paint() function too)

class TCraigPanel : public TPanel
{
public:

virtual void __fastcall Paint(void);
__property Canvas;
};

void __fastcall TCraigPanel::Paint(void)
{
// call inherited method to do default drawing
TPanel::Paint();
// do custom canvas drawing now
[your code here]
}

Paint() get's called when a component needs to repaint itself onto the
screen


Gambit

"Craig Shipman" <cs...@attglobal.net> wrote in message
news:3925d978@dnews...

0 new messages