/* ========================================================================== * ÆÄ ÀÏ : ListFolderBox.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2008-03-18 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "ListCtrl.h" const unsigned int IMAGE_GAP = 2; const unsigned int LOW_GAP = 15; struct sFolderData : sData { long key; /// À̹ÌÁö Ç÷¡±× bool mCheck; cUIImage* mCheckImg; /// Ãß°¡ Á¤º¸ void* mExtraData; sFolderData() { key = -1; mExtraData = 0; } ~sFolderData(){} }; /// ¸®½ºÆ® Æú´õ ¹Ú½º ui class cScrollBar; class cPlaneObject; class cListFolderBox : public cListCtrl { public: cListFolderBox( eUINodeType type = eUINODE_LISTFOLDERBOX ); virtual ~cListFolderBox(); virtual void Clear(); void InitSelectRow(); /// »óÀ§¿­ Ãß°¡ ( key : »óÀ§¿­ÀÇ À妽º ) int AddHighData( long key, LPCTSTR str, unsigned long color, void* pExtraData = 0, cUIImage* pImage = 0, bool check = true ); /// ÇÏÀ§¿­ Ãß°¡ ( key : »óÀ§¿­ÀÇ À妽º ) bool AddLowData( long key, LPCTSTR str, unsigned long color, void* pExtraData = 0, cUIImage* pImage = 0, bool check = true ); // ¼±Åÿ­ ¹Ù²Ù±â void ChangeSelectColumn( unsigned int selectRow, bool sendEvent = false ); /// extraData¸¦ °¡Áø Á¤º¸ ã±â sFolderData* GetFolderData( unsigned int row, unsigned int column ); sFolderData* GetFolderDataByExtra( long key, void* extraData ); /// extraData ¸®ÅÏ void* GetColumnData( unsigned int row, unsigned int column ); /// ¼±Åà À̹ÌÁö ¼¼ÆÃ void SetHighCheckPos( unsigned int texX, unsigned int texY ); void SetHighNoCheckPos( unsigned int texX, unsigned int texY ); void SetLowCheckPos( unsigned int texX, unsigned int texY ); void SetLowNoCheckPos( unsigned int texX, unsigned int texY ); /// ½ÇÁ¦·Î ½ÃÀÛµÈ ¿­ unsigned int GetSelectRow() { return mSelectedRow; } unsigned int GetSelectRowColumn() { return mSelectedRowColumn; } /// ÇÏÀ§¿­ Ãâ·Â ½ÃÀÛ x À§Ä¡ Á¶Á¤ void SetLowGap( unsigned int gap ) { mLowGap = gap; } /// ¼±Åà À̹ÌÁö ÁÂÇ¥ ¾÷µ¥ÀÌÆ® virtual void UpdateSelectImage(); /// ÇÏÀ§¿­ °¹¼ö Ãâ·Â ¿©ºÎ void ShowNumber( bool show ) { mShowNumber = show; } /// Á¢ÇôÁ® ÀÖ´Â Ä«Å×°í¸® Ű °ª °¡Á®¿À±â void GetClosedCategory( tHashSet& keySet ); void SetClosedCategory( long key ); protected: virtual bool OnCreate( cUINodeProperty* pproperty ); virtual bool HandleEvent( const cUIEvent& event ); virtual void OnProcess(unsigned long deltaTime, unsigned long accumTime ); virtual void OnRender( cUIFontItemKeeper* pKeeper ); virtual bool SetSkin( const cUINodeSkin* pskin ); virtual void OnLButtonDown( const cUIPos& pos, bool ctrl, bool alt, bool shift ); virtual void OnLButtonDoubleClick( const cUIPos& pos ); virtual void OnScrollbarMoved( const cUIPos& pos ); virtual void OnMouseWheel( const cUIPos& pos, int wheel ); void CheckButtonEvent( unsigned int id ); virtual void UpdateSkin(); virtual void UpdateRect(); /// ½ºÅ©·Ñ¹ÙÀÇ »óÅ º¯°æ void UpdateScrollBar(); /// Ä÷³ ÃÑ °¹¼ö °»½Å void UpdateColumnCount(); protected: /// ½ºÅ©·Ñ¹Ù °ü·Ã cString mScrollSkin; cScrollBar* mpScrollBar; /// ¾ÆÀÌÅÛ ¼±Åýà ÀÇ À̹ÌÁö cPlaneObject* mpSelectImage; /// Ç¥½Ã ½ÃÀÛ Çà unsigned int mTopColumnIdx; /// ¼±Åà Çà ( mTopColumnIdx À» ±âÁØÀ¸·Î ÇÑ È­¸é»ó¿¡ º¸ÀÌ´Â Ä÷³ ) unsigned int mSelectedColumnIdx; /// ½ÇÁ¦ ¼±ÅÃµÈ row. ¿Í column unsigned int mSelectedRow; unsigned int mSelectedRowColumn; /// row ³»ÀÇ Ä÷³ /// ÇàÀÇ ³ôÀÌ unsigned int mRowHeight; /// ÃÖ´ë Çà¼ö unsigned int mMaxRowInPage; /// ¸®½ºÆ®°¡ ÃÑ ¼ö¿ëÇÏ´Â ¶óÀÎ ¼ö unsigned int mTotalMaxNum; /// üũ, ³ëüũ ÅØ½ºÃÄ À§Ä¡ cUIPos mHighCheckPos; cUIPos mHighNoCheckPos; cUIPos mLowCheckPos; cUIPos mLowNoCheckPos; /// ÃÑ ¿­ °¹¼ö unsigned int mColumnCount; /// ·»´õ¸µÀ» À§ÇÑ Ãâ·Â À§Ä¡ °è»ê¿ë unsigned int mRenderRow; unsigned int mRenderStartColumn; /// ÇÏÀ§¿­ Ãâ·Â x ÁÂÇ¥ ¼³Á¤ unsigned int mLowGap; /// °¹¼ö º¸¿©ÁÖ±â bool mShowNumber; // bool mShowSelect; }; inline void cListFolderBox::SetHighCheckPos( unsigned int texX, unsigned int texY ) { mHighCheckPos.mX = texX; mHighCheckPos.mY = texY; } inline void cListFolderBox::SetHighNoCheckPos( unsigned int texX, unsigned int texY ) { mHighNoCheckPos.mX = texX; mHighNoCheckPos.mY = texY; } inline void cListFolderBox::SetLowCheckPos( unsigned int texX, unsigned int texY ) { mLowCheckPos.mX = texX; mLowCheckPos.mY = texY; } inline void cListFolderBox::SetLowNoCheckPos( unsigned int texX, unsigned int texY ) { mLowNoCheckPos.mX = texX; mLowNoCheckPos.mY = texY; } ///////////////////////////////////////////// /// ¸®½ºÆ® Æú´õ ¹Ú½º½ºÅ² class cListFolderBoxSkin : public cUINodeSkin { public: cListFolderBoxSkin( eUINodeType type = eUINODE_LISTFOLDERBOX ); virtual ~cListFolderBoxSkin(); virtual bool Load( cParser& parser ); public: /// ¸®½ºÆ®¹Ú½ºÀÇ ÇÑÁÙ ³ôÀÌ unsigned int mRowHeight; /// ´ãÀ»¼ö ÀÖ´Â ÃÖ´ë °¹¼ö int mTotalMaxNum; public: cString mScrollSkin; /// NiTexture* mpSelectBarTexture; /// ui image ½ºÅ² Á¤º¸ sSkinInfo* mSelectBarSkin; /// ¼±ÅÃ¹Ù Æø unsigned int mSelectBarWidth; };