[lazarus] Screen.height

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Sep 19 04:24:14 EDT 2002


On Wed, 18 Sep 2002 21:46:49 -0500
"Tony Maro" <TonyM at nlisc.com> wrote:

> 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






More information about the Lazarus mailing list