aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1345

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1345  Scrollbar difficulties?

17/01/2006 @ 00:44
by Nevin Morrison

Anonymous



I am fairly new to izibasic. I want to a add a scroll bar to a program. I have added it, but it does nothing. How do I get the screen to scroll when the car is moved. Could someone please send me a sample code of how this works. Is it some type of on event code? Will it scroll all objects or just text?
Write to Nevin Morrison   Post an answer  Top

[]   


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
17/01/2006 @ 10:11
by aldweb

Anonymous

visitor
Hello Nevin,

It is up to you to detect when a scrollbar event occured (with the DOEVENTS or WAITEVENT function returning the scrollbar #), then detect the car position (with the SCROLLBAR() function) and have your source code do whatever you wished the scrollbar to do.

Quick example:
SCROLLBAR #1,1,150,50,9,100
REPEAT
E=DOEVENTS
IF E=1 GOSUB _MyScrollBar 'Car moved
UNTIL E=-1 : END

_MyScrollBar:
C=SCROLLBAR(#1) 'Car position in [1..100]
'do whatever you wish following scrollbar's change
RETURN


Why not offer an automatic behavior for scrollbars, especially with fields? Because I believe that the way offered in iziBasic is much more flexible by not only attaching scrollbars to fields, and leaving them as independant objects which can interact, by code, with the form and the other objects in the form.

Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
17/01/2006 @ 15:50
by Nevin

Anonymous

visitor
I thought that I would probably need to do that. I was just looking for an easy way before I did it that way. I just wanted to check.
Thanks,
Nevin
Write to Nevin   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3
--------
18/01/2006 @ 15:51
by Nevin Morrison

Anonymous

visitor
I still am having problems with the scrollbar. I think that I do not understand how to access the scrollbar function properly. Can you take a look at this code and tell me what is wrong with it:

BEGIN
LABEL #3,"Nothing",15,35
SCROLLBAR #1,1,150,50,9,100
REPEAT
E=DOEVENTS
IF E=1 GOSUB _SCROLLBAR
UNTIL E=-1 :END
END

_SCROLLBAR:
C=SCROLLBAR(#1)
B=2
IF C>=B THEN GOSUB _MoveDown
ELSE
GOSUB _MoveUp
END IF
RETURN

_MoveDown:
T=T-5
UPDATEPOS #3,30,T
RETURN

_MoveUp:
T=T+5
UPDATEPOS #3,30,T
RETURN
Write to Nevin Morrison   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4
--------
19/01/2006 @ 17:29
by aldweb

Anonymous

visitor
Hello Nevin,

The issue seems to be in your _SCROLLBAR: routine.
C=SCROLLBAR(#1) returns a car value between 1=top and 100=bottom. So 50=middle of scrollbar.

IF C>=B THEN returns true whenever C>=2 so at the very top of the scrollbar. Then, unless you really tick the top of the scrollbar, your LABEL #3 will always switch to _MoveDown: (but, in reality, it will move "up" the screen by 5 pixels!).

Anyway, this relative moving is not the right one. You should fix your top and bottom virtual scrolling window. Then, according to the relative scrollbar car position (and this is where the [1..100] range is smart as it can be used as a percentage), detect what is the frame to show of this window and align the LABEL accordingly.

Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5
--------
19/01/2006 @ 19:02
by Nevin

Anonymous

visitor
I do not understand how to fix my top and bottom virtual scrolling window. But I may have to do some more reading of your manual. I am sorry to bother you with this many questions. I do not really have a need for the scrollbar in the current app. I have been working on I just wanted to learn how to do it. Anyways I will try to figure it out. I have developed a work around where I can move objects in all 4 dirrections with push buttons if needed, but I would like to do it the right way.
Is there anywhere to post code or apps that have been developed on your site so that I can share my material. I have an application that demonstrates the use of a timer that may be useful to other developers(or maybe they have a better way).

Thank you for your help,

Nevin

Letbridge, Alberta, Canada
Write to Nevin   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 6
--------
21/01/2006 @ 15:50
by aldweb

Anonymous

visitor
Nevin,

Try this code:
BEGIN
LABEL #3,"Nothing",15,40
SCROLLBAR #1,1,150,50,9,110
REPEAT
E=DOEVENTS
IF E=1 THEN
C=SCROLLBAR(#1)+40
UPDATEPOS #3,15,C
END IF
UNTIL E=-1
END

Cheers

@+
aldweb
Write to aldweb   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^