Spin control...
#1
based on findings in settings general window:

1. spin control with only one choice does not show focus but the code wants to act as if it should, maybe it should be treated as disabled ie skin control.

the following i think is the problem as it does have focus but can not move up or down and hence no focus is drawn.

from cguispincontrol::render():

Quote:    if ( hasfocus() )
   {
       bool bshow=canmoveup();
       if (m_breverse)
           bshow = canmovedown();

       if (m_iselect==spin_button_up && bshow )
           m_imgspinupfocus.render();
       else
           m_imgspinup.render();

       bshow=canmovedown();
       if (m_breverse)
           bshow = canmoveup();
       if (m_iselect==spin_button_down && bshow)
           m_imgspindownfocus.render();
       else
           m_imgspindown.render();
   }
   else
   {
       m_imgspinup.render();
       m_imgspindown.render();
   }

2. this is related to (1) and (3). spin control with only one choice does not allow left movement navigation. this would be irrelevant if in this state it was treated as disabled - see suggestion on enabling disable at the end.

3. spin control when set at it's min or max will not allow left or right movement navigation respectively ie hd spindown.

from guispincontrol::onaction:

Quote:    if (action.wid == action_move_left)
   {
       if (m_iselect==spin_button_up)
       {
           if (m_breverse)
           {
               if (canmoveup() )
                   m_iselect=spin_button_down;
           }
           else
           {
               if (canmovedown() )
                   m_iselect=spin_button_down;
           }
           return;
       }
   }
   if (action.wid == action_move_right)
   {
       if (m_iselect==spin_button_down)
       {
           if (m_breverse)
           {
               if (canmovedown() )
                   m_iselect=spin_button_up;
           }
           else
           {
               if (canmoveup() )
                   m_iselect=spin_button_up;
           }
           return;
       }
   }

the return in these two conditions  is premature as later in the method it calls its subclass cguicontrol::onactions which enables the left/right movement naviagations. an example bit of logic to fix this might might be:

Quote:if ((action.wid == action_move_left) && canmovedown())
{
...
}

suggestion on enabling disable!
looking into making the thing disabled when only one choice is available could be as easy as overriding the canfocus method from cguicontrol in cguispincontrol this would enable the default code from cguicontrol::onmessage of:

Quote:      case gui_msg_setfocus:
       // if control is disabled then move 2 the next control
       if ( isdisabled() || !isvisible() || !canfocus() )
       {
         dword dwcontrol=0;
         if (message.getparam1()==action_move_down) dwcontrol = m_dwcontroldown;
         if (message.getparam1()==action_move_up) dwcontrol = m_dwcontrolup;
         if (message.getparam1()==action_move_left) dwcontrol = m_dwcontrolleft;
         if (message.getparam1()==action_move_right) dwcontrol = m_dwcontrolright;
         cguimessage msg(gui_msg_setfocus,getid(), dwcontrol, message.getparam1());
         g_graphicscontext.sendmessage(msg);
         return true;
       }
       m_bhasfocus=true;
       return true;
     break;

bingo. it navigates around it! at least from what i can tell by looking at the code.

hope this helps and you never know i might be able to write some code sometime soon.

sourceforge: 924860
Reply
#2
moving to the dev forum. Smile
read the xbmc online-manual, faq and search the forums before posting! do not e-mail the xbmc-team asking for support!
read/follow the forum rules! note! team-xbmc never have and never will host or distribute ms-xdk binaries/executables!
Reply
#3
i've added some code to the spin control to allow a label control to be associated to it. now, when the spin control does not have focus it renders itself and it's label in the disabled colour (dimmed) and in their text colours (as defined in the skin) when it does have focus.

this makes it very easy to see if focus is on the spin control, it also falls in line with the other controls (e.g. checkbox) in that it appears darker when it does not have focus.

the suggested fix, whilst sound in theory, proved un-workable for a variety of reasons (default control focus issues, label still appeared bright white etc.)

hope this meets with everyone's satisfaction Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
great. i'll look forward to seeing it as i can't build - yet!

did you get a chance to solve the navigation as well? that is, when focus is on one of these controls, which we can now see has focus, and in the case of the 'skin spin', can you navigate left? right is ok but left didn't work. this is kind of related to point 3 from the original post. on all other controls from the general setting window (and any other i guess) you can navigate both left and right. it's just that it's inconsistent and was especially confusing when you couldn't see the focus.

hope that makes sense and thanks.
Reply
#5
no, i didn't look at the navigation issue - i'll take a look at that tonight.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Spin control...0