home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OListBox.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  4KB  |  120 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OListBox.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30. // $Header: W:/Projects/OCL/Include/rcs/OListBox.hpp 1.50 1996/08/11 23:47:19 B.STEIN Release $
  31.  
  32. #ifndef OLISTBOX_INCLUDED
  33.   #define OLISTBOX_INCLUDED
  34.  
  35.  
  36. #ifndef OFRAME_INCLUDED
  37.   #include <OFrame.hpp>
  38. #endif
  39.  
  40. #ifndef OSTRING_INCLUDED
  41.   #include <OString.hpp>
  42. #endif
  43.  
  44.  
  45. // Note - the following styles are available
  46.  
  47. // LS_MULTIPLESEL             0x00000001L
  48. // LS_OWNERDRAW               0x00000002L
  49. // LS_NOADJUSTPOS             0x00000004L
  50. // LS_HORZSCROLL              0x00000008L
  51. // LS_EXTENDEDSEL             0x00000010L
  52.  
  53.  
  54. typedef class OListBox *pOListBox;
  55.  
  56.  
  57. class __CPP_EXPORT__ OListBox
  58.   : public OWindow
  59. {
  60.  protected:
  61.     BOOL                   autoScroll;
  62.  
  63.     void auto_scroll       ();
  64.  
  65.  public:
  66.  
  67.     OListBox               (const ULONG id,
  68.                             const HWND Parent,
  69.                             const ULONG Style = LS_NOADJUSTPOS | LS_EXTENDEDSEL,
  70.                             BOOL autoScrolling = FALSE);
  71.  
  72.     OListBox               (const ULONG id,
  73.                             const OFrame& Parent,
  74.                             const ULONG Style = LS_NOADJUSTPOS | LS_EXTENDEDSEL,
  75.                             BOOL autoScrolling = FALSE);
  76.  
  77.     OListBox               (const ULONG id,
  78.                             const pOFrame Parent,
  79.                             const ULONG Style = LS_NOADJUSTPOS | LS_EXTENDEDSEL,
  80.                             BOOL autoScrolling = FALSE);
  81.  
  82.     virtual
  83.        ~OListBox           ();
  84.  
  85.     virtual
  86.        PSZ isOfType        () const; 
  87.  
  88.     OListBox
  89.        &createListBox       (const ULONG x,  const ULONG y,
  90.                             const ULONG cx, const ULONG cy),
  91.  
  92.        &setAutoScroll       (BOOL autoScrolling = TRUE);
  93.  
  94.     BOOL
  95.        deleteAll           (),
  96.        selectItem          (const ULONG itemIndex, const BOOL state = TRUE),
  97.        setItemHandle       (const ULONG itemIndex, const ULONG handle),
  98.        setItemHeight       (const ULONG newHeight),
  99.        setItemText         (const ULONG itemIndex, PCSZ text),
  100.        setToTop            (const ULONG itemIndex);
  101.  
  102.     ULONG
  103.        deleteItem          (const ULONG itemIndex),
  104.        insertItem          (PCSZ  text, const ULONG itemIndex = LIT_END),
  105.        queryItemCount      (),
  106.        queryItemHandle     (const ULONG itemIndex),
  107.        queryItemText       (OString& Buffer, const ULONG itemIndex),
  108.        queryItemTextLength (const ULONG itemIndex),
  109.        querySelection      (const ULONG itemStart = LIT_FIRST),
  110.        queryTopItem        (),
  111.        searchString        (PCSZ  text,
  112.                             const ULONG itemStart = LIT_FIRST, 
  113.                             const ULONG command = LSS_CASESENSITIVE);
  114. };
  115.  
  116.  
  117. #endif // OLISTBOX_INCLUDED
  118.  
  119. // end of source
  120.