2009-01-17 05:43:43 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/osx/slider.h
|
2009-01-17 05:43:43 -05:00
|
|
|
// Purpose: wxSlider class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SLIDER_H_
|
|
|
|
#define _WX_SLIDER_H_
|
|
|
|
|
2015-10-25 13:46:06 -04:00
|
|
|
#include "wx/compositewin.h"
|
2009-01-17 05:43:43 -05:00
|
|
|
#include "wx/stattext.h"
|
|
|
|
|
|
|
|
// Slider
|
2015-10-25 13:46:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxSlider: public wxCompositeWindow<wxSliderBase>
|
2009-01-17 05:43:43 -05:00
|
|
|
{
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxSlider);
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
wxSlider();
|
|
|
|
|
2015-10-25 13:20:32 -04:00
|
|
|
wxSlider(wxWindow *parent, wxWindowID id,
|
2009-01-17 05:43:43 -05:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxSlider();
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual int GetValue() const wxOVERRIDE;
|
|
|
|
virtual void SetValue(int) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
void SetRange(int minValue, int maxValue) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
int GetMin() const wxOVERRIDE { return m_rangeMin; }
|
|
|
|
int GetMax() const wxOVERRIDE { return m_rangeMax; }
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
void SetMin(int minValue) { SetRange(minValue, m_rangeMax); }
|
|
|
|
void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); }
|
|
|
|
|
|
|
|
// For trackbars only
|
2015-11-22 04:14:29 -05:00
|
|
|
int GetTickFreq() const wxOVERRIDE { return m_tickFreq; }
|
|
|
|
void SetPageSize(int pageSize) wxOVERRIDE;
|
|
|
|
int GetPageSize() const wxOVERRIDE;
|
|
|
|
void ClearSel() wxOVERRIDE;
|
|
|
|
void ClearTicks() wxOVERRIDE;
|
|
|
|
void SetLineSize(int lineSize) wxOVERRIDE;
|
|
|
|
int GetLineSize() const wxOVERRIDE;
|
|
|
|
int GetSelEnd() const wxOVERRIDE;
|
|
|
|
int GetSelStart() const wxOVERRIDE;
|
|
|
|
void SetSelection(int minPos, int maxPos) wxOVERRIDE;
|
|
|
|
void SetThumbLength(int len) wxOVERRIDE;
|
|
|
|
int GetThumbLength() const wxOVERRIDE;
|
|
|
|
void SetTick(int tickPos) wxOVERRIDE;
|
|
|
|
|
|
|
|
void Command(wxCommandEvent& event) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
// osx specific event handling common for all osx-ports
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual bool OSXHandleClicked( double timestampsec ) wxOVERRIDE;
|
|
|
|
virtual void TriggerScrollEvent( wxEventType scrollEvent ) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
protected:
|
2011-02-05 11:36:30 -05:00
|
|
|
// Platform-specific implementation of SetTickFreq
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual void DoSetTickFreq(int freq) wxOVERRIDE;
|
2011-02-05 11:36:30 -05:00
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
|
|
|
virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
// set min/max size of the slider
|
|
|
|
virtual void DoSetSizeHints( int minW, int minH,
|
|
|
|
int maxW, int maxH,
|
2015-11-22 04:14:29 -05:00
|
|
|
int incW, int incH) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
// Common processing to invert slider values based on wxSL_INVERSE
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual int ValueInvertOrNot(int value) const wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
wxStaticText* m_macMinimumStatic ;
|
|
|
|
wxStaticText* m_macMaximumStatic ;
|
|
|
|
wxStaticText* m_macValueStatic ;
|
|
|
|
|
|
|
|
int m_rangeMin;
|
|
|
|
int m_rangeMax;
|
|
|
|
int m_pageSize;
|
|
|
|
int m_lineSize;
|
|
|
|
int m_tickFreq;
|
|
|
|
private :
|
2015-10-25 13:46:06 -04:00
|
|
|
virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE
|
|
|
|
{
|
|
|
|
wxWindowList parts;
|
|
|
|
parts.push_back(m_macMinimumStatic);
|
|
|
|
parts.push_back(m_macMaximumStatic);
|
|
|
|
parts.push_back(m_macValueStatic);
|
|
|
|
return parts;
|
|
|
|
}
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2009-01-17 05:43:43 -05:00
|
|
|
};
|
|
|
|
|
2008-06-11 12:30:48 -04:00
|
|
|
#endif
|
2009-01-17 05:43:43 -05:00
|
|
|
// _WX_SLIDER_H_
|