#include "MediaTool.h" #include "TextEditorView.h" #include "AudioEditorView.h" #include "ImageEditorView.h" #include "WebClientView.h" #include "TabbedPanelWidget.h" #include "TopBar.h" #include "TextNode.h" #include "StatusBar.h" #include "HorizontalSpacer.h" #include "DesktopManager.h" #include "MainApplication.h" MediaTool::MediaTool(std::unique_ptr args) : GuiApplication(std::move(args)) { } void MediaTool::initializeViews() { auto mainWindow = mDesktopManager->getWindowManager()->getMainWindow(); mainWindow->setSize(800, 600); auto tabbedPanel = TabbedPanelWidget::Create(); auto textEditor = TextEditorView::Create(); auto path = mMainApplication->getCommandLineArgs()->getLaunchPath(); path /= "out.txt"; textEditor->GetController()->SetSavePath(path); textEditor->GetController()->SetLoadPath(path); textEditor->Initialize(); tabbedPanel->addPanel(std::move(textEditor), "Text Editor"); auto audioEditor = AudioEditorView::Create(); tabbedPanel->addPanel(std::move(audioEditor), "Audio Editor"); auto imageEditor = ImageEditorView::Create(); tabbedPanel->addPanel(std::move(imageEditor), "Image Editor"); auto webClient = WebClientView::Create(); tabbedPanel->addPanel(std::move(webClient), "Web Client"); auto topBar = TopBar::Create(); auto statusBar = StatusBar::Create(); auto horizontal_spacer = HorizontalSpacer::Create(); horizontal_spacer->addWidgetWithScale(std::move(topBar), 1); horizontal_spacer->addWidgetWithScale(std::move(tabbedPanel), 20); horizontal_spacer->addWidgetWithScale(std::move(statusBar), 1); /* auto button = Button::Create(); button->setLabel("Click!"); button->setBounds(100, 200); button->setBackgroundColor(Color(255, 0, 255, 1)); auto background_widget = Widget::Create(); background_widget->setName("BackgroundWidget"); background_widget->setBackgroundColor(Color(0, 255, 255, 1)); auto horizontal_spacer = HorizontalSpacer::Create(); horizontal_spacer->addWidgetWithScale(std::move(button), 1); horizontal_spacer->addWidgetWithScale(std::move(background_widget), 1); */ mainWindow->setWidget(std::move(horizontal_spacer)); }