home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / FREDV19A.LHA / FrexxEd / fpl / AppQuery.FPL next >
Encoding:
Text File  |  1995-07-19  |  648 b   |  21 lines

  1. export int Dropped(string file)
  2. {
  3.   string query = sprintf("Open %s\ninto a new buffer or\ninsert it at current position?", file);
  4.   int ret;
  5.   ret = Request(query, "AppQuery", "New|Insert|Cancel");
  6.   if (ret==1) {
  7.     int id = New();
  8.     int before = GetBufferID();
  9.     CurrentBuffer(id);    /* make it the current */
  10.     if(0>Load(file)) {
  11.       Kill(id);           /* failed loading */
  12.     } else {
  13.       CurrentBuffer(id);    /* make it the current */
  14.       Activate(id);       /* popup a view */
  15.     }
  16.   }
  17.   WindowToFront();
  18.   return (ret!=2) ; /* stop the insert operation if "New" or "Cancel" was selected! */
  19. }
  20. Hook("IconDrop", "Dropped");
  21.