コード例 #1
0
bool GuiGameListMenuCtrl::onWake()
{
   if( !Parent::onWake() )
      return false;
      
   if( !hasValidProfile() )
      return false;
      
   if( mRows.empty() )
   {
      Con::errorf( "GuiGameListMenuCtrl: %s can't be woken up without any rows. Please use \"addRow\" to add at least one row to the control before pushing it to the canvas.",
         getName() );
      return false;
   }

   enforceConstraints();

   selectFirstEnabledRow();

   setFirstResponder();

   mHighlighted = NO_ROW;

   return true;
}
コード例 #2
0
bool GuiGameListMenuCtrl::onAdd()
{
   if( !Parent::onAdd() )
      return false;
      
   // If we have a non-GuiGameListMenuProfile profile, try to
   // substitute it for DefaultListMenuProfile.
      
   if( !hasValidProfile() )
   {
      GuiGameListMenuProfile* profile;
      if( !Sim::findObject( "DefaultListMenuProfile", profile ) )
      {
         Con::errorf( "GuiGameListMenuCtrl: %s can't be created with a profile of type %s. Please create it with a profile of type GuiGameListMenuProfile.",
            getName(), mProfile->getClassName() );
         return false;
      }
      else
         Con::warnf( "GuiGameListMenuCtrl: substituted non-GuiGameListMenuProfile in %s for DefaultListMenuProfile", getName() );
         
      setControlProfile( profile );
   }

   return true;
}
コード例 #3
0
void GuiGameListMenuCtrl::enforceConstraints()
{
   if (hasValidProfile())
   {
      ((GuiGameListMenuProfile *)mProfile)->enforceConstraints();
   }
   updateHeight();
}
コード例 #4
0
bool GuiGameListMenuCtrl::onAdd()
{
   if ((! Parent::onAdd()) || (! hasValidProfile()))
   {
      return false;
   }

   return true;
}