Recent

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

krzynio

  • Jr. Member
  • **
  • Posts: 68
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.

Lazarus version: trunk. FPC version: 3.0.4. OS: Linux Debian Testing x64 with XFCE 4.12 and Windows 10 x64 version: 1709

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

  • Jr. Member
  • **
  • Posts: 83
  • I click a little.
    • TreeStructInfo - format for text and binary configuration files
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 »