Board Logo
« Universal Screen Fit? »

Welcome Guest. Please Login or Register.
Jan 18th, 2018, 3:55pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 sticky  Author  Topic: Universal Screen Fit?  (Read 3501 times)
stumpy
Full Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 148
xx Re: Universal Screen Fit?
« Reply #30 on: Sep 9th, 2016, 04:39am »

Thank you very much. I tried that code, which I think preserved the proportions although it was not then full screen, as I now see to be inevitable.
User IP Logged

oxcart
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Reestablishing Set Focus on Dialog Box
« Reply #31 on: Jun 17th, 2017, 11:07am »

Code:
       CLS
    mainwin 240 240
    open "Overall" for append as #op

     Dim Bib(1000),First$(1000),Last$(1000),Age(1000),Sex$(1000),BFLAS$(1000),FLAS$(1000), FirstL$(1000)
     Dim AC$(700), DJ$(700), KO$(500), PZ$(700), RE$(500), XX$(700) ,L25$(700), PersFact(700)
     for i = 1 to 25 :L25$(i) = " -" : next i

     RE$(1) = "Results"

     DATA "1", Bob, Smith, "11", M, 2, Ann, Bird,   22, F, 3, Mark, Four,  33, M, 4, Nita, Dial, 44, F, 5, Bill, Dunn, 55, M
     DATA 6, Tia, Lyons, 66, F, 7, Bart, Jones, 77, M, 8, Della, Wynn, 88, F, 9, Dan, Biggs, 99, M

    For index = 1 to 9
    Read a, b$, c$, d, e$
    Bib(index) = a: btemp$ = right$("0000" + str$(a),3) + " "
    First$(index) = b$ : ftemp$ = left$(First$(index) + "          ",9) + " "
    Last$(index) = c$  : ltemp$ = left$(Last$(index) + "               ",15) : FirstL$(index) = First$(index) + Last$(index)
    Age(index) = d  : agtemp$ = right$("    " + str$(d),3)
    Sex$(index) = trim$(upper$(e$))
    BFLAS$(index) = btemp$ + ftemp$ + ltemp$ + agtemp$ + " " + Sex$(index)
    next index
    BFLAS$(10) = ""
     i = 0
    prereg = 10
    quarter = int(10 / 3) + 1
    'Assign runners to alphabet ranges
    [jumpup]
    i = i + 1
    if i > quarter goto [nextphase]
    a$ = left$(First$(i),1)
    ac = ac + 1: AC$(ac) = BFLAS$(i)                 : top1$ = First$(i)
    if i = 1 then top1a$ = First$(i) : top2a$ = First$(i + quarter) : top3a$ = First$(i + 2 * quarter) : top4a$ = First$(i + 3 * quarter)
    dj = dj + 1: DJ$(dj) = BFLAS$(i + quarter)       : top2$ = First$(i + quarter)
    ko = ko + 1: KO$(ko) = BFLAS$(i + 2 * quarter)   : top3$ = First$(i + 2 * quarter)
    goto [jumpup]
    [nextphase]

      NoCard$ = "999 No Card 99 M"

    for i = 1 to 2
    xxctr = xxctr + 1
    XX$(i) = NoCard$
    next i

    ' Set up windows
    WindowWidth  = DisplayWidth
    WindowHeight = DisplayHeight
    UpperLeftx   = 1
    UpperLefty   = 1
    WideA = 330 : WideBCD = 330 : WideE = 330
    LB = WideA : LC = LB + WideA :LD = LC + WideA : LE = 4* WideA
    ColoHI = 850 :NoHi = 150

    listbox #1.pickre, L25$(),[topick] ,   1,   1,  345, 990
     listbox #1.pickac, AC$(),[getac] ,   345,   1,  325, 990
      listbox #1.pickdj, DJ$(),[getdj] ,   670,   1,  325, 990
       listbox #1.pickko, KO$(),[getko] ,   995,   1,  325, 990
        listbox #1.pick25, RE$(),[getre],    1320,   1, 330, 790
         listbox #1.pickxx, XX$(),[getxx],    1320, 790, 330, 200

    topline$ = "Overall Order etc"

    open topline$ for window as #1

    print #1, " font calibri bold 14"
    #1.pickac "singleclickselect [getac]"
     #1.pickdj "singleclickselect [getdj]"
      #1.pickko "singleclickselect [getko]"
         #1.pick25 "singleclickselect [get25]"
           #1.pickxx "singleclickselect [getxx]"

     'open textbox to add runners
    WindowWidth = 495 : WindowHeight = 85
    UpperLeftX = 300
    UpperLeftY = 750
    textbox #hndl.txt, 8, 8, 320, 40
    button #hndl.default, "   ", [firstn], LR, 170, 10
    button #hndl.help, "Award",[sofar], UL,340, 10
    open "Bib First Last Age Sex (Place) or Add Time (23.25)   Click 'X' to Do Results --->" for dialog as #hndl
    print #hndl, "font calibri 12 "
    print #hndl.txt, "!setfocus"

      [topick]

    [clearskip]
    cls
    close #op
    kill "Overall.txt"
    open "Overall.txt" for output as #op

    print "Awards Printout"

    for i = 1 to fincount
    print RE$(i)
    print #op, RE$(i)
    next i

    print #hndl.txt, "!setfocus"

    for k = 1 to 40
    L25ctr = fincount - k + 1
    if L25ctr < 1 then L25$(k) = "" : goto [ljump]
    L25$(k) = RE$(L25ctr)
    [ljump]
    next k

    print #1.pick25, "reload"
     print #1.pickre, "reload"
    fincount = fincount + 1

    print #hndl, "trapclose [quit]"
    print #1, "trapclose [quit]"
    wait

    [getac]
    acctr = acctr + 1
    print #1.pickac, "selectionindex? indexer"
    findex$ = right$("   " + str$(fincount) + " ",4)
    RE$(fincount) = findex$ + AC$(indexer)
    AC$(indexer) = ""
        acleft = ac - acctr + 1
        for i = 1 to acleft
        ' If runner has been selected, replace "" runner with next place
        if AC$(i) = "" then outflag = 1
        if outflag = 1 then AC$(i) = AC$(i + 1)
        next i
        outflag = 0
        indexer = 0
     AC$(acleft) = ""
     print #1.pickac, "selectindex indexer"
     print #1.pickac, "reload"
     goto [topick]

    [getdj]
    djctr = djctr + 1
    print #1.pickdj, "selectionindex? indexer"
    findex$ = right$("   " + str$(fincount) + " ",4)
    RE$(fincount) = findex$ + DJ$(indexer)
        DJ$(indexer) = ""
        djleft = dj - djctr + 1
        for i = 1 to djleft
        ' If runner has been selected, replace "" runner with next place
        if DJ$(i) = "" then outflag = 1
        if outflag = 1 then DJ$(i) = DJ$(i + 1)
        next i
        outflag = 0  : indexer = 0
    print #1.pickdj, "selectindex indexer"
    print #1.pickdj, "reload"
    goto [topick]

    [getko]
    koctr = koctr + 1
    print #1.pickko, "selectionindex? indexer"
    findex$ = right$("   " + str$(fincount) + " ",4)
    RE$(fincount) = findex$ + KO$(indexer)
        KO$(indexer) = ""
        koleft = ko - koctr + 1

       for i = 1 to koleft
       ' If runner has been selected, replace "" runner with next place
        if KO$(i) = "" then outflag = 1
        if outflag = 1 then KO$(i) = KO$(i + 1)
       next i

        outflag = 0  : indexer = 0
    print #1.pickko, "selectindex indexer"
    print #1.pickko, "reload"
    goto [topick]

    ' *********************************   REMOVE RUNNERS FROM RESULTS / SELECTED ARRAY  **************************
    [get25]
    print #1.pick25, "selectionindex? indexer"
    outnot$ = RE$(indexer)

    'Is this an extra click (place only) - yes, we are only treating a symptom here
    goodflag = 1
    kik$ = mid$(outnot$,6,1)
    if asc(kik$) = 0 then goodflag = 0
    if goodflag = 0 then goto [kikpass]

    ' Increment count of removed runners
    xxctr = xxctr + 1
    XX$(xxctr) = right$(RE$(indexer),34)

    [kikpass] goodflag = 0
     for i = 1 to fincount
     if i = indexer then outflag = 1 : goto [skipflip]
      if outflag <> 1 then goto [skipflip]
     l = len(RE$(i)) - 3
    REtemp$ = right$(RE$(i),l)
     RE$(i - 1) = right$("   " + str$(i-1),3) + REtemp$
    [skipflip]
    next i
    skipflip = 0
    RE$(fincount-1) = ""
    fincount = fincount - 2
    outflag = 0

     print #1.pick25, "selectindex indexer"
     print #1.pickre, "selectindex indexer"
     print #1.pickxx, "reload"
     goto [topick]

    [getxx]
      print #1.pickxx, "selectionindex? indexer"
     findex$ = right$("   " + str$(fincount), 3)
    RE$(fincount) = findex$ + " " + XX$(indexer)

     if indexer < 3 then goto [nocardskip]
     for i = 1 to xxctr
    if i = indexer then XX$(i) = XX$(i + 1) : outflag = 1 : goto [skipone]
    if outflag = 1 then XX$(i) = XX$(i + 1)
    [skipone]
    next i

    xxctr = xxctr - 1
    [nocardskip]
    outflag = 0
    print #1.pickxx, "selectindex indexer"
    print #1.pickxx, "reload"

    goto [topick]

    [quit] close #1  : close #hndl : close #op : print "goto results"

    ' *****************************************      ADD, REMOVE & INSERT RUNNERS     ****************************
        ' Add runner and fix cap issues here
        [firstn]

        print #hndl.txt, "!contents?"
        input #hndl.txt, ADD$
        ADD$ = trim$(ADD$)
        print #hndl.txt, ""

         i = 0 :  bibtemp = val(left$(ADD$,3))
        [topalphacheck]
        if i = len(ADD$) then goto [checkingdone]
        i = i + 1
        achk$ = mid$(ADD$,i,1)
         if asc(achk$) > 57 then goto [huntjump]
        goto [topalphacheck]
        [checkingdone]

         bibtemp = val(ADD$)

          bibfound = 0 : bibhunt = 0
        while bibfound = o
        bibhunt = bibhunt + 1
        if bibhunt > index then fincount = fincount - 1 : goto [topick]
        if val(left$(BFLAS$(bibhunt),3)) = bibtemp then bibfound = 1
        wend

         gosub [bibdupcheck]
        [huntjump]
        a$ = WORD$(ADD$,1)
         BibAdd$ = a$
          a$ = WORD$(ADD$,2)
          gosub [firstfix]
          FNadd$ = a$
           a$ = WORD$(ADD$,3)
            gosub [firstfix]
            LNadd$ = a$
             AGadd$ = WORD$(ADD$,4)
               SXadd$ = Upper$(WORD$(ADD$,5))

         PSchg = val(WORD$(ADD$,6))

        ftemp$ = left$(FNadd$ + "          ",10)
         ltemp$ = left$(LNadd$ + "               ",15)
          agtemp$ = right$("   " + AGadd$,3)

        Added$ = BibAdd$ + " " +ftemp$ + ltemp$ + agtemp$ + " " + SXadd$ 
        TI = TI + 1
        TypeIn$(TI) = Added$
        addflag = 1

         findex$ = right$("   " + str$(fincount), 3)
        RE$(fincount) = findex$ + " " + Added$

        'Routine to insert runner
        if PSchg = 0 then goto [nochg]

         for i = fincount to 1 step -1
          if i < PSchg then goto [skipchng]
          if i <> PSchg then goto [shifter]
         findex$ = right$("   " + str$(i),3)
         Insert$ = findex$ + " " + Added$
         RE$(i) = Insert$ : goto [skipchng]
         [shifter]
         l = len(RE$(i-1)) - 3
         REtemp$ = right$(RE$(i - 1),l)
          RE$(i) = right$("   " + str$(i),3) + REtemp$
        [skipchng]
        next i

        cls
        [nochg]
        print #1.pickre, "reload"
        PSchg = 0
        [sofar]
        print "Output text file of awards."

        goto [topick]
 

Need to drag screen down to look at MainWin and keep focus on dialog box. This is really stripped down but it runs now. Longer version has a SPLIT button to input times. That also causes loss of focus. Tried dialog_modal (briefly ) but it locked up so bad I had to use Task Manager to get going again.

« Last Edit: Jun 18th, 2017, 4:31pm by oxcart » User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Re: Universal Screen Fit?
« Reply #32 on: Jun 18th, 2017, 05:37am »

I can't get your code to run, so I am guessing a bit. I would say that you should stop using the mainwin to view your output. List it in a text window or texteditor. That way you will have much more control of what has focus. You can disable the viewing window so it does not react to input and steal the focus.

You should also consider modal for your input control, modal will not let focus move from the input control.
User IP Logged

oxcart
New Member
Image


member is offline

Avatar




PM


Posts: 13
xx Re: Universal Screen Fit?
« Reply #33 on: Jun 18th, 2017, 05:52am »

First, sorry to post that in with the Universal Screen Fit but after a lot of looking, I could NOT figure out how to start a new thread.

No, that code will not run without a lot of other code that sets it up. It was only intended to show the sequence of execution.

The Text Window tip sounds like it is worth a try.

Thanks!
User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Re: Universal Screen Fit?
« Reply #34 on: Jun 18th, 2017, 06:04am »

What problems does this code leave to fix?

Code:
    nomainwin
    'open texteditor for display
    WindowWidth = 800
    WindowHeight = 600

    UpperLeftX = int((DisplayWidth-WindowWidth)/2)
    UpperLeftY = int((DisplayHeight-WindowHeight)/2)
    texteditor #edi.txt, 0,0,750,500
    open "Display Control" for window as #edi
    #edi "trapclose [quit]"
    for n= 1 to 15
    #edi.txt "Bib First Last Age Sex (Place) or Add Time (23.25)   Click 'X' to Do Results --->"
    next
    WindowWidth = 495 : WindowHeight = 85
    UpperLeftX = 300
    UpperLeftY = 750
    textbox #hndl.txt, 8, 8, 320, 40
    'textbox #hndl.time, 330,8,100,40
    button #hndl.default, "   ", [firstn], LR, 170, 10
    button #hndl.help, "Award",[sofar], UL,340, 10
    'button #hndl.results, "Place",[PLACEFINDER], UL, 400, 10
    open "Bib First Last Age Sex (Place) or Add Time (23.25)   Click 'X' to Do Results --->" for dialog_modal as #hndl
    print #hndl, "font calibri 12 "
    print #hndl.txt, "!setfocus"
    #hndl "trapclose [quit]"


wait

[quit]
close #hndl
close #edi
end
 
User IP Logged

stumpy
Full Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 148
xx Re: Universal Screen Fit?
« Reply #35 on: Jun 18th, 2017, 07:07am »

Something similar was a problem yesterday with windows 10, with apologies if I did not follow everything or it is irrelevant. Anyway, previous win versions seemed to remember the last setting for a screen when it is reopened, or something which allowed each JB screen to appear in a predictable fashion, rather than off-centre.

Other people have mentioned probs using windows 10 with other 'apps' and I looked at the System> multitasking> snap settings, which someone recommended, but that did no help, - however did find that adjusting the height of the window itself, as set up in JB, seemed to get win 10 to treat it better (while also using a screen scaling system by tsh73) so it appeared nearly maximised.

(also guess that JB could run an external program/script to maximise each window, but could not find one)

Quote:
if version$ = "1280" then '....rem for a native tablet screen 1280x800
WindowHeight = WindowWidth/1910*1190
goto [x3]
end if

'....rem. for 1920x1080 or 1366x768 screens, instead the following gives 'nearly fully expanded' window when the same prog runs in win7 for both 1920x1080 and 1366x768:-
WindoxWidth = DisplayWidth
WindowHeight = WindowWidth/1920*1080

[x3] '...rem: this is for all three screen resolutions the PCs, when the JB screen is still displayed a couple of character spaces away from the left of the display, even with :-
' TOP CORNER
UpperLeftX = 0
UpperLeftY = 0

In my case it seems that that JB can do so much but this is dependant upon Windows10, which seemed to be causing problems which were not present with win7 and XP. I assume that the figures or scaling effect does not matter, and that it was just fiddling to get the height and width proportions within a certain range which seemed to make win10 to behave better...and perhaps that is to use the same height/width ratio as the PC screen

-----------------

Edit: After using a modal window which is smaller than the screen, and with Win10 but not with Win7, a new window is also smaller, that is unless "windowwidth = displaywidth" is done before switching to the new different main window, and found that JB help says:-

"The size and placement of any window can be set before it is opened. If no size and placement statements are specified before a statement to OPEN a window, Just BASIC will pick default sizes.

There are four special variables that can be set to select the size and placement of windows:

UpperLeftX
UpperLeftY
WindowWidth
WindowHeight

The width and the height of the display screen can be retrieved with these variables:

DisplayWidth
DisplayHeight"
« Last Edit: Jun 18th, 2017, 5:59pm by stumpy » User IP Logged

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

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

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