home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / menus / menubar / menubar.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  974 b   |  39 lines

  1. //************************************************************
  2. // Menus - Using an IMenuBar
  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 <iapp.hpp>
  9. #include <iframe.hpp>
  10. #include <imenubar.hpp>
  11. #include "menubar.h"
  12.  
  13. void main()
  14. {
  15. // Create a frame window with a menubar from a resource.
  16. IFrameWindow
  17.   frame( "IMenuBar Example" );
  18.  
  19. // Add the Menubar from a resource file
  20. IMenuBar
  21.   menuBar( MAIN_MENU, &frame );
  22.  
  23. #ifdef IC_WIN
  24. // For windows, bitmap is not automatically loaded
  25. // into the menu, so load it now.
  26. menuBar.setBitmap( MI_BITMAP, MI_BITMAP );
  27. #endif
  28.  
  29. // Change the cascade to a conditional cascade.
  30. menuBar.setConditionalCascade( MI_CASCADE, MI_CASCADE1 );
  31.  
  32. // Set the focus and show the application.
  33. frame
  34.   .setFocus()
  35.   .show();
  36. IApplication::current().run();
  37. }
  38.  
  39.