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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

Too_large_heght_in_xfce.png (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
On Mon, 16 Sep 2019 00:29:58 +0000 (UTC), Haruyuki Fujimaki via
lazarus <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
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, alle ore 08:20, Bo Berglund via lazarus <[hidden email]> ha scritto:
On Mon, 16 Sep 2019 00:29:58 +0000 (UTC), Haruyuki Fujimaki via
lazarus <[hidden email]> 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.


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
On Mon, 16 Sep 2019 09:24:40 +0200, Salvatore Coppola via lazarus
<[hidden email]> wrote:

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

Yes, a typical workaround...
I am so used to using OnShow since my form always is only shown once
and never hidden afterwards. But you are right that it should rather
be in OnCreate!


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus