Cafu Engine
WindowInspector.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_WINDOW_INSPECTOR_HPP_INCLUDED
8 #define CAFU_GUIEDITOR_WINDOW_INSPECTOR_HPP_INCLUDED
9 
10 #include "ObserverPattern.hpp"
11 
12 #include "wx/wx.h"
13 #include "wx/propgrid/manager.h"
14 
15 
16 namespace cf { namespace GuiSys { class ComponentBaseT; } }
17 namespace cf { namespace GuiSys { class WindowT; } }
18 namespace cf { namespace TypeSys { class VarBaseT; } }
19 
20 
21 namespace GuiEditor
22 {
23  class ChildFrameT;
24  class GuiDocumentT;
25 
26  class WindowInspectorT : public wxPropertyGridManager, public ObserverT
27  {
28  public:
29 
30  WindowInspectorT(ChildFrameT* Parent, const wxSize& Size);
31 
32  // ObserverT implementation.
35  void NotifySubjectChanged_Modified(SubjectT* Subject, const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> >& Windows, WindowModDetailE Detail);
36  void Notify_Changed(SubjectT* Subject, const cf::TypeSys::VarBaseT& Var);
37  void NotifySubjectDies(SubjectT* dyingSubject);
38 
39  void RefreshPropGrid();
40 
41 
42  private:
43 
44  GuiDocumentT* m_GuiDocument;
45  ChildFrameT* m_Parent;
46  IntrusivePtrT<cf::GuiSys::WindowT> m_SelectedWindow;
47  bool m_IsRecursiveSelfNotify;
48 
49  void AppendComponent(IntrusivePtrT<cf::GuiSys::ComponentBaseT> Comp);
50 
51  void OnPropertyGridChanging(wxPropertyGridEvent& Event);
52  void OnPropertyGridChanged(wxPropertyGridEvent& Event);
53  void OnPropertyGridRightClick(wxPropertyGridEvent& Event);
54 
55  DECLARE_EVENT_TABLE()
56  };
57 }
58 
59 #endif
void NotifySubjectChanged_Modified(SubjectT *Subject, const ArrayT< IntrusivePtrT< cf::GuiSys::WindowT > > &Windows, WindowModDetailE Detail)
Definition: WindowInspector.cpp:69
void NotifySubjectChanged_Deleted(SubjectT *Subject, const ArrayT< IntrusivePtrT< cf::GuiSys::WindowT > > &Windows)
Notifies the observer that one or more windows have been deleted.
Definition: WindowInspector.cpp:51
Definition: ObserverPattern.hpp:38
This class represents a child frame.
Definition: ChildFrame.hpp:55
void NotifySubjectChanged_Selection(SubjectT *Subject, const ArrayT< IntrusivePtrT< cf::GuiSys::WindowT > > &OldSelection, const ArrayT< IntrusivePtrT< cf::GuiSys::WindowT > > &NewSelection)
This method is called whenever the window selection of a GUI subject changed.
Definition: WindowInspector.cpp:45
Definition: WindowInspector.hpp:26
Definition: ChildFrame.hpp:35
void NotifySubjectDies(SubjectT *dyingSubject)
This method is called whenever a subject is about the be destroyed (and become unavailable).
Definition: WindowInspector.cpp:153
Definition: GuiDocument.hpp:39
This is the common base class for the VarT classes.
Definition: Variables.hpp:113
Definition: ObserverPattern.hpp:95
void Notify_Changed(SubjectT *Subject, const cf::TypeSys::VarBaseT &Var)
Notifies the observer that a variable has changed.
Definition: WindowInspector.cpp:115
This file provides the classes for the Observer pattern as described in the book by the GoF...
Definition: Renderer.hpp:16