Recent

Author Topic: [SOLVED] ProgressBar Height  (Read 7050 times)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
[SOLVED] ProgressBar Height
« on: January 17, 2018, 07:24:41 pm »
Hi to all,

I am unable to  set the height of TProgressBar below 10, something like 5. I can change it in runtime but in design mode it is just impossible to change. It seems like height is bound to minimum of 10 in design time. Is there any method to enable the change of height in design time below 10.
« Last Edit: January 21, 2018, 07:12:47 am by Deepaak »
Holiday season is online now. :-)

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: ProgressBar Height
« Reply #1 on: January 17, 2018, 07:35:39 pm »
No problem here, I can set the height to 5 on design time on my Lazarus 1.8.0 Gtk2 64-bit on Ubuntu 17.10.

What is your OS, Lazarus version, widgetset?

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: ProgressBar Height
« Reply #2 on: January 17, 2018, 07:49:02 pm »
No problem here, I can set the height to 5 on design time on my Lazarus 1.8.0 Gtk2 64-bit on Ubuntu 17.10.

What is your OS, Lazarus version, widgetset?

Mine Windows 10, Lazarus Latest SVN, Freepascal 3.0.4 and Win32/Win64 Widget. Tested on Windows 8.1 also
Holiday season is online now. :-)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: ProgressBar Height
« Reply #3 on: January 17, 2018, 07:58:28 pm »
If you select your progressbar in the Object Inspector and review the Restricted page, you'll see that Height is one of the widgetset restrictions in Windows.

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: ProgressBar Height
« Reply #4 on: January 17, 2018, 08:08:40 pm »
If you select your progressbar in the Object Inspector and review the Restricted page, you'll see that Height is one of the widgetset restrictions in Windows.

 :( Yes now got the reason. So on Window it is not possible to change the size below 10 in design time. It can only be achieved in run-time.
Holiday season is online now. :-)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: ProgressBar Height
« Reply #5 on: January 17, 2018, 08:14:17 pm »
No, on Windows the progressbar widget has a minimum height that is fixed by the designers of Windows. Design/run time is irrelevant.

balazsszekely

  • Guest
Re: ProgressBar Height
« Reply #6 on: January 17, 2018, 09:20:19 pm »
@Deepaak
Draw you're own progressbar? IIRC there was a TGauge component somewhere, basically a TProgressBar on steroids.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: ProgressBar Height
« Reply #7 on: January 18, 2018, 03:35:34 am »
@Deepaak

Or maybe you can try:

TBGRAFlashProgressBar from BGRAControls:
http://wiki.lazarus.freepascal.org/BGRAControls#TBGRAFlashProgressBar

TECProgressBar or TECPositionBar from Eye-Candy Controls:
http://wiki.freepascal.org/Eye-Candy_Controls#TECProgressBar

ATGauge from ATFlatControls:
http://wiki.freepascal.org/ATGauge

TCDProgressBar from Lazarus Custom Drawn Controls:
http://wiki.freepascal.org/Lazarus_Custom_Drawn_Controls#TCDProgressBar

CM630

  • Hero Member
  • *****
  • Posts: 1076
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: ProgressBar Height
« Reply #8 on: January 18, 2018, 08:36:23 am »
Simply set Constraints.MaxHeight:=5 and that is all.
At least it works this way in Win 7.
Лазар 3,0 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: ProgressBar Height
« Reply #9 on: January 18, 2018, 11:18:39 am »
Simply set Constraints.MaxHeight:=5 and that is all.
At least it works this way in Win 7.
Does not works on Win 10. I can't say whether why Constraints.MaxHeight don't worked. 
Holiday season is online now. :-)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: ProgressBar Height
« Reply #10 on: January 18, 2018, 11:25:08 am »
Thank you every one for your help. But none worked. Because i was looking for Marquee effect which only TProgressBar provides. So i created a small procedure which set the height of
Code: Pascal  [Select][+][-]
  1. TProgressBar.Height := 5
on runtime.

As @howardpc mentioned that Height is one of the widgetset restrictions in Windows for Progressbar, Thank you for that info.

Holiday season is online now. :-)

ASerge

  • Hero Member
  • *****
  • Posts: 2212
Re: ProgressBar Height
« Reply #11 on: January 18, 2018, 10:59:41 pm »
No, on Windows the progressbar widget has a minimum height that is fixed by the designers of Windows. Design/run time is irrelevant.
I think this is the problem of Lazarus. On Delphi any ProgressBar height is set, in design and in runtime.

ASerge

  • Hero Member
  • *****
  • Posts: 2212
Re: ProgressBar Height
« Reply #12 on: January 18, 2018, 11:11:18 pm »
No, on Windows the progressbar widget has a minimum height that is fixed by the designers of Windows. Design/run time is irrelevant.
I think this is the problem of Lazarus. On Delphi any ProgressBar height is set, in design and in runtime.
Found error:
Code: Pascal  [Select][+][-]
  1. class function TWin32WSProgressBar.GetConstraints(const AControl: TControl;
  2.   const AConstraints: TObject): Boolean;
  3. ...
  4.     // The ProgressBar needs a minimum Height of 10 when themed,
  5.     // as required by Windows, otherwise it's image is corrupted
  6.     if ThemeServices.ThemesEnabled then
  7.       MinHeight := 10;
  8. ...

Also, an incorrect comment on the error.

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: ProgressBar Height
« Reply #13 on: January 19, 2018, 06:44:51 am »
No, on Windows the progressbar widget has a minimum height that is fixed by the designers of Windows. Design/run time is irrelevant.
I think this is the problem of Lazarus. On Delphi any ProgressBar height is set, in design and in runtime.
Found error:
Code: Pascal  [Select][+][-]
  1. class function TWin32WSProgressBar.GetConstraints(const AControl: TControl;
  2.   const AConstraints: TObject): Boolean;
  3. ...
  4.     // The ProgressBar needs a minimum Height of 10 when themed,
  5.     // as required by Windows, otherwise it's image is corrupted
  6.     if ThemeServices.ThemesEnabled then
  7.       MinHeight := 10;
  8. ...

Also, an incorrect comment on the error.

Good Hit. You are correct. In Delphi ProgressBar.height can be even set to 1px. Screen shot attached. LCL Widget have this restriction unless some patch is applied. In General it is a bug.

@howardpc In SVN 56500 i was able to set the height of Progressbar to 5. But in current SVN : 57116, I am unable to set it on runtime.

« Last Edit: January 19, 2018, 07:18:44 am by Deepaak »
Holiday season is online now. :-)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: ProgressBar Height
« Reply #14 on: January 19, 2018, 09:30:30 am »
No, on Windows the progressbar widget has a minimum height that is fixed by the designers of Windows. Design/run time is irrelevant.
I think this is the problem of Lazarus. On Delphi any ProgressBar height is set, in design and in runtime.
@ASerge
Can you submit a patch to correct the Windows widgetset implementation, and the comment?
I don't know what needs to be done to correct the info on the OI Restricted page for TProgressBar, but that will also need updating.

 

TinyPortal © 2005-2018