summaryrefslogtreecommitdiff
path: root/app/fvwm/extras/FvwmConfig/WinSlider.h
blob: 94ede90ecf4fb5f6d09be754341b0917d2062e62 (plain)
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
#ifndef winslider_h
#define winslider_h

#include <X11/Xlib.h>
#include "WinBase.h"

class WinSlider: public WinBase
{
 public:
  float min_value;
  float max_value;
  float current_value;
  
  void (*MotionAction)(float new_location, WinSlider *which);

  WinSlider(WinBase *Parent, int w, int h, int x, int y,
	    float min_val=0, float max_val=100, 
	    float init_val=50);
  ~WinSlider();

  void SetMinValue(float new_val);
  void SetMaxValue(float new_val);
  void SetCurrentValue(float new_val);
  void UpdatePosition(int newx, int newy);
  void SetMotionAction(void (*NewMotionAction)(float new_location,
					       WinSlider *which));
  void DrawCallback(XEvent *event = NULL);
  void BPressCallback(XEvent *event = NULL);
  void BReleaseCallback(XEvent *event = NULL);
  void MotionCallback(XEvent *event = NULL);
};

#endif