Show Push Dialog after close commit dialog
[TortoiseGit.git] / src / TortoiseProc / Colors.cpp
blobcc98a5f43685b908a34e9b657254c165986bd1f1
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2007 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "StdAfx.h"
20 #include ".\colors.h"
22 CColors::COLOR_DATA CColors::m_ColorArray[]=
24 {Cmd,_T("Software\\TortoiseGit\\Colors\\Cmd"),RGB(100, 100, 100)},
25 {Conflict,_T("Software\\TortoiseGit\\Colors\\Conflict"), RGB(255, 0, 0)},
26 {Modified,_T("Software\\TortoiseGit\\Colors\\Modified"), RGB(0, 50, 160)},
27 {Merged,_T("Software\\TortoiseGit\\Colors\\Merged"), RGB(0, 100, 0)},
28 {Deleted,_T("Software\\TortoiseGit\\Colors\\Deleted"), RGB(100, 0, 0)},
29 {Added,_T("Software\\TortoiseGit\\Colors\\Added"), RGB(100, 0, 100)},
30 {LastCommit,_T("Software\\TortoiseGit\\Colors\\LastCommit"), RGB(100, 100, 100)},
31 {DeletedNode,_T("Software\\TortoiseGit\\Colors\\DeletedNode"), RGB(255, 0, 0)},
32 {AddedNode,_T("Software\\TortoiseGit\\Colors\\AddedNode"), RGB(0, 255, 0)},
33 {ReplacedNode,_T("Software\\TortoiseGit\\Colors\\ReplacedNode"), RGB(0, 255, 0)},
34 {RenamedNode,_T("Software\\TortoiseGit\\Colors\\RenamedNode"), RGB(0, 0, 255)},
35 {LastCommitNode,_T("Software\\TortoiseGit\\Colors\\LastCommitNode"), RGB(200, 200, 200)},
36 {PropertyChanged,_T("Software\\TortoiseGit\\Colors\\PropertyChanged"), RGB(0, 50, 160)},
37 {CurrentBranch,_T("Software\\TortoiseGit\\Colors\\CurrentBranch"), RGB(200, 0, 0)},
38 {LocalBranch,_T("Software\\TortoiseGit\\Colors\\LocalBranch"), RGB(0, 195, 0)},
39 {RemoteBranch,_T("Software\\TortoiseGit\\Colors\\RemoteBranch"), RGB(255, 221, 170)},
40 {Tag,_T("Software\\TortoiseGit\\Colors\\Tag"), RGB(255, 255, 0)},
41 {Stash,_T("Software\\TortoiseGit\\Colors\\Stash"), RGB(128, 128, 128)},
42 {BranchLine1,_T("Software\\TortoiseGit\\Colors\\BranchLine1"), RGB(0,0,0)},
43 {BranchLine2,_T("Software\\TortoiseGit\\Colors\\BranchLine2"), RGB(0xFF,0,0)},
44 {BranchLine3,_T("Software\\TortoiseGit\\Colors\\BranchLine3"), RGB(0,0xFF,0)},
45 {BranchLine4,_T("Software\\TortoiseGit\\Colors\\BranchLine4"), RGB(0,0,0xFF)},
46 {BranchLine5,_T("Software\\TortoiseGit\\Colors\\BranchLine5"), RGB(128,128,128)},
47 {BranchLine6,_T("Software\\TortoiseGit\\Colors\\BranchLine6"), RGB(128,128,0)},
48 {BranchLine7,_T("Software\\TortoiseGit\\Colors\\BranchLine7"), RGB(0,128,128)},
49 {BranchLine8,_T("Software\\TortoiseGit\\Colors\\BranchLine8"), RGB(128,0,128)},
50 {COLOR_END,_T("Software\\TortoiseGit\\Colors\\END"),RGB(0,0,0)},
54 CColors::CColors(void)
58 CColors::~CColors(void)
62 COLORREF CColors::GetColor(Colors col, bool bDefault /*=true*/)
64 int i=0;
65 while(1)
67 if(m_ColorArray[i].Color == COLOR_END)
68 return RGB(0,0,0);
70 if(m_ColorArray[i].Color == col)
72 if(bDefault)
73 return m_ColorArray[i].Default;
74 else
76 CRegDWORD reg(m_ColorArray[i].RegKey,m_ColorArray[i].Default);
77 return (COLORREF)(DWORD) reg;
81 i++;
85 void CColors::SetColor(Colors col, COLORREF cr)
87 int i=0;
88 while(1)
90 if(m_ColorArray[i].Color == COLOR_END)
91 break;
93 if(m_ColorArray[i].Color == col)
95 CRegDWORD reg(m_ColorArray[i].RegKey,m_ColorArray[i].Default);
96 reg=cr;
99 i++;