Debian Codegraph @

plugins/dm.objectives/ce/CustomComponentEditor.cpp

raw
1 #include "CustomComponentEditor.h"
2 #include "../SpecifierType.h"
3 #include "../Component.h"
4
5 #include "i18n.h"
6
7 #include <wx/stattext.h>
8
9 namespace objectives
10 {
11
12 namespace ce
13 {
14
15 namespace {
16 const char* const DESCRIPTION = N_(
17 "A custom component requires no specifiers,\n"
18 "the state of this component is manually controlled \n"
19 "(i.e. by scripts or triggers).");
20 }
21
22 // Registration helper, will register this editor in the factory
23 CustomComponentEditor::RegHelper CustomComponentEditor::regHelper;
24
25 // Constructor
26 CustomComponentEditor::CustomComponentEditor(wxWindow* parent, Component& component) :
27 ComponentEditorBase(parent),
28 _component(&component)
29 {
30 _panel->GetSizer()->Add(new wxStaticText(_panel, wxID_ANY, _(DESCRIPTION)), 0);
31 }
32
33 // Write to component
34 void CustomComponentEditor::writeToComponent() const
35 {
36 if (!_active) return; // still under construction
37
38 _component->clearArguments();
39
40 // nothing to save here
41 }
42
43 } // namespace ce
44
45 } // namespace objectives