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

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Window Example
  3. // 5.18.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/reqtools.hpp"
  11.  
  12. //////////////////////////////////////////////////////////////////////////////
  13. // ControlWindow Class Definition
  14.  
  15. class ControlWindow : public AFWindow
  16. {
  17. public:
  18.     ControlWindow();
  19.     virtual void OnCreate();
  20.     virtual void OnCloseWindow(LPIntuiMessage imess);
  21.     virtual void OnNewSize(LPIntuiMessage imess);
  22.     virtual ULONG WindowFlags();
  23.     virtual ULONG WindowIDCMP();
  24.  
  25.     AFReqTools rt;
  26. };
  27.  
  28. //////////////////////////////////////////////////////////////////////////////
  29. // ControlWindow Implementation routines
  30.  
  31. ControlWindow::ControlWindow()
  32. {
  33.     rt.EZRequest("AFWindow::AFWindow","Ok");
  34. }
  35.  
  36. void ControlWindow::OnCloseWindow(LPIntuiMessage imess)
  37. {
  38.     rt.EZRequest("AFWindow::OnCloseWindow","Ok");
  39.     AFWindow::DestroyWindow();
  40. }
  41.  
  42. void ControlWindow::OnCreate()
  43. {
  44.     rt.EZRequest("AFWindow::OnCreate","Ok");
  45. }
  46.  
  47. void ControlWindow::OnNewSize(LPIntuiMessage imess)
  48. {
  49.     rt.EZRequest("AFWindow::OnNewSize","Ok");
  50. }
  51.  
  52. ULONG ControlWindow::WindowFlags()
  53. {
  54.     return (AFWindow::WindowFlags() | WFLG_GIMMEZEROZERO);
  55. }
  56.  
  57. ULONG ControlWindow::WindowIDCMP()
  58. {
  59.     return (AFWindow::WindowIDCMP() | IDCMP_IDCMPUPDATE);
  60. }
  61.  
  62. //////////////////////////////////////////////////////////////////////////////
  63. // MAIN
  64.  
  65. void main()
  66. {
  67.     AFAmigaApp theApp;
  68.     ControlWindow win;
  69.     AFRect rect(10,10,100,100);
  70.  
  71.     win.Create(&theApp,&rect,"AFrame Window Example");
  72.  
  73.     theApp.RunApp();
  74. }
  75.