Scroll Bars
BlitzPlus Forums/BlitzPlus Beginners Area/Scroll Bars
| ||
Hey guys, I have a hankering to make my own hexeditor. However, I cannot display an entire one megabyte file on the screen at once. So, the obvious choice would be a scrollbar for a canvas (I think). Is there any way to do this? I looked into sliders, but there was too little documentation to get them going... Anyone got a way to do ACTUAL scrollbars or an example of sliders? |
| ||
No documentation? I think the B+ manual is quite decent! |
| ||
'ave a look here:window=CreateWindow("oO",0,0,640,480,0,1) canvas=CreateCanvas(0,0,512,256,window,1) scrollbar=CreateSlider(512,0,16,256,window,2) lines=1024 linesvisable=16 position=0 SetSliderRange scrollbar,linesvisable,lines Dim txt$(1024) For t=0 To lines-1 txt$(t)="blahblah "+t Next Repeat WaitEvent() If EventID()=$803 quit=1 If EventID()=$401 position=SliderValue(scrollbar) SetBuffer CanvasBuffer(canvas) Cls For t=0 To 15 r=t+position Text 0,t*16,txt$(r) Next FlipCanvas canvas EndIf Until quit |
| ||
[No documentation? I think the B+ manual is quite decent!] >I think no, they are not updated and not complet ( my last surprise was with RequestFile$() )... :( |
| ||
What I meant was that (as far as I know) the GUI commands have no example programs to go with the definitions. Knowing the Command and its syntax is only half of the battle. It would be nice if some you more expirienced users would at least give your examples on the documentation page. Then the newbs like me wouldn't need to wait a couple of days for responses on the forms in order to continue work on our code. Anyways, I have a question about your sourcecode CS_TBL. Whats with the ",1" in your createcavas command? I looked and there is no such parameter to the command (according to the documentation). What exactly does it do? |
| ||
uhm.. it's there being useless I think ^_^ The 1 was in the cache of my head after typing it in the createwindow thing ^_^ nonetheless, it's a style parameter... while not mentioned in the actual help-page, it *is* mentioned in the quick hint in the statusbar.. (but in this case of my source it was a typo really ^_^) In general: I learnt all the GUI things / event things from the manual.., this, coming from B3d and being a real Basic-only programmer, says to me the manual is decent enough.. there're always things one can improve, but generally I think one can perfectly learn it from there, perhaps there's no help example in the slider help.. but there might be one attached to another GUI command. |