home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / help / helptbl / helptbl.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  3.2 KB  |  118 lines

  1. #ifndef _HELPTBL_
  2. #define _HELPTBL_
  3. //***********************************************************
  4. // Using Help - Help Tables                                  
  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 <ientryfd.hpp>
  11. #include <iframe.hpp>
  12. #include <imcelcv.hpp>
  13. #include <ipushbut.hpp>
  14. #include <iselhdr.hpp>
  15. #include <istattxt.hpp>
  16. #include <ititle.hpp>
  17.  
  18. #include "helptbl.h"
  19.  
  20. class ListBoxSelectHandler : public ISelectHandler {
  21. protected:
  22. virtual Boolean
  23.   enter ( IControlEvent& event );
  24. }; // ListBoxSelectHandler
  25.  
  26. class TestWindow : public IFrameWindow {
  27. public:
  28.   TestWindow ( unsigned long id,
  29.                IWindow*      parent = 0,
  30.                IWindow*      owner = 0 )
  31.     : IFrameWindow ( id, parent, owner ),
  32.       canvasClient( ID_CLIENT, this, this ),
  33.       prompt1 ( ID_DUMMY, &canvasClient, &canvasClient ),
  34.       prompt2 ( ID_DUMMY, &canvasClient, &canvasClient ),
  35.       entry1 ( ID_ENTRY1, &canvasClient, &canvasClient ),
  36.       entry2 ( ID_ENTRY2, &canvasClient, &canvasClient ),
  37.       helpButton ( ID_HELP_BUTTON, &canvasClient, &canvasClient )
  38.   {
  39.     prompt1
  40.      .setText( "Has contextual help" );
  41.     prompt2
  42.      .setText( "No contextual help" );
  43.     entry1
  44.      .enableTabStop()
  45.      .enableGroup();
  46.     entry2
  47.      .enableTabStop()
  48.      .enableGroup();
  49.     helpButton
  50.      .enableHelp()
  51.      .disableMouseClickFocus()
  52.      .setText( "Help" )
  53.      .enableTabStop()
  54.      .enableGroup();
  55.  
  56.     canvasClient
  57.      .addToCell( &prompt1,    2, 2 )
  58.      .addToCell( &prompt2,    2, 4 )
  59.      .addToCell( &entry1,     4, 2 )
  60.      .addToCell( &entry2,     4, 4 )
  61.      .addToCell( &helpButton, 2, 6, 3 );
  62.     canvasClient
  63.      .setColumnWidth( 5, 10 )
  64.      .setRowHeight( 7, 10 );
  65.  
  66.     (*this)
  67.      .moveSizeToClient( IRectangle( this->rect().minXMinY(),
  68.                                     ISize( canvasClient.minimumSize() ) ) )
  69.      .setFocus();
  70.   }
  71. private:
  72.   TestWindow ( const TestWindow& );
  73. TestWindow
  74.  &operator=  ( const TestWindow& );
  75. IMultiCellCanvas
  76.   canvasClient;
  77. IStaticText
  78.   prompt1,
  79.   prompt2;
  80. IEntryField
  81.   entry1,
  82.   entry2;
  83. IPushButton
  84.   helpButton;
  85. }; // TestWindow
  86.  
  87. class PrimaryWindow : public TestWindow {
  88. public:
  89.   PrimaryWindow ( )
  90.     : TestWindow ( ID_PRIMARY2 )
  91.   {
  92.     ITitle( this, "Another Primary Window" );
  93.   }
  94. private:
  95.   PrimaryWindow ( const PrimaryWindow& );
  96. PrimaryWindow
  97.  &operator=     ( const PrimaryWindow& );
  98. }; // PrimaryWindow
  99.  
  100. class SecondaryWindow : public TestWindow {
  101. public:
  102.   SecondaryWindow ( unsigned long id,
  103.                     IWindow*      owner )
  104.     : TestWindow ( id, 0, owner )
  105.   {
  106.     ITitle( this,
  107.             id == ID_SECONDARY_MODELESS ?
  108.                "Modeless Secondary Window" :
  109.                "Modal Secondary Window" );
  110.   }
  111. private:
  112.   SecondaryWindow ( const SecondaryWindow& );
  113. SecondaryWindow
  114.  &operator=       ( const SecondaryWindow& );
  115. }; // SecondaryWindow
  116.  
  117. #endif // _HELPTBL_
  118.