home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / uicldd.zip / DMSAMP1.CPP < prev    next >
Text File  |  1993-08-23  |  2KB  |  59 lines

  1. #include <iframe.hpp>
  2. #include <ientryfd.hpp>
  3. #include <idmefit.hpp>
  4. #include <idmefpv.hpp>
  5. #include <idmsrch.hpp>
  6. #include <idmtgth.hpp>
  7. #include <idmisrnd.hpp>
  8.  
  9. void main()
  10. {
  11.  
  12.   /*-------------------------------------------------------------------
  13.      Standard frame with client area divided between client
  14.      entry field and an entry field extension...
  15.    -------------------------------------------------------------------*/
  16.   IFrameWindow
  17.     frame( "ICLUI Direct Manipulation Sample 1" );
  18.  
  19.   IEntryField
  20.     client( 0, &frame, &frame ),
  21.     ext   ( 0, &frame, &frame );
  22.  
  23.   /*-------------------------------------------------------------------
  24.      Instantiate source and target Direct Manipulation handlers
  25.      and configure client as both a source and target handler
  26.    -------------------------------------------------------------------*/
  27.   IDMSourceHandler
  28.     srcHandler( &client );
  29.   IDMTargetHandler
  30.     tgtHandler( &client );
  31.  
  32.   /*-------------------------------------------------------------------
  33.      Reuse the drag item provider in the extension that was
  34.      instantiated for the client.
  35.    -------------------------------------------------------------------*/
  36.   ext.setItemProvider(client.itemProvider());
  37.  
  38.   /*-------------------------------------------------------------------
  39.      Configure the extension as both a source and target handler
  40.    -------------------------------------------------------------------*/
  41.   srcHandler.handleEventsFor(&ext);
  42.   tgtHandler.handleEventsFor(&ext);
  43.  
  44.   /*-------------------------------------------------------------------
  45.      Frame setup
  46.    -------------------------------------------------------------------*/
  47.   frame
  48.     .setClient( &client )
  49.     .addExtension( &ext, IFrameWindow::belowClient, 0.5 )
  50.     .setFocus()
  51.     .show();
  52.  
  53.   /*-------------------------------------------------------------------
  54.      Invoke ICLUI Direct Manipulation Sample 1
  55.    -------------------------------------------------------------------*/
  56.   IApplication::current().run();
  57.  
  58. }
  59.