| 1 | /* |
|---|
| 2 | ================================================================================= |
|---|
| 3 | This file is part of Cafu, the open-source game engine and graphics engine |
|---|
| 4 | for multiplayer, cross-platform, real-time 3D action. |
|---|
| 5 | Copyright (C) 2002-2012 Carsten Fuchs Software. |
|---|
| 6 | |
|---|
| 7 | Cafu is free software: you can redistribute it and/or modify it under the terms |
|---|
| 8 | of the GNU General Public License as published by the Free Software Foundation, |
|---|
| 9 | either version 3 of the License, or (at your option) any later version. |
|---|
| 10 | |
|---|
| 11 | Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 12 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|---|
| 13 | PURPOSE. See the GNU General Public License for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU General Public License |
|---|
| 16 | along with Cafu. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | |
|---|
| 18 | For support and more information about Cafu, visit us at <http://www.cafu.de>. |
|---|
| 19 | ================================================================================= |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #ifndef CAFU_DIALOG_INSP_ENTITY_TREE_HPP_INCLUDED |
|---|
| 23 | #define CAFU_DIALOG_INSP_ENTITY_TREE_HPP_INCLUDED |
|---|
| 24 | |
|---|
| 25 | #include "ObserverPattern.hpp" |
|---|
| 26 | #include "wx/panel.h" |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | class wxCheckBox; |
|---|
| 30 | class wxComboBox; |
|---|
| 31 | class wxNotebook; |
|---|
| 32 | class wxListBox; |
|---|
| 33 | class wxTextCtrl; |
|---|
| 34 | class MapDocumentT; |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | class InspDlgEntityTreeT : public wxPanel, public ObserverT |
|---|
| 38 | { |
|---|
| 39 | public: |
|---|
| 40 | |
|---|
| 41 | InspDlgEntityTreeT(wxNotebook* Parent_, MapDocumentT* MapDoc_); |
|---|
| 42 | ~InspDlgEntityTreeT(); |
|---|
| 43 | |
|---|
| 44 | // Implementation of the ObserverT interface. |
|---|
| 45 | void NotifySubjectChanged_Selection(SubjectT* Subject, const ArrayT<MapElementT*>& OldSelection, const ArrayT<MapElementT*>& NewSelection); |
|---|
| 46 | void NotifySubjectChanged_Created(const ArrayT<MapElementT*>& MapElements); |
|---|
| 47 | void NotifySubjectChanged_Deleted(SubjectT* Subject, const ArrayT<MapElementT*>& MapElements); |
|---|
| 48 | void NotifySubjectChanged_Modified(SubjectT* Subject, const ArrayT<MapElementT*>& MapElements, MapElemModDetailE Detail, const wxString& Key); |
|---|
| 49 | void NotifySubjectChanged_Modified(SubjectT* Subject, const ArrayT<MapElementT*>& MapElements, MapElemModDetailE Detail); |
|---|
| 50 | void NotifySubjectDies(SubjectT* dyingSubject); |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | private: |
|---|
| 54 | |
|---|
| 55 | MapDocumentT* MapDoc; |
|---|
| 56 | bool IsRecursiveSelfNotify; ///< Did we trigger the current call to NotifySubjectChanged() ourselves? |
|---|
| 57 | |
|---|
| 58 | wxListBox* EntityListBox; |
|---|
| 59 | wxCheckBox* ShowSolidEntitiesCheckBox; |
|---|
| 60 | wxCheckBox* ShowPointEntitiesCheckBox; |
|---|
| 61 | wxCheckBox* ShowHiddenEntitiesCheckBox; |
|---|
| 62 | wxCheckBox* FilterByPropCheckBox; |
|---|
| 63 | wxCheckBox* FilterByPropExactCheckBox; |
|---|
| 64 | wxCheckBox* FilterByClassCheckBox; |
|---|
| 65 | wxTextCtrl* FilterKeyText; |
|---|
| 66 | wxTextCtrl* FilterValueText; |
|---|
| 67 | wxComboBox* FilterClassComboBox; |
|---|
| 68 | |
|---|
| 69 | // Helper functions. |
|---|
| 70 | wxSizer* EntityReportInit(wxWindow* parent, bool call_fit, bool set_sizer); |
|---|
| 71 | void UpdateEntityListBox(); |
|---|
| 72 | |
|---|
| 73 | // Event handlers. |
|---|
| 74 | void OnCheckbox_ShowSolidEntities(wxCommandEvent& Event); |
|---|
| 75 | void OnCheckbox_ShowPointEntities(wxCommandEvent& Event); |
|---|
| 76 | void OnCheckbox_ShowHiddenEntities(wxCommandEvent& Event); |
|---|
| 77 | void OnCheckbox_FilterByProp(wxCommandEvent& Event); |
|---|
| 78 | void OnCheckbox_FilterByPropExact(wxCommandEvent& Event); |
|---|
| 79 | void OnCheckbox_FilterByClass(wxCommandEvent& Event); |
|---|
| 80 | void OnText_FilterKeyChanged(wxCommandEvent& Event); |
|---|
| 81 | void OnText_FilterValueChanged(wxCommandEvent& Event); |
|---|
| 82 | void OnComboBox_FilterClass_SelectionChanged(wxCommandEvent& Event); |
|---|
| 83 | void OnComboBox_FilterClass_TextChanged(wxCommandEvent& Event); |
|---|
| 84 | void OnListBox_SelectionChanged(wxCommandEvent& Event); |
|---|
| 85 | |
|---|
| 86 | // IDs for the controls in whose events we are interested. |
|---|
| 87 | enum |
|---|
| 88 | { |
|---|
| 89 | ID_CHECKBOX_ShowSolidEntities=wxID_HIGHEST+1, |
|---|
| 90 | ID_CHECKBOX_ShowPointEntities, |
|---|
| 91 | ID_CHECKBOX_ShowHiddenEntities, |
|---|
| 92 | ID_CHECKBOX_FilterByProp, |
|---|
| 93 | ID_CHECKBOX_FilterByPropExact, |
|---|
| 94 | ID_CHECKBOX_FilterByClass, |
|---|
| 95 | ID_TEXT_FilterKey, |
|---|
| 96 | ID_TEXT_FilterValue, |
|---|
| 97 | ID_COMBOBOX_FilterClass, |
|---|
| 98 | ID_LISTBOX_Entities |
|---|
| 99 | }; |
|---|
| 100 | |
|---|
| 101 | DECLARE_EVENT_TABLE() |
|---|
| 102 | }; |
|---|
| 103 | |
|---|
| 104 | #endif |
|---|