/* ========================================================================== * ÆÄ ÀÏ : UIWindow.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2006.09.29 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "UIID.h" #include "UIContainer.h" #include "UIMsgboxEvent.h" /// UI À©µµ¿ì class cListBox; class cBitArray; class cBaseStage; class cUINodeProperty; class cUIWindow : public cUIContainer { public: cUIWindow( eUINodeType type = eUINODE_WINDOW ); virtual ~cUIWindow(); /// À̺¥Æ® virtual bool HandleEvent( const cUIEvent& event ); /// À§Ä¡ ÃʱâÈ­ virtual bool Reset(); /// ½ºÅ² ¼¼ÆÃ virtual bool SetSkin( const cUINodeSkin* pskin ); /// µå·¡±× bool ContainPoint( const cUIPos& pos ) const; /// stage º¯°æ ½ÃÁ¡¿¡¸¸ ¿Â´Ù virtual void Open(); virtual void Close(); /// virtual void ShowModal( eMSGBox_Event eventType, eMSGBox_Type modalType = eMSGBOX_MODAL ); virtual void Show( bool onsound = true ); virtual void Hide( bool onsound = true ); /// ESC ·Î ÀÎÇØ ²¨Á³À»¶§ µû·Î ó¸®ÇÒ ³»¿ë. virtual void HideESC( bool onsound = true ); /// ¼î Åä±Û virtual void Toggle(); /// ĸ¼Ç ³ôÀÌ À§Ä¡¸¦ ¾ò¾î¿È cUIRect GetCaptionRect() const; void SetCaptionRect( cUIRect& rect ); /// virtual void NetLock( int lockTry = 0 ); virtual void NetUnLock( int lockTry = 0 ); inline eMSGBox_Event GetEvent() { return mEventType; } eMSGBox_Type GetModalType(){ return mModalType; } void SetCaller( cUIWindow* caller ) { mpCaller = caller; } void RegistMsgBox( cUIWindow* n ); cUIWindow* GetRegistMsgBox() { return mpRegistMsgBox; } /// ÀÚ½ÅÀÇ È£ÃâÀÚÀÇ ¸Þ¼¼Áö ¹Ú½º¸¦ Ŭ¸®¾î void DeleteCallerMsgBox(); protected: /// ÀڽĻý¼º ( Create ´ÙÀ½¿¡ ¹Ù·Î È£ÃâµÇ¹Ç·Î »ý¼ºÇÒ¶§ ÇÊ¿äÇÑ ÀϵéÀ» ÇϸéµÈ´Ù) virtual bool OnCreate( cUINodeProperty* pproperty ); /// ó¸® virtual void OnProcess( unsigned long deltaTime, unsigned long accumTime ); /// ·»´õ¸µ virtual void OnPreRender(); virtual void OnRender( cUIFontItemKeeper* pKeeper ); /// À̺¥Æ® virtual void OnShow(); virtual void OnHide(); virtual void OnOk(); virtual void OnCancel(); virtual void OnTimer(); virtual void OnMouseMove( const cUIPos& pos ); virtual void OnLButtonDown( const cUIPos& pos, bool ctrl, bool alt, bool /*shiftPress*/ ); virtual void OnLButtonUp( const cUIPos& pos ); virtual void OnCaptureLost(); virtual void OnNetLock( int lockTry ) {} virtual void OnNetUnLock( int lockTry ) {} /// ¾ËÆÄ virtual void SetAlpha( float a ); /// ŸÀÌ¸Ó void SetTimer( bool enabled, unsigned long timeout = 0 ); private: cUIWindow* CreateChildWindow( eUINodeType type, const cString& name ); cListBox* CreateChildListBox( eUINodeType type, const cString& name ); protected: /// µå·¡±× bool mDragging; cUIPos mDragStart; /// ĸ¼Ç¿µ¿ª cUIRect mCaptionRect; /// ŸÀÌ¸Ó bool mTimerEnabled; unsigned long mTimeOut; unsigned long mAccumTime; unsigned long mLastAccumTime; cBaseStage* mMsgHandler; /// ¸Þ½ÃÁö Çڵ鷯 eMSGBox_Event mEventType; /// ¸Þ½ÃÁö¹Ú½º À̺¥Æ® eMSGBox_Type mModalType; /// ¸Þ½ÃÁö¹Ú½º ŸÀÔ cUIWindow* mpCaller; /// show ½Ã Ç÷¹ÀÌ »ç¿îµå À妽º unsigned long mOpenSoundIdx; /// close ½Ã Ç÷¹ÀÌ »ç¿îµå À妽º unsigned long mCloseSoundIdx; /// ¾ËÆÄ ºñÆ® ¹è¿­ cBitArray* mAlphaBitArray; // µî·Ï °¡´ÉÇÑ ¸Þ¼¼Áö¹Ú½º cUIWindow* mpRegistMsgBox; }; //////////////////////////////////////////////////////////////////////////////////// class cBitArray; /// UI À©µµ¿ì ½ºÅ² class cUIWindowSkin : public cUIContainerSkin { friend class cUISkin; public: cUIWindowSkin( eUINodeType type = eUINODE_WINDOW ); virtual ~cUIWindowSkin(); static cUINodeSkin* Create( const cString& name ); /// ·Îµù bool Load( cParser& parser ); public: /// ¾ËÆÄ ºñÆ® ¹è¿­ cBitArray* mAlphaBitArray; /// float mAlpha; /// ¹Ýµå½Ã º¸¿©¾ßÇÏ´Â À©µµ¿ì ¼³Á¤ bool mHoldView; /// ĸ¼Ç¿µ¿ª cUIRect mCaptionRect; /// unsigned long mOpenSoundIdx; unsigned long mCloseSoundIdx; };