Debian Codegraph @

plugins/dm.stimresponse/StimResponseEditor.h

raw
1 #pragma once
2
3 #include <memory>
4 #include "ientity.h"
5 #include "iradiant.h"
6 #include "icommandsystem.h"
7 #include "iscenegraph.h"
8 #include "wxutil/WindowPosition.h"
9 #include "wxutil/dialog/DialogBase.h"
10 #include "wxutil/XmlResourceBasedWidget.h"
11
12 #include "StimTypes.h"
13 #include "SREntity.h"
14 #include "CustomStimEditor.h"
15
16 #include <wx/notebook.h>
17
18 namespace ui
19 {
20
21 class StimEditor;
22 class ResponseEditor;
23
24 class StimResponseEditor;
25 typedef std::shared_ptr<StimResponseEditor> StimResponseEditorPtr;
26
27 class StimResponseEditor :
28 public wxutil::DialogBase,
29 public wxutil::XmlResourceBasedWidget
30 {
31 private:
32 wxNotebook* _notebook;
33 std::unique_ptr<wxImageList> _imageList;
34
35 int _stimPageNum;
36 int _responsePageNum;
37 int _customStimPageNum;
38 static int _lastShownPage;
39
40 // The "extended" entity object managing the stims
41 SREntityPtr _srEntity;
42
43 // The position/size memoriser
44 wxutil::WindowPosition _windowPosition;
45
46 // The entity we're editing
47 Entity* _entity;
48
49 // The helper class managing the stims
50 StimTypes _stimTypes;
51
52 // The helper classes for editing the stims/responses
53 std::unique_ptr<StimEditor> _stimEditor;
54 std::unique_ptr<ResponseEditor> _responseEditor;
55 std::unique_ptr<CustomStimEditor> _customStimEditor;
56
57 public:
58 StimResponseEditor();
59
60 // override DialogBase
61 int ShowModal() override;
62
63 // Command target to toggle the dialog
64 static void ShowDialog();
65
66 // Get notified when the dialog is not needed anymore
67 virtual bool Destroy() override;
68
69 private:
70 /** greebo: Saves the current working set to the entity
71 */
72 void save();
73
74 /* WIDGET POPULATION */
75 void populateWindow(); // Main window
76
77 /** greebo: Checks the selection for a single entity.
78 */
79 void rescanSelection();
80
81 void onPageChanged(wxBookCtrlEvent& ev);
82 };
83
84 } // namespace ui