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

Graeme Geldenhuys graeme at geldenhuys.co.uk
Thu Mar 28 17:56:21 CET 2013


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.



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/





More information about the Lazarus mailing list