home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / uidemo / cursor / main.cxx < prev    next >
C/C++ Source or Header  |  1995-04-08  |  1KB  |  50 lines

  1.  
  2. // A demo of cursor changes using YACL
  3. //
  4. // M. A. Sridhar
  5. // April 3, 1994
  6.  
  7. #include "ui/composit.h"
  8. #include "ui/applic.h"
  9. #include "ui/pushbtn.h"
  10. #include "ui/cursor.h"
  11.  
  12. int UI_Application::Main (int, char*[])
  13. {
  14.     // This program demonstrates that, under MS-Windows, message objects
  15.     // (i.e., "static" objects) will not be sent mouse move events!
  16.     UI_CompositeVObject* root = new UI_CompositeVObject
  17.         (NULL, NULL, FALSE, UI_Rectangle (50, 50, 230, 400));
  18.     MakeTopWindow (root);
  19.     root->Title () = "YACL Cursor demo";
  20.     
  21.     UI_PushButton* m1 = new UI_PushButton
  22.         (root, UI_Rectangle (10, 10, 200, 50));
  23.     (m1->Model()) = CL_String ("I use an i-beam cursor");
  24.     m1->Cursor() = UICursor_IBeam;
  25.     
  26.     UI_PushButton* m2 = new UI_PushButton
  27.         (root, UI_Rectangle (10, 100, 200, 50));
  28.     (m2->Model()) = CL_String ("I use a wait cursor");
  29.     m2->Cursor() = UICursor_Wait;
  30.     
  31. #if !defined(__OS2__)
  32.     UI_PushButton* m3 = new UI_PushButton
  33.         (root, UI_Rectangle (10, 200, 200, 50));
  34.     (m3->Model()) = CL_String ("I use a cross-hair cursor");
  35.     m3->Cursor() = UICursor_CrossHairs;
  36. #endif
  37.     
  38. #if defined(__MS_WINDOWS__)
  39.     UI_PushButton* m4 = new UI_PushButton
  40.         (root, UI_Rectangle (10, 300, 200, 50));
  41.     (m4->Model()) = CL_String ("I use a custom cursor");
  42.     m4->Cursor() = "SampleCursor";
  43. #endif
  44.     
  45.     Run();
  46.     return 0;
  47. }
  48.  
  49.  
  50.