1999-10-11 06:05:36 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: spinctrl.h
|
|
|
|
// Purpose: wxSpinCtrl class
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Robert Roebling
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKSPINCTRLH__
|
|
|
|
#define __GTKSPINCTRLH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1999-11-27 11:43:47 -05:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_SPINCTRL
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
//-----------------------------------------------------------------------------
|
1999-10-28 09:04:45 -04:00
|
|
|
// wxSpinCtrl
|
1999-10-11 06:05:36 -04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxSpinCtrl : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxSpinCtrl() {}
|
|
|
|
wxSpinCtrl(wxWindow *parent,
|
|
|
|
wxWindowID id = -1,
|
1999-10-28 09:04:45 -04:00
|
|
|
const wxString& value = wxEmptyString,
|
1999-10-11 06:05:36 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_ARROW_KEYS,
|
|
|
|
int min = 0, int max = 100, int initial = 0,
|
|
|
|
const wxString& name = _T("wxSpinCtrl"))
|
|
|
|
{
|
1999-10-28 09:04:45 -04:00
|
|
|
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
1999-10-11 06:05:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id = -1,
|
1999-10-28 09:04:45 -04:00
|
|
|
const wxString& value = wxEmptyString,
|
1999-10-11 06:05:36 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_ARROW_KEYS,
|
|
|
|
int min = 0, int max = 100, int initial = 0,
|
|
|
|
const wxString& name = _T("wxSpinCtrl"));
|
|
|
|
|
1999-10-28 09:04:45 -04:00
|
|
|
void SetValue(const wxString& text);
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
virtual int GetValue() const;
|
|
|
|
virtual void SetValue( int value );
|
|
|
|
virtual void SetRange( int minVal, int maxVal );
|
|
|
|
virtual int GetMin() const;
|
|
|
|
virtual int GetMax() const;
|
|
|
|
|
1999-10-28 09:04:45 -04:00
|
|
|
// implementation
|
1999-11-27 11:43:47 -05:00
|
|
|
// --------------
|
|
|
|
|
1999-10-29 13:20:44 -04:00
|
|
|
void OnChar( wxKeyEvent &event );
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
|
|
|
void ApplyWidgetStyle();
|
|
|
|
|
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
1999-10-29 13:20:44 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-10-11 06:05:36 -04:00
|
|
|
};
|
|
|
|
|
1999-11-27 11:43:47 -05:00
|
|
|
#endif
|
|
|
|
// wxUSE_SPINCTRL
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
#endif
|
|
|
|
// __GTKSPINCTRLH__
|