/* The ProjApp defines the startup behavior of the project
   application.  It inherits from the formal class Application.
   This is a new class defined in Actor 2.0.
*/!!

inherit(Application, #ProjApp, nil, 2, nil)!!

now(class(ProjApp))!!

/* Remove unused methods during seal off. */
Def removeExtra(self)
{
  removeMethods(self, Date, #(asLongString asVeryLongString asDayString
        diff inc dec next previous dayOfWeek));
  removeMethods(self, DateClass, #(current));
  removeMethods(self, Network, #(show));
  removeMethods(self, Node, #(show));

  removeMethods(self, Number, #(cos sqrt tan sin exp log arcCos 
        arcSin degToRad radToDeg asHex));
  removeMethods(self, Int, #(random, tabs));
  removeMethods(self, Rect, #(inflate, offset, intersect,
        union, setOrigin,origin,setCorner));
  removeMethods(self, Object, #(removeCompiler));
  removeMethods(self, String, #(asGlobalHandle,
    charSet, compile, copyUpTo, fillWith, format,
    left, literal, map, primFormat, replicate, right, 
    trimLeading, trimTrailing, upTo,leadingBlanks,
    breakLines,erase,rightJustify));    
removeMethods(self, Point, #(round, line));
removeMethods(self, Object, #(wCallArgsError,ancestError,
       cstat,inheritError,inspect,dateStr,group,timeStr,
       traceOff,break,removeNames,condCompile,getFileName,
       inherit,ancestors,now));
removeMethods(self, Struct, #(copyFromLong));
removeMethods(self, Dictionary, #(reclaim));
removeMethods(self, Symbol, #(implementors));
removeMethods(self, Char, #(isHexDigit));
removeMethods(self, Real, #(radToDeg,degToRad));
removeMethods(self, MethodDictionary, #(profile,clear));
removeMethods(self, Collection, #(writeLinesOn, browse));
removeMethods(self, WindowsObject, #(getCRect,sendMessage,validate));
removeMethods(self, Dialog, #(toggle,flash,disableItem,enableItem));
removeMethods(self, Window, #(recreate,changeMenu));

removeMethods(self, System, #(profile));
removeMethods(self, IdentityDictionary, #(profile));
}!!

now(ProjApp)!!

/* Start the project application.  Show the window, 
   load selected file (if any) and display about box.
*/
Def init(self , commandStr | dlg, fName)
{ init(self:ancestor, commandStr);
  register(ProjWindow);
  register(GanttWindow);
  mainWindow := new(ProjWindow, nil, nil, loadString(PW_APPNAME), nil);
  show(mainWindow, CmdShow);
  if commandStr
    fName := words(commandStr)[0];
    if fName 
      fileOpen(mainWindow, fName);
    endif;
  endif;
  dlg := new(Dialog);
  runModal(dlg, ABOUT_BOX, mainWindow);
  /* set the cursor in case there's no mouse */
  setCursorPos(mainWindow, 
         point(mainWindow.boxHSpace, mainWindow.boxHeight));
}!!

/* Class Initialization */
