Cafu Engine
CompSelection.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_GUIEDITOR_COMPONENT_SELECTION_HPP_INCLUDED
8 #define CAFU_GUIEDITOR_COMPONENT_SELECTION_HPP_INCLUDED
9 
10 #include "GuiSys/CompBase.hpp"
11 
12 
13 namespace GuiEditor
14 {
15  /// This components reflects the selection state of its window.
17  {
18  public:
19 
20  /// The constructor.
22 
23  /// The copy constructor.
24  /// @param Comp The component to create a copy of.
26 
27  bool IsSelected() const { return m_IsSelected; }
28  void SetSelected(bool Sel) { m_IsSelected = Sel; }
29 
30  // Base class overrides.
31  ComponentSelectionT* Clone() const;
32  const char* GetName() const { return "Selection"; }
33  void Render() const;
34 
35 
36  // The TypeSys related declarations for this class.
37  const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; }
38  static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params);
39  static const cf::TypeSys::TypeInfoT TypeInfo;
40 
41 
42  private:
43 
44  // The Lua API methods of this class.
45  static const luaL_Reg MethodsList[]; ///< The list of Lua methods for this class.
46  static int toString(lua_State* LuaState); ///< Returns a string representation of this object.
47 
48  bool m_IsSelected; ///< Is this window currently selected?
49  };
50 }
51 
52 #endif
ComponentSelectionT * Clone() const
The virtual copy constructor.
Definition: CompSelection.cpp:53
This is the base class for the components that a window is composed/aggregated of.
Definition: CompBase.hpp:51
void Render() const
This method implements the graphical output of this component.
Definition: CompSelection.cpp:59
ComponentSelectionT()
The constructor.
Definition: CompSelection.cpp:39
This components reflects the selection state of its window.
Definition: CompSelection.hpp:16
const char * GetName() const
Returns the name of this component.
Definition: CompSelection.hpp:32
Definition: TypeSys.hpp:52
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79