Example #1
0
void PreviewEditorWindow::onCenterClicked()
{
  if (m_centerButton->isSelected()) {
    DocumentView* view = UIContext::instance()->activeView();
    if (view)
      updateUsingEditor(view->getEditor());
  }
}
Editor* UIContext::activeEditor()
{
  DocumentView* view = activeView();
  if (view)
    return view->getEditor();
  else
    return NULL;
}
Example #3
0
void PreviewEditorWindow::onWindowResize()
{
  Window::onWindowResize();

  DocumentView* view = UIContext::instance()->activeView();
  if (view)
    updateUsingEditor(view->getEditor());
}
void UIContext::onAddDocument(doc::Document* doc)
{
  Context::onAddDocument(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(static_cast<app::Document*>(doc), DocumentView::Normal);

  // Add a tab with the new view for the document
  App::instance()->getMainWindow()->getWorkspace()->addView(view);

  setActiveView(view);
  view->getEditor()->setDefaultScroll();
}