[Gambas-user] ProgressBar Change Event

Demosthenes Koptsis demosthenesk at ...626...
Sun Jul 10 22:15:19 CEST 2011



ok, it works.

But what is better programming approach, a progressbar to have a change
event or not?

i am thinking Fabien's approach.



On Sun, 2011-07-10 at 20:28 +0200, Benoît Minisini wrote:
> > ok, maybe you are right.
> > 
> > i explain my case:
> > In my case the purpose to use a change event for progressbar is to
> > inform user about the changes of its value within control and not from a
> > variable which changes the value of the control.
> > Only for this.
> > 
> > For the data/view part i understand what are you saying.
> > But the progressbar store its state to its value property.
> > 
> > The difference is that the user cannot change its value from the
> > keyboard but the program does it, ok.
> > 
> > Also from another point of view there is a change to the property Value
> > regardless that there is no implementation for this as an event, so far
> > or an obvious purpose to use such an event.
> > 
> > If the change event is used only for the input of user and how the user
> > changes a value, it is ok, there is no need for a change event for
> > progressbar. i just thought that the change event would described better
> > the behavior of the progressbar to its operation independently of user
> > actions.
> > 
> 
> If you really need that Change event, you can reimplement the ProgressBar 
> control in your project :
> 
> ----[ ProgressBar.class ]-------------------------------------
> 
> ' Gambas class file
> 
> Export
> 
> Event Change
> 
> Property Value As Float
> 
> Private Sub Value_Read() As Float
> 
>   Return Super.Value
> 
> End
> 
> Private Sub Value_Write(Value As Float)
> 
>   Super.Value = Value
>   Raise Change
> 
> End
> 
> --------------------------------------------------------------
> 
> Tell me if it works. :-)
> 

-- 
Regards,
Demosthenes Koptsis.





More information about the User mailing list