Board Logo
« Universal Screen Fit? »

Welcome Guest. Please Login or Register.
Jan 16th, 2018, 3:31pm


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 3495 times)
bkg73123
Member in Training
ImageImage


member is offline

Avatar




PM


Posts: 43
xx Universal Screen Fit?
« Thread started on: Jun 22nd, 2009, 11:42am »

Hello All,

How would you code a window to fit to any size monitor
proportionally?
So it would stretch to fit...

I am using:
Code:
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
 


,but this doesn't work correctly when going from computer
to computer with different screen resolutions and monitor
sizes.

Thank You!
B
User IP Logged

flaxen
Full Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 274
xx Re: Universal Screen Fit?
« Reply #1 on: Jun 22nd, 2009, 12:07pm »

If you are using a window you can use for example window_fs.
User IP Logged

•๖ۣۜۜFlaxen•
bkg73123
Member in Training
ImageImage


member is offline

Avatar




PM


Posts: 43
xx Re: Universal Screen Fit?
« Reply #2 on: Jun 22nd, 2009, 12:31pm »

The following isn't working.
Code:
nomainwin
OPEN "WINDOWS" for window_fs as #1
wait
 


This works, but I don't know if this is compatible with what I am trying to do. Display graphics boxes(text), retrieve text from text box, display bmps.

Code:
graphics_fs 
User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Re: Universal Screen Fit?
« Reply #3 on: Jun 22nd, 2009, 1:51pm »

I'm not understanding. In what way does this code not meet your needs?

Code:
    WindowWidth = DisplayWidth
    WindowHeight = DisplayHeight
    open "Full Window" for window as #w
    print #w, "trapclose [quit]"
    wait

    [quit]
    close #w
    end
 
User IP Logged

tooanalytical
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1739
xx Re: Universal Screen Fit?
« Reply #4 on: Jun 22nd, 2009, 1:59pm »

Here is a dumb question:
How do DisplayWidth and DisplayHeight relate to screen resolution?
User IP Logged

JohnDavidson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4142
xx Re: Universal Screen Fit?
« Reply #5 on: Jun 22nd, 2009, 2:52pm »

Actually it does work.
I am assuming that your windows covers the Windows taskbar on some systems and not others.

A JB window can't stay on top of a taskbar on a system that is setup to keep the taskbar on top of other windows.
The bottom of a DisplayHeight window will be behind the taskbar.

DisplayWidth and DisplayHeight is your screen resolution.


John
User IP Logged

John Davidson
e-me: johnshomeport@yahoo.com
My JB Page: http://john.jbusers.com/
Did ya Libby yet? http://lblibby.com/
Welopez
Moderator
ImageImageImageImageImage


member is offline

Avatar

Never let your beliefs get in the way of learning.


PM

Gender: Male
Posts: 4407
xx Re: Universal Screen Fit?
« Reply #6 on: Jun 22nd, 2009, 3:04pm »

We can't be sure of your intentions either, but this snippet is cool:
Code:
NOMAINWIN

WindowWidth = DisplayWidth
WindowHeight = DisplayHeight

TEXTBOX #test.tb1, 20, 20, (DisplayWidth-40), 40

OPEN "Dumb Test" FOR GRAPHICS_nsb AS #test
PRINT #test, "trapclose [quit]"
PRINT #test, "FONT Tahoma 10 Bold"
PRINT #test.tb1, "Now is the time for all good men to come to the aid of the party.  "+_
    "The quick brown fox jumps over the lazy dog.  "+_
    "Pack my box with five dozen liquor jugs.  "+_
    "Help!  I'm a programmer!  Get me out of here."
PRINT #test.tb1, "!contents? nonsense$"
PRINT #test, "FILL buttonface"
PRINT #test, "BACKCOLOR buttonface"
PRINT #test, "PLACE 30, 250"
s=10  'begin with font size 10
FOR k=1 TO 4
PRINT #test, "\\"; WORD$(nonsense$,k,".")
s=s+4
PRINT #test, "FONT Tahoma "; s; " bold"  'change font size
NEXT k
WAIT

[quit]
    CLOSE #test
    END
 

Perhaps if you can explain your needs more clearly, we can give you a better answer.

www.wikipedia.org has a very good explanation of the mis-nomer, screen resolution.

Good luck to you!
User IP Logged

JB 1.01
Win7 64bit, 4 GB RAM, Pentium 6200@2.13 GHz (laptop)
WinXP, 1 GB RAM, Intel N270@1.6 GHz (netbook)
bkg73123
Member in Training
ImageImage


member is offline

Avatar




PM


Posts: 43
xx Re: Universal Screen Fit?
« Reply #7 on: Jun 22nd, 2009, 3:04pm »

"I'm not understanding. In what way does this code not meet your needs?"



I used that code at home while making the program.
It worked fine on my monitors at home.
However, both my computers that I tried my program
on were the exact same monitor set at the exact same resolution.

I ran my EXE on my work computer today and the window was way larger than the screen. You could not see the "X" at the top right of the window. It also extended vertically past the boundaries of the monitor. This is a wide screen monitor set at different resolution.

What is causing this?

Resolution settings will effect the outer boundaries used on the any given monitor. If I change the resolution on my work computer monitor it may only display the desktop on 2/3 of the monitor screen.

Thanks,
B
User IP Logged

jeremyhowell
Senior Member
ImageImageImageImageImage


member is offline

Avatar

A Life? Cool! Where can I download one of those from?


Homepage PM

Gender: Male
Posts: 874
xx Re: Universal Screen Fit?
« Reply #8 on: Jun 22nd, 2009, 5:50pm »

So the code works, but the EXE doesn't?

Where the computers it didn't work on Vista?

huh

~ Jeremy
User IP Logged

The mods and admins are not paid to help you and run this forum, so give them the respect they deserve. wink

Free Games

AMD Athlon XP 2200+ 1.81Ghz, 512mb RAM, GeForce 7600 GS, Windows XP Home Edition SP3, Just BASIC 1.01
bkg73123
Member in Training
ImageImage


member is offline

Avatar




PM


Posts: 43
xx Re: Universal Screen Fit?
« Reply #9 on: Jun 22nd, 2009, 7:15pm »

I think you are right.
The code works fine when ran from inside JB.
However, the EXE that is created on my home computer doesn't display correctly on my work computer.
I am not certain what OS I have specifically.
I want to say it is XP Professional.
I don't think we have Vista. I will check tomorrow AM.
My home comps are XP Home Edition. What would the solution be here?
User IP Logged

jeremyhowell
Senior Member
ImageImageImageImageImage


member is offline

Avatar

A Life? Cool! Where can I download one of those from?


Homepage PM

Gender: Male
Posts: 874
xx Re: Universal Screen Fit?
« Reply #10 on: Jun 22nd, 2009, 7:37pm »

I did hear at one time (at least I think I did) about DisplayWidth and DisplayHeight variables playing up on Vista machines, I don't know how true this is, though. I don't own a Vista computer, so the only things I know about them are things I hear, so this statement really has no base at all. undecided

Quote:
I ran my EXE on my work computer today and the window was way larger than the screen. You could not see the "X" at the top right of the window. It also extended vertically past the boundaries of the monitor. This is a wide screen monitor set at different resolution.


You say your work computer monitor is widescreen, but set at a different resolution. This might be the cause, if I am understanding your statement correctly. huh Do other programs have this problem?



User IP Logged

The mods and admins are not paid to help you and run this forum, so give them the respect they deserve. wink

Free Games

AMD Athlon XP 2200+ 1.81Ghz, 512mb RAM, GeForce 7600 GS, Windows XP Home Edition SP3, Just BASIC 1.01
bkg73123
Member in Training
ImageImage


member is offline

Avatar




PM


Posts: 43
xx Re: Universal Screen Fit?
« Reply #11 on: Jun 22nd, 2009, 8:39pm »

Let me add that no matter what resolution I tried on my work comp...the window from my JB program still did not fit the display area. I am thinking that the resolution doesn't have anything to do with it.
User IP Logged

JohnDavidson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 4142
xx Re: Universal Screen Fit?
« Reply #12 on: Jun 22nd, 2009, 9:19pm »

Quote:
Resolution settings will effect the outer boundaries used on the any given monitor. If I change the resolution on my work computer monitor it may only display the desktop on 2/3 of the monitor screen.


Are you restarting your program after changing resolution?
Can you post the code used to create the window?

John
User IP Logged

John Davidson
e-me: johnshomeport@yahoo.com
My JB Page: http://john.jbusers.com/
Did ya Libby yet? http://lblibby.com/
bkg73123
Member in Training
ImageImage


member is offline

Avatar




PM


Posts: 43
xx Re: Universal Screen Fit?
« Reply #13 on: Jun 22nd, 2009, 10:09pm »

Yes , I believe I did restart after changing the resolution.

I am using:
Code:
NOMAINWIN

WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
 
User IP Logged

tooanalytical
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1739
xx Re: Universal Screen Fit?
« Reply #14 on: Jun 22nd, 2009, 10:10pm »

One may notice, at least on Windows XP if not other Windows, that three of the consecutive resolution settings are: 800x600, 960x600, 1024x768.

The second one, the 960x600, horizontally contracts the screen image.

This was probably not important in this problem. Does the same problem occur on Windows 98?
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