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

Last change on this file since 271 was 271, checked in by epyon, 11 years ago
  • entity storage based on handles in handle.hh
  • gui uses entity storage
File size: 1.5 KB
Line 
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
16#include <nv/common.hh>
17#include <nv/position.hh>
18#include <nv/io_event.hh>
19#include <nv/gui/gui_common.hh>
20
21namespace nv
22{
23        namespace gui
24        {
25
26                class element
27                {
28                public:
29                        /// List type
30                        typedef std::list<handle> list;
31
32
33                        element()
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 ) {}
41
42                        string    m_id;              ///< id type of the object
43                        handle    m_parent;          ///< pointer to parent
44                        list      m_children;        ///< children objects
45                        size_t    m_child_count;     ///< number of children
46                        string    m_class; ///< Class name.
47                        string    m_text; ///< Displayed label or text.
48                        rectangle m_relative; ///< Position relative to parent.
49                        rectangle m_absolute; ///< Position relative to window/screen.
50                        bool m_enabled; ///< Whether the element accepts events.
51                        bool m_visible; ///< Whether the element is drawn.
52                        bool m_dirty; ///< Whether the element needs updating.
53                        render_data* m_render_data; ///<   -?-
54                };
55
56        } // namespace gui
57
58} // namespace nv
59
60#endif // NV_GUI_ELEMENT_HH
Note: See TracBrowser for help on using the repository browser.