On 05.03.2008, at 23:23, Alvin wrote:

>> Or "gray out" the slider by deactivating it while the
>> operation is running, then reactivate it when done.
>
> This is certainly a possibility but require disabling several controls
> ranging from sliders to menu items.


Well, you fund Fl::flush() already, but the clean way to do this is to  
disable() the controls that you don't want to be changed. This is  
fairly easy if you either keep a list of controls that need to be  
disabled, or simply disable the whole window (which automatically  
disables all widgets inside that window).

 From a user interface perspective however, I would avaoid triggering  
a long calculation when the user releases the slider. That would be  
unexpected and counterproductive since the user may have to adjust  
multiple sliders, or may want to fine-tune the slider setting. The  
common solution would be a "Start" Button that opens a modal progress  
dialog with a "Cancel" button.

But if you already call Fl::check() frequently and honor a "Cancel"  
request, I suggest this, which is a great compromise of both solutions  
above:

Your calculation should be done on a second data set. Whenever the  
user starts to move a slider, cancel any calculation that may be going  
on. When the user releases the slider, copy the data from the sliders  
to the second data set, then restart the calculation immediatly, but  
keep the sliders active. Whenever the user changes his mind during the  
calculation, he simply changes the slider setting again, triggering  
another calculation.

You can even add a small progress slider somewhere to indicate that  
the calculation has started, and how long it will take to finish.

That is IMHO the most intuitive solution.

Cheers,

  Matthias

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to