[dasher: 54/61] Fix for direct entry preblem with too frequent reset on focus change.
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 54/61] Fix for direct entry preblem with too frequent reset on focus change.
- Date: Thu, 28 Dec 2017 10:07:08 +0000 (UTC)
commit 0f33470b100a3e8d65e36bede51eb4473342c75c
Author: Ada Majorek <amajorek google com>
Date: Sat Apr 22 03:58:35 2017 -0700
Fix for direct entry preblem with too frequent reset on focus change.
Added configuration option, to turn off reset Dasher to new sentence
after focus changes window. Fixes #115.
Src/Common/AppSettingsData.h | 1 +
Src/Common/AppSettingsHeader.h | 3 ++-
Src/Win32/Dasher.rc | 9 +++++----
Src/Win32/DasherWindow.cpp | 3 ++-
Src/Win32/Widgets/AdvancedPage.cpp | 16 +++++++++++-----
Src/Win32/resource.h | 2 +-
6 files changed, 22 insertions(+), 12 deletions(-)
---
diff --git a/Src/Common/AppSettingsData.h b/Src/Common/AppSettingsData.h
index 5beddc2..c9d84ba 100644
--- a/Src/Common/AppSettingsData.h
+++ b/Src/Common/AppSettingsData.h
@@ -34,6 +34,7 @@ Dasher::Settings::bp_table app_boolparamtable[] = {
#endif
{ APP_BP_MIRROR_LAYOUT, "MirrorLayout", Persistence::PERSISTENT, false, "MirrorLayout" },
{ APP_BP_FULL_SCREEN, "FullScreen", Persistence::PERSISTENT, false, "FullScreen" },
+{ APP_BP_RESET_ON_FOCUS_CHANGE, "ResetOnFocusChange", Persistence::PERSISTENT, true, "ResetOnFocusChange" },
};
Dasher::Settings::lp_table app_longparamtable[] = {
diff --git a/Src/Common/AppSettingsHeader.h b/Src/Common/AppSettingsHeader.h
index bde7e7e..da12729 100644
--- a/Src/Common/AppSettingsHeader.h
+++ b/Src/Common/AppSettingsHeader.h
@@ -8,7 +8,8 @@
enum {
APP_BP_TIME_STAMP = END_OF_SPS, APP_BP_CONFIRM_UNSAVED, APP_BP_SHOW_TOOLBAR,
- APP_BP_SHOW_STATUSBAR, APP_BP_MIRROR_LAYOUT, APP_BP_FULL_SCREEN, END_OF_APP_BPS
+ APP_BP_SHOW_STATUSBAR, APP_BP_MIRROR_LAYOUT, APP_BP_FULL_SCREEN, APP_BP_RESET_ON_FOCUS_CHANGE,
+ END_OF_APP_BPS
};
enum {
diff --git a/Src/Win32/Dasher.rc b/Src/Win32/Dasher.rc
index 80f57e3..9766ec2 100644
--- a/Src/Win32/Dasher.rc
+++ b/Src/Win32/Dasher.rc
@@ -233,11 +233,10 @@ BEGIN
CONTROL "Show statusbar",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,54,66,10
CONTROL "Control mode",IDC_CONTROLMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,82,59,10
LISTBOX IDC_CONTROLBOXES,14,92,166,132,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Stand-alone",IDC_STYLE_STANDALONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP |
WS_TABSTOP,204,96,55,10
+ CONTROL "Stand-alone",IDC_STYLE_STANDALONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP |
WS_TABSTOP,204,108,55,10
CONTROL "Composition",IDC_STYLE_COMPOSITION,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,204,120,55,10
- CONTROL "Direct entry",IDC_STYLE_DIRECT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,204,108,54,10
+ CONTROL "Direct entry",IDC_STYLE_DIRECT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,204,96,54,10
GROUPBOX "Application Style:",IDC_STATIC,198,84,180,63
- CONTROL "Full screen",IDC_STYLE_FULL,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE |
WS_TABSTOP,204,132,50,10
GROUPBOX "Application Options:",IDC_STATIC,7,7,180,62
GROUPBOX "Speech:",IDC_STATIC,198,6,180,39
GROUPBOX "Editor Font:",IDC_STATIC,194,154,180,30
@@ -246,9 +245,11 @@ BEGIN
CONTROL "Speak on word breaks",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,30,90,10
GROUPBOX "Clipboard:",IDC_STATIC,198,48,180,30
CONTROL "Copy all on stop",IDC_COPYONSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,60,90,10
- CONTROL "Flip Edit Position",IDC_MIRROR_LAYOUT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,295,91,76,21
+ CONTROL "Flip Edit Position",IDC_MIRROR_LAYOUT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,270,114,76,10
COMBOBOX IDC_FILE_ENCODING,198,208,153,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "File Encoding:",IDC_STATIC,193,194,180,30
+ CONTROL "Reset on Window Change",IDC_RESET_ON_FOCUS_CHANGE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,96,100,10
END
IDD_MODULESETTINGS DIALOGEX 0, 0, 309, 177
diff --git a/Src/Win32/DasherWindow.cpp b/Src/Win32/DasherWindow.cpp
index 2273b44..0f40131 100644
--- a/Src/Win32/DasherWindow.cpp
+++ b/Src/Win32/DasherWindow.cpp
@@ -496,7 +496,8 @@ void CDasherWindow::HandleWinEvent(HWINEVENTHOOK hWinEventHook, DWORD event, HWN
return;
// Ignore events if not in direct mode
- if (m_pAppSettings->GetLongParameter(APP_LP_STYLE) != APP_STYLE_DIRECT)
+ if ((m_pAppSettings->GetLongParameter(APP_LP_STYLE) != APP_STYLE_DIRECT) ||
+ !m_pAppSettings->GetBoolParameter(APP_BP_RESET_ON_FOCUS_CHANGE))
return;
// For now assume all events are focus changes, so reset the buffer
diff --git a/Src/Win32/Widgets/AdvancedPage.cpp b/Src/Win32/Widgets/AdvancedPage.cpp
index a68f042..4638af0 100644
--- a/Src/Win32/Widgets/AdvancedPage.cpp
+++ b/Src/Win32/Widgets/AdvancedPage.cpp
@@ -47,6 +47,7 @@ static menuentry menutable[] = {
{BP_SPEAK_ALL_ON_STOP, IDC_CHECK3},
{ BP_COPY_ALL_ON_STOP, IDC_COPYONSTOP },
{ APP_BP_MIRROR_LAYOUT, IDC_MIRROR_LAYOUT},
+ { APP_BP_RESET_ON_FOCUS_CHANGE, IDC_RESET_ON_FOCUS_CHANGE},
};
void CAdvancedPage::PopulateList() {
@@ -72,9 +73,6 @@ void CAdvancedPage::PopulateList() {
case APP_STYLE_DIRECT:
SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_DIRECT), BM_SETCHECK, BST_CHECKED, 0);
break;
- case APP_STYLE_FULLSCREEN:
- SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_FULL), BM_SETCHECK, BST_CHECKED, 0);
- break;
}
HWND ListBox = GetDlgItem(m_hwnd, IDC_CONTROLBOXES);
@@ -118,6 +116,10 @@ void CAdvancedPage::PopulateList() {
fileEncodingCb.SendMessage(CB_SETCURSEL, 0, 0);
break;
}
+
+ EnableWindow(ListBox, SendMessage(GetDlgItem(m_hwnd, IDC_CONTROLMODE), BM_GETCHECK, 0, 0) == BST_CHECKED);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_MIRROR_LAYOUT), !SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_DIRECT),
BM_GETCHECK, 0, 0) == BST_CHECKED);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_RESET_ON_FOCUS_CHANGE), SendMessage(GetDlgItem(m_hwnd,
IDC_STYLE_DIRECT), BM_GETCHECK, 0, 0) == BST_CHECKED);
}
bool CAdvancedPage::Apply() {
@@ -127,8 +129,6 @@ bool CAdvancedPage::Apply() {
m_pAppSettings->SetLongParameter(APP_LP_STYLE, 1);
else if(SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_DIRECT), BM_GETCHECK, 0, 0))
m_pAppSettings->SetLongParameter(APP_LP_STYLE, 2);
- else if(SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_FULL), BM_GETCHECK, 0, 0))
- m_pAppSettings->SetLongParameter(APP_LP_STYLE, 3);
HWND ListBox = GetDlgItem(m_hwnd, IDC_CONTROLBOXES);
LRESULT CurrentItem = SendMessage(ListBox, LB_GETCURSEL, 0, 0);
@@ -203,6 +203,12 @@ LRESULT CAdvancedPage::WndProc(HWND Window, UINT message, WPARAM wParam, LPARAM
case IDC_CONTROLMODE:
EnableWindow(GetDlgItem(m_hwnd, IDC_CONTROLBOXES), SendMessage(GetDlgItem(m_hwnd, IDC_CONTROLMODE),
BM_GETCHECK, 0, 0) == BST_CHECKED);
break;
+ case IDC_STYLE_COMPOSITION:
+ case IDC_STYLE_DIRECT:
+ case IDC_STYLE_STANDALONE:
+ EnableWindow(GetDlgItem(m_hwnd, IDC_MIRROR_LAYOUT), !SendMessage(GetDlgItem(m_hwnd,
IDC_STYLE_DIRECT), BM_GETCHECK, 0, 0) == BST_CHECKED);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_RESET_ON_FOCUS_CHANGE), SendMessage(GetDlgItem(m_hwnd,
IDC_STYLE_DIRECT), BM_GETCHECK, 0, 0) == BST_CHECKED);
+ break;
}
}
diff --git a/Src/Win32/resource.h b/Src/Win32/resource.h
index cde219a..9084c04 100644
--- a/Src/Win32/resource.h
+++ b/Src/Win32/resource.h
@@ -47,6 +47,7 @@
#define IDC_THICKLINE 1020
#define IDC_COPYONSTOP 1020
#define IDC_MIRROR_LAYOUT 1021
+#define IDC_RESET_ON_FOCUS_CHANGE 1022
#define IDC_SPACE 1036
#define IDC_UNIFORMVAL 1040
#define IDC_CHECK3 1071
@@ -75,7 +76,6 @@
#define IDC_STYLE_STANDALONE 1122
#define IDC_STYLE_COMPOSITION 1123
#define IDC_STYLE_DIRECT 1124
-#define IDC_STYLE_FULL 1125
#define IDC_MOUSEPOS_STYLE 1144
#define IDC_AUTOCALIBRATE 1145
#define IDC_CONTROLMODE 1146
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]