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

  1. //************************************************************
  2. // Tool Bars  - Tool Bar With Decks 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 With Decks 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 to the left of the client window.
  25. IToolBar
  26.   leftOfClient(0x01, &frame, IToolBar::leftOfClient);
  27.  
  28. // Create some library-supplied tool bar buttons.
  29. IToolBarButton
  30.   cutButton       (IC_ID_CUT,        &leftOfClient, &leftOfClient),
  31.   copyButton      (IC_ID_COPY,       &leftOfClient, &leftOfClient),
  32.   pasteButton     (IC_ID_PASTE,      &leftOfClient, &leftOfClient),
  33.   openButton      (IC_ID_OPEN,       &leftOfClient, &leftOfClient),
  34.   saveButton      (IC_ID_SAVE,       &leftOfClient, &leftOfClient),
  35.   printButton     (IC_ID_PRINT,      &leftOfClient, &leftOfClient),
  36.   locateButton    (IC_ID_LOCATE,     &leftOfClient, &leftOfClient),
  37.   helpButton      (IC_ID_HELP,       &leftOfClient, &leftOfClient), 
  38.   boldButton      (IC_ID_BOLD,       &leftOfClient, &leftOfClient),
  39.   italicButton    (IC_ID_ITALIC,     &leftOfClient, &leftOfClient),
  40.   underscoreButton(IC_ID_UNDERSCORE, &leftOfClient, &leftOfClient),
  41.   settingsButton  (IC_ID_SETTINGS,   &leftOfClient, &leftOfClient),
  42.   copyToButton    (IC_ID_COPYTO,     &leftOfClient, &leftOfClient);
  43.  
  44. // Add the buttons to the tool bar.
  45. leftOfClient
  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. leftOfClient.setDeckCount(2);
  61.  
  62. frame
  63.   .setClient (&mle)
  64.   .setFocus()
  65.   .show();
  66. IApplication::current().run();
  67.  
  68. }
  69.  
  70.  
  71.