home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / icombobx.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.1 KB  |  138 lines

  1. #ifndef _ICOMBOBX_
  2.   #define _ICOMBOBX_
  3. /*******************************************************************************
  4. * FILE NAME: icombobx.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IComboBox                                                                *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <icombobs.hpp>
  19. #include <ientryfd.hpp>
  20. #include <irect.hpp>
  21.  
  22. class IComboBoxData;
  23.  
  24. #pragma pack(4)
  25.  
  26. class IComboBox : public IBaseComboBox {
  27. typedef IBaseComboBox
  28.   Inherited;
  29.  
  30. public:
  31.  
  32. typedef IBaseComboBox::Cursor
  33.   Cursor;
  34.  
  35. class Style;
  36. /*------------------------------- Constructors -------------------------------*/
  37.   IComboBox         ( unsigned long        id,
  38.                       IWindow*             parent,
  39.                       IWindow*             owner,
  40.                       const IRectangle&    initial = IRectangle  ( ),
  41.                       const Style&         style   = defaultStyle( ) );
  42.  
  43.   IComboBox         ( unsigned long        id,
  44.                       IWindow*             parent );
  45.  
  46.   IComboBox         ( const IWindowHandle& handle);
  47.  
  48. virtual
  49.  ~IComboBox         ( );
  50.  
  51. /*---------------------------------- Styles ----------------------------------*/
  52. INESTEDBITFLAGCLASSDEF3(Style, IComboBox, IWindow, IControl, IBaseComboBox);
  53.  
  54. static const Style
  55.   IC_IMPORTU classDefaultStyle;
  56.  
  57. static Style
  58.   defaultStyle      ( );
  59.  
  60. static void
  61.   setDefaultStyle   ( const Style&       style );
  62.  
  63. /*------------------------- Add Items ----------------------------------------*/
  64. virtual unsigned long
  65.   add               ( unsigned long      index,
  66.                       const char*        text ),
  67.   add               ( unsigned long      index,
  68.                       const char* const* itemList,
  69.                       unsigned long      count = 1 ),
  70.   addAsFirst        ( const char*        text ),
  71.   addAsLast         ( const char*        text ),
  72.   addAscending      ( const char*        text ),
  73.   addDescending     ( const char*        text ),
  74.   add               ( unsigned long      index,
  75.                       const IResourceId& item ),
  76.   addAsFirst        ( const IResourceId& item ),
  77.   addAsLast         ( const IResourceId& item ),
  78.   addAscending      ( const IResourceId& item ),
  79.   addDescending     ( const IResourceId& item );
  80.  
  81. virtual IComboBox
  82.  &add               ( const char*        text,
  83.                       Cursor&            cursor ),
  84.  &add               ( const IResourceId& item,
  85.                       Cursor&            cursor ),
  86.  &addAsFirst        ( const char*        text,
  87.                       Cursor&            cursor ),
  88.  &addAsLast         ( const char*        text,
  89.                       Cursor&            cursor ),
  90.  &addAsNext         ( const char*        text,
  91.                       Cursor&            cursor ),
  92.  &addAsFirst        ( const IResourceId& item,
  93.                       Cursor&            cursor),
  94.  &addAsLast         ( const IResourceId& item,
  95.                       Cursor&            cursor ),
  96.  &addAsNext         ( const IResourceId& item,
  97.                       Cursor&            cursor );
  98.  
  99. /*------------------------- Remove and Replace Items -------------------------*/
  100. virtual IComboBox
  101.  &removeAt          ( Cursor&            cursor ),
  102.  &removeAll         ( ),
  103.  &replaceAt         ( const char*        text,
  104.                       const Cursor&      cursor ),
  105.  &replaceAt         ( const IResourceId& item,
  106.                       const Cursor&      cursor );
  107.  
  108. virtual unsigned long
  109.   remove            ( unsigned long      index );
  110.  
  111. /*--------------------------- Notification Members ---------------------------*/
  112. static INotificationId const
  113.   IC_IMPORTU addId,
  114.   IC_IMPORTU removeId;
  115.  
  116. private:
  117. /*------------------------------ Hidden Members ------------------------------*/
  118.   IComboBox         ( const IComboBox&   comboBox );
  119. IComboBox
  120.  &operator=         ( const IComboBox&   comboBox );
  121.  
  122. /*--------------------------------- Private ----------------------------------*/
  123. friend class IBaseComboBox::Cursor;
  124.  
  125. static Style
  126.   currentDefaultStyle;
  127.  
  128. IComboBoxData
  129.  *fComboBoxData;
  130.  
  131. };  /* IComboBox */
  132.  
  133. INESTEDBITFLAGCLASSFUNCS(Style, IComboBox);
  134.  
  135. #pragma pack()
  136.  
  137. #endif  /* _ICOMBOBX_ */
  138.