1999-10-11 10:05:36 +00: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 16:43:47 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_SPINCTRL
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
1999-10-28 13:04:45 +00:00
|
|
|
// wxSpinCtrl
|
1999-10-11 10:05:36 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxSpinCtrl : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxSpinCtrl() {}
|
|
|
|
wxSpinCtrl(wxWindow *parent,
|
|
|
|
wxWindowID id = -1,
|
1999-10-28 13:04:45 +00:00
|
|
|
const wxString& value = wxEmptyString,
|
1999-10-11 10:05:36 +00: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 13:04:45 +00:00
|
|
|
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
1999-10-11 10:05:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id = -1,
|
1999-10-28 13:04:45 +00:00
|
|
|
const wxString& value = wxEmptyString,
|
1999-10-11 10:05:36 +00: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 13:04:45 +00:00
|
|
|
void SetValue(const wxString& text);
|
|
|
|
|
1999-10-11 10:05:36 +00: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 13:04:45 +00:00
|
|
|
// implementation
|
1999-11-27 16:43:47 +00:00
|
|
|
// --------------
|
|
|
|
|
1999-10-29 17:20:44 +00:00
|
|
|
void OnChar( wxKeyEvent &event );
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
|
|
|
void ApplyWidgetStyle();
|
2000-01-02 16:25:28 +00:00
|
|
|
void GtkDisableEvents();
|
|
|
|
void GtkEnableEvents();
|
1999-10-11 10:05:36 +00:00
|
|
|
|
|
|
|
GtkAdjustment *m_adjust;
|
|
|
|
float m_oldPos;
|
|
|
|
|
1999-12-29 19:18:01 +00:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
1999-10-29 17:20:44 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-10-11 10:05:36 +00:00
|
|
|
};
|
|
|
|
|
1999-11-27 16:43:47 +00:00
|
|
|
#endif
|
|
|
|
// wxUSE_SPINCTRL
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
#endif
|
|
|
|
// __GTKSPINCTRLH__
|