home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / toolbar / flybasic / flybasic.cpp next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  2.0 KB  |  63 lines

  1. /************************************************************
  2. / Tool Bar - Basic Fly-over Help 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 <ipushbut.hpp>
  10. #include <iinfoa.hpp>
  11. #include <iflytext.hpp>
  12. #include <iflyhhdr.hpp>
  13. #include <icoordsy.hpp>   
  14. #include <icanvas.hpp>
  15. #include "flybasic.h"
  16.  
  17. void main( )
  18. {
  19. // Defect 7664
  20. //  ICoordinateSystem::setApplicationOrientation(
  21. //              ICoordinateSystem::originUpperLeft );
  22.   IFrameWindow frame("Basic Fly-over Help");
  23.   ICanvas client (IC_FRAME_CLIENT_ID, &frame, &frame);
  24.   frame.setClient(&client);
  25.  
  26.   // Create the fly-over text for short text and an info area
  27.   // for the long text.
  28.   IFlyText flyText(ID_FLYTEXT, &frame);
  29.   IInfoArea infoArea(&frame);
  30.  
  31.   // Create the fly-over help handler and attach it to
  32.   // frame.
  33.   IFlyOverHelpHandler flyHandler( &flyText, &infoArea);
  34.   flyHandler.handleEventsFor(&frame);
  35.  
  36.   // Set the string table offsets.
  37.   flyHandler.setFlyTextStringTableOffset(FLYTEXT_OFFSET);
  38.   flyHandler.setLongStringTableOffset( LONGTEXT_OFFSET);
  39.  
  40.   // Create buttons that have fly-over and long text.  The
  41.   // first buttons text comes from the application resource
  42.   // file and the second buttons text is specified here.
  43.   IPushButton resourceButton( ID_BUTTON1, &client, &client, 
  44.                           IRectangle(20, 100, 120, 150));
  45.   resourceButton.setText(ID_BUTTON1);
  46.  
  47.   IPushButton textButton (ID_BUTTON2, &client, &client,
  48.                           IRectangle(140, 100, 240, 150));
  49.   textButton.setText( "Stop");
  50.   flyHandler.setHelpText( textButton.handle(), 
  51.                           "Press to Stop",
  52.                           "Press to stop the Web Browser.");
  53.  
  54.   // Show the window and start the application.
  55.   frame
  56.    .setFocus()
  57.    .show();
  58.  
  59.   IApplication::current().run();
  60.  
  61. // Note: The info area does not display until the window is resized.
  62. }
  63.