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

  1. // dragsamp.cpp
  2.  
  3. // $Header: W:/Projects/OCL/Samples/DragSamp/Source/rcs/dragsamp.cpp 1.50 1996/08/11 23:47:57 B.STEIN Release $
  4.  
  5. #define __OCL_RESOLVE_TEMPLATES__
  6.  
  7. #include "..\Source\dragsamp.hpp"
  8.  
  9. void main(void)
  10. {
  11.  DragSamp sample;
  12.  
  13.  try
  14.   {
  15.    sample.createDlg();
  16.    sample.centerDlg();
  17.    sample.showDlg();
  18.    sample.run();
  19.   }
  20.  
  21.  catch(OPMException &except)
  22.   {
  23.    except.viewError();
  24.    _exit(1);
  25.   }
  26.  
  27.  _exit(0);
  28. }
  29.  
  30.  
  31.  
  32. DragSamp::DragSamp()
  33.   : ODialog (DRAGSAMP_DLG),
  34.     odf_a   (DRAGSAMP_A, NULLHANDLE),
  35.     odf_b   (DRAGSAMP_B, NULLHANDLE),
  36.     odf_c   (DRAGSAMP_C, NULLHANDLE)
  37.   {}
  38.  
  39.  
  40.  
  41. DragSamp::~DragSamp()
  42.   {}
  43.  
  44.  
  45.  
  46. BOOL DragSamp::OCommand(ULONG msg, MPARAM mp1, MPARAM mp2)
  47. {
  48.  switch(msg)
  49.   {
  50.    case WM_INITDLG:
  51.      odf_a.inherit(hwnd);
  52.      odf_b.inherit(hwnd);
  53.      odf_c.inherit(hwnd);
  54.      break;
  55.  
  56.    case WM_COMMAND:
  57.      WinSendMsg(hwnd, WM_CLOSE, NULL, NULL);
  58.      break;
  59.  
  60.    case WM_CLOSE:
  61.      hideDlg();
  62.      forceQuit();
  63.      break;
  64.  
  65.    default:
  66.      return(FALSE);
  67.   } 
  68.  return(TRUE);
  69. }
  70.  
  71.  
  72.  
  73. // end of source
  74.