Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. Groups.hxx
  7. This file contains common group definitions that other people might
  8. find useful.
  9. FILE HISTORY:
  10. Johnl 11-Apr-1992 Created
  11. */
  12. #ifndef _GROUPS_HXX_
  13. #define _GROUPS_HXX_
  14. #include "strlst.hxx"
  15. /*************************************************************************
  16. NAME: SLE_STRLB_GROUP
  17. SYNOPSIS: This group defines the behaviour between an input SLE, a
  18. string listbox that contains the inputted data (and supplies
  19. the output data) and two buttons which controls the
  20. input/output sequence. This is essentially a set control
  21. except one of listboxes is replaced by an SLE.
  22. INTERFACE:
  23. Init
  24. Fills the Listbox with the items in the STRLIST.
  25. Must be called even if nothing is to be added the listbox.
  26. PARENT: CONTROL_GROUP
  27. USES: PUSH_BUTTON, SLE, STRING_LISTBOX
  28. CAVEATS: Init is used because we can't reliably gurantee all of the
  29. controls have been constructed at construct time.
  30. NOTES: No action will be performed on the controls passed to the
  31. constructor
  32. HISTORY:
  33. JohnL 11-Apr-1992 Created
  34. KeithMo 12-Nov-1992 Added W_Add virtual worker.
  35. **************************************************************************/
  36. DLL_CLASS SLE_STRLB_GROUP : public CONTROL_GROUP
  37. {
  38. public:
  39. SLE_STRLB_GROUP( OWNER_WINDOW * powin,
  40. SLE * sleInput,
  41. STRING_LISTBOX * pStrLB,
  42. PUSH_BUTTON * pbuttonAdd,
  43. PUSH_BUTTON * pbuttonRemove ) ;
  44. ~SLE_STRLB_GROUP() ;
  45. APIERR Init( STRLIST * pstrlist = NULL ) ;
  46. STRING_LISTBOX * QueryStrLB( void ) const
  47. { return _pStrLB ; }
  48. SLE * QueryInputSLE( void ) const
  49. { return _psleInput ; }
  50. protected:
  51. APIERR OnAdd( void ) ;
  52. APIERR OnRemove( void ) ;
  53. virtual APIERR W_Add( const TCHAR * psz );
  54. virtual APIERR OnUserAction( CONTROL_WINDOW * pcwin,
  55. const CONTROL_EVENT & e ) ;
  56. /* Grays buttons and disables controls based on the current state of the
  57. * group.
  58. */
  59. void SetState( void ) const ;
  60. PUSH_BUTTON * QueryAddButton( void ) const
  61. { return _pbuttonAdd ; }
  62. PUSH_BUTTON * QueryRemoveButton( void ) const
  63. { return _pbuttonRemove ; }
  64. private:
  65. STRING_LISTBOX * _pStrLB ;
  66. SLE * _psleInput ;
  67. PUSH_BUTTON * _pbuttonAdd ;
  68. PUSH_BUTTON * _pbuttonRemove ;
  69. } ;
  70. #endif // _GROUPS_HXX_