Esempio n. 1
0
void PreviewEditorWindow::onWindowResize()
{
  Window::onWindowResize();

  DocumentView* view = UIContext::instance()->activeView();
  if (view)
    updateUsingEditor(view->editor());
}
Esempio n. 2
0
Editor* UIContext::activeEditor()
{
  DocumentView* view = activeView();
  if (view)
    return view->editor();
  else
    return NULL;
}
Esempio n. 3
0
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();
}