|
Post by justnorm on Sept 24, 2018 22:04:51 GMT -5
What kind of "container" do I need to house information that is going to require me to have a vertical scroll bar? Also, I believe that might be done with stylebits - how do I format that? Not a very clear question, but I hope Rod or someone can figure out what I am asking.
As always - Appreciate the help. JustNorm
|
|
|
Post by Rod on Sept 25, 2018 1:22:41 GMT -5
What are we scrolling? Text or graphics?
|
|
|
Post by Rod on Sept 25, 2018 2:24:12 GMT -5
This scrolls a text box its from the LBPE.
Nomainwin WindowWidth=200 WindowHeight=160
text1$ = "STYLEBITS allows you to change the style of a Liberty BASIC window or control." text2$ = "Add to or edit this text."
Textbox #Main.txtbx, 0, 0, 190, 68 Stylebits #Main.txtbx, _WS_VSCROLL OR _ES_MULTILINE, _ES_AUTOHSCROLL, 0, 0 Statictext #Main, text2$, 5, 80, 190, 30
Open "LineWrap for LB" for Window_nf as #Main Print #Main, "Trapclose EndDemo" Print #Main, "Font Times_New_Roman 12 Bold" Print #Main.txtbx, text1$ Wait
Sub EndDemo handle$ Close #Main End End Sub
This the graphics demo
Nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = Int((DisplayWidth - WindowWidth)/2) UpperLeftY = Int((DisplayHeight - WindowHeight)/2)
Open "Showing and Hiding Scrollbars in a Graphics Window" for Graphics as #g Print #g, "Trapclose [EndDemo]" ' Toggle Count ( Odd = Off, Even = On) toggleCount = 0 ' Draw some graphics Print #g, "Down; Fill Black" Print #g, "Color Black; Backcolor Green" For y = 0 to 700 Step 100 For x = 0 to 900 Step 100 Print #g, "Place ";x;" ";y Print #g, "Boxfilled ";x + 100;" ";y + 100 Print #g, "Place ";x + 10;" ";y + 60 Print #g, "\";x / 100;" - ";y / 100 Next x Next y Print #g, "Flush" Print #g, "When leftButtonUp [ToggleScrollbarsOnOff]"
[ToggleScrollbarsOnOff] xPos = MouseX yPos = MouseY toggleCount = toggleCount + 1 If toggleCount / 2 = Int(toggleCount / 2) Then ' If even Print #g, "Horizscrollbar Off" Print #g, "Vertscrollbar Off" msg$ = "Left Click to See Scrollbars" Else ' If toggleCount is odd Print #g, "Horizscrollbar On" Print #g, "Vertscrollbar On" msg$ = "Left Click to Hide Scrollbars" End If Print #g, "Place ";xPos + 20;" ";yPos + 20 Print #g, "\";msg$ Print #g, "Discard" Wait
[EndDemo] Close #g End
|
|
|
Post by justnorm on Sept 25, 2018 9:07:44 GMT -5
Thanks, Rod. That is just what I wanted. Right now I am only wanting to scroll text but that will get me started. May have questions later, but have a busy day ahead of me. Many thanks!
JustNorm
|
|