Recent

Author Topic: Drawn sizes of controlls different than declared  (Read 1835 times)

krzynio

  • Jr. Member
  • **
  • Posts: 99
    • Krzynio's home page
Drawn sizes of controlls different than declared
« on: February 27, 2018, 08:05:36 am »
Hi!
I created a complex component. It consists of TEdit, TSpeedButton and TStringGrid placed on the TCustomPanel.
The size of TSpeedButton is adujsted automatically to TEdit in Resize method.
Code: Pascal  [Select][+][-]
  1. SpeedButton.Height := Edit.Height
Under Linux (gtk2) it works fine but under Windows SpeedButton is smaller. See attachment.
Is it a bug or it is intended drawing the SpeedButton Height (and probably width also) less then its defined Height? Or maybe drawn height of TEdit is higher than declared in Edit.Height. I didn't measure.

Ubuntu 23.10 x64, / Windows 11 PL - latest updates
Lazarus 2.2.6, FPC 3.2.2

eric

  • Sr. Member
  • ****
  • Posts: 267
Re: Drawn sizes of controlls different than declared
« Reply #1 on: February 27, 2018, 01:45:06 pm »
I haven't checked this, but it seems likely that the Windows implementation of the speedbutton has a transparent border round it.

PatBayford

  • Full Member
  • ***
  • Posts: 125
Re: Drawn sizes of controlls different than declared
« Reply #2 on: February 28, 2018, 03:59:44 am »
I believe Eric is correct - the Windows API speed button either has a transparent border, or is drawn with border space. This seems to be a requirement of the way Microsoft implements it's speed button containers.
Lazarus 1.8.0 FPC 3.0.2 SVN 56594 Windows 10 64bit (i386-win32-win32/win64)

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Drawn sizes of controlls different than declared
« Reply #3 on: February 28, 2018, 02:44:09 pm »
@krzynio: the same problem also exists for other controls and other Windows themes, for exemple TButton under WinXP Luna theme looks too short. TEdit too and you can do nothing with it.
« Last Edit: February 28, 2018, 02:47:43 pm by furious programming »
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

 

TinyPortal © 2005-2018