RB2006r2:
Window1 includes some Canvas controls, named 'cvsDescription' in my code,
where 'Description' gives the type of graphics displayed within. I have a
family of indexed Canvases called 'cvsDicePair()' that I generated by
cloning from the instance dragged into Window1 thusly:
---------------------------------------------------------------------------
Dim ss as Canvas
// Instantiate the other dice pair canvases and surrounds
for Col=1 to NPAIRS
ss = New cvsDicePair
cvsDicePair(Col).Top=TOPLG
cvsDicePair(Col).Left=cvsDicePair(Col-1).Left+PITCHLG
cvsDicePair(Col).width=WIDTHLG+4*SRDINSETLG
cvsDicePair(Col).height=HTLG*STRETCHK+SMLYSZLG
next
----------------------------------------------------------------------------
-
This arrays the canvases across Window1. Everything is working as it should,
except, the graphics in the cloned canvases are not being repainted when
they should be. I've determined that this is because the Paint event never
gets triggered for the clones.
Here's my Paint Event code, following suggestions I read in prior posts to
this maillist:
----------------------------------------------------------------------------
--------------
Sub Paint (Index as integer, g as graphics)
static sBackBuffer(35) as Picture
// Check to see if we need to recreate our buffer
if sBackBuffer(Index) = nil or sBackBuffer(Index).Width <> g.Width or
sBackBuffer(Index).Height <> g.Height then
// Create a new buffer
sBackBuffer(Index) = new Picture( g.Width, g.Height, 32 )
end if
// Paint the proper way
MakeDice(index, sBackBuffer(Index).Graphics ) // MakeDice draws
rectangles and filled circles
// Now flip our back buffer
g.DrawPicture( sBackBuffer(Index), 0, 0 )
----------------------------------------------------------------------------
------------------
The above works fine for cvsDicePair(0), i.e., the non-cloned Canvas, but it
never fires for any of the other instances. Any clues will be greatly
appreciated. (I'm aware that there may be something else
laughable/correctable in my approach to this problem, but I'd really
appreciate an answer to the question of why the Paint Event doesn't fire,
too.) Thanks.
Paul Mathews
floating on Whidbey Island
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>