2004-03-28, 14:45
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():
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:
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:
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:
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
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