home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / c-tools / c_examples / pointer / pointer_example.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-19  |  1.9 KB  |  87 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Pointer Example
  3. // 5.19.96 Deryk Robosson
  4.  
  5. //////////////////////////////////////////////////////////////////////////////
  6. // Includes
  7. #include "aframe:include/amigaapp.hpp"
  8. #include "aframe:include/window.hpp"
  9. #include "aframe:include/rect.hpp"
  10. #include "aframe:include/pointer.hpp"
  11. #include "aframe:include/reqtools.hpp"
  12.  
  13. static UWORD __chip Block_sdata[] =   // sample pointer data
  14. {
  15.     0x0000, 0x0000,        /* reserved, must be NULL */
  16.  
  17.     0x0000, 0x0100,
  18.     0x0100, 0x0280,
  19.     0x0380, 0x0440,
  20.     0x0100, 0x0280,
  21.     0x0100, 0x0ee0,
  22.     0x0000, 0x2828,
  23.     0x2008, 0x5834,
  24.     0x783c, 0x8002,
  25.     0x2008, 0x5834,
  26.     0x0000, 0x2828,
  27.     0x0100, 0x0ee0,
  28.     0x0100, 0x0280,
  29.     0x0380, 0x0440,
  30.     0x0100, 0x0280,
  31.     0x0000, 0x0100,
  32.     0x0000, 0x0000,
  33.     0x0000, 0x0000,
  34.     0x0000, 0x0000,
  35.     0x0000, 0x0000,
  36.     0x0000, 0x0000,
  37.     0x0000, 0x0000,
  38.     0x0000, 0x0000,
  39.     0x0000, 0x0000,
  40.     0x0000, 0x0000,
  41.     0x0000, 0x0000,
  42.     0x0000, 0x0000,
  43.     0x0000, 0x0000,
  44.     0x0000, 0x0000,
  45.     0x0000, 0x0000,
  46.     0x0000, 0x0000,
  47.     0x0000, 0x0000,
  48.     0x0000, 0x0000,
  49.  
  50.     0x0000, 0x0000,        /* reserved, must be NULL */
  51. };
  52.  
  53. //////////////////////////////////////////////////////////////////////////////
  54. // ControlWindow Class Definition
  55.  
  56. class ControlWindow : public AFWindow
  57. {
  58. public:
  59.     virtual void OnCreate();
  60.  
  61.     AFPointer pointer;
  62.     AFReqTools rt;
  63. };
  64.  
  65. //////////////////////////////////////////////////////////////////////////////
  66. // ControlWindow Implementation routines
  67.  
  68. void ControlWindow::OnCreate()
  69. {
  70.     rt.EZRequest("Setting Pointer","Ok");
  71.     pointer.SetPointer(this, Block_sdata, 32l, 16l, -8l, -7l);
  72. }
  73.  
  74. //////////////////////////////////////////////////////////////////////////////
  75. // MAIN
  76.  
  77. void main()
  78. {
  79.     AFAmigaApp theApp;
  80.     ControlWindow win;
  81.     AFRect rect(10,10,100,100);
  82.  
  83.     win.Create(&theApp,&rect,"AFrame Pointer Example");
  84.  
  85.     theApp.RunApp();
  86. }
  87.