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
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-10-11 06:05:36 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-30 01:55:56 -04:00
|
|
|
#ifndef _WX_GTK_SPINCTRL_H_
|
|
|
|
#define _WX_GTK_SPINCTRL_H_
|
1999-11-27 11:43:47 -05:00
|
|
|
|
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
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxControl
|
1999-10-11 06:05:36 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-05-18 13:04:16 -04:00
|
|
|
wxSpinCtrl();
|
1999-10-11 06:05:36 -04:00
|
|
|
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);
|
2004-01-22 10:20:34 -05:00
|
|
|
void SetSelection(long from, long to);
|
1999-10-28 09:04:45 -04:00
|
|
|
|
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;
|
|
|
|
|
2004-05-06 13:26:25 -04:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
1999-10-28 09:04:45 -04:00
|
|
|
// implementation
|
1999-10-29 13:20:44 -04:00
|
|
|
void OnChar( wxKeyEvent &event );
|
|
|
|
|
2000-01-02 11:25:28 -05:00
|
|
|
void GtkDisableEvents();
|
|
|
|
void GtkEnableEvents();
|
1999-10-11 06:05:36 -04:00
|
|
|
|
2006-05-18 13:04:16 -04:00
|
|
|
int m_pos;
|
1999-10-11 06:05:36 -04:00
|
|
|
|
1999-12-29 14:18:01 -05:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
2006-08-25 08:59:28 -04:00
|
|
|
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
1999-12-29 14:18:01 -05:00
|
|
|
|
2004-05-06 13:26:25 -04:00
|
|
|
// Widgets that use the style->base colour for the BG colour should
|
|
|
|
// override this and return true.
|
|
|
|
virtual bool UseGTKStyleBase() const { return true; }
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
1999-10-29 13:20:44 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-10-11 06:05:36 -04:00
|
|
|
};
|
|
|
|
|
2006-08-30 01:55:56 -04:00
|
|
|
#endif // _WX_GTK_SPINCTRL_H_
|