[Gambas-user] ProgressBar Change Event

Fabien Bodard gambas.fr at ...626...
Sun Jul 10 10:54:04 CEST 2011


But There is an ENORMOUS difference between a textbox and a progressbar !!

In the progressbar side the user CAN'T change the value with his
keyboard or mouse. So we know where and when the value is changed.

The change event in the text box is a way to inform the program that
the user do something.

You need really to explain us why you really need this event !!


i think it's not a real need because


Public sub SpinBow_Change()
  Progressbar1.Value = Last.value/100
End


Public sub ProgressBar1_Change()
  If last.Value =1 then message.info("end process")
End


is more complicated (for the same result) than :

Public sub SpinBow_Change()
  Progressbar1.Value = Last.value/100
  If last.Value =100 then message.info("end process")
End


no ?

I really don't understand why you need to test the progressbar ? and
not check on the value that set the progressbar... you need to
learn the data/view way of programming. Datas are one thing , View
another ! ProgressBar is just a view for a state... but does not
store the state.

2011/7/10 Demosthenes Koptsis <demosthenesk at ...626...>:
> Dimitris i say exactly that.
>
> 1) There is no watcher method to watch the changes in a progressbar.
>
> i would like to write something like that.
>
> PUBLIC SUB ProgressBar1_Change()
>  Message.Info("Complete 100%")
> END
>
> but progressbar has not any Change() event.
>
> 2) So for now i use a Timer with interval 100 ms who watch
> ProgressBar.Value and show the Message.
>
> 3) Of course i can watch the variable who feeds the ProgressBar.Value
> but this is not the solution.
>
> it is the same to watch the sString variable for a tetbox and not use
> the Change event.
> example:
> TextBox1.Text = sString.
>
> what is the solution here? To watch sString or to use a change event?
>
>
> On Sat, 2011-07-09 at 21:54 -0600, Dimitris Anogiatis wrote:
>> Demosthene,
>>
>> Since the value of the progressbar cotnrol is just between 0 to 1
>> you can probably try
>>
>> IF ProgressBar1.Value = 1 THEN ProgressBar1.label="Process complete"
>>
>>
>> You can probably do this within the ProgressBar1_Change() event
>> assuming that the event is going to get fired when an input changes
>> the Value property of the control.
>>
>> I hope this helps
>>
>> Dimitris
>>
>> On Sat, Jul 9, 2011 at 1:04 AM, Demosthenes Koptsis
>> <demosthenesk at ...626...>wrote:
>>
>> > in that case
>> >
>> > the expression
>> > if X >=1 then message.info("all is done")
>> >
>> > who will watch this expression?
>> >
>> > i need a timer or event loop or event ProgressBar1_Change()
>> >
>> > i implement this for now with a timer
>> > but i think it would be more elegant as programming approach to watch the
>> > ProgressBar1.Value and not the variable who set this value.
>> >
>> >
>> > On Sat, 2011-07-09 at 00:02 +0200, Fabien Bodard wrote:
>> > > ??? can't you test the value when you set the value of the progressbar ?
>> > >
>> > > progressbar1.value = X
>> > >
>> > > if X >=1 then message.info("all is done")
>> > >
>> > > 2011/7/8 Demosthenes Koptsis <demosthenesk at ...626...>:
>> > > > hi,
>> > > >
>> > > > i make an example with progressbar and i saw that i was needed a
>> > > > ProgressBar_Change() event to check the status (value) of the control.
>> > > >
>> > > > So if value is 1 to show a Message.Info("Complete 100%").
>> > > >
>> > > > Is it possible to implement this event?
>> > > >
>> > > >
>> > > > --
>> > > > Regards,
>> > > > Demosthenes Koptsis.
>> > > >
>> > > >
>> > > >
>> > ------------------------------------------------------------------------------
>> > > > All of the data generated in your IT infrastructure is seriously
>> > valuable.
>> > > > Why? It contains a definitive record of application performance,
>> > security
>> > > > threats, fraudulent activity, and more. Splunk takes this data and
>> > makes
>> > > > sense of it. IT sense. And common sense.
>> > > > http://p.sf.net/sfu/splunk-d2d-c2
>> > > > _______________________________________________
>> > > > Gambas-user mailing list
>> > > > Gambas-user at lists.sourceforge.net
>> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> > > >
>> > >
>> > >
>> > >
>> >
>> > --
>> > Regards,
>> > Demosthenes Koptsis.
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > All of the data generated in your IT infrastructure is seriously valuable.
>> > Why? It contains a definitive record of application performance, security
>> > threats, fraudulent activity, and more. Splunk takes this data and makes
>> > sense of it. IT sense. And common sense.
>> > http://p.sf.net/sfu/splunk-d2d-c2
>> > _______________________________________________
>> > Gambas-user mailing list
>> > Gambas-user at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>> ------------------------------------------------------------------------------
>> All of the data generated in your IT infrastructure is seriously valuable.
>> Why? It contains a definitive record of application performance, security
>> threats, fraudulent activity, and more. Splunk takes this data and makes
>> sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-d2d-c2
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
> --
> Regards,
> Demosthenes
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard




More information about the User mailing list