home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / DRAG1 / DMSAMP1.CPP < prev    next >
Text File  |  1995-05-01  |  2KB  |  53 lines

  1. #ifndef _IBASE_                         //Make sure ibase.hpp is included
  2.   #include <ibase.hpp>                  //  since that is where IC_<environ>
  3. #endif                                  //  is defined.
  4. #include <iframe.hpp>
  5. #include <ientryfd.hpp>
  6. #include <idmefit.hpp>
  7. #include <idmhndlr.hpp>
  8. #include "dmsamp1.h"
  9.  
  10. /*------------------------------------------------------------------------------
  11. | main                                                                         |
  12. ------------------------------------------------------------------------------*/
  13. int main()
  14. {
  15.  
  16.   /***********************************************************************/
  17.   /* Create a generic frame window.                                      */
  18.   /***********************************************************************/
  19.   IFrameWindow
  20.     frame( "Direct Manipulation Sample 1", WND_MAIN );
  21.  
  22.   /***********************************************************************/
  23.   /* Create 2 entry fields for the client area.                          */
  24.   /***********************************************************************/
  25.   IEntryField
  26.     client( 1000, &frame, &frame ),
  27.     ext   ( 1001, &frame, &frame );
  28.  
  29.   /***********************************************************************/
  30.   /* Enable source and target direct manipulation support for both       */
  31.   /* entry fields.                                                       */
  32.   /***********************************************************************/
  33.   IDMHandler::enableDragDropFor( &client );
  34.   IDMHandler::enableDragDropFor( &ext );
  35.  
  36.   /***********************************************************************/
  37.   /* Frame setup - Put both entry fields in the client area, with one    */
  38.   /* added as an extension.                                              */
  39.   /***********************************************************************/
  40.   frame
  41.     .setIcon( frame.id() )
  42.     .setClient( &client )
  43.     .addExtension( &ext, IFrameWindow::belowClient, 0.5 )
  44.     .setFocus()
  45.     .show();
  46.  
  47.   /***********************************************************************/
  48.   /* Run Direct Manipulation Sample 1                                    */
  49.   /***********************************************************************/
  50.   IApplication::current().run();
  51.   return 0;
  52. }
  53.