1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: slider.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
1998-05-20 10:01:55 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKSLIDERH__
|
|
|
|
#define __GTKSLIDERH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-14 19:04:05 -04:00
|
|
|
|
|
|
|
#if wxUSE_SLIDER
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxSlider;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern const char *wxSliderNameStr;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxSlider
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxSlider: public wxControl
|
|
|
|
{
|
1999-11-27 11:43:47 -05:00
|
|
|
public:
|
|
|
|
wxSlider() {}
|
1998-08-14 06:07:38 -04:00
|
|
|
inline wxSlider( wxWindow *parent, wxWindowID id,
|
1998-07-04 11:17:59 -04:00
|
|
|
int value, int minValue, int maxValue,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxSL_HORIZONTAL,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr )
|
|
|
|
{
|
|
|
|
Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name );
|
|
|
|
}
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
1998-07-04 11:17:59 -04:00
|
|
|
int value, int minValue, int maxValue,
|
1998-05-20 10:01:55 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxSL_HORIZONTAL,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr );
|
1999-11-27 11:43:47 -05:00
|
|
|
virtual int GetValue() const;
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual void SetValue( int );
|
|
|
|
void SetRange( int minValue, int maxValue );
|
1999-11-27 11:43:47 -05:00
|
|
|
int GetMin() const;
|
|
|
|
int GetMax() const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetTickFreq( int n, int pos );
|
1999-11-27 11:43:47 -05:00
|
|
|
int GetTickFreq() const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetPageSize( int pageSize );
|
1999-11-27 11:43:47 -05:00
|
|
|
int GetPageSize() const;
|
|
|
|
void ClearSel();
|
|
|
|
void ClearTicks();
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetLineSize( int lineSize );
|
1999-11-27 11:43:47 -05:00
|
|
|
int GetLineSize() const;
|
|
|
|
int GetSelEnd() const;
|
|
|
|
int GetSelStart() const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection( int minPos, int maxPos );
|
|
|
|
void SetThumbLength( int len );
|
1999-11-27 11:43:47 -05:00
|
|
|
int GetThumbLength() const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetTick( int tickPos );
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-11-27 11:43:47 -05:00
|
|
|
// implementation
|
|
|
|
// --------------
|
1998-09-07 08:29:07 -04:00
|
|
|
|
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
1998-10-29 13:03:18 -05:00
|
|
|
void ApplyWidgetStyle();
|
1998-09-07 08:29:07 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
|
|
|
|
1999-11-27 11:43:47 -05:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __GTKSLIDERH__
|