Ejemplo n.º 1
0
void ShellPool::ShellClosed(const ShellEvent::Pointer& e)
{

  if (e->doit)
  {
    Shell::Pointer s = e->GetSource();
    IShellListener* l =  s->GetExtraShellListener();

    if (l != 0)
    {
      s->SetExtraShellListener(NULL);
      l->ShellClosed(e);

      // The shell can 'cancel' the close by setting
      // the 'doit' to false...if so, do nothing
      if (e->doit)
      {
        availableShells.push_back(s);
        s->SetVisible(false);
      }
      else
      {
        // Restore the listener
        s->SetExtraShellListener(l);
      }
    }
  }
  e->doit = false;
}