home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / toolbar / tbargrps / tbargrps.cpp < prev   
Text File  |  1996-10-29  |  2KB  |  71 lines

  1. //************************************************************
  2. // Tool Bars  - Tool Bar Group 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 <itbar.hpp>
  10. #include <itbarbut.hpp>
  11. #include <imle.hpp>
  12. #include <iapp.hpp>
  13. #include <icconst.h>
  14.  
  15. void main()
  16. {
  17. IFrameWindow
  18.   frame ("Tool Bar Group Example");
  19.  
  20. // Create an MLE for the client area.
  21. IMultiLineEdit
  22.   mle(IC_FRAME_CLIENT_ID, &frame, &frame);
  23.  
  24. // Create a Tool Bar above the client by default.
  25. IToolBar
  26.   aboveClient(0x01, &frame);
  27.  
  28. // Create some library supplied tool bar buttons.
  29. IToolBarButton
  30.   cutButton       (IC_ID_CUT,        &aboveClient, &aboveClient),
  31.   copyButton      (IC_ID_COPY,       &aboveClient, &aboveClient),
  32.   pasteButton     (IC_ID_PASTE,      &aboveClient, &aboveClient),
  33.   openButton      (IC_ID_OPEN,       &aboveClient, &aboveClient),
  34.   saveButton      (IC_ID_SAVE,       &aboveClient, &aboveClient),
  35.   printButton     (IC_ID_PRINT,      &aboveClient, &aboveClient),
  36.   locateButton    (IC_ID_LOCATE,     &aboveClient, &aboveClient),
  37.   helpButton      (IC_ID_HELP,       &aboveClient, &aboveClient), 
  38.   boldButton      (IC_ID_BOLD,       &aboveClient, &aboveClient),
  39.   italicButton    (IC_ID_ITALIC,     &aboveClient, &aboveClient),
  40.   underscoreButton(IC_ID_UNDERSCORE, &aboveClient, &aboveClient),
  41.   settingsButton  (IC_ID_SETTINGS,   &aboveClient, &aboveClient),
  42.   copyToButton    (IC_ID_COPYTO,     &aboveClient, &aboveClient);
  43.  
  44. // Add the buttons to the tool bar.
  45. aboveClient
  46.   .addAsLast ( &cutButton )
  47.   .addAsLast ( ©Button )
  48.   .addAsLast ( &pasteButton )
  49.   .addAsLast ( &openButton, true )
  50.   .addAsLast ( &saveButton )
  51.   .addAsLast ( &settingsButton )
  52.   .addAsLast ( ©ToButton )
  53.   .addAsLast ( &printButton, true )
  54.   .addAsLast ( &locateButton )
  55.   .addAsLast ( &helpButton )
  56.   .addAsLast ( &italicButton, true )
  57.   .addAsLast ( &underscoreButton )
  58.   .addAsLast ( &boldButton );
  59.  
  60. aboveClient.setGroupPad(20);
  61.  
  62. frame
  63.   .setClient (&mle)
  64.   .setFocus()
  65.   .show();
  66. IApplication::current().run();
  67.  
  68. }
  69.  
  70.  
  71.