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
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_parent;          ///< pointer to parent
[268]44                        list      m_children;        ///< children objects
45                        size_t    m_child_count;     ///< number of children
[110]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; ///<   -?-
[66]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.