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

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // (c) 1994 Matthias Stübner
  5. // (c) Benjamin Stein 1994
  6. // OSPINBTN.hpp
  7.  
  8. /*
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that the following conditions
  11.  * are met:
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  15.  *    endorse or promote products derived from this software
  16.  *    without specific prior written permission.
  17.  * 3. See OCL.INF for a detailed copyright notice.
  18.  *
  19.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  20.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  23.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29.  * SUCH DAMAGE.
  30.  */
  31.  
  32. // $Header: W:/Projects/OCL/Include/rcs/OSpinBtn.hpp 1.50 1996/08/11 23:47:30 B.STEIN Release $
  33.  
  34. #ifndef OSPINBTN_INCLUDED
  35.   #define OSPINBTN_INCLUDED
  36.  
  37.  
  38. #ifndef OFRAME_INCLUDED
  39.   #include <OFrame.hpp>
  40. #endif
  41.  
  42.  
  43. /* Mögliche Styles für einen Spinbutton sind:
  44.  
  45. SPBS_MASTER         -   spin button with arrows
  46. SPBS_SERVANT        -   spin button without arrows
  47.  
  48. SPBS_ALLCHARACTERS  -   all characteralle
  49. SPBS_NUMERICONLY    -   only numbers
  50. SPBS_READONLY       -   read only
  51.  
  52. SPBS_JUSTLEFT       -   content is left justified
  53. SPBS_JUSTRIGHT      -   content is right justified
  54. SPBS_JUSTCENTER     -   content is centered
  55. SPBS_NOBORDER       -   without borders
  56.  
  57. SPBS_FASTSPIN       -   fast spin
  58. SPBS_PADWITHZERO    -   pad with zeros
  59. */
  60.  
  61.  
  62. typedef class OSpinBtn *pOSpinBtn;
  63.  
  64. class __CPP_EXPORT__ OSpinBtn
  65.   : public OWindow
  66. {
  67.  public:
  68.  
  69.     OSpinBtn           (const ULONG ID,
  70.                         const HWND  Parent,  // becomes parent and owner of the slider
  71.                         const ULONG Style);
  72.  
  73.     OSpinBtn           (const ULONG id,
  74.                         const OFrame& Parent, 
  75.                         const ULONG Style);
  76.  
  77.     OSpinBtn           (const ULONG id,
  78.                         const pOFrame Parent, 
  79.                         const ULONG Style);
  80.  
  81.     virtual
  82.        ~OSpinBtn       ();
  83.  
  84.     virtual
  85.        PSZ isOfType    () const;
  86.   
  87.     BOOL
  88.        createSpinBtn   (const SHORT x,  const SHORT y,
  89.                         const SHORT cx, const SHORT cy),
  90.        setArray        (PSZ array, ULONG num),
  91.        setCurrent      (LONG index),
  92.        setLimits       (LONG upper, LONG lower),
  93.        setMaster       (HWND master),
  94.        setTextLimit    (USHORT length),
  95.        overrideLimits  (LONG upper, LONG lower),
  96.        incSpin         (ULONG delta = 1),
  97.        decSpin         (ULONG delta = 1),
  98.        getLimits       (LONG *upper, LONG *lower),
  99.        getCurrent      (PVOID addr, USHORT size, USHORT control = SPBQ_UPDATEIFVALID),
  100.        jumptoEnd       (),
  101.        jumptoStart     ();
  102. };
  103.  
  104.  
  105. #endif // OSPINBTN_INCLUDED
  106.