Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-09

Screen.height

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Tony Maro: I just learned why on some computers my drop-down calendar will appear in the middle of…
Show quoted text 9 lines
I just learned why on some computers my drop-down calendar will appear in the middle of the screen... If a window is created off the edge of the screen this happens. The problem is, the "edge" is calculated according to where my gnome panel is. Gnome panels are different sizes... So, if I calculate the edge of the screen with screen.height and then attempt to make a window fit just within that I end up overlapping the panel, and it won't let me do that so the window pops to the middle. Is there a way to calculate the _usable_ screen size? In the LCL I see references to GetSystemMetrics, but what unit would I need in my uses to use that, and where can I find a list of the constants used to request a given metric?

The positioning and panels are handled by the windowmanager. The underlying gtk does not have the information of panels and the windowmanager specific guidelines how a window is positioned. Therefore the gtk-interface of the LCL has this problem too. To get the full information, you must use the libs of the each windowmanager. You could adjust the position a second time after the window is repositioned by the windowmanager, but window managers can ignore this request or reposition it again.

Mattias

Reply by email

Tony Maro

I just learned why on some computers my drop-down calendar will appear in the middle of the screen...

If a window is created off the edge of the screen this happens.

The problem is, the "edge" is calculated according to where my gnome panel is. Gnome panels are different sizes...

So, if I calculate the edge of the screen with screen.height and then attempt to make a window fit just within that I end up overlapping the panel, and it won't let me do that so the window pops to the middle.

Is there a way to calculate the _usable_ screen size? In the LCL I see references to GetSystemMetrics, but what unit would I need in my uses to use that, and where can I find a list of the constants used to request a given metric?

Thanks,

Tony

<<winmail.dat>>

Reply by email