home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / toolbar / cbuthdr / cbuthdr.cpp next >
Text File  |  1996-10-29  |  1KB  |  50 lines

  1. //************************************************************
  2. // Tool Bars  - Custom Button Handler Example
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //************************************************************
  8. #include <iframe.hpp>
  9. #include <igraphic.hpp>
  10. #include <igbitmap.hpp>
  11. #include <igrect.hpp>
  12. #include <iglist.hpp>
  13. #include <isetcv.hpp>
  14. #include <iapp.hpp>
  15. #include <icoordsy.hpp>
  16. #include <icconst.h>
  17. #include "graphbut.hpp"
  18.  
  19. void main()
  20. {
  21. // Set the coordinate system to upper left on all platforms.
  22. ICoordinateSystem::setApplicationOrientation(
  23.       ICoordinateSystem::originUpperLeft);
  24.  
  25.  
  26. IFrameWindow
  27.   frame ("Custom Button Handler Example");
  28.  
  29. // Create a set canvas for the client area.
  30. ISetCanvas
  31.   client(IC_FRAME_CLIENT_ID, &frame, &frame);
  32.  
  33. // Create the graphic button with defaults.
  34. GraphicButton
  35.   graphicButton(11, &client, &client);
  36.  
  37. // Enable latching.
  38. graphicButton.enableLatching();
  39.  
  40. graphicButton.setText("This is a \n custom button!");
  41.  
  42. // Put the canvas in the client area and run the application.
  43. frame
  44.   .setClient(&client)
  45.   .setFocus()
  46.   .show();
  47. IApplication::current().run();
  48.  
  49. }
  50.