ProgressBar text in GTK2 interface does not match Qt ProgressBar text (patch supplied)
Original Reporter info from Mantis: edvard
-
Reporter name: Eddy Martin
Original Reporter info from Mantis: edvard
- Reporter name: Eddy Martin
Description:
When using 'BarShowText' property of TProgressBar, the text doesn't make a whole lot of sense (to me) and can't be set without altering the source. e.g., If the ProgressBar Position = 10, 'Min' = 0 and 'Max' = 100, the text shows as "10 from [0-100] (10%)". When using the Qt interface, the ProgressBar text shows simply as a percentile between Max and Min (in the example case, it would simply show '10%').
Steps to reproduce:
Launch GTK Lazarus.
Add a TProgressBar to Form1.
From Project Inspector, set ProgressBar1 'Min'=0, 'Max'=100, 'Position'=10, and 'BarShowText'=True.
Compile and run.
ProgressBar1 text will show as "10 from [0-100] (10%)".
Close window and set Qt as the LCLWidgetType for the project per this link:
http://wiki.freepascal.org/Qt_Interface#For_Lazarus_0.9.31 at "If you use a gtk2 IDE and want to compile a project for qt ...".
Compile and run.
ProgressBar1 text will show as '10%'.
Apply supplied patch to 'gtk2wscomctrls.pp' from lazarus/1.0.14/lcl/interfaces/gtk2, or open the file in a text editor and change line 459 to read "wText := Format('%d%s', [Position,'%%']);"
Save and recompile project for GTK2 widgetset (simply remove Qt steps from above).
ProgressBar text will show as '10%'
Additional information:
I know the demonstrated Qt behavior is simply the built-in default for the widget set and cannot be changed, and I haven't tested other widgetsets, but the supplied patch proposes to at least change the GTK2 text to match Qt, so maybe this isn't a bug 'per se' but a feature change for the 'Wishlist' category.
This also applies to RC2 of 1.2, just alter the relevant line numbers.
I will be testing other widgetsets soon and supply patches if the widgetset allows AND if this is a desirable change.
Patch attached.
Mantis conversion info:
- Mantis ID: 25807
- Version: 1.0.14