1
0

skinnedfolder.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "./skinnedfolder.h"
  2. #include "../winamp/wa_dlg.h"
  3. #include "./skinning.h"
  4. SkinnedFolderBrowser::SkinnedFolderBrowser(void) : SkinnedScrollWnd(FALSE)
  5. {
  6. }
  7. SkinnedFolderBrowser::~SkinnedFolderBrowser(void)
  8. {
  9. }
  10. BOOL SkinnedFolderBrowser::Attach(HWND hwndFB)
  11. {
  12. if(!SkinnedScrollWnd::Attach(hwndFB)) return FALSE;
  13. SetType(SKINNEDWND_TYPE_FOLDERBROWSER);
  14. SetMode(SCROLLMODE_STANDARD);
  15. DisableNoScroll(TRUE);
  16. FOLDERBROWSERINFO fbi;
  17. fbi.cbSize = sizeof(FOLDERBROWSERINFO);
  18. if (FolderBrowser_GetInfo(hwnd, &fbi))
  19. {
  20. if (NULL != fbi.hwndActive) SkinWindowEx(fbi.hwndActive, SKINNEDWND_TYPE_LISTBOX, style);
  21. if (NULL != fbi.hwndDraw) SkinWindowEx(fbi.hwndDraw, SKINNEDWND_TYPE_LISTBOX, style);
  22. }
  23. SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
  24. return TRUE;
  25. }
  26. BOOL SkinnedFolderBrowser::SetStyle(UINT newStyle, BOOL bRedraw)
  27. {
  28. BOOL result = __super::SetStyle(newStyle, bRedraw);
  29. if (hwnd)
  30. {
  31. FOLDERBROWSERINFO fbi;
  32. fbi.cbSize = sizeof(FOLDERBROWSERINFO);
  33. if (FolderBrowser_GetInfo(hwnd, &fbi))
  34. {
  35. if (NULL != fbi.hwndActive) MLSkinnedWnd_SetStyle(fbi.hwndActive, style);
  36. if (NULL != fbi.hwndDraw) MLSkinnedWnd_SetStyle(fbi.hwndDraw, style);
  37. }
  38. }
  39. return result;
  40. }
  41. void SkinnedFolderBrowser::OnSkinChanged(BOOL bNotifyChildren, BOOL bRedraw)
  42. {
  43. if (SWS_USESKINCOLORS & style)
  44. {
  45. FolderBrowser_SetBkColor(hwnd, WADlg_getColor(WADLG_ITEMBG));
  46. FolderBrowser_SetTextColor(hwnd, WADlg_getColor(WADLG_ITEMFG));
  47. }
  48. __super::OnSkinChanged(bNotifyChildren, bRedraw);
  49. }