[Wgui-cvs] wgui/wgui_ex/includes wgex_knob.h,1.3,1.4
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-04-23 19:38:56
|
Update of /cvsroot/wgui/wgui/wgui_ex/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20009/wgui_ex/includes Modified Files: wgex_knob.h Log Message: wGui_ex clean up and minor stuff Index: wgex_knob.h =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/includes/wgex_knob.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wgex_knob.h 26 Feb 2004 17:00:35 -0000 1.3 --- wgex_knob.h 23 Apr 2004 19:38:47 -0000 1.4 *************** *** 1,8 **** // wgex_knob.h // - // // CKnob interface // // // Copyright (c) 2003 kRAkEn/gORe // kra...@li... --- 1,9 ---- // wgex_knob.h // // CKnob interface // // + // Copyright (c) 2004 Rob Wiskow + // ro...@bo... // Copyright (c) 2003 kRAkEn/gORe // kra...@li... *************** *** 31,40 **** #include "wg_application.h" #include "wg_window.h" - - #include "wgex_control.h" #include "wgex_painter.h" - // #include "wg_picture.h" - // #include "wg_menu.h" - --- 32,36 ---- *************** *** 44,51 **** //! A knob control ! class CKnob : public CControl { public: ! //! Constructs a new checkbox //! \param WindowRect A CRect that defines the outer limits of the control //! \param pParent A pointer to the parent window --- 40,47 ---- //! A knob control ! class CKnob : public CWindow { public: ! //! Constructs a new knob //! \param WindowRect A CRect that defines the outer limits of the control //! \param pParent A pointer to the parent window *************** *** 63,67 **** virtual bool HandleMessage( CMessage* pMessage ); ! //! This is called whenever the button is clicked on by the mouse //! Only the topmost window that bounds the point will be called by the system //! \param Point The point where the mouse clicked --- 59,63 ---- virtual bool HandleMessage( CMessage* pMessage ); ! //! This is called whenever the knob is clicked on by the mouse //! Only the topmost window that bounds the point will be called by the system //! \param Point The point where the mouse clicked *************** *** 70,74 **** virtual bool OnMouseButtonDown(CPoint Point, unsigned int Button); ! //! This is called whenever the a mouse button is released in the button //! Only the topmost window that bounds the point will be called by the system //! \param Point The point where the mouse clicked --- 66,70 ---- virtual bool OnMouseButtonDown(CPoint Point, unsigned int Button); ! //! This is called whenever the a mouse button is released in the knob //! Only the topmost window that bounds the point will be called by the system //! \param Point The point where the mouse clicked *************** *** 78,127 **** ! ! void ValueToPoint( int* iValueX, int* iValueY ) const ! { ! float fAlpha = (m_fValue - m_fCoefB) / m_fCoefA; ! *iValueX = (long)( m_fRadius + cosf(fAlpha) * (m_fRadius - m_iInsetPixels) + 0.5f); ! *iValueY = (long)( m_fRadius - sinf(fAlpha) * (m_fRadius - m_iInsetPixels) + 0.5f); ! } ! ! void SetStartAngle( float fAngle ) ! { ! m_fStartAngle = fAngle; ! ComputeCoeff(); ! } ! ! void SetRangeAngle( float fAngle ) ! { ! m_fRangeAngle = fAngle; ! ComputeCoeff(); ! } ! ! void ComputeCoeff() { ! m_fCoefA = 1.0f / m_fRangeAngle; ! m_fCoefB = - ( m_fCoefA * m_fStartAngle ); ! m_fHalfAngle = ( 2.0f * 3.141592f - fabsf(m_fRangeAngle) ) / 2.0f; } protected: - - CRGBColor m_CircleUpColor; CRGBColor m_CircleLoColor; - CRGBColor m_HandleUpColor; CRGBColor m_HandleLoColor; ! int m_iInsetPixels; ! ! float m_fRadius; ! float m_fStartAngle; ! float m_fRangeAngle; ! ! float m_fHalfAngle; ! float m_fCoefA; ! float m_fCoefB; --- 74,96 ---- ! void ValueToPoint(int* iValueX, int* iValueY) const { ! double dAlpha = (m_dValue - m_dCoefB) / m_dCoefA; ! *iValueX = (long)( m_dRadius + cosf(dAlpha) * (m_dRadius - m_iInsetPixels) + 0.5f); ! *iValueY = (long)( m_dRadius - sinf(dAlpha) * (m_dRadius - m_iInsetPixels) + 0.5f); } protected: CRGBColor m_CircleUpColor; CRGBColor m_CircleLoColor; CRGBColor m_HandleUpColor; CRGBColor m_HandleLoColor; ! double m_dValue; ! double m_dRadius; ! double m_dStartAngle; ! double m_dRangeAngle; ! unsigned int m_iMouseButton; //!< The current buttons pressed *************** *** 131,137 **** ! ! ! class CAnimKnob : public CKnob --- 100,104 ---- ! //! An animated knob class CAnimKnob : public CKnob *************** *** 141,151 **** //! \param WindowRect A CRect that defines the outer limits of the control //! \param pParent A pointer to the parent window ! CAnimKnob( ! const CRect& WindowRect, ! CWindow* pParent, ! const std::string& sPictureFile, ! int iSubpix, ! bool bVertical = 1 ! ); //! Standard destructor --- 108,115 ---- //! \param WindowRect A CRect that defines the outer limits of the control //! \param pParent A pointer to the parent window ! //! \param sPictureFile The filename of the bitmap to use as the source pictures ! //! \param iSubpix The count of the number of bitmaps in the picture file ! //! \param bVertical Indicates if the pictures are arranged vertically or horizontally ! CAnimKnob(const CRect& WindowRect, CWindow* pParent, const std::string& sPictureFile, int iSubpix, bool bVertical = true); //! Standard destructor *************** *** 153,172 **** // CWindow overrides ! //! Draws the checkbox virtual void Draw(void) const; - // CMessageClient overrides - //! CCheckBoxes handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_LCLICK messages - //! \param pMessage A pointer to the message - // virtual bool HandleMessage(CMessage* pMessage); - - protected: - CBitmapResourceHandle m_hBitmap; //!< A handle for the bitmap resource ! ! int m_iHeightOneImage; // height of one image ! int m_iNumSubpix; // number of pixmaps ! int m_bVerticalImages; --- 117,128 ---- // CWindow overrides ! //! Draws the knob virtual void Draw(void) const; protected: CBitmapResourceHandle m_hBitmap; //!< A handle for the bitmap resource ! int m_iHeightOneImage; //! height of one image ! int m_iNumSubpix; //! number of pixmaps ! int m_bVerticalImages; //! indicates if the pixmaps are arrange horizontally or vertically *************** *** 175,183 **** }; - } #endif // _WGUI_EX_KNOB_H_ - - --- 131,136 ---- |