home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pwrgu2.zip / POWERGU2.EXE / GENHDRS / KEYBD / KEYBD.CPP next >
Text File  |  1995-07-23  |  2KB  |  53 lines

  1. //************************************************************
  2. // Reusable Handlers - Keyboard Handler
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // All Rights Reserved.
  6. //************************************************************
  7. #include <icombobx.hpp>
  8. #include <ientryfd.hpp>
  9. #include <iframe.hpp>
  10. #include <iapp.hpp>
  11. #include <imle.hpp>
  12.  
  13. #include "hexkeybd.hpp"
  14. #include "uckeybd.hpp"
  15. #include "keybd.h"
  16.  
  17. //=========================== Main ============================
  18.  
  19. void main ( )
  20. {
  21.   IFrameWindow frame( ID_KEYBD_DIALOG );
  22.  
  23.   // Wrapper the relevant dialog controls.
  24.   IEntryField anyEntry( ID_ANY_ENTRY, &frame );
  25.   IEntryField upperEntry( ID_UPPERCASE_ENTRY, &frame );
  26.   IEntryField hexEntry( ID_HEX_ENTRY, &frame );
  27.   IEntryField upperHexEntry( ID_UPPERCASE_HEX_ENTRY, &frame );
  28.   IComboBox upperHexCombo( ID_UPPERCASE_HEX_COMBO, &frame );
  29.   IEntryField comboEntry( 0x029B, &upperHexCombo );
  30.                    // CBID_EDIT entry field child window.
  31.   IMultiLineEdit upperHexMLE( ID_UPPERCASE_HEX_MLE, &frame );
  32.  
  33.   // Construct and attach the keyboard handlers.
  34.   UppercaseKeyboardHandler upperKeyboardHandler;
  35.   upperKeyboardHandler
  36.    .handleEventsFor( &upperEntry )
  37.    .handleEventsFor( &upperHexEntry )
  38.    .handleEventsFor( &comboEntry )
  39.    .handleEventsFor( &upperHexMLE );
  40.  
  41.   HexKeyboardHandler hexKeyboardHandler;
  42.   hexKeyboardHandler
  43.    .handleEventsFor( &hexEntry )
  44.    .handleEventsFor( &upperHexEntry )
  45.    .handleEventsFor( &comboEntry )
  46.    .handleEventsFor( &upperHexMLE );
  47.  
  48.   // Show the window now.
  49.   anyEntry.setFocus();
  50.   frame.show();
  51.   IApplication::current().run();
  52. }  // main()
  53.