Recent

Author Topic: Resizing TSpinEdit and Right justify is a problem  (Read 965 times)

flaza

  • Jr. Member
  • **
  • Posts: 59
Resizing TSpinEdit and Right justify is a problem
« on: June 04, 2024, 11:36:18 am »
Hi,

I"m using Lazarus 3.4 with ftp 3.2.2 on Windows 10. I use 2 TSpinEdit components vertical aligned and I want the numbers right aligned. See the picture Right justify with increased width.png. With the default height and fontsize it works fine. But then I want set the fontsize to 18 the numbers are partly hidden behind the UpDown buttons of the component, see picture Right justify with Autosize and fontsize 18.png.
Is there away to solve this problem? Or is this a bug? Or is it the widgetset that is responsible?

Thx for your time.

Bart

  • Hero Member
  • *****
  • Posts: 5349
    • Bart en Mariska's Webstek
Re: Resizing TSpinEdit and Right justify is a problem
« Reply #1 on: June 04, 2024, 01:49:52 pm »
Not sure.
You could try if TSpinEditEx behaves better in this respect.

Bart

wp

  • Hero Member
  • *****
  • Posts: 12297
Re: Resizing TSpinEdit and Right justify is a problem
« Reply #2 on: June 04, 2024, 04:05:49 pm »
TSpinEditEx works as expected. However, the button width remains too narrow. There is property BuddyWidth, but this is proteced. You can subclass the control to get access to the protected property:
Code: Pascal  [Select][+][-]
  1. type
  2.   TSpinEditExOpener = class(TSpinEditEx)
  3.   public
  4.     property BuddyWidth;
  5.   end;
  6.  
  7. procedure TForm1.FormCreate(Sender: TObject);
  8. begin
  9.   TSpinEditExOpener(SpinEditEx1).BuddyWidth := 40;
  10. end;

Maybe the property should be published here as "ButtonWidth" like with TFileNameEdit, so that the user has full and easy access.

flaza

  • Jr. Member
  • **
  • Posts: 59
Re: Resizing TSpinEdit and Right justify is a problem
« Reply #3 on: June 04, 2024, 04:12:11 pm »
Thx for the solutions, it works fine.

Bart

  • Hero Member
  • *****
  • Posts: 5349
    • Bart en Mariska's Webstek
Re: Resizing TSpinEdit and Right justify is a problem
« Reply #4 on: June 04, 2024, 08:06:53 pm »
Maybe the property should be published here as "ButtonWidth" like with TFileNameEdit, so that the user has full and easy access.

Yes, probably a good idea to expose this to the user.
Maybe a bit better name: SpinButtonWidth?

Feel free to implement it, or assign a feature request in the bugtracker to me.

Bart

wp

  • Hero Member
  • *****
  • Posts: 12297
Re: Resizing TSpinEdit and Right justify is a problem
« Reply #5 on: June 05, 2024, 03:09:42 pm »
Committed a version of TSpinEditEx and TFloatSpinEditEx which as a new published property SpinButtonWidth

 

TinyPortal © 2005-2018