From 563aac340768af4f96fd74a3246098cc3bdf47e0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 5 Feb 2019 13:39:25 +0300 Subject: fixes #1825 (spin control initialization should be done in the constructor, not inside OnInitDialog) --- src/core/stdautoaway/src/options.cpp | 3 +-- src/core/stdmsg/src/chat_options.cpp | 9 +++------ src/core/stdmsg/src/msgoptions.cpp | 7 +++---- 3 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src/core') diff --git a/src/core/stdautoaway/src/options.cpp b/src/core/stdautoaway/src/options.cpp index 33c9a25713..ad04fdb3a3 100644 --- a/src/core/stdautoaway/src/options.cpp +++ b/src/core/stdautoaway/src/options.cpp @@ -59,7 +59,7 @@ public: COptionsDlg() : CDlgBase(g_plugin, IDD_OPT_IDLE), edt1sttime(this, IDC_IDLE1STTIME), - spinIdle(this, IDC_IDLESPIN), + spinIdle(this, IDC_IDLESPIN, 60, 1), cmbAAStatus(this, IDC_AASTATUS), chkShort(this, IDC_IDLESHORT), chkLocked(this, IDC_LOCKED), @@ -91,7 +91,6 @@ public: { chkOnWindows.SetState(!g_plugin.bIdleMethod); - spinIdle.SetRange(60, 1); spinIdle.SetPosition(g_plugin.iIdleTime1st); for (auto &it : aa_Status) diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 91a6d735c5..4089bea769 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -432,9 +432,9 @@ class COptLogDlg : public CDlgBase public: COptLogDlg() : CDlgBase(g_plugin, IDD_OPTIONS2), - spin2(this, IDC_SPIN2), - spin3(this, IDC_SPIN3), - spin4(this, IDC_SPIN4), + spin2(this, IDC_SPIN2, 5000), + spin3(this, IDC_SPIN3, 10000), + spin4(this, IDC_SPIN4, 255, 10), edtGroup(this, IDC_GROUP), edtLimit(this, IDC_LIMIT), @@ -458,11 +458,8 @@ public: bool OnInitDialog() override { - spin2.SetRange(5000); spin2.SetPosition(db_get_w(0, CHAT_MODULE, "LogLimit", 100)); - spin3.SetRange(10000); spin3.SetPosition(db_get_w(0, CHAT_MODULE, "LoggingLimit", 100)); - spin4.SetRange(255, 10); spin4.SetPosition(db_get_b(0, CHAT_MODULE, "NicklistRowDist", 12)); edtGroup.SetText(ptrW(Chat_GetGroup())); diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index bbe98a0d34..432691a177 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -330,8 +330,8 @@ public: chkLoadCount(this, IDC_LOADCOUNT), chkLoadUnread(this, IDC_LOADUNREAD), - spinTime(this, IDC_LOADTIMESPIN), - spinCount(this, IDC_LOADCOUNTSPIN) + spinTime(this, IDC_LOADTIMESPIN, 12 * 60), + spinCount(this, IDC_LOADCOUNTSPIN, 100) { chkTime.OnChange = Callback(this, &COptionLogDlg::onChange_Time); chkLoadUnread.OnChange = chkLoadCount.OnChange = chkLoadTime.OnChange = Callback(this, &COptionLogDlg::onChange_Load); @@ -362,9 +362,8 @@ public: EnableWindow(GetDlgItem(m_hwnd, IDC_STMINSOLD), TRUE); break; } - spinCount.SetRange(100); + spinCount.SetPosition(g_dat.nLoadCount); - spinTime.SetRange(12 * 60); spinTime.SetPosition(g_dat.nLoadTime); onChange_Time(nullptr); -- cgit v1.2.3