Changeset 66 for trunk


Ignore:
Timestamp:
05/31/13 02:32:49 (12 years ago)
Author:
epyon
Message:
  • gui_element class and gui_common file
  • additions to object class
Location:
trunk
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/object.hh

    r64 r66  
    129129                 * @returns parent object of current object
    130130                 */
    131                 object* get_parent() const { return m_parent; }
     131                virtual object* get_parent() const { return m_parent; }
    132132
    133133                /**
     
    140140                 */
    141141                int get_lua_index() const { return m_lua_index; }
     142
     143                /**
     144                 * Moves object to back of child list (top of stack)
     145                 *
     146                 * @returns true if object found, false otherwise
     147                 */
     148                bool move_to_top( object* child );
     149
     150                /**
     151                 * Moves object to front of child list (bottom of stack)
     152                 *
     153                 * @returns true if object found, false otherwise
     154                 */
     155                bool move_to_bottom( object* child );
    142156
    143157                list::iterator begin() { return m_children.begin(); }
  • trunk/src/object.cc

    r64 r66  
    138138}
    139139
     140bool object::move_to_top( object* child )
     141{
     142        list::iterator it = std::find( m_children.begin(), m_children.end(), child );
     143        if ( it != m_children.end() )
     144        {
     145                m_children.erase( it );
     146                m_children.push_back( child );
     147                return true;
     148        }       
     149        return false;
     150}
     151
     152bool object::move_to_bottom( object* child )
     153{
     154        list::iterator it = std::find( m_children.begin(), m_children.end(), child );
     155        if ( it != m_children.end() )
     156        {
     157                m_children.erase( it );
     158                m_children.push_front( child );
     159                return true;
     160        }       
     161        return false;
     162}
     163
    140164void object::register_type( type_database* db )
    141165{
Note: See TracChangeset for help on using the changeset viewer.