summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-02 16:25:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-02 16:25:50 +0300
commit9cece856f594b529aae2f42ad116d16cbb3c0e52 (patch)
treed43b6b7fb4d8293a3f3aaba0a07c5ba28b05e611 /src
parent428051b8b98331a7419ca025be55a1ce0c52f826 (diff)
if nothing else helps, finally read the manual
- CCtrlSpin::SetRange had mixed up max & min values; - changing data in a spin control didn't send a change notification
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/mir_core.def3
-rw-r--r--src/mir_core/src/mir_core64.def3
-rw-r--r--src/mir_core/src/ui_utils.cpp16
3 files changed, 17 insertions, 5 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index ab1a87b9c7..6647e17126 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1036,5 +1036,6 @@ CallFunctionSync @1170
?GetItemRect@CCtrlListBox@@QAEHHPAUtagRECT@@@Z @1193 NONAME
?SetItemHeight@CCtrlListBox@@QAEXHH@Z @1194 NONAME
?UseSystemColors@CCtrlBase@@QAEXXZ @1195 NONAME
-?SetPosition@CCtrlSpin@@QAEXGG@Z @1196 NONAME
+?SetPosition@CCtrlSpin@@QAEXG@Z @1196 NONAME
?GetPosition@CCtrlSpin@@QAEGXZ @1197 NONAME
+?OnNotify@CCtrlSpin@@EAEHHPAUtagNMHDR@@@Z @1198 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 2f448e51a0..80f401f367 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1036,5 +1036,6 @@ CallFunctionSync @1170
?GetItemRect@CCtrlListBox@@QEAAHHPEAUtagRECT@@@Z @1193 NONAME
?SetItemHeight@CCtrlListBox@@QEAAXHH@Z @1194 NONAME
?UseSystemColors@CCtrlBase@@QEAAXXZ @1195 NONAME
-?SetPosition@CCtrlSpin@@QEAAXGG@Z @1196 NONAME
+?SetPosition@CCtrlSpin@@QEAAXG@Z @1196 NONAME
?GetPosition@CCtrlSpin@@QEAAGXZ @1197 NONAME
+?OnNotify@CCtrlSpin@@EEAAHHPEAUtagNMHDR@@@Z @1198 NONAME
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index a1ff5a9597..e4719b7372 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -676,19 +676,29 @@ CCtrlSpin::CCtrlSpin(CDlgBase *dlg, int ctrlId)
: CCtrlBase(dlg, ctrlId)
{}
+BOOL CCtrlSpin::OnNotify(int, NMHDR *pnmh)
+{
+ if (pnmh->code == UDN_DELTAPOS) {
+ NotifyChange();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
WORD CCtrlSpin::GetPosition()
{
return SendMsg(UDM_GETPOS, 0, 0);
}
-void CCtrlSpin::SetPosition(WORD wMax, WORD wMin)
+void CCtrlSpin::SetPosition(WORD wPos)
{
- SendMsg(UDM_SETPOS, 0, MAKELONG(wMin, wMax));
+ SendMsg(UDM_SETPOS, 0, wPos);
}
void CCtrlSpin::SetRange(WORD wMax, WORD wMin)
{
- SendMsg(UDM_SETRANGE, 0, MAKELONG(wMin, wMax));
+ SendMsg(UDM_SETRANGE, 0, MAKELPARAM(wMax, wMin));
}
/////////////////////////////////////////////////////////////////////////////////////////