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

  DocumentView* view = UIContext::instance()->activeView();
  if (view)
    updateUsingEditor(view->getEditor());
}
Ejemplo n.º 4
0
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();
}