/* ========================================================================== * ÆÄ ÀÏ : RadioButton.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2007-03-06 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Button.h" #include "UINodeData.h" class cRadioButton : public cButton { public: cRadioButton( eUINodeType type = eUINODE_BUTTON ); virtual ~cRadioButton(); virtual void SetEnabled( bool enabled ); /// ´­¸² ¼³Á¤ virtual void SetPress( bool press, bool onsound = true, bool exceptEnable = false ); /// À̺¥Æ® ¾øÀÌ ´­¸² ¼³Á¤ void SetPressNoEvent( bool press, bool onsound = true ); /// ¶óµð¿À ¹öư ±×·ì ¿¬°á void Link( cUINode* node ); /// ±×·ì ³Ñ¹ö ¸®ÅÏ int GetGroupNum() const; /// ¶óµð¿À¹öưÀÇ ÅØ½ºÆ® ¸®ÅÏ LPCTSTR GetText(); cRadioButton* GetNext() { return mpNext; } void Hide(); private: /// À̺¥Æ® ó¸® virtual bool OnCreate( cUINodeProperty* pproperty ); virtual void OnRender( cUIFontItemKeeper* pKeeper ); virtual void OnLButtonDoubleClick( const cUIPos& pos ) {} virtual void OnLButtonDown( const cUIPos& pos, bool ctrl, bool alt, bool shift ); virtual bool SetSkin( const cUINodeSkin* pskin ); virtual void OnMouseHovered( const cUIPos& /*pos*/ ); virtual void OnMouseLeft( const cUIPos& /*pos*/ ); virtual void OnLButtonUp( const cUIPos& /*pos*/ ) {} virtual void OnMouseMove( const cUIPos& /*pos*/ ) {} /// ÅØ½ºÆ® ÁÂÇ¥ ¾÷µ¥ÀÌÆ® virtual void UpdateText(); /// ¶óµð¿À ±×·ì Àû¿ë void UpdateGroup(); /// ´­¸²À» Àû¿ë void AdjustPress(); private: /// ¶óµð¿À ¹öưÀÇ ±×·ì ¹øÈ£ ÁöÁ¤ int mGroupNum; cRadioButton* mpPrev; cRadioButton* mpNext; unsigned long mDownSoundIdx; }; inline int cRadioButton::GetGroupNum() const { return mGroupNum; } //////////////////////////////////////////////////////////////////////////// /// ¶óµð¿À ¹öư ½ºÅ² class cRadioButtonSkin : public cUINodeSkin { public: cRadioButtonSkin( eUINodeType type = eUINODE_RADIOBUTTON ); virtual ~cRadioButtonSkin(); /// ·Îµù virtual bool Load( cParser& parser ); public: /// ÅØ½ºÆ® cStringT mText; /// ¹öưÀÇ À̹ÌÁö º¯È¯ÁÂÇ¥ ÀúÀå cUIPos mUpPos; cUIPos mDownPos; cUIPos mUpOverPos; /// °¢ ¹öư»óÅ¿¡ µû¸¥ ÅØ½ºÆ® Ä÷¯ unsigned long mUpColor; unsigned long mDownColor; /// ¶óµð¿À ¹öưÀÇ ±×·ì ¹øÈ£ int mGroupNum; unsigned long mDownSoundIdx; };