Browse Source

show selected index and clipboard change delay in adv settings

sabrogden 8 years ago
parent
commit
f9cb7915a1
3 changed files with 26 additions and 0 deletions
  1. 20 0
      AdvGeneral.cpp
  2. 5 0
      Options.cpp
  3. 1 0
      Options.h

+ 20 - 0
AdvGeneral.cpp

@@ -102,6 +102,8 @@ END_MESSAGE_MAP()
 
 #define SETTING_SHOW_STARTUP_MESSAGE 58
 #define SETTING_TOOLTIP_TIMEOUT 59
+#define SETTING_SELECTED_INDEX 60
+#define SETTING_CLIPBOARD_SAVE_DELAY 61
 
 BOOL CAdvGeneral::OnInitDialog()
 {
@@ -153,7 +155,13 @@ BOOL CAdvGeneral::OnInitDialog()
 
 	AddTrueFalse(pGroupTest, _T("Paste Clip in active window after selection"), CGetSetOptions::GetSendPasteAfterSelection(), SETTING_PASTE_IN_ACTIVE_WINDOW);
 	AddTrueFalse(pGroupTest, _T("Prompt when deleting clips"), CGetSetOptions::GetPromptWhenDeletingClips(), SETTING_PROMP_ON_DELETE);
+
+	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Save Clipboard Delay (ms, default: 100))"), (long)(CGetSetOptions::GetProcessDrawClipboardDelay()), _T(""), SETTING_CLIPBOARD_SAVE_DELAY));
+
 	AddTrueFalse(pGroupTest, _T("Save Multi-Pastes"), CGetSetOptions::GetSaveMultiPaste(), SETTING_SAVE_MULTI_PASTE);
+
+	pGroupTest->AddSubItem(new CMFCPropertyGridProperty(_T("Selected Index"), (long)(CGetSetOptions::SelectedIndex()+1), _T(""), SETTING_SELECTED_INDEX));
+
 	AddTrueFalse(pGroupTest, _T("Show Clips That are in Groups in Main List"), CGetSetOptions::GetShowAllClipsInMainList(), SETTING_SHOW_GROUP_CLIPS_IN_LIST);
 	AddTrueFalse(pGroupTest, _T("Show leading whitespace"), CGetSetOptions::GetDescShowLeadingWhiteSpace(), SETTING_SHOW_LEADING_WHITESPACE);
 	AddTrueFalse(pGroupTest, _T("Show In Taskbar"), CGetSetOptions::GetShowInTaskBar(), SETTTING_SHOW_IN_TASKBAR);
@@ -253,6 +261,18 @@ void CAdvGeneral::OnBnClickedOk()
 					CGetSetOptions::SetDescTextSize(pNewValue->lVal);
 				}
 				break;
+			case SETTING_SELECTED_INDEX:
+				if (pNewValue->lVal != pOrigValue->lVal)
+				{
+					CGetSetOptions::SetSelectedIndex(max((pNewValue->lVal-1), 0));
+				}
+				break;
+			case SETTING_CLIPBOARD_SAVE_DELAY:
+				if (pNewValue->lVal != pOrigValue->lVal)
+				{
+					CGetSetOptions::SetProcessDrawClipboardDelay(max(pNewValue->lVal, 0));
+				}
+				break;
 			case SETTING_SHOW_TASKBAR_ICON:
 				if (wcscmp(pNewValue->bstrVal, pOrigValue->bstrVal) != 0)
 				{

+ 5 - 0
Options.cpp

@@ -1984,6 +1984,11 @@ DWORD CGetSetOptions::SelectedIndex()
 	return (DWORD)GetProfileLong(_T("SelectedIndex"), 0);
 }
 
+void CGetSetOptions::SetSelectedIndex(int val)
+{
+	SetProfileLong(_T("SelectedIndex"), val);
+}
+
 void CGetSetOptions::SetCopyAppInclude(CString csAppName)
 {
 	SetProfileString(_T("CopyAppInclude"), csAppName);

+ 1 - 0
Options.h

@@ -404,6 +404,7 @@ public:
 	static BOOL		GetSetFocusToApp(CString csAppName);
 
 	static DWORD	SelectedIndex();
+	static void		SetSelectedIndex(int val);
 
 	static void		SetCopyAppInclude(CString csAppName);
 	static CString  GetCopyAppInclude();