| 73 | } |
| 74 | |
| 75 | void 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 | |
| 106 | wxWindow* DefinitionView::getMainPanel() |
| 107 | { |
no test coverage detected