1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: slider.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
1998-05-20 14:01:55 +00: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 23:04:05 +00:00
|
|
|
|
|
|
|
#if wxUSE_SLIDER
|
|
|
|
|
1998-05-20 14:01:55 +00: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 16:43:47 +00:00
|
|
|
public:
|
1999-11-28 17:17:24 +00:00
|
|
|
wxSlider() {}
|
1998-08-14 10:07:38 +00:00
|
|
|
inline wxSlider( wxWindow *parent, wxWindowID id,
|
1998-07-04 15:17:59 +00:00
|
|
|
int value, int minValue, int maxValue,
|
1998-05-20 14:01:55 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-07-04 15:17:59 +00:00
|
|
|
long style = wxSL_HORIZONTAL,
|
1998-08-14 10:07:38 +00: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 15:17:59 +00:00
|
|
|
int value, int minValue, int maxValue,
|
1998-05-20 14:01:55 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-07-04 15:17:59 +00:00
|
|
|
long style = wxSL_HORIZONTAL,
|
1999-11-27 20:28:25 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
1998-08-14 10:07:38 +00:00
|
|
|
const wxString& name = wxSliderNameStr );
|
1999-11-27 16:43:47 +00:00
|
|
|
virtual int GetValue() const;
|
1998-07-04 15:17:59 +00:00
|
|
|
virtual void SetValue( int );
|
|
|
|
void SetRange( int minValue, int maxValue );
|
1999-11-27 16:43:47 +00:00
|
|
|
int GetMin() const;
|
|
|
|
int GetMax() const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetTickFreq( int n, int pos );
|
1999-11-27 16:43:47 +00:00
|
|
|
int GetTickFreq() const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetPageSize( int pageSize );
|
1999-11-27 16:43:47 +00:00
|
|
|
int GetPageSize() const;
|
|
|
|
void ClearSel();
|
|
|
|
void ClearTicks();
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetLineSize( int lineSize );
|
1999-11-27 16:43:47 +00:00
|
|
|
int GetLineSize() const;
|
|
|
|
int GetSelEnd() const;
|
|
|
|
int GetSelStart() const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetSelection( int minPos, int maxPos );
|
|
|
|
void SetThumbLength( int len );
|
1999-11-27 16:43:47 +00:00
|
|
|
int GetThumbLength() const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetTick( int tickPos );
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-11-27 20:28:25 +00:00
|
|
|
// implementation
|
1999-11-27 16:43:47 +00:00
|
|
|
// --------------
|
1999-11-27 20:28:25 +00:00
|
|
|
|
1998-09-07 12:29:07 +00:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
1998-10-29 18:03:18 +00:00
|
|
|
void ApplyWidgetStyle();
|
1999-11-27 20:28:25 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
1999-11-27 20:28:25 +00:00
|
|
|
|
1999-11-27 16:43:47 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif // __GTKSLIDERH__
|