realbasic-nug
[Top] [All Lists]

RE: canvas.Scroll

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: RE: canvas.Scroll
From: "Dixon, Tom" <dixont at Jostens dot com>
Date: Mon, 30 May 2005 09:48:18 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcVlIKj2xVga/2T+Q3a2rcONnOcltAAA1gFw
Thread-topic: canvas.Scroll
How are you building the canvas to scroll?

What I have done in the past is construct a canvas or canvases within a
canvas and draw into the internal canvas or canvases. I scroll the
internal canvas or canvases with a scrollbar by setting the Top property
of the internal canvas or canvases in relation to the scroll value.
Because the canvas or canvases are a child of another canvas the parts
you do not want to display are outside the visible area of the parent
canvas and the redraw of the internal canvas or canvases or even other
controls are handled automatically. Here is some code I used for an
array of canvases enclosed in another canvas.

  Dim i,n,s,theTop As Integer
  s = Me.Value
  
  // numcanvases is a global integer variable
  // holds the number of canvas controls I have
  // created in the canvas array
  n = (numcanvases -1)
  
  // 36 is the window.open top value for the internal canvas 
  theTop = (36 - s) 
  theCanvas(0).Top = theTop
  
  For i = 1 To n
    theTop = (theTop + 420)
    // 420 is the LineStep value I set for this scrollBar
    theCanvas(i).Top = theTop
  Next

HTH

Tom

> How do people find out what portion of a canvas needs to be 
> drawn when calling a canvas.scroll with only a portion being 
> scrolled? And is it possible to tell the canvas not to erase 
> that portion?
> 
> thanks
> 
> AC
_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>