[Lazarus] TWSProgressBar.SetPosition() - what is it for?

zeljko zeljko at holobit.net
Thu Mar 28 18:53:50 CET 2013


On 03/28/2013 05:56 PM, Graeme Geldenhuys wrote:
> Hi,
>
> I've just added TProgressBar support for LCL-fpGUI, but I find the
> widgetset design extremely confusing.
>
> For example, I implemented TFpGuiWSProgressBar.SetPosition() - the
> component is painted on the form, but the position property was never
> set. Adding a SendDebug() call inside TFpGuiWSProgressBar.SetPosition()
> I noticed that it is _never_ called. Not at the creation of the form,
> and not when you set the ProgressBar.Position property at runtime.
>
> Everything seems to go via the ApplyUpdates() method. I could confirm
> this inside the progressbar.inc file where TCustomProgressBar class is
> implemented. So what is TWSProgressBar.SetPosition() then used for, and
> when is it called?
>
> I had a look at the LCL-Qt widgetset implementation for TProgressBar. I
> can see code duplication (setting the Position information) in
> ApplyUpdates and SetPosition() as well.

Yes, that's something pretty weird in TProgressBar implementation.I've 
asked about it on mailing list few months ago afair, but no answer.

zeljko





More information about the Lazarus mailing list