Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Sep 15, 2019 8:50 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Scrollbar Navigation Question
PostPosted: Mon May 20, 2013 8:21 am 
Offline

Joined: Tue Mar 05, 2013 2:33 pm
Posts: 64
Location: Greensboro, North Carolina
Hi,

I am new to Scrollbars and I am implementing them into a test app I am writing. What is the best style to use when writing "if" statements to recognize when a user is scrolling Up or Down (Vertical Scroll example)?

I have been trying to use the following code which isn't working since it never leaves the first if block.

Sub ValueChanged()
dim LastValue as integer

if me.value > LastValue-1 then
LeftRulerCanvas1.Top = LeftRulerCanvas1.Top - Scrollunit
CampusMapCanvas.Top = CampusMapCanvas.Top - Scrollunit
LastValue = Me.value
elseif me.value < LastValue+1 then
LeftRulerCanvas1.Top = LeftRulerCanvas1.Top + Scrollunit
CampusMapCanvas.Top = CampusMapCanvas.Top + Scrollunit
LastValue = Me.value
end if

End Sub


Thank you in advance!

_________________
Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice
Chief Technology Officer
Onepath Systems, LLC


Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar Navigation Question
PostPosted: Mon May 20, 2013 9:00 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Move DIM LastValue OUT of that procedure. Put it in a Module.

It needs to be in a scope that is not the same as the procedure itself

otherwise it gets reset to ZERO every time ValueChanged is called... so me.value is ALWAYS greater than -1

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar Navigation Question
PostPosted: Mon May 20, 2013 9:04 am 
Offline

Joined: Tue Mar 05, 2013 2:33 pm
Posts: 64
Location: Greensboro, North Carolina
DaveS wrote:
Move DIM LastValue OUT of that procedure. Put it in a Module.

It needs to be in a scope that is not the same as the procedure itself

otherwise it gets reset to ZERO every time ValueChanged is called... so me.value is ALWAYS greater than -1


:mrgreen: Thanks Dave!

I deleted the DIM statement and just made a property of that canvas object. It worked and thanks again!

_________________
Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice
Chief Technology Officer
Onepath Systems, LLC


Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group