home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / canvas / complex / pushbtns.hpp < prev    next >
Text File  |  1996-10-29  |  2KB  |  62 lines

  1. #ifndef _PUSHBTNS_
  2. #define _PUSHBTNS_
  3. //*********************************************************
  4. // Canvas - Complex Canvas Example
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  8. // All Rights Reserved.
  9. //*********************************************************
  10. #include <ipushbut.hpp>
  11. #include <isetcv.hpp>
  12. #include <icconst.h>
  13.  
  14. #ifdef IC_PM
  15.   // Define special window identifiers not originally
  16.   // included in VisualAge for C++ for OS/2, V3.0.
  17.   #ifndef IC_ID_OK
  18.     #define IC_ID_OK     1
  19.   #endif
  20.   #ifndef IC_ID_CLOSE
  21.     #define IC_ID_CLOSE  0x8004
  22.   #endif
  23. #endif
  24.  
  25. class MyStandardPushButtons : public ISetCanvas {
  26. public:
  27.   MyStandardPushButtons ( unsigned long id,
  28.                           IWindow*      parentAndOwner )
  29.     : ISetCanvas( id, parentAndOwner, parentAndOwner ),
  30.       ok( IC_ID_OK, this, this ),
  31.       cancel( IC_ID_CLOSE, this, this ),
  32.       help( IC_ID_HELP, this, this )
  33.   {
  34.     (*this)
  35.      .setMargin( ISize() )
  36.      .setPackType( ISetCanvas::expanded );
  37.                    // Make all the buttons the same size.
  38.     ok
  39.      .enableDefault()
  40.      .setText( "OK" )
  41.      .enableTabStop()
  42.      .enableGroup();
  43.     cancel
  44.      .enableSystemCommand()  // For the Close system command.
  45.      .setText( "Cancel" );
  46.     help
  47.      .enableHelp()
  48.      .disableMouseClickFocus()
  49.      .setText( "Help" );
  50.   }
  51. private:
  52.   MyStandardPushButtons ( const MyStandardPushButtons& );
  53. MyStandardPushButtons
  54.  &operator=             ( const MyStandardPushButtons& );
  55. IPushButton
  56.   ok,
  57.   cancel,
  58.   help;
  59. }; // MyStandardPushButtons
  60.  
  61. #endif // _PUSHBTNS_
  62.