OSDN Git Service

Handling key and mouse events in listctrl is improved
[molby/Molby.git] / wxSources / MySlider.h
1 /*
2  *  MySlider.h
3  *  Molby
4  *
5  *  Created by Toshi Nagata on 08/11/15.
6  *  Copyright 2008 Toshi Nagata. All rights reserved.
7  *
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation version 2 of the License.
11  
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  GNU General Public License for more details.
16  */
17
18 #ifndef __MySlider_h__
19 #define __MySlider_h__
20
21 #include "wx/tglbtn.h"
22 #include "wx/string.h"
23 #include "wx/slider.h"
24
25 extern const wxEventType MySliderEvent;
26
27 class MySlider: public wxToggleButton
28 {
29 public:
30         int m_direction;
31         int mouseStatus;  /*  0: mouseUp, 1: mouseDown, 2: dragging  */
32         wxPoint mouseDownPoint;
33         wxPoint mouseDragPoint;
34         
35     MySlider(wxWindow* parent, wxWindowID id, int direction, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("slider"));
36     void OnPaint(wxPaintEvent &event);
37     void OnMouseEvent(wxMouseEvent &event);
38         int GetMouseStatus() { return mouseStatus; }
39         float GetFloatValue();
40         void OnCaptureLost(wxMouseCaptureLostEvent &event);
41
42 private:
43     DECLARE_EVENT_TABLE()       
44 };
45
46 #endif /* __MySlider_h__ */