void PreviewEditorWindow::onWindowResize() { Window::onWindowResize(); DocumentView* view = UIContext::instance()->activeView(); if (view) updateUsingEditor(view->editor()); }
Editor* UIContext::activeEditor() { DocumentView* view = activeView(); if (view) return view->editor(); else return NULL; }
void UIContext::onAddDocument(doc::Document* doc) { m_lastSelectedDoc = static_cast<app::Document*>(doc); // We don't create views in batch mode. if (!App::instance()->isGui()) return; // Add a new view for this document DocumentView* view = new DocumentView( m_lastSelectedDoc, DocumentView::Normal, App::instance()->mainWindow()->getPreviewEditor()); // Add a tab with the new view for the document App::instance()->workspace()->addView(view); setActiveView(view); view->editor()->setDefaultScroll(); }