Liberty BASIC Community Forum
« Notice command with vertical scroll »

Welcome Guest. Please Login or Register.
Dec 12th, 2017, 07:57am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Notice command with vertical scroll  (Read 75 times)
fox
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 176
xx Notice command with vertical scroll
« Thread started on: Feb 4th, 2017, 08:42am »

Hi all.
I would like to know if it is possible to create a dialog box with vertical scroll using "Notice" command.
Because I think that if I have a string expression very long a part of it will be shortened by display's dimensions.
Thanks a lot for any help and bye.
fox
User IP Logged

tenochtitlanuk
Board Moderator

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1170
xx Re: Notice command with vertical scroll
« Reply #1 on: Feb 4th, 2017, 10:16am »

I've never wanted to do this. I'd have opened another (?popup?) window.
Here's a quick demo of a few thousand characters WITHOUT any scrolling.
Code:
    nomainwin

    longString$ ="Here is the title of the notice" +chr$( 13) +"Text starts here.." +chr$( 13)

    for i =1 to 6000
        longString$ =longString$ +chr$( 65 +int( 26 *rnd( 1)))
        if i /140 =int( i /140) then longString$ =longString$ +chr$( 13)
    next i

    longString$ =longString$ +chr$( 13) +"END!"

    notice longString$

    end
 

...producing 3/4 screenful of reaDABLE TEXT....
User IP Logged

fox
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 176
xx Re: Notice command with vertical scroll
« Reply #2 on: Feb 4th, 2017, 4:24pm »

Thanks, tenochtitlanuk, for your suggestion.
But, please, what do you mean with "I'd have opened another (?popup?) window."?
Thanks a lot again and bye.
fox
« Last Edit: Feb 4th, 2017, 4:29pm by fox » User IP Logged

tenochtitlanuk
Board Moderator

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1170
xx Re: Notice command with vertical scroll
« Reply #3 on: Feb 5th, 2017, 06:11am »

I don't really know what you want to do. 'Notice' is usually used to hold a program until a very short message-to-the-operator is read.
I was thinking of something like the following which opens a second window for a user to read a lengthy text.....
Code:
    nomainwin

    UpperLeftX   =  10
    UpperLeftY   =  10
    WindowWidth  =1200
    WindowHeight = 700

    global longString$

    button #w.b, "Info?", info, LR, 500, 40
    textbox #w.tb1, 50, 50, 1000, 400

    open "Main GUI Window of program" for window as #w

    #w "trapclose quitMe"
    #w.tb1 "!font Ubuntu_Mono 32"
    #w.tb1 "Here's the main window for the program."

    CR$ =chr$( 13) +chr$( 10)

    longString$ ="THIS IS SOME SAMPLE TEXT. SCROLL ME!"+CR$+_
    ""+CR$+_
    "It is important to note that this statement "+CR$+_
    "traps the events of mouse buttons being clicked and released,"+CR$+_
    "the mouse being moved, and keys being pressed. "+CR$+_
    "It does not return the state of mouse buttons or keyboard keys "+CR$+_
    "at all times. For instance when leftButtonDown traps the event"+CR$+_
    " of the button being pressed. "+CR$+_
    "It does not continue to report that the button is in the down position."+CR$+_
    "print #handle, when leftButtonDown"+CR$+_
    "Events that can be trapped - event names are case sensitive"+CR$+_
    "leftButtonDown- the left mouse button has been pressed"+CR$+_
    "leftButtonUp - the left mouse button has been released"+CR$+_
    "leftButtonMove- the mouse moved while the left button was down"+CR$+_
    "leftButtonDouble- the left mouse button has been double-clicked"+CR$+_
    "rightButtonDown- the right mouse button has been pressed"+CR$+_
    "rightButtonUp- the right mouse button has been released"+CR$+_
    "rightButtonMove- the mouse moved while the right button was down"+CR$+_
    "rightButtonDouble- the right mouse button has been double-clicked"+CR$+_
    "middleButtonDown- the middle mouse button has been pressed"+CR$+_
    "middleButtonUp- the middle mouse button has been released"+CR$+_
    "middleButtonMove- the mouse moved while the middle button was down"+CR$+_
    "middleButtonDouble- the middle mouse button has been double-clicked"+CR$+_
    "mouseMove- the mouse moved when no button was down"+CR$+_
    "characterInput- a key was pressed while the graphics window"+CR$+_
    "has input focus (see the setfocus command, above)"+CR$

    for i =1 to 1000
        longString$ =longString$ +chr$( 32 +65 +int( 26 *rnd( 1)))
        if i /140 =int( i /140) then longString$ =longString$ +chr$( 13) +chr$( 10)
    next i

    longString$ =longString$ +CR$ +longString$ +CR$ +longString$ +CR$ +CR$ +"END!"

    wait

sub info h$
    WindowWidth  = 800
    WindowHeight = 350

    texteditor #wPop.te1, 10, 10, 760, 300
    button     #wPop.b1, "Done scrolling and reading? Press me", [q], LR, 400, 40

    open "PopUp window" for dialog_modal as #wPop
        #wPop      "trapclose [q]"
        #wPop.te1  "!font Ubuntu_Mono 14"
        #wPop.te1   longString$
        #wPop.te1  "!origin 0 0"
        wait
      [q]
    close #wPop
end sub

sub quitMe h$
    close #h$
    end
end sub
 
User IP Logged

fox
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 176
xx Re: Notice command with vertical scroll
« Reply #4 on: Feb 5th, 2017, 11:53am »

Thanks a lot, tenochtitlanuk.
A very interesting solution.
A very good help for me.
My target is to have the possibility to display a very long message for user without fearing that a part of this message can be lost.
Thanks a lot again and bye.
fox
« Last Edit: Feb 5th, 2017, 3:01pm by fox » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls