home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / toolbar / tbarmult / tbarmult.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-10-29  |  2.5 KB  |  76 lines

  1. //************************************************************
  2. // Tool Bars  - Tool Bar Container With Multiple Tool Bars 
  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 Container Example");
  19.  
  20. // Create an MLE for the client area.
  21. IMultiLineEdit
  22.   mle(IC_FRAME_CLIENT_ID, &frame, &frame);
  23.  
  24. // Create a number of tool bars to the left of the client.
  25. IToolBar
  26.   leftOfClient11(0x01, &frame, IToolBar::leftOfClient),
  27.   leftOfClient12(0x01, &frame, IToolBar::leftOfClient, true),
  28.   leftOfClient21(0x01, &frame, IToolBar::leftOfClient),
  29.   leftOfClient22(0x01, &frame, IToolBar::leftOfClient, true);
  30.  
  31.  
  32. // Create some library-supplied tool bar buttons.
  33. IToolBarButton
  34.   cutButton       (IC_ID_CUT,        &leftOfClient11, &leftOfClient11),
  35.   copyButton      (IC_ID_COPY,       &leftOfClient11, &leftOfClient11),
  36.   pasteButton     (IC_ID_PASTE,      &leftOfClient11, &leftOfClient11),
  37.   openButton      (IC_ID_OPEN,       &leftOfClient12, &leftOfClient12),
  38.   saveButton      (IC_ID_SAVE,       &leftOfClient12, &leftOfClient12),
  39.   settingsButton  (IC_ID_SETTINGS,   &leftOfClient12, &leftOfClient12),
  40.   copyToButton    (IC_ID_COPYTO,     &leftOfClient12, &leftOfClient12),
  41.   printButton     (IC_ID_PRINT,      &leftOfClient21, &leftOfClient21),
  42.   locateButton    (IC_ID_LOCATE,     &leftOfClient21, &leftOfClient21),
  43.   helpButton      (IC_ID_HELP,       &leftOfClient21, &leftOfClient21), 
  44.   boldButton      (IC_ID_BOLD,       &leftOfClient22, &leftOfClient22),
  45.   italicButton    (IC_ID_ITALIC,     &leftOfClient22, &leftOfClient22),
  46.   underscoreButton(IC_ID_UNDERSCORE, &leftOfClient22, &leftOfClient22);
  47.  
  48. // Add the buttons to the tool bar.
  49. leftOfClient11
  50.   .addAsLast ( &cutButton )
  51.   .addAsLast ( ©Button )
  52.   .addAsLast ( &pasteButton );
  53. leftOfClient12
  54.   .addAsLast ( &openButton)
  55.   .addAsLast ( &saveButton )
  56.   .addAsLast ( &settingsButton )
  57.   .addAsLast ( ©ToButton );
  58. leftOfClient21
  59.   .addAsLast ( &printButton) 
  60.   .addAsLast ( &locateButton )
  61.   .addAsLast ( &helpButton );
  62. leftOfClient22
  63.   .addAsLast ( &italicButton)
  64.   .addAsLast ( &underscoreButton )
  65.   .addAsLast ( &boldButton );
  66.  
  67. frame
  68.   .setClient (&mle)
  69.   .setFocus()
  70.   .show();
  71. IApplication::current().run();
  72.  
  73. }
  74.  
  75.  
  76.