LB Booster
« Window alignment »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:54am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Window alignment  (Read 621 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Window alignment
« Thread started on: Nov 16th, 2016, 3:53pm »

When I use this code, I expect the window to fill the screen and not leave any space on any side, but it seems not to work in LBB. Am I doing something wrong?

r.m.

Code:
 WindowWidth = DisplayWidth:    WindowHeight = DisplayWidth
 UpperLeftX=0 :     UpperLeftY=0 
 
User IP Logged

Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: Window alignment
« Reply #1 on: Nov 16th, 2016, 5:02pm »

Windows has changed, it is broken across all implementations. Don't know why but it is not LBB specific.

I get a 7pixel border right and left and a 5pixel border at bottom.
« Last Edit: Nov 16th, 2016, 5:32pm by Rod » User IP Logged

Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Re: Window alignment
« Reply #2 on: Nov 16th, 2016, 7:49pm »

I get a full screen under Windows XP with LBB and JB.
UpperLeftX=0: UpperLeftY=0 is not needed.
WindowHeight = DisplayHeight, not DisplayWidth. This messes up JB but not LBB.

Code:
NoMainWin
WindowWidth = DisplayWidth: WindowHeight = DisplayHeight
'UpperLeftX=0: UpperLeftY=0
open "Full Screen Window" for window as #win
#win "TrapClose [quit]"
wait
[quit]
close #win
end 



User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Window alignment
« Reply #3 on: Nov 16th, 2016, 8:41pm »

on Nov 16th, 2016, 3:53pm, Alincon wrote:
When I use this code, I expect the window to fill the screen

Part of the problem is that "fill the screen" isn't well-defined. For example, do you expect the right and left window borders to be visible or not? Do you expect the taskbar to cover part of the window or not? Do you expect the title bar to be visible or not?

In the case of a DIALOG, GRAPHICS or TEXT window, Liberty BASIC provides specific 'full screen' versions which you select by appending _FS to the window name. The window is resized so that it is slightly wider than the screen (so the left and right borders are not visible) but the height is somewhat less than the display height (so the taskbar does not cover any of the window). This is probably the best option for those window types.

For some reason the WINDOW type does not has a _FS option (I could easily add one in LBB); but you can achieve the same effect using STYLEBITS:

Code:
NoMainWin
stylebits #win, _WS_MAXIMIZE, 0, 0, 0
open "Full Screen Window" for window as #win
#win "TrapClose [quit]"
wait
[quit]
close #win
end 

If you try to force a window to be 'full screen' by setting the WindowWidth and WindowHeight variables to the display dimensions something different happens. Specifically, the left and right borders are visible, because WindowWidth is inclusive of them; this is admittedly largely cosmetic. But more seriously, the window will extend to the bottom of the display underneath the taskbar which is probably undesirable and may confuse Windows.

So my recommendation is that if you want a 'full screen' window you should achieve it using the _FS suffix when it is available, and using STYLEBITS otherwise. The WindowWidth and WindowHeight variables should be reserved for when you want the window to be smaller than the screen.

For completeness I should add that it is also possible to create a genuinely 'full screen' window in which neither the title bar nor taskbar is visible. This can be achieved using API calls but is generally not to be encouraged except for special purposes such as video games.

Richard.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: Window alignment
« Reply #4 on: Nov 16th, 2016, 8:46pm »

I'm embarrassed to say that this thread is due to programmer error.
r.m.
« Last Edit: Nov 17th, 2016, 12:30am by Alincon » User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Window alignment
« Reply #5 on: Nov 17th, 2016, 07:08am »

As they said - the only one who do not error is one that does nothing .
User IP Logged

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

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls