|
Post by donjohn24 on Sept 28, 2022 14:51:39 GMT
I have a program for running a Tote at race nights - for which I recently received assistance to successfully solve a problem, and it runs happily on my main monitor or on a laptop PC. A minor difficulty I have is that my main monitor - of three - is actually a 48 inch TV, which helps with my aged eyes, but at the moment, whether I start the program from there or from one of the smaller displays, the program always starts on that main monitor. If I transfer the program window to one of the other monitors - for testing on that monitor, say - cannot get it to size correctly to fit, and when I select another menu option, the program window jumps back to the main large display. I tried exiting the program whilst (partly) displayed on a smaller monitor, but when I start it again, it does not start there but goes back to the large main monitor. I tried repeating the windows sizing section at the beginning of the main display window routine, but the move to the main monitor seems to occur first, so no solution. As mentioned, this is a minor problem for me, but as I wish to make this program/app available free to charities, I would like to ensure that this problem will not affect others - if there is a way to correct it. I wonder if it has anything to do with justbasic1.ini, but I'm such a novice with JustBasic that I don't know where to begin. If you wish to look - kindly - at my source code, it is downloadable at www.donjohnson24.co.uk/test2/RACENITE.BAS and you might need www.donjohnson24.co.uk/test2/RACENITE.DAT to see it in action.
|
|
|
Post by Rod on Sept 28, 2022 18:58:55 GMT
I am guessing this is a Windows question since Just BASIC has no power to change its display window. windows needs to dictate what the display looks like.
|
|
|
Post by xxgeek on Sept 28, 2022 19:20:59 GMT
I am guessing this is a Windows question since Just BASIC has no power to change its display window. windows needs to dictate what the display looks like. My thoughts as well. I no longer have a Windows install, so can't give details. But if you go into your display settings there should be settings for each monitor to "mirror" your displays. You may also need to change the scaling settings as well. Changing these settings may affect other things you do on your PC re:monitor use, so be forewarned. Note your current settings so you can return to them if you have problems.
|
|
|
Post by donjohn24 on Sept 28, 2022 19:53:13 GMT
Thanks Rod and xxgeek for the responses - which indicate that I'm not missing something in FB, so I'll stop worrying and use the workaround of redefining the monitor on which I want the app to run as my 'main display' whilst I test it there.
|
|
|
Post by xxgeek on Sept 28, 2022 20:47:28 GMT
If you get it working could you post the details of how you did it? Your reply may help someone in the future, thanks donjohn24
I know I had difficulty with 2 different monitors a few years ago. I can only assume that it is much easier when using identical monitors.
|
|
|
Post by donjohn24 on Sept 29, 2022 0:41:00 GMT
If you get it working could you post the details of how you did it? Your reply may help someone in the future, thanks donjohn24 I know I had difficulty with 2 different monitors a few years ago. I can only assume that it is much easier when using identical monitors. The simple workaround: Using the Windows Display settings - right click on a blank part of the Desktop - then select the display on which the app is to run, and under 'Multiple Displays' tick the box 'Make this my main display'. The app then starts and runs on the smaller display, automatically sizing itself to the smaller screen, without any problems. However, attempting to move the window to the larger screen fails, as it keep reverting to the new 'main display' I should add that I have no difficulty in moving screens for other apps from one monitor to another, and resizing them using the middle icon at the top right, so perhaps there IS something different in Just Basic created .exe files with regard to this functionality in Windows
|
|
|
Post by Rod on Sept 29, 2022 6:31:36 GMT
You would need to code the application to recognise it has been resized and to redraw all its controls. There is an example resize.bas that ships with just basic. Far far easier to code for a screen size you know.
Edit it ships with Liberty BASIC but appears to work with Just BASIC
'resize.bas 'This is an example of a program which resizes several 'controls in a window depending on how the user changes 'the size of the window.
nomainwin WindowWidth = 550 WindowHeight = 410
listbox #resizer.lbox1, array$(), [lbox1DClick], 1, 0, 256, 186 listbox #resizer.lbox2, array$(), [lbox2DClick], 257, 0, 284, 164 combobox #resizer.cbox3, array$(), [cbox3DoubleClick], 257, 164, 283, 150 texteditor #resizer.tedit4, 1, 186, 540, 195 open "Resizing example" for window as #resizer print #resizer, "trapclose [quit]"
[loop] print #resizer, "resizehandler [resized]" input r$ goto [loop]
[resized] wWid = WindowWidth wHig = WindowHeight upperVert = int(256/550*wWid) 'upper middle vertical edge midHoriz = int(186/410*wHig) 'middle horizontal edge urWid = upperVert - wWid print #resizer.lbox1, "locate 0 0 "; upperVert; " "; int(186/410*wHig) print #resizer.lbox2, "locate "; upperVert; " 0 "; wWid-upperVert; " "; int(186/410*wHig)-23 print #resizer.cbox3, "locate "; upperVert; " "; midHoriz-23; " "; wWid - upperVert; " "; 100 print #resizer.tedit4, "!locate 0 "; midHoriz; " "; wWid; " "; wHig-midHoriz; print #resizer, "refresh" goto [loop]
[quit] 'quit the program
close #resizer end
|
|
|
Post by donjohn24 on Sept 29, 2022 10:11:34 GMT
Rod, I do have a sizing routine at the start of my program, but it obviously takes its input from the screen on which the program runs, but as it insists on reverting to the 'main display' even after moving it to another, it is the 'main display' screen that provides the dimensions.
|
|
|
Post by Rod on Sept 29, 2022 20:29:04 GMT
Takes its input from the program starting in the small window or being resized in the larger window? I don’t have multiple monitors so can’t experiment, and I have seen few applications coded for multiple monitors. Still think it is.more of a Windows issue. What happens if you open the app in the larger window rather than try. To resize it
|
|
|
Post by tenochtitlanuk on Sept 30, 2022 8:23:59 GMT
My standard set-up is Linux/Wine/LBJB with a laptop and larger screen stacked vertically. My laptop screen can't display my graphic screens which are often 1000x1000 pixels. Basically I get similar behaviour to what the OP reports when I have them mirrored rather than stacked.
The OP code runs SLIGHTLY too big on the external monitor for me. Usable- I just have to drag the display left a little if the right hand side is needed for an option. I suspect I could change OP code to 95% of the values and the big display would be fine.
I never size screens via DisplayWidth/Height, but rather use absolute values.
I suspect LB won't detect current screen it runs in so if two or more monitors have different RESOLUTION ( rather than SIZE) you won't be able to make it fill both correctly- can't check at the moment as I'm travelling.
|
|
|
Post by donjohn24 on Sept 30, 2022 11:20:39 GMT
I realise that I may not have explained what happens clearly, so I've created a video that should do so. Unfortunately, the auto brightness control on the camera app makes the display on the smaller monitor hard to see on the video. If you haven't got bored with this topic, the video is available at www.donjohnson24.co.uk/test2/RaceniteScreens.mp4BTW - I missed out a couple of steps - I should have shown that when the partially resized program is displayed on the smaller screen, clicking on any screen option causes the program display to jump back to the main screen, sized to fit it.
|
|