[Wgui-cvs] wgui/includes wg_range_control.h,NONE,1.1 Makefile.am,1.10,1.11 wgui.h,1.32,1.33
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-04-26 22:38:10
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2833/includes Modified Files: Makefile.am wgui.h Added Files: wg_range_control.h Log Message: Added CRangeControl. --- NEW FILE: wg_range_control.h --- // wg_range_control.h // // CRangeControl interface // // // Copyright (c) 2002-2004 Rob Wiskow // ro...@bo... // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #ifndef _WG_RANGE_CONTROL_H_ #define _WG_RANGE_CONTROL_H_ #include "wg_window.h" namespace wGui { //! An abstract class that handles all the basics of a control that uses a value that is constrained to a certain range //! Sends a CTRL_VALUECHANGE message whenever the value changes template<typename T> class CRangeControl : public CWindow { public: //! Constructs a range control //! \param WindowRect A CRect that defines the outer limits of the control //! \param pParent A pointer to the parent window //! \param minLimit The minimum limit for the control //! \param maxLimit The maximum limit for the control //! \param stepSize The amount to increase/decrease the value by for Increment and Decrement //! \param defaultValue The amount to initialize the value to CRangeControl(const CRect& WindowRect, CWindow* pParent, T minLimit, T maxLimit, T stepSize, T defaultValue) : CWindow(WindowRect, pParent), m_MinLimit(minLimit), m_MaxLimit(maxLimit), m_StepSize(stepSize), m_Value(defaultValue) { } //! Set the lower limit for the control void SetMinLimit(T minLimit) { m_MinLimit = minLimit; } //! \return The minimum limit of the progress bar T GetMinLimit(void) const { return m_MinLimit; } //! Set the upper limit for the control void SetMaxLimit(T maxLimit) { m_MaxLimit = maxLimit; } //! \return The maximum limit of the progress bar T GetMaxLimit(void) const { return m_MaxLimit; } //! Set the current steo size. void SetStepSize(T stepSize); //! \return The current step size T GetStepSize(void) const { return m_StepSize; } //! Set the current value. void SetValue(T value); //! \return The current value T GetValue(void) const { return m_Value; } //! Increase the value by one step size void Increment(void); //! Decrease the value by one step size void Decrement(void); private: T m_MinLimit; //!< The minimum value of the control T m_MaxLimit; //!< The maximum value of the control T m_StepSize; //!< The step size of the control T m_Value; //!< The current value of the control private: void operator=(CRangeControl) { } //!< The assignment operator is not allowed for CWindow derived objects }; } #endif // _WG_RANGE_CONTROL_H_ Index: Makefile.am =================================================================== RCS file: /cvsroot/wgui/wgui/includes/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.am 31 Mar 2004 15:31:32 -0000 1.10 --- Makefile.am 26 Apr 2004 22:38:00 -0000 1.11 *************** *** 27,30 **** --- 27,31 ---- wg_point.h \ wg_progress.h \ + wg_range_control.h \ wg_rect.h \ wg_renderedstring.h \ Index: wgui.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wgui.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wgui.h 2 Apr 2004 17:26:14 -0000 1.32 --- wgui.h 26 Apr 2004 22:38:00 -0000 1.33 *************** *** 45,48 **** --- 45,49 ---- #include "wg_application.h" #include "wg_window.h" + #include "wg_range_control.h" #include "wg_view.h" #include "wg_frame.h" |