|
Post by flotul on Mar 1, 2022 9:53:22 GMT -5
Hi There, I'm making a program where I need to display so many fields that I can't put them on one single screen (or window). How can I make either my screen be scrolling or create a multiple window program? Or is there another way to solve this kind of issue? I already googled quite a while without having the feeling finding the advice or help I need (i.e. www.libertybasicuniversity.com/lbnews/nl112/multi.htm). Thanks for any info Roger
|
|
bplus
Full Member
Posts: 127
|
Post by bplus on Mar 1, 2022 10:59:14 GMT -5
TextEditor control has scrollers, also has select info.
|
|
|
Post by flotul on Mar 1, 2022 14:36:44 GMT -5
Thanks a lot Rod, Sometimes the words I use for a search just aren't the right ones, I guess. I'll give all the threads a try asap PS: I'm not sure I can do this within a TextEditor; I'm having fields like a form with text boxes, checkboxes, radio buttons ans so on.
|
|
|
Post by Walt Decker on Mar 1, 2022 14:55:51 GMT -5
|
|
|
Post by Rod on Mar 2, 2022 2:21:05 GMT -5
Stop thinking you need lots of controls. You just need one or perhaps six sets of controls and then PAGE the data to the controls. So you have a form then an index which dictates which set of six records get displayed on the form.
|
|
|
Post by flotul on Mar 2, 2022 10:16:09 GMT -5
Hummm....
I never had to "PAGE the data to the controls" so I'm not sure to make a good start.
Do you mean doing this using, i.e., the control's "show" or "hide" handlers?
|
|
|
Post by Rod on Mar 2, 2022 10:55:22 GMT -5
No you just reuse the controls.
nomainwin dim record$(100) for n= 1 to 100 record$(n)="Record "+str$(n) next global index index=50
'my form textbox #f.1 20, 10, 100, 25 textbox #f.2 20,40,100,25 textbox #f.3 20,70,100,25 textbox #f.4 20,100,100,25 textbox #f.5 20,130,100,25 button #f.pd "PageDown", pagedown, UL, 130,130 button #f.pd "PageUp", pageup, UL, 130,10 WindowWidth = 350 : WindowHeight = 350 open "My Form" for window_nf as #f #f "trapclose quitform" call fillform wait
sub fillform #f.1 record$(index) #f.2 record$(index+1) #f.3 record$(index+2) #f.4 record$(index+3) #f.5 record$(index+4) end sub
sub pagedown h$ index=index+5 if index>95 then index=95 call fillform end sub
sub pageup h$ index=index-5 if index<1 then index=1 call fillform end sub
sub quitform h$ close #f end sub
|
|
|
Post by Rod on Mar 2, 2022 11:19:53 GMT -5
This version has a checkbox and shows how you might update it.
nomainwin dim record$(100,2) for n= 1 to 100 record$(n,1)="Record "+str$(n) if rnd(0)>.5 then record$(n,2)="set" else record$(n,2)="reset" next global index index=50
'my form textbox #f.1 20, 10, 100, 25 textbox #f.2 20,40,100,25 textbox #f.3 20,70,100,25 textbox #f.4 20,100,100,25 textbox #f.5 20,130,100,25 checkbox #f.cb1 "Ok",set,reset,130,10,50,25 checkbox #f.cb2 "Ok",set,reset,130,40,50,25 checkbox #f.cb3 "Ok",set,reset,130,70,50,25 checkbox #f.cb4 "Ok",set,reset,130,100,50,25 checkbox #f.cb5 "Ok",set,reset,130,130,50,25 button #f.pd "PageDown",pagedown,UL,200,130 button #f.pu "PageUp", pageup, UL, 200,10 WindowWidth = 350 : WindowHeight = 350 open "My Form" for window_nf as #f #f "trapclose quitform" call fillform wait
sub fillform #f.1 record$(index,1) #f.2 record$(index+1,1) #f.3 record$(index+2,1) #f.4 record$(index+3,1) #f.5 record$(index+4,1) #f.cb1 record$(index,2) #f.cb2 record$(index+1,2) #f.cb3 record$(index+2,2) #f.cb4 record$(index+3,2) #f.cb5 record$(index+4,2) end sub
sub set h$ #h$ "set" 'parse the handle to know which record to set i=val(right$(h$,1)) record$(index-1+i,2)="set" end sub
sub reset h$ #h$ "reset" i=val(right$(h$,1)) record$(index-1+i,2)="reset" end sub
sub pagedown h$ index=index+5 if index>95 then index=95 call fillform end sub
sub pageup h$ index=index-5 if index<1 then index=1 call fillform end sub
sub quitform h$ close #f end sub
|
|
|
Post by flotul on Mar 3, 2022 10:43:04 GMT -5
Thanks a lot Rod. I'll try this way
|
|