diff options
author | George Hazan <ghazan@miranda.im> | 2022-02-27 20:35:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-02-27 20:35:15 +0300 |
commit | 4486400f900e1e7520ab88e4f8675af395e4cdc5 (patch) | |
tree | 1928a612b689f71befea39e8be48a5ae7f90269a /plugins/NewEventNotify | |
parent | 63cf6dce8b3151a02feeb88a40837b5039a32ea6 (diff) |
NEN: added spin control to prevent entering random values into options
Diffstat (limited to 'plugins/NewEventNotify')
-rw-r--r-- | plugins/NewEventNotify/res/resource.rc | 3 | ||||
-rw-r--r-- | plugins/NewEventNotify/src/options.cpp | 11 | ||||
-rw-r--r-- | plugins/NewEventNotify/src/resource.h | 3 |
3 files changed, 12 insertions, 5 deletions
diff --git a/plugins/NewEventNotify/res/resource.rc b/plugins/NewEventNotify/res/resource.rc index b654e93e9e..b164f67480 100644 --- a/plugins/NewEventNotify/res/resource.rc +++ b/plugins/NewEventNotify/res/resource.rc @@ -80,8 +80,9 @@ BEGIN CONTROL "Show date",IDC_CHKSHOWDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,74,227,10
CONTROL "Show time",IDC_CHKSHOWTIME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,85,214,10
CONTROL "Show headers",IDC_CHKSHOWHEADERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,96,220,10
- LTEXT "Number of begin shown messages",IDC_LBNUMBERMSG,15,109,143,8
+ LTEXT "Number of messages being shown",IDC_LBNUMBERMSG,15,109,143,8
EDITTEXT IDC_NUMBERMSG,166,107,48,13,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN_MSGNUMBER,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,214,106,10,14
CONTROL "Last message display first",IDC_RDNEW,"Button",BS_AUTORADIOBUTTON,14,120,253,9
CONTROL "Last message display last",IDC_RDOLD,"Button",BS_AUTORADIOBUTTON,14,131,285,9
END
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp index 7fb0e21e43..0d6c566b03 100644 --- a/plugins/NewEventNotify/src/options.cpp +++ b/plugins/NewEventNotify/src/options.cpp @@ -349,8 +349,12 @@ public: class COptionsMessageDlg : public COptionsBaseDlg
{
+ CCtrlSpin spinMsgNumber;
+
void GrabData()
{
+ g_plugin.iNumberMsg = spinMsgNumber.GetPosition();
+
g_plugin.bMergePopup = IsDlgButtonChecked(m_hwnd, IDC_CHKMERGEPOPUP);
g_plugin.bMsgWindowCheck = IsDlgButtonChecked(m_hwnd, IDC_CHKWINDOWCHECK);
g_plugin.bMsgReplyWindow = IsDlgButtonChecked(m_hwnd, IDC_CHKREPLYWINDOW);
@@ -360,16 +364,18 @@ class COptionsMessageDlg : public COptionsBaseDlg g_plugin.bShowON = IsDlgButtonChecked(m_hwnd, IDC_RDOLD);
g_plugin.bShowON = BST_UNCHECKED == IsDlgButtonChecked(m_hwnd, IDC_RDNEW);
g_plugin.bHideSend = IsDlgButtonChecked(m_hwnd, IDC_CHKHIDESEND);
- g_plugin.iNumberMsg = GetDlgItemInt(m_hwnd, IDC_NUMBERMSG, nullptr, FALSE);
}
public:
COptionsMessageDlg() :
- COptionsBaseDlg(IDD_OPT_MESSAGE)
+ COptionsBaseDlg(IDD_OPT_MESSAGE),
+ spinMsgNumber(this, IDC_SPIN_MSGNUMBER, 10, 1)
{}
bool OnInitDialog() override
{
+ spinMsgNumber.SetPosition(g_plugin.iNumberMsg);
+
CheckDlgButton(m_hwnd, IDC_CHKMERGEPOPUP, g_plugin.bMergePopup);
CheckDlgButton(m_hwnd, IDC_CHKWINDOWCHECK, g_plugin.bMsgWindowCheck);
CheckDlgButton(m_hwnd, IDC_CHKREPLYWINDOW, g_plugin.bMsgReplyWindow);
@@ -379,7 +385,6 @@ public: CheckDlgButton(m_hwnd, IDC_RDNEW, !g_plugin.bShowON);
CheckDlgButton(m_hwnd, IDC_RDOLD, g_plugin.bShowON);
CheckDlgButton(m_hwnd, IDC_CHKHIDESEND, g_plugin.bHideSend);
- SetDlgItemInt(m_hwnd, IDC_NUMBERMSG, g_plugin.iNumberMsg, FALSE);
OnChange();
return true;
diff --git a/plugins/NewEventNotify/src/resource.h b/plugins/NewEventNotify/src/resource.h index cc09b63989..564dd33c47 100644 --- a/plugins/NewEventNotify/src/resource.h +++ b/plugins/NewEventNotify/src/resource.h @@ -45,6 +45,7 @@ #define IDC_TESTFORREAD 1046
#define IDC_CMDEDITHEADERS 1047
#define IDC_OPT_TREE 1048
+#define IDC_SPIN_MSGNUMBER 1049
// Next default values for new objects
//
@@ -52,7 +53,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1049
+#define _APS_NEXT_CONTROL_VALUE 1050
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|