1998-05-20 10:01:55 -04: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-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 );
|
|
|
|
}
|
|
|
|
~wxSlider(void);
|
|
|
|
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 );
|
1998-05-20 10:01:55 -04:00
|
|
|
virtual int GetValue(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual void SetValue( int );
|
1998-05-20 10:01:55 -04:00
|
|
|
void GetSize( int *x, int *y ) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
|
1998-05-20 10:01:55 -04:00
|
|
|
void GetPosition( int *x, int *y ) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetRange( int minValue, int maxValue );
|
1998-05-20 10:01:55 -04:00
|
|
|
int GetMin(void) const;
|
|
|
|
int GetMax(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetTickFreq( int n, int pos );
|
1998-05-20 10:01:55 -04:00
|
|
|
int GetTickFreq(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetPageSize( int pageSize );
|
1998-05-20 10:01:55 -04:00
|
|
|
int GetPageSize(void) const;
|
|
|
|
void ClearSel(void);
|
|
|
|
void ClearTicks(void);
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetLineSize( int lineSize );
|
1998-05-20 10:01:55 -04:00
|
|
|
int GetLineSize(void) const;
|
|
|
|
int GetSelEnd(void) const;
|
|
|
|
int GetSelStart(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection( int minPos, int maxPos );
|
|
|
|
void SetThumbLength( int len );
|
1998-05-20 10:01:55 -04:00
|
|
|
int GetThumbLength(void) const;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetTick( int tickPos );
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-09-07 08:29:07 -04:00
|
|
|
// implementation
|
|
|
|
|
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKSLIDERH__
|