UIEdit.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. DECLARE_DUICONTROL(CEditUI)
  10. friend class CEditWnd;
  11. public:
  12. CEditUI();
  13. LPCTSTR GetClass() const;
  14. LPVOID GetInterface(LPCTSTR pstrName);
  15. UINT GetControlFlags() 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. void SetNumberOnly(bool bNumberOnly);
  27. bool IsNumberOnly() const;
  28. int GetWindowStyls() const;
  29. LPCTSTR GetNormalImage();
  30. void SetNormalImage(LPCTSTR pStrImage);
  31. LPCTSTR GetHotImage();
  32. void SetHotImage(LPCTSTR pStrImage);
  33. LPCTSTR GetFocusedImage();
  34. void SetFocusedImage(LPCTSTR pStrImage);
  35. LPCTSTR GetDisabledImage();
  36. void SetDisabledImage(LPCTSTR pStrImage);
  37. void SetNativeEditBkColor(DWORD dwBkColor);
  38. DWORD GetNativeEditBkColor() const;
  39. void SetNativeEditTextColor( LPCTSTR pStrColor );
  40. DWORD GetNativeEditTextColor() const;
  41. bool IsAutoSelAll();
  42. void SetAutoSelAll(bool bAutoSelAll);
  43. void SetSel(long nStartChar, long nEndChar);
  44. void SetSelAll();
  45. void SetReplaceSel(LPCTSTR lpszReplace);
  46. void SetTipValue(LPCTSTR pStrTipValue);
  47. LPCTSTR GetTipValue();
  48. void SetTipValueColor(LPCTSTR pStrColor);
  49. DWORD GetTipValueColor();
  50. HWND GetHWND();
  51. void SetPos(RECT rc, bool bNeedInvalidate = true);
  52. void Move(SIZE szOffset, bool bNeedInvalidate = true);
  53. void SetVisible(bool bVisible = true);
  54. void SetInternVisible(bool bVisible = true);
  55. SIZE EstimateSize(SIZE szAvailable);
  56. void DoEvent(TEventUI& event);
  57. void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  58. void PaintStatusImage(HDC hDC);
  59. void PaintText(HDC hDC);
  60. protected:
  61. CEditWnd* m_pWindow;
  62. UINT m_uMaxChar;
  63. bool m_bReadOnly;
  64. bool m_bPasswordMode;
  65. bool m_bAutoSelAll;
  66. TCHAR m_cPasswordChar;
  67. UINT m_uButtonState;
  68. CDuiString m_sNormalImage;
  69. CDuiString m_sHotImage;
  70. CDuiString m_sFocusedImage;
  71. CDuiString m_sDisabledImage;
  72. CDuiString m_sTipValue;
  73. DWORD m_dwTipValueColor;
  74. DWORD m_dwEditbkColor;
  75. DWORD m_dwEditTextColor;
  76. int m_iWindowStyls;
  77. };
  78. }
  79. #endif // __UIEDIT_H__