Recent

Author Topic: What is the width and height of a form?  (Read 7284 times)

Xenno

  • Jr. Member
  • **
  • Posts: 88
    • BS Programs
Re: What is the width and height of a form?
« Reply #15 on: March 22, 2026, 10:35:09 am »
Code: Pascal  [Select][+][-]
  1.     + Format(#13#13'  - Form height with title bar and top+bottom frame = %d', [Height + GetSystemMetrics(SM_CYSMCAPTION) + 2 * GetSystemMetrics(SM_CXFRAME)]);

Yes, that will do, too. Perhaps needs to make sure to match BorderStyle.
Lazarus 4.0, Windows 10, https://www.youtube.com/@bsprograms

Thaddy

  • Hero Member
  • *****
  • Posts: 19121
  • Glad to be alive.
Re: What is the width and height of a form?
« Reply #16 on: March 22, 2026, 10:48:02 am »
GetWindowRect is Windows only and on Windows there is no overlap anyway.
The issue is for other widgetsets incl. gtk2 and Qt.
objects are fine constructs. You can even initialize them with constructors.

Xenno

  • Jr. Member
  • **
  • Posts: 88
    • BS Programs
Re: What is the width and height of a form?
« Reply #17 on: March 22, 2026, 01:24:45 pm »
Thank you to clarify. I thought GetWindowRect in lcl/interfaces/gtk/gtkwinapih.inc could be used.
Lazarus 4.0, Windows 10, https://www.youtube.com/@bsprograms

jamie

  • Hero Member
  • *****
  • Posts: 7693
Re: What is the width and height of a form?
« Reply #18 on: March 22, 2026, 01:35:49 pm »
Thank you to clarify. I thought GetWindowRect in lcl/interfaces/gtk/gtkwinapih.inc could be used.

 That is what the LCLIntF is for, to give you compatible windows APIs.

As usual, someone is blowing smoke, again.

Jamie
The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 19121
  • Glad to be alive.
Re: What is the width and height of a form?
« Reply #19 on: March 22, 2026, 04:04:12 pm »
lclintf does noy support it. Simple: it is pure windows API.
And most non-windows widgetsets (all) do not support it correctly.
Try for yourself. (I did)
« Last Edit: March 22, 2026, 04:05:51 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

jamie

  • Hero Member
  • *****
  • Posts: 7693
Re: What is the width and height of a form?
« Reply #20 on: March 23, 2026, 11:33:44 am »
lclintf does noy support it. Simple: it is pure windows API.
And most non-windows widgetsets (all) do not support it correctly.
Try for yourself. (I did)
The fact that its in the LCLIntf means the intend is there, just because it does not work as you would think does not mean it's a windows only thing, it means the other widgets need to fix their code. As you said it, not supported correctly, so where is the fault there?

 I don't even know why I replied to this.

Jamie
The only true wisdom is knowing you know nothing

mercurhyo

  • Sr. Member
  • ****
  • Posts: 265
Re: What is the width and height of a form?
« Reply #21 on: March 24, 2026, 12:06:27 pm »
repeat
  eat;
until popcorn.bag = emptybag;
 :D
DEO MERCHVRIO - Fedora PlasmaKDE, Win11pro - Ryzen9XT+Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld

 

TinyPortal © 2005-2018