how to handle events of slider when slider is connected with dataTarget?

View: New views
2 Messages — Rating Filter:   Alert me  

how to handle events of slider when slider is connected with dataTarget?

by Gajera Tejas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

I have problem with slider which connected with DataTarget. it's value can not update when we make a change in slider.

basically if we have like... new FXSlider(parent, target, ID_SOMETHING);
then it will call the function which is assign with ID_SOMETHING;

but what happend with...new FXSlider(parent, &DataTarget, FXDataTarget::ID_VALUE);
this slider connected with data target. how to handle events when we click on slider or move slider using mouse?

Thanks
Tejas



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Foxgui-announce mailing list
Foxgui-announce@...
https://lists.sourceforge.net/lists/listinfo/foxgui-announce

Re: how to handle events of slider when slider is connected with dataTarget?

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 30 October 2008, Gajera Tejas wrote:

> hi,
>
> I have problem with slider which connected with DataTarget. it's value can
> not update when we make a change in slider.
>
> basically if we have like... new FXSlider(parent, target, ID_SOMETHING);
> then it will call the function which is assign with ID_SOMETHING;
>
> but what happend with...new FXSlider(parent, &DataTarget,
> FXDataTarget::ID_VALUE);
> this slider connected with data target. how to handle events when we click
> on slider or move slider using mouse?

The FXDataTarget itself also has a target/message ID; it generates SEL_COMMAND
or SEL_CHANGED messages with this ID when it receives messages from the FXSlider.

The target of the FXDataTarget will however NOT receive SEL_UPDATE messages
from the FXDataTarget; this is because these can now be satisfied by the FXDataTarget
itself through its associated variable.

My own philosophy is to use FXDataTarget when a simple variable needs to be changed,
and to catch SEL_COMMAND and SEL_UPDATE messages directly from the widget if the
interaction between the control and the program is more immediate [for example, besides
updating the control's value you might have to enable/disable it based on program state].



Hope this helps,


                - Jeroen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Foxgui-announce mailing list
Foxgui-announce@...
https://lists.sourceforge.net/lists/listinfo/foxgui-announce