ciderpress/util/MySpinCtrl.h

50 lines
1.4 KiB
C
Raw Normal View History

2007-03-27 17:47:10 +00:00
/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* Replacement spin control with extended range. Requires auto-buddy.
*
* This is based on code originally written by Definitive Solutions, Inc.
* It was rewritten because their code was miserable.
*/
#ifndef __MYSPINCTRL__
#define __MYSPINCTRL__
#include <afxcmn.h> // for CSpinButtonCtrl
2007-03-27 17:47:10 +00:00
// Declare depending on whether this file is in an EXE or a DLL.
class
#ifdef _WINDLL
AFX_EXT_CLASS
#endif
2007-03-27 17:47:10 +00:00
MySpinCtrl : public CSpinButtonCtrl
{
public:
MySpinCtrl(void) : fLow(0), fHigh(100) {}
virtual ~MySpinCtrl(void) {}
// override original methods (AFXCMN.H)
int SetPos(int nPos);
int GetPos() const;
void SetRange(int nLower, int nUpper) { SetRange32(nLower, nUpper); }
void SetRange32(int nLower, int nUpper);
DWORD GetRange() const; // don't use this
void GetRange(int &lower, int& upper) const { GetRange32(lower, upper); }
void GetRange32(int &lower, int& upper) const;
2007-03-27 17:47:10 +00:00
protected:
//virtual void PreSubclassWindow();
afx_msg void OnDeltaPos(NMHDR* pNMHDR, LRESULT* pResult);
2007-03-27 17:47:10 +00:00
private:
int fLow, fHigh;
2007-03-27 17:47:10 +00:00
bool ConvLong(const char* str, long* pVal) const;
2007-03-27 17:47:10 +00:00
DECLARE_MESSAGE_MAP()
2007-03-27 17:47:10 +00:00
};
#endif /*__MYSPINCTRL__*/