UiFaceSelector.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:2k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /* 
  2.  * File:     UiFaceSelector.h
  3.  * Desc:     表情选择窗口
  4.  * Author:   flying
  5.  * Creation: 2003/7/8
  6.  * 今天是偶老婆的生日哦,呵呵
  7.  */
  8. //-----------------------------------------------------------------------------
  9. #pragma once
  10. #if !defined _FACESELECTOR
  11. #define _FACESELECTOR
  12. #include "../Elem/WndButton.h"
  13. class KUiFaceSelector : public KWndWindow
  14. {
  15. public:
  16. //打开窗口,返回唯一的一个类对象实例
  17. static KUiFaceSelector* OpenWindow(KWndWindow* pCaller, void* pvParam);
  18. //关闭窗口,同时可以选则是否删除对象实例
  19. static void CloseWindow(bool bDestroy);
  20. static KUiFaceSelector* GetIfVisible();
  21. void LoadScheme(const char* pScheme); //载入界面方案
  22. static void LoadFaceList();
  23. static void Clear();
  24. static int ConvertFaceText(char* pDest, const char* pSrc, int nCount);
  25. private:
  26. KUiFaceSelector();
  27. virtual ~KUiFaceSelector() {}
  28. static int ConvertFace(char* pDest, int& nConvertCount, const char* pSrc, int nCount, int& nReadPos);
  29. void PaintWindow();
  30. int WndProc(unsigned int uMsg, unsigned int uParam, int nParam);
  31. void Show();
  32. void Hide();
  33. void Initialize();
  34. int GetFaceAtPos(int x, int y);
  35. void UpdateFaceTip(int x, int y);
  36. void OnSelFace();
  37. void OnExpandWnd();
  38. void OnUnExpandWnd();
  39. private:
  40. struct KFaceItem
  41. {
  42. char szFaceText[32];
  43. char szFaceTip[32];
  44. WORD wFaceID;
  45. };
  46. static KUiFaceSelector* m_pSelf;
  47. static KFaceItem* ms_pFaceList;
  48. static int ms_nNumFaces;
  49. private:
  50. KWndButton m_LessBtn;
  51. KWndButton m_MoreBtn;
  52. int m_nNormColuCount;
  53. int                 m_nExpColuCount;
  54. int m_nRowCount;
  55. int                 m_nIndentH, m_nIndentV;
  56. int m_nBtnWidth,  m_nBtnHeight; //表情符号按钮的长宽
  57. unsigned int m_nBgColor;
  58. unsigned int m_nBgOver;
  59. unsigned int m_nBgAlpha;
  60. unsigned int m_nBorderColor;
  61. int m_nCurrIndex; //当前选中/指向的表情图标
  62. BOOL                m_bIsExpandMode; //是否在扩展状态
  63. KWndWindow* m_pCallerWnd; //调用窗口
  64. void* m_pvCallerParam; //调用窗口调用时的自定义参数
  65. };
  66. #endif