1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: slider.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Created: 01/02/97
|
|
|
|
// Id:
|
|
|
|
// 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"
|
|
|
|
#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
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxSlider(void);
|
1998-07-04 15:17:59 +00:00
|
|
|
wxSlider( wxWindow *parent, wxWindowID id,
|
|
|
|
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-05-20 14:01:55 +00:00
|
|
|
/* const wxValidator& validator = wxDefaultValidator, */
|
|
|
|
const wxString& name = wxSliderNameStr);
|
|
|
|
~wxSlider(void);
|
1998-07-04 15:17:59 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
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-05-20 14:01:55 +00:00
|
|
|
/* const wxValidator& validator = wxDefaultValidator, */
|
|
|
|
const wxString& name = wxSliderNameStr);
|
|
|
|
virtual int GetValue(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
virtual void SetValue( int );
|
1998-05-20 14:01:55 +00:00
|
|
|
void GetSize( int *x, int *y ) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
|
1998-05-20 14:01:55 +00:00
|
|
|
void GetPosition( int *x, int *y ) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetRange( int minValue, int maxValue );
|
1998-05-20 14:01:55 +00:00
|
|
|
int GetMin(void) const;
|
|
|
|
int GetMax(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetTickFreq( int n, int pos );
|
1998-05-20 14:01:55 +00:00
|
|
|
int GetTickFreq(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetPageSize( int pageSize );
|
1998-05-20 14:01:55 +00:00
|
|
|
int GetPageSize(void) const;
|
|
|
|
void ClearSel(void);
|
|
|
|
void ClearTicks(void);
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetLineSize( int lineSize );
|
1998-05-20 14:01:55 +00:00
|
|
|
int GetLineSize(void) const;
|
|
|
|
int GetSelEnd(void) const;
|
|
|
|
int GetSelStart(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetSelection( int minPos, int maxPos );
|
|
|
|
void SetThumbLength( int len );
|
1998-05-20 14:01:55 +00:00
|
|
|
int GetThumbLength(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
void SetTick( int tickPos );
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKSLIDERH__
|