DocumentView* UIContext::activeView() const
{
  Workspace* workspace = App::instance()->getMainWindow()->getWorkspace();
  WorkspaceView* view = workspace->activeView();
  if (DocumentView* docView = dynamic_cast<DocumentView*>(view))
    return docView;
  else
    return NULL;
}
Beispiel #2
0
DocumentView* UIContext::activeView() const
{
  if (!isUIAvailable())
    return nullptr;

  Workspace* workspace = App::instance()->workspace();
  if (!workspace)
    return nullptr;

  WorkspaceView* view = workspace->activeView();
  if (DocumentView* docView = dynamic_cast<DocumentView*>(view))
    return docView;
  else
    return nullptr;
}
Beispiel #3
0
bool DuplicateViewCommand::onEnabled(Context* context)
{
  Workspace* workspace = App::instance()->workspace();
  WorkspaceView* view = workspace->activeView();
  return (view != nullptr);
}
Beispiel #4
0
 void onExecute(Context* context) override {
   Workspace* workspace = App::instance()->getMainWindow()->getWorkspace();
   WorkspaceView* view = workspace->activeView();
   if (view)
     workspace->closeView(view);
 }
Beispiel #5
0
 bool onEnabled(Context* context) override {
   Workspace* workspace = App::instance()->getMainWindow()->getWorkspace();
   WorkspaceView* view = workspace->activeView();
   return (view != nullptr);
 }