MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / update

Method update

libs/wxutil/sourceview/DefinitionView.cpp:75–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void DefinitionView::update()
76{
77 if (isEmpty())
78 {
79 // Null-ify the contents
80 _declName->SetLabelMarkup("");
81 _filename->SetLabelMarkup("");
82
83 _view->Enable(false);
84 return;
85 }
86
87 // Add the shader and file name
88 auto declName = getDeclName();
89
90 _declName->SetLabel(declName);
91 _filename->SetLabel(getDeclFileName());
92
93 _view->Enable(true);
94
95 // Surround the definition with curly braces, these are not included
96 std::string definition = declName + "\n{\n\r";
97 definition += getDefinition();
98 definition += "\n\r}";
99
100 // Value Updates are only possible when read-only is false
101 _view->SetReadOnly(false);
102 _view->SetValue(definition);
103 _view->SetReadOnly(true);
104}
105
106wxWindow* DefinitionView::getMainPanel()
107{

Callers 1

SetPreviewDeclNameMethod · 0.45

Calls 1

SetValueMethod · 0.45

Tested by

no test coverage detected