skinnededit.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef NULLOSFT_MEDIALIBRARY_SKINNED_EDIT_HEADER
  2. #define NULLOSFT_MEDIALIBRARY_SKINNED_EDIT_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./skinnedwnd.h"
  7. class SkinnedEdit : public SkinnedWnd
  8. {
  9. protected:
  10. SkinnedEdit(void);
  11. virtual ~SkinnedEdit(void);
  12. protected:
  13. virtual BOOL Attach(HWND hwndEdit);
  14. virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); // treat this as dialog proc
  15. virtual void OnPaint(void);
  16. virtual void OnSkinUpdated(BOOL bNotifyChildren, BOOL bRedraw);
  17. virtual void OnWindowPosChanged(WINDOWPOS *pwp);
  18. virtual void OnSetFont(HFONT hFont, BOOL fRedraw);
  19. void FontChanged();
  20. private:
  21. friend BOOL SkinWindowEx(HWND hwndToSkin, INT type, UINT style);
  22. void EraseBckGnd(HDC hdc, RECT *prc, RECT *prcText, BOOL fEraseAll, HBRUSH hBrush);
  23. void DrawText(HDC hdc, RECT *prc, RECT *prcText, LPCWSTR pszText, INT cchText);
  24. LRESULT OverrideDefault(UINT uMsg, WPARAM wParam, LPARAM lParam);
  25. typedef struct __SELECTION
  26. {
  27. INT first;
  28. INT last;
  29. LONG leftX;
  30. LONG rightX;
  31. } SELECTION;
  32. BOOL GetSelection(SELECTION *selection, INT cchText, const RECT *clientRect);
  33. protected:
  34. int firstVisible;
  35. int lastVisible;
  36. int firstSelected;
  37. int lastSelected;
  38. INT maxCharWidth;
  39. WPARAM mouseWParam;
  40. LPARAM mouseLParam;
  41. int cx;
  42. int cy;
  43. };
  44. #endif // NULLOSFT_MEDIALIBRARY_SKINNED_EDIT_HEADER