--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/range.h
+// Purpose: Range Value Class
+// Author: Stefan Csomor
+// Modified by:
+// Created: 2011-01-07
+// RCS-ID: $Id$
+// Copyright: (c) 2011 Stefan Csomor
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_RANGE_H_
+#define _WX_RANGE_H_
+
+#include "wx/defs.h"
+
+class wxRange
+{
+public :
+ wxRange(): m_minVal(0), m_maxVal(0) {}
+ wxRange( int minVal, int maxVal) : m_minVal(minVal), m_maxVal(maxVal) {}
+ int GetMin() const { return m_minVal; }
+ int GetMax() const { return m_maxVal; }
+private :
+ int m_minVal;
+ int m_maxVal;
+};
+
+#endif // _WX_RANGE_H_
#define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, NULL)
-#define wxIMPLEMENT_CLASS(name, basename) \
- wxIMPLEMENT_ABSTRACT_CLASS(name, basename)
-
-#define wxIMPLEMENT_CLASS2(name, basename1, basename2) \
- IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2)
-
// -----------------------------------
// XTI-compatible macros
// -----------------------------------
#include "wx/control.h"
#include "wx/event.h"
+#include "wx/range.h"
#define wxSPIN_BUTTON_NAME wxT("wxSpinButton")
virtual int GetValue() const = 0;
virtual int GetMin() const { return m_min; }
virtual int GetMax() const { return m_max; }
+ wxRange GetRange() const { return wxRange( GetMin(), GetMax() );}
// operations
virtual void SetValue(int val) = 0;
m_min = minVal;
m_max = maxVal;
}
+ void SetRange( const wxRange& range) { SetRange( range.GetMin(), range.GetMax()); }
// is this spin button vertically oriented?
bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; }