[Lazarus] Too large height of TEdit and TSpinEdit in xfce

Salvatore Coppola coppolastudio at gmail.com
Mon Sep 16 09:24:40 CEST 2019


Ok it is a workaround but why not call your function only one time at start for instance in main form create?
Regard
Salvatore 


Il giorno 16 Set 2019, 08:20, alle ore 08:20, Bo Berglund via lazarus <lazarus at lists.lazarus-ide.org> ha scritto:
>On Mon, 16 Sep 2019 00:29:58 +0000 (UTC), Haruyuki Fujimaki via
>lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>>Hello everyone,
>>I am maintaining my softwares in xfce desktop system (Linux Lite).
>>The height of TEdit and TSpinEdit controls becomes awkwardly too 
>>large as shown in attached screenshot.
>>By setting AutoSize := False, I can modify the height, but it is 
>>laborious for a big project and downward arrow of TSpinEdit is 
>>hidden.Does anyone know how to solve this problem?
>>Haruyuki Fujimaki
>
>I recently had a similar problem with a cross-platform application
>when I built it on Linux (Raspbian).
>In my case the controls became too small, but I think the problem is
>the same as yours.
>
>My sources are first developed on Windows and stored in subversion.
>When I retrieved them in Raspbian and opened Lazarus there to build
>the Linux version the user entry boxes for data were all too small.
>
>What happened was that the font of these controls had gotten a
>different size when the project was opened in Lazarus on Linux!
>
>In my case the control types affected were buttons, spinedits,
>statictexts, groupboxes, checkboxes and labels.
>
>So I had to add a procedure to set the font size of them all, which is
>called from the Form.OnShow event. I only had to change the size by
>one point to make the form look OK again.
>
>Here is my function:
>
>procedure TfrmMain.SetFontSize(S: shortint);
>begin
>  // Set font size on load.
>  btnDec60.Font.Size := S;
>  btnDec30.Font.Size := S;
>  btnDec10.Font.Size := S;
>  btnDec1.Font.Size := S;
>  btnInc1.Font.Size := S;
>  btnInc10.Font.Size := S;
>  btnInc30.Font.Size := S;
>  btnInc60.Font.Size := S;
>  btnCutStart.Font.Size := S;
>  btnCutEnd.Font.Size := S;
>  btnAddCut.Font.Size := S;
>  btnJump.Font.Size := S;
>  btnShiftAudio.Font.Size := S;
>  speDelay.Font.Size := S;
>  stxCutStart.Font.Size := S;
>  stxCutEnd.Font.Size := S;
>  stxCutTime.Font.Size := S;
>  stxClipCnt.Font.Size := S;
>  gbxCut.Font.Size := S;
>  ckbLogin.Font.Size := S;
>  lblTotal.Font.Size := S;
>end;
>
>
>And it is called from here:
>
>procedure TfrmMain.FormShow(Sender: TObject);
>begin
>  SetFontSize(9);
>end;
>
>I do not understand why the size clearly stated in the sources as 9
>are changed by Lazarus when the project loads on a different operating
>system, but that is in any case what happens.
>
>I am using Lazarus 2.0.4 and fpc 3.0.4 on Windows and Raspbian.
>
>
>-- 
>Bo Berglund
>Developer in Sweden
>
>-- 
>_______________________________________________
>lazarus mailing list
>lazarus at lists.lazarus-ide.org
>https://lists.lazarus-ide.org/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190916/7e4b4b2a/attachment.html>


More information about the lazarus mailing list