OSDN Git Service

Fix an issue where items with different case are not displayed correctly in the folde...
[winmerge-jp/winmerge-jp.git] / Src / OptionsCustomColors.cpp
1 #include "pch.h"
2 #include "OptionsCustomColors.h"
3 #include "OptionsMgr.h"
4
5 namespace Options { namespace CustomColors
6 {
7
8 /** @brief Setting name for user-defined custom colors. */
9 const TCHAR Section[] = _T("Custom Colors");
10
11 void Init(COptionsMgr *pOptionsMgr)
12 {
13         for (int i = 0; i < 16; i++)
14         {
15                 String valuename = strutils::format(_T("%s/%d"), Section, i);
16                 pOptionsMgr->InitOption(valuename, RGB(255, 255, 255), true);
17         }
18 }
19
20 void Load(COptionsMgr *pOptionsMgr, COLORREF * colors)
21 {
22         for (int i = 0; i < 16; i++)
23         {
24                 String valuename = strutils::format(_T("%s/%d"), Section, i);
25                 colors[i] = pOptionsMgr->GetInt(valuename);
26         }
27 }
28
29 void Save(COptionsMgr *pOptionsMgr, const COLORREF * colors)
30 {
31         for (int i = 0; i < 16; i++)
32         {
33                 String valuename = strutils::format(_T("%s/%d"), Section, i);
34                 pOptionsMgr->SaveOption(valuename, static_cast<int>(colors[i]));
35         }
36 }
37
38 }}