home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / genhdrs / keybd / keybd.cpp < prev    next >
Text File  |  1996-10-29  |  2KB  |  70 lines

  1. //*********************************************************
  2. // Reusable Handlers - Keyboard Handler
  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 <icombobx.hpp>
  10. #include <ientryfd.hpp>
  11. #include <iframe.hpp>
  12. #include <imle.hpp>
  13. #include <ipushbut.hpp>
  14.  
  15. #include "hexkeybd.hpp"
  16. #include "uckeybd.hpp"
  17. #include "keybd.h"
  18.  
  19. void main ( )
  20. {
  21.   IFrameWindow
  22.     frame( ID_KEYBD_DIALOG );
  23.  
  24.   // Provide a wrapper for the relevant dialog controls.
  25.   IEntryField
  26.     anyEntry( ID_ANY_ENTRY, &frame ),
  27.     upperEntry( ID_UPPERCASE_ENTRY, &frame ),
  28.     hexEntry( ID_HEX_ENTRY, &frame ),
  29.     upperHexEntry( ID_UPPERCASE_HEX_ENTRY, &frame );
  30.   IComboBox
  31.     upperHexCombo( ID_UPPERCASE_HEX_COMBO, &frame );
  32.   IEntryField
  33.     comboEntry( ID_COMBOBOX_EF, &upperHexCombo );
  34.                    // ID_COMBOBOX_EF is platform specific.
  35.   IMultiLineEdit
  36.     upperHexMLE( ID_UPPERCASE_HEX_MLE, &frame );
  37.  
  38. #ifndef IC_PM
  39.   IPushButton
  40.     ok( ID_CLOSE, &frame );
  41.   ok
  42.    .enableSystemCommand();  // For the Close system command.
  43. #endif
  44.  
  45.   // Construct and attach the keyboard handlers.
  46.   UppercaseKeyboardHandler
  47.     upperKeyboardHandler;
  48.   upperKeyboardHandler
  49.    .handleEventsFor( &upperEntry )
  50.    .handleEventsFor( &upperHexEntry )
  51.    .handleEventsFor( &comboEntry )
  52.    .handleEventsFor( &upperHexMLE );
  53.  
  54.   HexKeyboardHandler
  55.     hexKeyboardHandler;
  56.   hexKeyboardHandler
  57.    .handleEventsFor( &hexEntry )
  58.    .handleEventsFor( &upperHexEntry )
  59.    .handleEventsFor( &comboEntry )
  60.    .handleEventsFor( &upperHexMLE );
  61.  
  62.   // Show the window now.
  63.   anyEntry
  64.    .setFocus();
  65.   frame
  66.    .show();
  67.  
  68.   IApplication::current().run();
  69. }
  70.