/* ========================================================================== * ÆÄ ÀÏ : TextCtrl.h * ¸ñ Àû : ÅØ½ºÆ®¹Ú½º¿ë Àü¿ë ÀÚ·á ±¸Á¶ Ŭ·¡½º * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2007-03-12 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "UIWindow.h" #include "PointerQueue.h" /// °¡·ÎÇà µ¥ÀÌÅÍ struct sTextData { cStringT mText; unsigned long mColor; bool mEnter; /// ¿£ÅÍŰ (ÇöÀç ¶óÀÎÀÌ ¿£ÅͶóÀÎÀÎÁö ¿©ºÎ) bool mUseInven; sTextData() { mColor = 0; mUseInven = false; mEnter = false; } }; struct sInvenData : sTextData { sInventory mInventory; sInvenData() { ::memset( &mInventory, 0, sizeof(mInventory) ); } }; /// ¼¼·ÎÇà µ¥ÀÌÅÍ struct sRowTextData { /// sTextData tPointerArray mColumes; }; class cTextCtrl : public cUIWindow { public: cTextCtrl( eUINodeType type = eUINODE_TEXTBOX ); virtual ~cTextCtrl(); protected: /// µ¥ÀÌÅ͸¦ ¸ðµÎ Áö¿ò void Clear(); /// ºó ¶óÀÎ Ãß°¡ void AddEmptyRow( unsigned int line ); /// »õ·Î¿î ¶óÀο¡ µ¥ÀÌÅÍ Ãß°¡ void AddNewRow( LPCTSTR str, unsigned long color, sInventory* inventory = 0 ); /// ±âÁ¸ ¶óÀο¡ ¿¬°áÇÏ¿© µ¥ÀÌÅÍ Ãß°¡ void AddPasteRow( LPCTSTR str, unsigned long color, sInventory* inventory = 0 ); /// Àüü ¿­ ¼ö Á¤º¸ unsigned int GetRowCount(); /// ÇØ´ç ¶óÀÎ Á¤º¸ sRowTextData* GetRowData( unsigned int rowIdx ); private: void InsertRow( LPCTSTR str, unsigned long color, sInventory* inventory = 0); void InsertColumn( LPCTSTR str, unsigned long color, sInventory* inventory = 0); protected: /// ¹®ÀÚ¿­ ¸®½ºÆ® typedef tPointerQueue cTextQueue; cTextQueue mTextQueue; /// ÇÑÁÙ¿¡¼ö¿ëÇÏ´Â ¹®ÀÚ Æø unsigned int mMaxTextWidth; /// ¸®½ºÆ®°¡ ÃÑ ¼ö¿ëÇÏ´Â ¶óÀÎ ¼ö unsigned int mTotalMaxNum; }; inline unsigned int cTextCtrl::GetRowCount() { return mTextQueue.GetSize(); }