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

  1. #ifndef _ILISTBOX_
  2.   #define _ILISTBOX_
  3. /*******************************************************************************
  4. * FILE NAME: ilistbox.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IListBox                                                                 *
  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 <ilistbas.hpp>
  19. #include <icontrol.hpp>
  20. #include <irect.hpp>
  21.  
  22. class IString;
  23. class IResourceId;
  24. class IListBoxData;
  25.  
  26. #pragma pack(4)
  27.  
  28. class IListBox : public IBaseListBox {
  29. typedef IBaseListBox
  30.   Inherited;
  31.  
  32. public:
  33.  
  34. typedef IBaseListBox::Cursor
  35.   Cursor;
  36.  
  37. class Style;
  38.  
  39. /*------------------------- Constructors -------------------------------------*/
  40.   IListBox          ( unsigned             long id,
  41.                       IWindow*             parent,
  42.                       IWindow*             owner,
  43.                       const IRectangle&    initial = IRectangle  ( ),
  44.                       const Style&         style   = defaultStyle( ) );
  45.  
  46.   IListBox          ( unsigned long        id,
  47.                       IWindow*             parent );
  48.  
  49.   IListBox          ( const IWindowHandle& handle );
  50.  
  51. virtual
  52.   ~IListBox         ( );
  53.  
  54. /*------------------------- Styles -------------------------------------------*/
  55. INESTEDBITFLAGCLASSDEF3(Style, IListBox, IWindow, IControl, IBaseListBox);
  56.  
  57. static const Style
  58.   IC_IMPORTU classDefaultStyle;
  59.  
  60. static Style
  61.   defaultStyle      ( );
  62. static void
  63.   setDefaultStyle   ( const Style&        style );
  64.  
  65. /*------------------------ Remove and Replace Items --------------------------*/
  66. virtual IListBox
  67.  &removeAt          ( Cursor&             cursor ),
  68.  &removeAll         ( ),
  69.  &replaceAt         ( const char*         item,
  70.                       const Cursor&       cursor ),
  71.  &replaceAt         ( const IResourceId&  text,
  72.                       const Cursor&       cursor);
  73. virtual unsigned long
  74.   remove            ( unsigned long       index );
  75.  
  76.  
  77. /*------------------------ Add Items -----------------------------------------*/
  78. virtual unsigned long
  79.   add               ( unsigned long       index,
  80.                       const char*         text ),
  81.   add               ( unsigned long       index,
  82.                       const char* const * itemList,
  83.                       unsigned long       count = 1 ),
  84.   addAsFirst        ( const char*         text ),
  85.   addAsLast         ( const char*         text ),
  86.   addAscending      ( const char*         text ),
  87.   addDescending     ( const char*         text ),
  88.   add               ( unsigned long       index,
  89.                       const IResourceId&  item ),
  90.   addAsFirst        ( const IResourceId&  item ),
  91.   addAsLast         ( const IResourceId&  item ),
  92.   addAscending      ( const IResourceId&  item ),
  93.   addDescending     ( const IResourceId&  item );
  94.  
  95. virtual IListBox
  96.   &add              ( const char*         item,
  97.                       Cursor&             cursor ),
  98.   &add              ( const IResourceId&  text,
  99.                       Cursor&             cursor),
  100.   &addAsFirst       ( const char*         item,
  101.                       Cursor&             cursor),
  102.   &addAsLast        ( const char*         item,
  103.                       Cursor&             cursor),
  104.   &addAsNext        ( const char*         item,
  105.                       Cursor&             cursor ),
  106.   &addAsFirst       ( const IResourceId&  text,
  107.                       Cursor&             cursor ),
  108.   &addAsLast        ( const IResourceId&  text,
  109.                       Cursor&             cursor ),
  110.   &addAsNext        ( const IResourceId&  text,
  111.                       Cursor&             cursor);
  112.  
  113. /*------------------------- Notification Members -----------------------------*/
  114. static INotificationId const
  115.   IC_IMPORTU addId,
  116.   IC_IMPORTU removeId;
  117.  
  118. private:
  119. /*------------------------- Hidden Members -----------------------------------*/
  120.   IListBox          ( const IListBox&     listBox );
  121. IListBox
  122.  &operator=         ( const IListBox&     listBox );
  123.  
  124. /*------------------------- Private ------------------------------------------*/
  125. IListBoxData
  126.  *fListBoxData;
  127.  
  128. static Style
  129.   currentDefaultStyle;
  130.  
  131. friend class IBaseListBox::Cursor;
  132.  
  133. };  // IListBox
  134.  
  135.  
  136. INESTEDBITFLAGCLASSFUNCS(Style, IListBox);
  137.  
  138. #pragma pack()
  139.  
  140. #endif  /* _ILISTBOX_ */
  141.