Cafu Engine
DialogInsp-PrimitiveProps.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_DIALOG_INSP_PRIMITIVE_PROPS_HPP_INCLUDED
8 #define CAFU_DIALOG_INSP_PRIMITIVE_PROPS_HPP_INCLUDED
9 
10 #include "ObserverPattern.hpp"
11 #include "wx/panel.h"
12 
13 
14 class wxPropertyGridManager;
15 class wxPropertyGridEvent;
16 class MapDocumentT;
17 class MapElementT;
18 class wxStaticText;
19 
20 
21 class InspDlgPrimitivePropsT : public wxPanel, public ObserverT
22 {
23  public:
24 
25  InspDlgPrimitivePropsT(wxWindow* Parent, MapDocumentT* MapDoc);
27 
28  // Implementation of the ObserverT interface.
29  void NotifySubjectChanged_Selection(SubjectT* Subject, const ArrayT<MapElementT*>& OldSelection, const ArrayT<MapElementT*>& NewSelection);
30  void NotifySubjectChanged_Deleted(SubjectT* Subject, const ArrayT<MapPrimitiveT*>& Primitives);
31  void NotifySubjectChanged_Modified(SubjectT* Subject, const ArrayT<MapElementT*>& MapElements, MapElemModDetailE Detail);
32  void NotifySubjectChanged_Modified(SubjectT* Subject, const ArrayT<MapElementT*>& MapElements, MapElemModDetailE Detail, const ArrayT<BoundingBox3fT>& OldBounds);
33  void NotifySubjectDies(SubjectT* dyingSubject);
34 
35 
36  private:
37 
38  wxSizer* InspectorPrimitivePropsInit(wxWindow* parent, bool call_fit=true, bool set_sizer=true);
39  void UpdateGrid();
40 
41  // Event handler methods.
42  void OnPropertyGridChanged(wxPropertyGridEvent& Event);
43 
44  MapDocumentT* m_MapDoc;
45  wxPropertyGridManager* m_PropMan;
46  wxStaticText* m_SelectionText; ///< Text that is displayed above the property grid. It shows the number of selected primitives.
47  bool m_IsRecursiveSelfNotify;
48 };
49 
50 #endif
void NotifySubjectChanged_Selection(SubjectT *Subject, const ArrayT< MapElementT * > &OldSelection, const ArrayT< MapElementT * > &NewSelection)
Notifies the observer that the selection in the current subject has been changed. ...
Definition: DialogInsp-PrimitiveProps.cpp:127
MapElemModDetailE
Definition: ObserverPattern.hpp:37
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
void NotifySubjectChanged_Modified(SubjectT *Subject, const ArrayT< MapElementT * > &MapElements, MapElemModDetailE Detail)
Definition: DialogInsp-PrimitiveProps.cpp:142
Definition: ObserverPattern.hpp:64
Definition: DialogInsp-PrimitiveProps.hpp:21
Definition: ObserverPattern.hpp:158
void NotifySubjectDies(SubjectT *dyingSubject)
This method is called whenever a subject is about the be destroyed (and become unavailable).
Definition: DialogInsp-PrimitiveProps.cpp:176
This file provides the classes for the Observer pattern as described in the book by the GoF...
void NotifySubjectChanged_Deleted(SubjectT *Subject, const ArrayT< MapPrimitiveT * > &Primitives)
Notifies the observer that one or more map primitives have been deleted.
Definition: DialogInsp-PrimitiveProps.cpp:135
This is the base class for all elements ("objects") that can exist in a map.
Definition: MapElement.hpp:57