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

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // (c) 1994 B. Stein
  5.  
  6.  
  7. /*
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  14.  *    endorse or promote products derived from this software
  15.  *    without specific prior written permission.
  16.  * 3. See OCL.INF for a detailed copyright notice.
  17.  *
  18.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  19.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28.  * SUCH DAMAGE.
  29.  */
  30.  
  31.  
  32. // $Header: W:/Projects/OCL/INCLUDE/rcs/OCircSlider.hpp 1.1 1996/08/12 00:01:12 B.STEIN Release $
  33.  
  34. #ifndef OCIRCSLIDER_INCLUDED
  35.   #define OCIRCSLIDER_INCLUDED
  36.  
  37.  
  38. #ifndef OFRAME_INCLUDED
  39.   #include <OFrame.hpp>
  40. #endif
  41.  
  42.  
  43. extern "C"
  44. {
  45.  BOOL EXPENTRY WinRegisterCircularSlider(VOID);
  46. }                                 // requires SW.DLL from MMPM/2 :-(
  47.  
  48.  
  49. #ifndef INCL_WINCIRCULARSLIDER    // this will be defined in the new Toolkit in pmstddlg.h
  50.                                   // do not define the stuff more than once
  51.  
  52.  #define WC_CIRCULARSLIDER   ((PSZ)0xffff0041L)
  53.  
  54.  typedef struct _CSBITMAPDATA
  55.   {
  56.    HBITMAP hbmLeftUp;
  57.    HBITMAP hbmLeftDown;
  58.    HBITMAP hbmRightUp;
  59.    HBITMAP hbmRightDown;
  60.   } CSBITMAPDATA;
  61.   typedef CSBITMAPDATA *PCSBITMAPDATA;
  62.  
  63.   // Messages
  64.  
  65.  #define CSM_QUERYRANGE      0x053D       // mp1: PSHORT pLow  mp2: PSHORT pHigh  
  66.  #define CSM_SETRANGE        0x053E       // mp1: SHORT  Low   mp2: SHORT  High   
  67.  #define CSM_QUERYVALUE      0x053F       // mp1: PSHORT pValue  mp2: NULL  
  68.  #define CSM_SETVALUE        0x0540       // mp1: SHORT  Value   mp2: NULL  
  69.  #define CSM_QUERYRADIUS     0x0541       // mp1: PUSHORT uRadius  
  70.  #define CSM_SETINCREMENT    0x0542       // mp1: USHORT  ButtonIncr  mp2: USHORT TickIncr  
  71.  #define CSM_QUERYINCREMENT  0x0543       // mp1: PUSHORT pButtonIncr mp2: PUSHORT pTickIncr  
  72.  #define CSM_SETBITMAPDATA   0x0544       // mp1: PDIALBITMAPDATA  
  73.  
  74.  #define CSN_SETFOCUS        0x0548       // mp2: BOOL fSetFocus  
  75.  #define CSN_CHANGED         0x0549       // mp2: SHORT Value  
  76.  #define CSN_TRACKING        0x054A       // mp2: SHORT Value  
  77.  #define CSN_QUERYBACKGROUNDCOLOR 0x054B  // mp2: NULL   return: CLR_  
  78.  
  79.  #define WS_NOBUTTON        0x1           // Style bits  
  80.  #define WS_NOTEXT          0x2
  81.  #define WS_NONUMBER        0x4
  82.  #define WS_POINTSELECT     0x8
  83.  #define WS_360            0x10
  84.  #define WS_MIDPOINT       0x20
  85.  
  86.  #define CSS_NOBUTTON       WS_NOBUTTON   // Style bits  
  87.  #define CSS_NOTEXT         WS_NOTEXT
  88.  #define CSS_NONUMBER       WS_NONUMBER
  89.  #define CSS_POINTSELECT    WS_POINTSELECT
  90.  #define CSS_360            WS_360
  91.  #define CSS_MIDPOINT       WS_MIDPOINT
  92.  
  93.  #define CSS_PROPORTIONALTICKS  0x40
  94.  
  95. #endif // !INCL_WINCIRCULARSLIDER
  96.  
  97.  
  98. // Class definition
  99.  
  100.  
  101. typedef class OCircSlider *pOCircSlider;
  102.  
  103.  
  104. class __CPP_EXPORT__ OCircSlider
  105.   : public OWindow
  106. {
  107.  protected:
  108.     CSBITMAPDATA          ctlData;
  109.     ULONG                 Scale;
  110.     ULONG                 Space;
  111.  
  112.  public:
  113.  
  114. // ctors
  115.     OCircSlider           (const ULONG ID,
  116.                            const HWND  Parent,
  117.                            const ULONG scale, 
  118.                            const ULONG space,
  119.                            const ULONG Style);
  120.  
  121.     OCircSlider           (const ULONG id,
  122.                            const OFrame& Parent,
  123.                            const ULONG scale, 
  124.                            const ULONG space,
  125.                            const ULONG Style);
  126.  
  127.     OCircSlider           (const ULONG id,
  128.                            const pOFrame Parent,
  129.                            const ULONG scale, 
  130.                            const ULONG space,
  131.                            const ULONG Style);
  132.  
  133.     virtual
  134.        ~OCircSlider       ();
  135.  
  136.     virtual
  137.        PSZ isOfType       () const; 
  138.  
  139.     OCircSlider&
  140.        createCircSlider   (const SHORT x  = 0,
  141.                            const SHORT y  = 0,
  142.                            const SHORT cx = 0,
  143.                            const SHORT cy = 0);
  144.  
  145. };
  146.  
  147.  
  148. #endif // OCIRCSLIDER_INCLUDED
  149.