Widget suggestions
2 posters
Widget suggestions
I have two suggestions to make regarding the SIO2 widgets:
Best,
Matt
- The current widget checking looks like that:
- Code:
if( _SIO2widget->_SIO2widgettap )
{
if( _state == SIO2_WINDOW_TAP_DOWN )
{ sio2EnableState( &_SIO2widget->flags, SIO2_WIDGET_SELECTED ); }
else
{ sio2DisableState( &_SIO2widget->flags, SIO2_WIDGET_SELECTED ); }
_SIO2widget->_SIO2widgettap( _tap,
_state,
_SIO2window->touch->x,
_SIO2window->touch->y );
}
- In order to allow using one callback for multiple widgets or to use a C function as a dispatcher into a C++ object (like I do) it's useful to have the triggering widget available as a parameter. I'd suggest to enhance the callback parameters with the SIO2widget*.
Best,
Matt
Re: Widget suggestions
This means that status SIO2_WIDGET_SELECTED is only set if a callback in _SIO2widgettap is set. I don't know your original intentions, but from my point of view, this isn't a necessary requirement. I for once don't really need the callback, I'm also happy with "pulling" the current state from the widget.
>> Well the idea here, is like ideal for "pushed" button, as long as the widget is pressed on tap you render the pressed button over it...
I agree that is maybe not ideal but... any suggestions?
In order to allow using one callback for multiple widgets or to use a C function as a dispatcher into a C++ object (like I do) it's useful to have the triggering widget available as a parameter. I'd suggest to enhance the callback parameters with the SIO2widget*.
>> Good idea I already make the modifications and pass the SIO2widget* to the callback function, it'll be available in the next revision.
Tks!
>> Well the idea here, is like ideal for "pushed" button, as long as the widget is pressed on tap you render the pressed button over it...
I agree that is maybe not ideal but... any suggestions?
In order to allow using one callback for multiple widgets or to use a C function as a dispatcher into a C++ object (like I do) it's useful to have the triggering widget available as a parameter. I'd suggest to enhance the callback parameters with the SIO2widget*.
>> Good idea I already make the modifications and pass the SIO2widget* to the callback function, it'll be available in the next revision.
Tks!
Permissions in this forum:
You cannot reply to topics in this forum