Widget suggestions

View previous topic View next topic Go down

Widget suggestions

Post  matt on Sun Oct 26, 2008 6:13 pm

I have two suggestions to make regarding the SIO2 widgets:

  1. 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 );
                   }
    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.

  2. 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

matt

Posts : 155
Join date : 2008-09-30

View user profile http://elfrun.net

Back to top Go down

Re: Widget suggestions

Post  sio2interactive on Sun Oct 26, 2008 7:00 pm

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!
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum