This commit is contained in:
parent
7b80782ebc
commit
fcaef22819
4 changed files with 44 additions and 6 deletions
|
@ -43,6 +43,10 @@ public:
|
|||
virtual void think(int _frames);
|
||||
|
||||
|
||||
protected:
|
||||
virtual int isSelectable() {return true;}
|
||||
|
||||
|
||||
private:
|
||||
int *m_target;
|
||||
int *m_data;
|
||||
|
|
|
@ -85,6 +85,33 @@ void CGUIGroupFrame::clearFlags(GUI_FLAGS _flags)
|
|||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int CGUIGroupFrame::isSelectable()
|
||||
{
|
||||
CGUIObject *pGUI;
|
||||
int selectable=false;
|
||||
|
||||
pGUI=getChild();
|
||||
while(pGUI)
|
||||
{
|
||||
if(pGUI->isSelectable())
|
||||
{
|
||||
selectable=true;
|
||||
break;
|
||||
}
|
||||
pGUI=pGUI->getNext();
|
||||
}
|
||||
|
||||
GUI_DBGMSG("frame is %s",selectable?"SELECTABLE":"NOT SELECTABLE");
|
||||
return selectable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -118,9 +145,12 @@ void CGUIControlFrame::think(int _frames)
|
|||
pGUI->unselect();
|
||||
GUI_DBGMSG("unselected %d",pGUI->getId());
|
||||
|
||||
// Find next object and select it
|
||||
pGUI=pGUI->getNext();
|
||||
if(!pGUI)pGUI=getChild();
|
||||
// Find next selectbale object and select it
|
||||
while(!pGUI->isSelectable())
|
||||
{
|
||||
pGUI=pGUI->getNext();
|
||||
if(!pGUI)pGUI=getChild();
|
||||
}
|
||||
pGUI->select();
|
||||
GUI_DBGMSG("selected %d",pGUI->getId());
|
||||
}
|
||||
|
@ -181,10 +211,12 @@ void CGUIControlFrame::selectFrame()
|
|||
CGUIObject *pGUI;
|
||||
|
||||
pGUI=getChild();
|
||||
if(pGUI)
|
||||
while(!pGUI->isSelectable())
|
||||
{
|
||||
pGUI->select();
|
||||
ASSERT(pGUI);
|
||||
pGUI=pGUI->getNext();
|
||||
}
|
||||
pGUI->select();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
virtual void setFlags(GUI_FLAGS _flags);
|
||||
virtual void clearFlags(GUI_FLAGS _flags);
|
||||
|
||||
virtual int isSelectable();
|
||||
|
||||
|
||||
protected:
|
||||
GUI_FLAGS getInitialFlags() {return FLAG_DRAWBORDER;}
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
|
||||
CGUIObject *getChild() {return m_child;}
|
||||
CGUIObject *getNext() {return m_next;}
|
||||
virtual int isSelectable() {return false;}
|
||||
|
||||
int getId() {return m_id;}
|
||||
|
||||
|
@ -85,7 +86,6 @@ protected:
|
|||
virtual void recalc();
|
||||
|
||||
virtual GUI_FLAGS getInitialFlags() {return FLAG_NONE;}
|
||||
virtual int isSelectable() {return false;}
|
||||
|
||||
int getX() {return m_x;}
|
||||
int getY() {return m_y;}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue