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

  1. //************************************************************
  2. // Tool Bars  - Tool Bar Floating Frames
  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 Floating Frames");
  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 floating tool bars.
  29. IToolBar
  30.   floating1    (0x05, &frame, IToolBar::floating),
  31.   floating2    (0x06, &frame, IToolBar::floating);
  32.  
  33. // Create some library supplied tool bar buttons.
  34. IToolBarButton
  35.   cutButton1      (IC_ID_CUT,        &floating1, &floating1),
  36.   copyButton1     (IC_ID_COPY,       &floating1, &floating1),
  37.   pasteButton1    (IC_ID_PASTE,      &floating1, &floating1),
  38.   cutButton2      (IC_ID_CUT,        &floating2, &floating2),
  39.   copyButton2     (IC_ID_COPY,       &floating2, &floating2),
  40.   pasteButton2    (IC_ID_PASTE,      &floating2, &floating2),
  41.   cutButton3      (IC_ID_CUT,        &aboveClient, &aboveClient),
  42.   copyButton3     (IC_ID_COPY,       &aboveClient, &aboveClient), 
  43.   pasteButton3    (IC_ID_PASTE,      &aboveClient, &aboveClient);
  44.  
  45. // Add the buttons to the respective tool bars.
  46. floating1
  47.   .addAsLast ( &cutButton1 )
  48.   .addAsLast ( ©Button1 )
  49.   .addAsLast ( &pasteButton1 );
  50. floating2
  51.   .addAsLast ( &cutButton2 )
  52.   .addAsLast ( ©Button2 )
  53.   .addAsLast ( &pasteButton2 );
  54. aboveClient
  55.   .addAsLast ( &cutButton3 )
  56.   .addAsLast ( ©Button3 )
  57.   .addAsLast ( &pasteButton3 );
  58.  
  59.  
  60. frame
  61.   .setClient (&mle)
  62.   .setFocus()
  63.   .show();
  64. IApplication::current().run();
  65.  
  66. }
  67.  
  68.  
  69.