1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/spinbutt.h
|
1998-09-18 06:19:10 -04:00
|
|
|
// Purpose: wxSpinButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SPINBUTT_H_
|
|
|
|
#define _WX_SPINBUTT_H_
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxArrowButton; // internal
|
2002-07-28 09:33:29 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxSpinButton);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
public:
|
2002-07-28 09:33:29 -04:00
|
|
|
wxSpinButton() : m_up( 0 ), m_down( 0 ), m_pos( 0 ) { }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
wxSpinButton(wxWindow *parent,
|
2006-07-25 10:31:55 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
2002-02-05 11:34:33 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_VERTICAL,
|
|
|
|
const wxString& name = "wxSpinButton")
|
2002-07-28 09:33:29 -04:00
|
|
|
: m_up( 0 ),
|
|
|
|
m_down( 0 ),
|
|
|
|
m_pos( 0 )
|
1999-07-23 17:03:02 -04:00
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxSpinButton();
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
bool Create(wxWindow *parent,
|
2006-07-25 10:31:55 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
2002-02-05 11:34:33 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_VERTICAL,
|
|
|
|
const wxString& name = "wxSpinButton");
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
// accessors
|
|
|
|
int GetValue() const;
|
|
|
|
int GetMin() const { return m_min; }
|
|
|
|
int GetMax() const { return m_max; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
// operations
|
|
|
|
void SetValue(int val);
|
|
|
|
void SetRange(int minVal, int maxVal);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
// Implementation
|
2002-07-28 09:33:29 -04:00
|
|
|
virtual void Command(wxCommandEvent& event)
|
2011-12-29 09:42:13 -05:00
|
|
|
{ (void)ProcessCommand(event); }
|
2005-02-06 12:38:33 -05:00
|
|
|
virtual void ChangeFont(bool keepOriginalSize = true);
|
1999-07-23 17:03:02 -04:00
|
|
|
virtual void ChangeBackgroundColour();
|
|
|
|
virtual void ChangeForegroundColour();
|
2002-07-28 09:33:29 -04:00
|
|
|
public:
|
|
|
|
// implementation detail
|
|
|
|
void Increment( int delta );
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void DoSetSize(int x, int y, int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
|
|
|
wxArrowButton* m_up;
|
|
|
|
wxArrowButton* m_down;
|
|
|
|
int m_pos;
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_SPINBUTT_H_
|