home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Samples / GTakPM / Source / GTPMWinCommand.cpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  2KB  |  92 lines

  1. // GTakPM
  2. // (c) Benjamin Stein 1994
  3. // All Rights Reserved
  4. // GTPMWinCommand.cpp
  5.  
  6. //  $Header: W:/Projects/OCL/Samples/GTakPM/Source/rcs/GTPMWinCommand.cpp 1.50 1996/08/11 23:48:09 B.STEIN Release $
  7.  
  8. #include "..\Source\GTakPM.hpp"
  9.  
  10.  
  11. BOOL GTPMWin::command(MPARAM mp1, MPARAM mp2)
  12. {
  13.  switch(SHORT1FROMMP(mp1))
  14.   {
  15.    case CMD_QUIT:
  16.     WinPostMsg(hwnd, WM_CLOSE, NULL, NULL);
  17.     break;
  18.  
  19.    case CMD_RESCAN:
  20.     Excludes->deleteAll();
  21.     Includes->deleteAll();
  22.     Drives->setupItems();
  23.     break;
  24.  
  25.    case CMD_BACKUP:
  26.     if(!showMonitor)
  27.       command(MPFROM2SHORT(CMD_MONITOR, 0), NULL);
  28.     backupThr.run();
  29.     break;
  30.  
  31.    case CMD_RESTORE:
  32.     if(!showMonitor)
  33.       command(MPFROM2SHORT(CMD_MONITOR, 0), NULL);
  34.     restoreThr.run();
  35.     break;
  36.  
  37.    case CMD_MONITOR:
  38.     WinQueryWindowRect(hwnd, &rcl);
  39.     showMonitor = !showMonitor;
  40.     resizeClients(MPFROM2SHORT(rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom)); 
  41.     break;
  42.  
  43.    case TAPEBAR_LOAD:
  44.     processing = TRUE;
  45.     tape->load();
  46.     break;
  47.    case TAPEBAR_UNLOAD:
  48.     processing = TRUE;
  49.     tape->unload();
  50.     break;
  51.    case TAPEBAR_REWIND:
  52.     processing = TRUE;
  53.     tape->rewind();
  54.     break;
  55.    case TAPEBAR_PARTITIONS: {
  56.     processing = TRUE;
  57.     OString command("SIZE=10");
  58.     tape->part(command); 
  59.     break; }
  60.    case TAPEBAR_FORMAT:
  61.     processing = TRUE;
  62.     tape->format();
  63.     break;
  64.    case TAPEBAR_ERASE:
  65.     processing = TRUE;
  66.     tape->erase();
  67.     break;
  68.    case TAPEBAR_ERASEQ:
  69.     processing = TRUE;
  70.     tape->eraseq();
  71.     break;
  72.    case TAPEBAR_LOCK:
  73.     processing = TRUE;
  74.     tape->lock();
  75.     break;
  76.    case TAPEBAR_UNLOCK:
  77.     processing = TRUE;
  78.     tape->unlock();
  79.     break;
  80.    case TAPEBAR_STOP_ASAP:
  81.     pmpipe.stopChild();
  82.     break;
  83.  
  84.    default:
  85.     return(FALSE);
  86.   }
  87.  return(TRUE);
  88. }
  89.  
  90.  
  91. // end of source
  92.