1998-09-18 06:19:10 -04: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 10:56:36 -04:00
|
|
|
// Licence: wxWidgets licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SPINBUTT_H_
|
|
|
|
#define _WX_SPINBUTT_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2002-02-05 11:34:33 -05:00
|
|
|
#pragma interface "spinbutt.h"
|
1998-09-18 06:19:10 -04:00
|
|
|
#endif
|
|
|
|
|
2002-07-28 09:33:29 -04:00
|
|
|
class WXDLLEXPORT wxArrowButton; // internal
|
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
1999-07-23 17:03:02 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
2002-02-05 11:34:33 -05: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 ) { }
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
wxSpinButton(wxWindow *parent,
|
2002-02-05 11:34:33 -05:00
|
|
|
wxWindowID id = -1,
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
~wxSpinButton();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
bool Create(wxWindow *parent,
|
2002-02-05 11:34:33 -05:00
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_VERTICAL,
|
|
|
|
const wxString& name = "wxSpinButton");
|
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
// accessors
|
|
|
|
int GetValue() const;
|
|
|
|
int GetMin() const { return m_min; }
|
|
|
|
int GetMax() const { return m_max; }
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
// operations
|
|
|
|
void SetValue(int val);
|
|
|
|
void SetRange(int minVal, int maxVal);
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
// Implementation
|
2002-07-28 09:33:29 -04:00
|
|
|
virtual void Command(wxCommandEvent& event)
|
|
|
|
{ (void)ProcessCommand(event); };
|
1999-07-23 17:03:02 -04:00
|
|
|
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
|
|
|
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_
|