Furniture

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Furniture

Post by bogs » Mon Jul 16, 2018 2:47 pm

FourthWorld wrote:
Mon Jul 16, 2018 8:29 am
bogs wrote:
Mon Jul 16, 2018 3:51 am
I don't think anythings 'missing' per se, I think he is saying that the working screenRect and effective working screenRect are reporting the same dimensions.
Unless you're using multiple monitors that should be what we expect, no?
No, I don't think that would be the expected behavior, at least, not as I interpret the dictionary.

On a single monitor/screen, you have the screenRect (the entire screen). Of that space, you have the working screenRect (the part of the screen minus toolbars/docks/menubar etc.). While working and effective are similar, the effective qualifier should give you whatever portion is just for the application, according to the way I read the entry in the dictionary (Richmond and I quoted the pertinent references up above), but I'll put the direct references here as well, since we are now on a 2nd page, with the parts of the text at issue.

This is a direct copy from the current dictionary -
Description

. Use the screenRect function to find out the available screen sizes and to scale windows to the size of the screen.
. In its singular form (screenRect) this function returns the virtual co-ordinates of the primary display.
. In its plural form (screenRects) this function returns a list containing the virtual co-ordinates of all the screens currently attached to the system. The first line is always that of the primary display, and the order of the rest are in an OS-specific order.
. The virtual co-ordinates of a screen a quadruple of four integers specifying the left, top, right and bottom of the rectangle. The right and bottom edges are not included in the screen's area.
. Adding the working adjective to either form returns the virtual co-ordinates of each screen's working-area. The working-area of a screen is defined to be the area not covered by OS furniture (such as the task bar on Windows, and the Dock and Menubar on Mac OS X).
. Adding the effective adjective to either form returns the area of the screen the application has to itself. In particular, if the keyboard is activated, it take into account if the keyboard is taking up space on the screen. (Android and iOS only)

# Note: The co-ordinates returned by the screenRect family of functions can be anywhere in the virtual desktop defined by the OS - their values will depend on the user's local configuration. In particular, they can take both positive and negative values.

It is certainly possible I am misinterpreting the 'effective' comment, since the way it is written it could apply only to mobile, however it does also say " to either form ", which would imply it is universal in nature.

Let us put it another way, these are all listed under screenRect, if all 3 are the exact same thing, why would you bother adding the adjectives to screenRect if they serve no purpose?
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Furniture

Post by jacque » Mon Jul 16, 2018 6:23 pm

The "effective" modifier was added primarily for mobile to accommodate the situation where the keyboard is displayed. In that case the working screenrect and the effective working screenrect will be different. I assume there could be cases on desktop where this would also apply though I can't think of any offhand.

Richmond's results show a working screenrect to be 47 pixels shorter than the actual screenrect. That should be the total amount of the heights of the menubar and the dock. I'm not sure what the problem is.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Furniture

Post by richmond62 » Mon Jul 16, 2018 9:20 pm

Richmond's results
The problem is that my Dock takes up quite a bit more space than that.

And this is NBG on Linux.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Furniture

Post by jacque » Mon Jul 16, 2018 10:21 pm

It seems to be working here. My dock is on the side, and the screenMouseLoc shows the same width as the working screenrect shows. Put "the screenMouseLoc" into the message box, carefully align your mouse with the top of the dock and then hit the return key. See how that compares to the figures in the working screenrect.

I misinformed you about the 47 pixels -- that would be the height of the dock, and does not include the menubar. The menubar height is the second item of the working screenrect.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Furniture

Post by bogs » Mon Jul 16, 2018 11:22 pm

Works on linux here, Richmond. To test, I enabled 3 docks.
Image
What I found was that if the docks were set to autohide, then the amount for those hidden ones aren't taken into account, when not set to hide, the panels are taken into account.
Selection_004.png
Autohidden panels...
I didn't notice any difference between working and effective working, but didn't expect to see a difference with this setup either.
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”