Theme.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #pragma once
  2. #include "tinyxml\Tinyxml.h"
  3. #include "tinyxml\tinystr.h"
  4. class CTheme
  5. {
  6. public:
  7. CTheme(void);
  8. ~CTheme(void);
  9. bool Load(CString csTheme, bool bHeaderOnly = false, bool bCheckLastWriteTime = false);
  10. COLORREF CaptionLeft() const { return m_CaptionLeft; }
  11. COLORREF CaptionRight() const { return m_CaptionRight; }
  12. COLORREF Border() const { return m_Border; }
  13. COLORREF BorderTopMost() const { return m_BorderTopMost; }
  14. COLORREF BorderNotConnected() const { return m_BorderNotConnected; }
  15. COLORREF CaptionLeftTopMost() const { return m_CaptionLeftTopMost; }
  16. COLORREF CaptionRightTopMost() const { return m_CaptionRightTopMost; }
  17. COLORREF CaptionLeftNotConnected() const { return m_CaptionLeftNotConnected; }
  18. COLORREF CaptionRightNotConnected() const { return m_CaptionRightNotConnected; }
  19. COLORREF CaptionTextColor() const { return m_CaptionTextColor; }
  20. COLORREF ListBoxOddRowsBG() const { return m_ListBoxOddRowsBG; }
  21. COLORREF ListBoxEvenRowsBG() const { return m_ListBoxEvenRowsBG; }
  22. COLORREF ListBoxOddRowsText() const { return m_ListBoxOddRowsText; }
  23. COLORREF ListBoxEvenRowsText() const { return m_ListBoxEvenRowsText; }
  24. COLORREF ListBoxSelectedBG() const { return m_ListBoxSelectedBG; }
  25. COLORREF ListBoxSelectedNoFocusBG() const { return m_ListBoxSelectedNoFocusBG; }
  26. COLORREF ListBoxSelectedText() const { return m_ListBoxSelectedText; }
  27. COLORREF ListBoxSelectedNoFocusText() const { return m_ListBoxSelectedNoFocusText; }
  28. COLORREF ClipPastedColor() const { return m_clipPastedColor; }
  29. COLORREF ListSmallQuickPasteIndexColor() const { return m_listSmallQuickPasteIndexColor; }
  30. COLORREF MainWindowBG() const { return m_mainWindowBG; }
  31. COLORREF SearchTextBoxFocusBG() const { return m_searchTextBoxFocusBG; }
  32. COLORREF SearchTextBoxFocusText() const { return m_searchTextBoxFocusText; }
  33. COLORREF GroupTreeBG() const { return m_groupTreeBG; }
  34. COLORREF GroupTreeText() const { return m_groupTreeText; }
  35. int GetCaptionSize() const { return m_captionSize; }
  36. int GetCaptionFontSize() const { return m_captionFontSize; }
  37. COLORREF DescriptionWindowBG() const { return m_descriptionWindowBG; }
  38. COLORREF DescriptionWindowText() const { return m_descriptionWindowText; }
  39. CString Notes() const { return m_csNotes; }
  40. CString Author() const { return m_csAuthor; }
  41. long FileVersion() const { return m_lFileVersion; }
  42. CString LastError() const { return m_csLastError; }
  43. protected:
  44. bool LoadElement(TiXmlElement *pParent, CStringA csNode, COLORREF &Color, int &intValue);
  45. bool LoadInt(TiXmlElement *pParent, CStringA csNode, int &intValue);
  46. bool LoadColor(TiXmlElement *pParent, CStringA csNode, COLORREF &Color);
  47. protected:
  48. COLORREF m_CaptionLeft;
  49. COLORREF m_CaptionRight;
  50. COLORREF m_CaptionLeftTopMost;
  51. COLORREF m_CaptionRightTopMost;
  52. COLORREF m_CaptionLeftNotConnected;
  53. COLORREF m_CaptionRightNotConnected;
  54. COLORREF m_CaptionTextColor;
  55. COLORREF m_ListBoxOddRowsBG;
  56. COLORREF m_ListBoxEvenRowsBG;
  57. COLORREF m_ListBoxOddRowsText;
  58. COLORREF m_ListBoxEvenRowsText;
  59. COLORREF m_ListBoxSelectedBG;
  60. COLORREF m_ListBoxSelectedNoFocusBG;
  61. COLORREF m_ListBoxSelectedText;
  62. COLORREF m_ListBoxSelectedNoFocusText;
  63. COLORREF m_clipPastedColor;
  64. COLORREF m_listSmallQuickPasteIndexColor;
  65. COLORREF m_mainWindowBG;
  66. COLORREF m_Border;
  67. COLORREF m_BorderTopMost;
  68. COLORREF m_BorderNotConnected;
  69. COLORREF m_searchTextBoxFocusBG;
  70. COLORREF m_searchTextBoxFocusText;
  71. COLORREF m_groupTreeBG;
  72. COLORREF m_groupTreeText;
  73. COLORREF m_descriptionWindowBG;
  74. COLORREF m_descriptionWindowText;
  75. int m_captionSize;
  76. int m_captionFontSize;
  77. CString m_csLastError;
  78. long m_lFileVersion;
  79. CString m_csAuthor;
  80. CString m_csNotes;
  81. __int64 m_LastWriteTime;
  82. CString m_lastTheme;
  83. void LoadDefaults();
  84. };