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
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxSlider(void);
|
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 );
|
|
|
|
}
|
|
|
|
~wxSlider(void);
|
|
|
|
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,
|
1998-08-14 10:07:38 +00:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr );
|
1998-05-20 14:01:55 +00:00
|
|
|
virtual int GetValue(void) const;
|
1998-07-04 15:17:59 +00:00
|
|
|
virtual void SetValue( int );
|
|
|
|
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
|
|
|
|
1998-09-07 12:29:07 +00:00
|
|
|
// implementation
|
|
|
|
|
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
1998-10-29 18:03:18 +00:00
|
|
|
void ApplyWidgetStyle();
|
1998-09-07 12:29:07 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif // __GTKSLIDERH__
|