1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 20:59:19 +00:00
|
|
|
// Name: wx/gtk/slider.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
2003-03-17 10:34:04 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-09-14 04:26:33 +00:00
|
|
|
#ifndef _WX_GTK_SLIDER_H_
|
|
|
|
#define _WX_GTK_SLIDER_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 14:01:55 +00:00
|
|
|
// wxSlider
|
2001-06-26 20:59:19 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-11-27 16:43:47 +00:00
|
|
|
public:
|
2006-05-19 16:57:37 +00:00
|
|
|
wxSlider();
|
2001-06-26 20:59:19 +00:00
|
|
|
wxSlider(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
int value, int minValue, int maxValue,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSL_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr)
|
1998-08-14 10:07:38 +00:00
|
|
|
{
|
2001-06-26 20:59:19 +00:00
|
|
|
Create( parent, id, value, minValue, maxValue,
|
|
|
|
pos, size, style, validator, name );
|
1998-08-14 10:07:38 +00:00
|
|
|
}
|
2012-10-17 16:23:18 +00:00
|
|
|
~wxSlider();
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
int value, int minValue, int maxValue,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSL_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr);
|
|
|
|
|
|
|
|
// implement the base class pure virtuals
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual int GetValue() const wxOVERRIDE;
|
|
|
|
virtual void SetValue(int value) wxOVERRIDE;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetRange(int minValue, int maxValue) wxOVERRIDE;
|
|
|
|
virtual int GetMin() const wxOVERRIDE;
|
|
|
|
virtual int GetMax() const wxOVERRIDE;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetLineSize(int lineSize) wxOVERRIDE;
|
|
|
|
virtual void SetPageSize(int pageSize) wxOVERRIDE;
|
|
|
|
virtual int GetLineSize() const wxOVERRIDE;
|
|
|
|
virtual int GetPageSize() const wxOVERRIDE;
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetThumbLength(int lenPixels) wxOVERRIDE;
|
|
|
|
virtual int GetThumbLength() const wxOVERRIDE;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2004-05-06 17:26:25 +00:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
2007-10-23 18:16:06 +00:00
|
|
|
|
1999-11-27 20:28:25 +00:00
|
|
|
// implementation
|
2009-11-14 10:58:31 +00:00
|
|
|
void GTKDisableEvents();
|
|
|
|
void GTKEnableEvents();
|
|
|
|
bool GTKEventsDisabled() const;
|
2010-09-30 11:44:45 +00:00
|
|
|
|
2006-05-19 16:57:37 +00:00
|
|
|
double m_pos;
|
|
|
|
int m_scrollEventType;
|
|
|
|
bool m_needThumbRelease;
|
2009-11-14 10:58:31 +00:00
|
|
|
GtkWidget *m_scale;
|
1999-11-27 20:28:25 +00:00
|
|
|
|
2006-08-25 12:59:28 +00:00
|
|
|
protected:
|
2009-11-14 10:58:31 +00:00
|
|
|
GtkWidget *m_minLabel,*m_maxLabel;
|
|
|
|
bool m_blockScrollEvent;
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
2006-08-25 12:59:28 +00:00
|
|
|
|
2007-10-23 18:16:06 +00:00
|
|
|
// set the slider value unconditionally
|
|
|
|
void GTKSetValue(int value);
|
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxSlider);
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2007-09-14 04:26:33 +00:00
|
|
|
#endif // _WX_GTK_SLIDER_H_
|