source: trunk/nv/gui/gui_element.hh @ 270

Last change on this file since 270 was 270, checked in by epyon, 11 years ago
  • nv::handle - generic handle implementation
  • nv::index_store - index store based on handles
  • gui elements fully based on handles instead of pointers
File size: 1.5 KB
RevLine 
[66]1// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
2// http://chaosforge.org/
3//
4// This file is part of NV Libraries.
5// For conditions of distribution and use, see copyright notice in nv.hh
6
7/**
8 * @file gui_element.hh
9 * @author Kornel Kisielewicz
10 * @brief GUI Element
11 */
12
13#ifndef NV_GUI_ELEMENT_HH
14#define NV_GUI_ELEMENT_HH
15
[268]16#include <nv/common.hh>
[66]17#include <nv/position.hh>
[69]18#include <nv/io_event.hh>
19#include <nv/gui/gui_common.hh>
[66]20
21namespace nv
22{
23        namespace gui
24        {
[269]25
[268]26                class element
[66]27                {
[269]28                public:
[268]29                        /// List type
[269]30                        typedef std::list<handle> list;
[110]31
[268]32
[269]33                        element()
[268]34                                : m_id( "" )
35                                , m_child_count(0)
36                                , m_class("")
37                                , m_enabled( true )
38                                , m_visible( true )
39                                , m_dirty( true )
40                                , m_render_data( nullptr ) {}
[110]41
[268]42                        string    m_id;              ///< id type of the object
[269]43                        handle    m_this;            ///< pointer to parent
44                        handle    m_parent;          ///< pointer to parent
[268]45                        list      m_children;        ///< children objects
46                        size_t    m_child_count;     ///< number of children
[110]47                        string    m_class; ///< Class name.
48                        string    m_text; ///< Displayed label or text.
49                        rectangle m_relative; ///< Position relative to parent.
50                        rectangle m_absolute; ///< Position relative to window/screen.
51                        bool m_enabled; ///< Whether the element accepts events.
52                        bool m_visible; ///< Whether the element is drawn.
53                        bool m_dirty; ///< Whether the element needs updating.
54                        render_data* m_render_data; ///<   -?-
[66]55                };
56
57        } // namespace gui
58
59} // namespace nv
60
61#endif // NV_GUI_ELEMENT_HH
Note: See TracBrowser for help on using the repository browser.