File: ASlider.h

package info (click to toggle)
audacity 0.98-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,896 kB
  • ctags: 4,089
  • sloc: cpp: 26,099; ansic: 4,961; sh: 2,465; makefile: 156; perl: 23
file content (65 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**********************************************************************

  Audacity: A Digital Audio Editor

  ASlider.h

  Dominic Mazzoni

  This class is a custom slider (currently used just for the volume
  control).  It is not very customizable in the sense that the
  background image must be exactly the size you want it, but it does
  allow for a slicker look and feel by allowing you to use images
  for the slider background and the thumb.

**********************************************************************/

#ifndef __AUDACITY_SLIDER__
#define __AUDACITY_SLIDER__

#include <wx/window.h>

class wxBitmap;

class ASlider:public wxWindow {
 public:

   ASlider(wxWindow * parent, wxWindowID id,
           const wxPoint & pos,
           const wxSize & size,
           char **sliderXPM, char **thumbXPM, int max);

    virtual ~ ASlider();

   virtual int Get();
   virtual void Set(int value);

   virtual void OnPaint(wxPaintEvent & event);
   virtual void OnMouseEvent(wxMouseEvent & event);

 private:

   int mWidth;
   int mHeight;

   int mThumbWidth;
   int mThumbHeight;

   int mValue;
   int mMax;

   int mInitialX;
   int mInitialY;
   int mInitialPos;

   bool mIsDragging;

   wxBitmap *mBitmap;
   wxBitmap *mThumbBitmap;

 public:

    DECLARE_EVENT_TABLE()
};

#endif