UIEdit.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef __UIEDIT_H__
  2. #define __UIEDIT_H__
  3. #pragma once
  4. namespace DuiLib
  5. {
  6. class CEditWnd;
  7. class UILIB_API CEditUI : public CLabelUI
  8. {
  9. friend class CEditWnd;
  10. public:
  11. CEditUI();
  12. LPCTSTR GetClass() const;
  13. LPVOID GetInterface(LPCTSTR pstrName);
  14. UINT GetControlFlags() const;
  15. HWND GetNativeWindow() const;
  16. void SetEnabled(bool bEnable = true);
  17. void SetText(LPCTSTR pstrText);
  18. void SetMaxChar(UINT uMax);
  19. UINT GetMaxChar();
  20. void SetReadOnly(bool bReadOnly);
  21. bool IsReadOnly() const;
  22. void SetPasswordMode(bool bPasswordMode);
  23. bool IsPasswordMode() const;
  24. void SetPasswordChar(TCHAR cPasswordChar);
  25. TCHAR GetPasswordChar() const;
  26. bool IsAutoSelAll();
  27. void SetAutoSelAll(bool bAutoSelAll);
  28. void SetNumberOnly(bool bNumberOnly);
  29. bool IsNumberOnly() const;
  30. int GetWindowStyls() const;
  31. HWND GetNativeEditHWND() const;
  32. LPCTSTR GetNormalImage();
  33. void SetNormalImage(LPCTSTR pStrImage);
  34. LPCTSTR GetHotImage();
  35. void SetHotImage(LPCTSTR pStrImage);
  36. LPCTSTR GetFocusedImage();
  37. void SetFocusedImage(LPCTSTR pStrImage);
  38. LPCTSTR GetDisabledImage();
  39. void SetDisabledImage(LPCTSTR pStrImage);
  40. void SetNativeEditBkColor(DWORD dwBkColor);
  41. DWORD GetNativeEditBkColor() const;
  42. void SetSel(long nStartChar, long nEndChar);
  43. void SetSelAll();
  44. void SetReplaceSel(LPCTSTR lpszReplace);
  45. void SetPos(RECT rc, bool bNeedInvalidate = true);
  46. void Move(SIZE szOffset, bool bNeedInvalidate = true);
  47. void SetVisible(bool bVisible = true);
  48. void SetInternVisible(bool bVisible = true);
  49. SIZE EstimateSize(SIZE szAvailable);
  50. void DoEvent(TEventUI& event);
  51. void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  52. void PaintStatusImage(HDC hDC);
  53. void PaintText(HDC hDC);
  54. protected:
  55. CEditWnd* m_pWindow;
  56. UINT m_uMaxChar;
  57. bool m_bReadOnly;
  58. bool m_bPasswordMode;
  59. bool m_bAutoSelAll;
  60. TCHAR m_cPasswordChar;
  61. UINT m_uButtonState;
  62. DWORD m_dwEditbkColor;
  63. int m_iWindowStyls;
  64. TDrawInfo m_diNormal;
  65. TDrawInfo m_diHot;
  66. TDrawInfo m_diFocused;
  67. TDrawInfo m_diDisabled;
  68. };
  69. }
  70. #endif // __UIEDIT_H__