summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-05 23:38:07 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-05 23:38:07 +0300
commite5877abcc0a8321c79a53c24e3e7c8c0490c7d04 (patch)
tree3944915516ad02c3a4dcf51582d77bc15d651d2e /src/mir_core
parent5e448daea46d976774cff4f2dd7cf2af791ee201 (diff)
CCtrlColor class - the wrapper for Windows Color Picker
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/mir_core.vcxproj1
-rw-r--r--src/mir_core/mir_core.vcxproj.filters3
-rw-r--r--src/mir_core/src/CCtrlColor.cpp61
-rw-r--r--src/mir_core/src/mir_core.def8
-rw-r--r--src/mir_core/src/mir_core64.def8
5 files changed, 81 insertions, 0 deletions
diff --git a/src/mir_core/mir_core.vcxproj b/src/mir_core/mir_core.vcxproj
index 642c3291d8..d95f7b9197 100644
--- a/src/mir_core/mir_core.vcxproj
+++ b/src/mir_core/mir_core.vcxproj
@@ -46,6 +46,7 @@
<ClCompile Include="src\CCtrlButton.cpp" />
<ClCompile Include="src\CCtrlCheck.cpp" />
<ClCompile Include="src\CCtrlClc.cpp" />
+ <ClCompile Include="src\CCtrlColor.cpp" />
<ClCompile Include="src\CCtrlCombo.cpp" />
<ClCompile Include="src\CCtrlData.cpp" />
<ClCompile Include="src\cctrldate.cpp" />
diff --git a/src/mir_core/mir_core.vcxproj.filters b/src/mir_core/mir_core.vcxproj.filters
index 4a66ccbaa5..17987d4682 100644
--- a/src/mir_core/mir_core.vcxproj.filters
+++ b/src/mir_core/mir_core.vcxproj.filters
@@ -170,6 +170,9 @@
<ClCompile Include="src\CCtrlTreeOpts.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\CCtrlColor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\miranda.h">
diff --git a/src/mir_core/src/CCtrlColor.cpp b/src/mir_core/src/CCtrlColor.cpp
new file mode 100644
index 0000000000..f7bfe6c32d
--- /dev/null
+++ b/src/mir_core/src/CCtrlColor.cpp
@@ -0,0 +1,61 @@
+/*
+
+Object UI extensions
+Copyright (c) 2008 Victor Pavlychko, George Hazan
+Copyright (C) 2012-20 Miranda NG team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "stdafx.h"
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// CCtrlColor class
+
+CCtrlColor::CCtrlColor(CDlgBase *dlg, int ctrlId) :
+ CCtrlData(dlg, ctrlId)
+{}
+
+BOOL CCtrlColor::OnCommand(HWND, WORD, WORD)
+{
+ NotifyChange();
+ return TRUE;
+}
+
+bool CCtrlColor::OnApply()
+{
+ CSuper::OnApply();
+
+ if (m_dbLink != nullptr)
+ SaveInt(GetColor());
+ return true;
+}
+
+void CCtrlColor::OnReset()
+{
+ if (m_dbLink != nullptr)
+ SetColor(LoadInt());
+}
+
+DWORD CCtrlColor::GetColor()
+{
+ return ::SendMessage(m_hwnd, CPM_GETCOLOUR, 0, 0);
+}
+
+void CCtrlColor::SetColor(DWORD dwValue)
+{
+ ::SendMessage(m_hwnd, CPM_SETCOLOUR, 0, dwValue);
+}
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index fb23cba365..950ceb9d55 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1481,3 +1481,11 @@ TimeZone_GetSystemTime @1692
?OnInit@CCtrlTreeOpts@@UAEXXZ @1704 NONAME
?OnNotify@CCtrlTreeOpts@@UAEHHPAUtagNMHDR@@@Z @1705 NONAME
?ProcessItemClick@CCtrlTreeOpts@@IAEXPAU_TREEITEM@@@Z @1706 NONAME
+??0CCtrlColor@@QAE@PAVCDlgBase@@H@Z @1707 NONAME
+??1CCtrlColor@@UAE@XZ @1708 NONAME
+??_7CCtrlColor@@6B@ @1709 NONAME
+?GetColor@CCtrlColor@@QAEKXZ @1710 NONAME
+?OnApply@CCtrlColor@@UAE_NXZ @1711 NONAME
+?OnCommand@CCtrlColor@@UAEHPAUHWND__@@GG@Z @1712 NONAME
+?OnReset@CCtrlColor@@UAEXXZ @1713 NONAME
+?SetColor@CCtrlColor@@QAEXK@Z @1714 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index a69cfbc500..0a9b1f8baf 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1481,3 +1481,11 @@ TimeZone_GetSystemTime @1692
?OnInit@CCtrlTreeOpts@@UEAAXXZ @1704 NONAME
?OnNotify@CCtrlTreeOpts@@UEAAHHPEAUtagNMHDR@@@Z @1705 NONAME
?ProcessItemClick@CCtrlTreeOpts@@IEAAXPEAU_TREEITEM@@@Z @1706 NONAME
+??0CCtrlColor@@QEAA@PEAVCDlgBase@@H@Z @1707 NONAME
+??1CCtrlColor@@UEAA@XZ @1708 NONAME
+??_7CCtrlColor@@6B@ @1709 NONAME
+?GetColor@CCtrlColor@@QEAAKXZ @1710 NONAME
+?OnApply@CCtrlColor@@UEAA_NXZ @1711 NONAME
+?OnCommand@CCtrlColor@@UEAAHPEAUHWND__@@GG@Z @1712 NONAME
+?OnReset@CCtrlColor@@UEAAXXZ @1713 NONAME
+?SetColor@CCtrlColor@@QEAAXK@Z @1714 NONAME