| 60 | }; |
| 61 | |
| 62 | DevConsoleView::DevConsoleView() |
| 63 | : Box(VERTICAL) |
| 64 | , m_textBox("Welcome to LibreSprite Scripting Console\n(Experimental)", LEFT) |
| 65 | , m_label(">") |
| 66 | , m_entry(new CommmandEntry) |
| 67 | { |
| 68 | SkinTheme* theme = static_cast<SkinTheme*>(this->theme()); |
| 69 | |
| 70 | addChild(&m_view); |
| 71 | addChild(&m_bottomBox); |
| 72 | |
| 73 | m_bottomBox.addChild(&m_language); |
| 74 | m_bottomBox.addChild(&m_label); |
| 75 | m_bottomBox.addChild(m_entry); |
| 76 | |
| 77 | auto& engines = script::Engine::getRegistry(); |
| 78 | for (auto& entry : engines) { |
| 79 | std::string name = entry.first; |
| 80 | if (!name.empty()) |
| 81 | m_language.addItem(name); |
| 82 | } |
| 83 | |
| 84 | m_view.setProperty(SkinStylePropertyPtr( |
| 85 | new SkinStyleProperty(theme->styles.workspaceView()))); |
| 86 | |
| 87 | m_view.attachToView(&m_textBox); |
| 88 | m_view.setExpansive(true); |
| 89 | m_entry->setExpansive(true); |
| 90 | m_entry->ExecuteCommand.connect(&DevConsoleView::onExecuteCommand, this); |
| 91 | } |
| 92 | |
| 93 | DevConsoleView::~DevConsoleView() |
| 94 | { |
nothing calls this directly
no test coverage detected