1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: spinbutt.h
|
|
|
|
// Purpose: wxSpinButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SPINBUTT_H_
|
|
|
|
#define _WX_SPINBUTT_H_
|
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2002-02-05 16:34:33 +00:00
|
|
|
#pragma interface "spinbutt.h"
|
1998-09-18 10:19:10 +00:00
|
|
|
#endif
|
|
|
|
|
2002-07-28 13:33:29 +00:00
|
|
|
class WXDLLEXPORT wxArrowButton; // internal
|
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
|
1998-09-18 10:19:10 +00:00
|
|
|
{
|
1999-07-23 21:03:02 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
public:
|
2002-07-28 13:33:29 +00:00
|
|
|
wxSpinButton() : m_up( 0 ), m_down( 0 ), m_pos( 0 ) { }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
wxSpinButton(wxWindow *parent,
|
2002-02-05 16:34:33 +00:00
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_VERTICAL,
|
|
|
|
const wxString& name = "wxSpinButton")
|
2002-07-28 13:33:29 +00:00
|
|
|
: m_up( 0 ),
|
|
|
|
m_down( 0 ),
|
|
|
|
m_pos( 0 )
|
1999-07-23 21:03:02 +00:00
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
~wxSpinButton();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
bool Create(wxWindow *parent,
|
2002-02-05 16:34:33 +00:00
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_VERTICAL,
|
|
|
|
const wxString& name = "wxSpinButton");
|
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
// accessors
|
|
|
|
int GetValue() const;
|
|
|
|
int GetMin() const { return m_min; }
|
|
|
|
int GetMax() const { return m_max; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
// operations
|
|
|
|
void SetValue(int val);
|
|
|
|
void SetRange(int minVal, int maxVal);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-23 21:03:02 +00:00
|
|
|
// Implementation
|
2002-07-28 13:33:29 +00:00
|
|
|
virtual void Command(wxCommandEvent& event)
|
|
|
|
{ (void)ProcessCommand(event); };
|
1999-07-23 21:03:02 +00:00
|
|
|
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
|
|
|
virtual void ChangeBackgroundColour();
|
|
|
|
virtual void ChangeForegroundColour();
|
2002-07-28 13:33:29 +00: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 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 16:34:33 +00:00
|
|
|
// _WX_SPINBUTT_H_
|