This commit is contained in:
parent
094c8850bc
commit
46791b36f4
7 changed files with 397 additions and 38 deletions
|
@ -45,6 +45,18 @@
|
|||
Vars
|
||||
---- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGUIToggleButton::init(CGUIObject *_parent,GUIId _id)
|
||||
{
|
||||
CGUIObject::init(_parent,_id);
|
||||
m_target=0;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
|
@ -95,6 +107,19 @@ void CGUIToggleButton::think(int _frames)
|
|||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGUICycleButton::init(CGUIObject *_parent,GUIId _id)
|
||||
{
|
||||
CGUIToggleButton::init(_parent,_id);
|
||||
m_data=0;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -152,5 +177,90 @@ void CGUICycleButton::think(int _frames)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGUISliderButton::init(CGUIObject *_parent,GUIId _id)
|
||||
{
|
||||
CGUIToggleButton::init(_parent,_id);
|
||||
m_min=m_max=0;
|
||||
m_scrollSpeed=DEFAULT_SCROLL_SPEED;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGUISliderButton::setButtonRange(int _min,int _max)
|
||||
{
|
||||
m_min=_min;
|
||||
m_max=_max;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGUISliderButton::setScrollSpeed(int _scrollSpeed)
|
||||
{
|
||||
m_scrollSpeed=_scrollSpeed;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGUISliderButton::think(int _frames)
|
||||
{
|
||||
ASSERT(getTarget());
|
||||
ASSERT(m_min!=m_max);
|
||||
|
||||
CGUIObject::think(_frames);
|
||||
if(isSelected())
|
||||
{
|
||||
int padRepeat,padDown;
|
||||
int *target=getTarget();
|
||||
|
||||
padRepeat=PadGetRepeat(0);
|
||||
padDown=PadGetDown(0);
|
||||
if(padDown&PAD_LEFT)
|
||||
{
|
||||
*target-=1;
|
||||
}
|
||||
else if(padDown&PAD_RIGHT)
|
||||
{
|
||||
*target+=1;
|
||||
}
|
||||
else if(padRepeat&PAD_LEFT)
|
||||
{
|
||||
*target-=(_frames*m_scrollSpeed);
|
||||
}
|
||||
else if(padRepeat&PAD_RIGHT)
|
||||
{
|
||||
*target+=(_frames*m_scrollSpeed);
|
||||
}
|
||||
|
||||
if(*target<m_min)*target=m_min;
|
||||
else if(*target>m_max)*target=m_max;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
Loading…
Add table
Add a link
Reference in a new issue