Add keyboard navigation ability to Column Editor

Fix #8488, close #8569
This commit is contained in:
Scott Sumner 2020-07-15 14:22:25 -04:00 committed by Don HO
parent 1182371e07
commit 7d289139e8
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
4 changed files with 29 additions and 31 deletions

View File

@ -970,17 +970,17 @@ You can define several column markers by using white space to separate the diffe
<Item id="7004" name="Sort &amp;tabs"/> <Item id="7004" name="Sort &amp;tabs"/>
</Window> </Window>
<ColumnEditor title="Column Editor"> <ColumnEditor title="Column Editor">
<Item id="2023" name="Text to Insert"/> <Item id="2023" name="&amp;Text to Insert"/>
<Item id="2033" name="Number to Insert"/> <Item id="2033" name="&amp;Number to Insert"/>
<Item id="2030" name="Initial number :"/> <Item id="2030" name="&amp;Initial number :"/>
<Item id="2031" name="Increase by :"/> <Item id="2031" name="Increase b&amp;y :"/>
<Item id="2035" name="Leading zeros"/> <Item id="2035" name="Leading &amp;zeros"/>
<Item id="2036" name="Repeat :"/> <Item id="2036" name="&amp;Repeat :"/>
<Item id="2032" name="Format"/> <Item id="2032" name="&amp;Format"/>
<Item id="2024" name="Dec"/> <Item id="2024" name="&amp;Dec"/>
<Item id="2025" name="Oct"/> <Item id="2025" name="&amp;Oct"/>
<Item id="2026" name="Hex"/> <Item id="2026" name="&amp;Hex"/>
<Item id="2027" name="Bin"/> <Item id="2027" name="&amp;Bin"/>
<Item id="1" name="OK"/> <Item id="1" name="OK"/>
<Item id="2" name="Cancel"/> <Item id="2" name="Cancel"/>
</ColumnEditor> </ColumnEditor>

View File

@ -300,12 +300,10 @@ void ColumnEditorDlg::switchTo(bool toText)
{ {
HWND hText = ::GetDlgItem(_hSelf, IDC_COL_TEXT_EDIT); HWND hText = ::GetDlgItem(_hSelf, IDC_COL_TEXT_EDIT);
::EnableWindow(hText, toText); ::EnableWindow(hText, toText);
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_TEXT_GRP_STATIC), toText);
::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_SETCHECK, toText, 0); ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_SETCHECK, toText, 0);
HWND hNum = ::GetDlgItem(_hSelf, IDC_COL_INITNUM_EDIT); HWND hNum = ::GetDlgItem(_hSelf, IDC_COL_INITNUM_EDIT);
::SendDlgItemMessage(_hSelf, IDC_COL_NUM_RADIO, BM_SETCHECK, !toText, 0); ::SendDlgItemMessage(_hSelf, IDC_COL_NUM_RADIO, BM_SETCHECK, !toText, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_NUM_GRP_STATIC), !toText);
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_INITNUM_STATIC), !toText); ::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_INITNUM_STATIC), !toText);
::EnableWindow(hNum, !toText); ::EnableWindow(hNum, !toText);
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_INCRNUM_STATIC), !toText); ::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_INCRNUM_STATIC), !toText);

View File

@ -36,27 +36,27 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE
CAPTION "Column / Multi-Selection Editor" CAPTION "Column / Multi-Selection Editor"
FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x0 FONT 8, TEXT("MS Shell Dlg"), 0, 0, 0x0
BEGIN BEGIN
GROUPBOX "Text to Insert",IDC_COL_TEXT_GRP_STATIC,12,10,124,54 GROUPBOX "",IDC_COL_TEXT_GRP_STATIC,12,14,124,50
GROUPBOX "Number to Insert",IDC_COL_NUM_GRP_STATIC,12,75,204,139 GROUPBOX "",IDC_COL_NUM_GRP_STATIC,12,79,204,135
CONTROL "",IDC_COL_TEXT_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP,7,10,8,9 CONTROL "&Text to Insert",IDC_COL_TEXT_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP,7,5,124,9
CONTROL "",IDC_COL_NUM_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP, 7,75,8,9 CONTROL "&Number to Insert",IDC_COL_NUM_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP, 7,70,204,9
EDITTEXT IDC_COL_TEXT_EDIT,25,32,97,14,ES_AUTOHSCROLL EDITTEXT IDC_COL_TEXT_EDIT,25,32,97,14,ES_AUTOHSCROLL
RTEXT "Initial number :",IDC_COL_INITNUM_STATIC,15,91,76,8 RTEXT "&Initial number :",IDC_COL_INITNUM_STATIC,15,91,76,8
EDITTEXT IDC_COL_INITNUM_EDIT,95,89,38,12,ES_NUMBER EDITTEXT IDC_COL_INITNUM_EDIT,95,89,38,12,ES_NUMBER
RTEXT "Increase by :",IDC_COL_INCRNUM_STATIC,16,112,75,8 RTEXT "Increase b&y :",IDC_COL_INCRNUM_STATIC,16,112,75,8
EDITTEXT IDC_COL_INCREASENUM_EDIT,95,110,38,12,ES_NUMBER EDITTEXT IDC_COL_INCREASENUM_EDIT,95,110,38,12,ES_NUMBER
RTEXT "Repeat :",IDC_COL_REPEATNUM_STATIC,16,133,75,8 RTEXT "&Repeat :",IDC_COL_REPEATNUM_STATIC,16,133,75,8
EDITTEXT IDC_COL_REPEATNUM_EDIT,95,131,38,12,ES_NUMBER EDITTEXT IDC_COL_REPEATNUM_EDIT,95,131,38,12,ES_NUMBER
CONTROL "Leading zeros", IDC_COL_LEADZERO_CHECK,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,140,133,70,10 CONTROL "Leading &zeros", IDC_COL_LEADZERO_CHECK,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,140,133,70,10
CONTROL "Dec",IDC_COL_DEC_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,30,169,70,10 CONTROL "&Dec",IDC_COL_DEC_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,30,169,70,10
CONTROL "Hex",IDC_COL_HEX_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,124,169,70,10 CONTROL "&Hex",IDC_COL_HEX_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,124,169,70,10
CONTROL "Oct",IDC_COL_OCT_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,30,188,70,10 CONTROL "&Oct",IDC_COL_OCT_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,30,188,70,10
CONTROL "Bin",IDC_COL_BIN_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,124,188,70,10 CONTROL "&Bin",IDC_COL_BIN_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,124,188,70,10
GROUPBOX "Format",IDC_COL_FORMAT_GRP_STATIC,20,153,188,54,BS_CENTER GROUPBOX "&Format",IDC_COL_FORMAT_GRP_STATIC,20,153,188,54,BS_CENTER
DEFPUSHBUTTON "OK",IDOK,145,13,70,14,BS_NOTIFY DEFPUSHBUTTON "OK",IDOK,145,13,70,14,BS_NOTIFY
PUSHBUTTON "Cancel",IDCANCEL,145,36,70,14,BS_NOTIFY PUSHBUTTON "Cancel",IDCANCEL,145,36,70,14,BS_NOTIFY
END END

View File

@ -32,20 +32,20 @@
#define IDD_COLUMNEDIT 2020 #define IDD_COLUMNEDIT 2020
#define IDC_COL_INITNUM_EDIT (IDD_COLUMNEDIT + 1) #define IDC_COL_INITNUM_EDIT (IDD_COLUMNEDIT + 1)
#define IDC_COL_INCREASENUM_EDIT (IDD_COLUMNEDIT + 2) #define IDC_COL_INCREASENUM_EDIT (IDD_COLUMNEDIT + 2)
#define IDC_COL_TEXT_GRP_STATIC (IDD_COLUMNEDIT + 3) #define IDC_COL_TEXT_RADIO (IDD_COLUMNEDIT + 3)
#define IDC_COL_DEC_RADIO (IDD_COLUMNEDIT + 4) #define IDC_COL_DEC_RADIO (IDD_COLUMNEDIT + 4)
#define IDC_COL_OCT_RADIO (IDD_COLUMNEDIT + 5) #define IDC_COL_OCT_RADIO (IDD_COLUMNEDIT + 5)
#define IDC_COL_HEX_RADIO (IDD_COLUMNEDIT + 6) #define IDC_COL_HEX_RADIO (IDD_COLUMNEDIT + 6)
#define IDC_COL_BIN_RADIO (IDD_COLUMNEDIT + 7) #define IDC_COL_BIN_RADIO (IDD_COLUMNEDIT + 7)
#define IDC_COL_TEXT_RADIO (IDD_COLUMNEDIT + 8) #define IDC_COL_TEXT_GRP_STATIC (IDD_COLUMNEDIT + 8)
#define IDC_COL_NUM_RADIO (IDD_COLUMNEDIT + 9) #define IDC_COL_NUM_GRP_STATIC (IDD_COLUMNEDIT + 9)
#define IDC_COL_INITNUM_STATIC (IDD_COLUMNEDIT + 10) #define IDC_COL_INITNUM_STATIC (IDD_COLUMNEDIT + 10)
#define IDC_COL_INCRNUM_STATIC (IDD_COLUMNEDIT + 11) #define IDC_COL_INCRNUM_STATIC (IDD_COLUMNEDIT + 11)
#define IDC_COL_FORMAT_GRP_STATIC (IDD_COLUMNEDIT + 12) #define IDC_COL_FORMAT_GRP_STATIC (IDD_COLUMNEDIT + 12)
#define IDC_COL_NUM_GRP_STATIC (IDD_COLUMNEDIT + 13) #define IDC_COL_NUM_RADIO (IDD_COLUMNEDIT + 13)
#define IDC_COL_TEXT_EDIT (IDD_COLUMNEDIT + 14) #define IDC_COL_TEXT_EDIT (IDD_COLUMNEDIT + 14)
#define IDC_COL_LEADZERO_CHECK (IDD_COLUMNEDIT + 15) #define IDC_COL_LEADZERO_CHECK (IDD_COLUMNEDIT + 15)
#define IDC_COL_REPEATNUM_STATIC (IDD_COLUMNEDIT + 16) #define IDC_COL_REPEATNUM_STATIC (IDD_COLUMNEDIT + 16)
#define IDC_COL_REPEATNUM_EDIT (IDD_COLUMNEDIT + 17) #define IDC_COL_REPEATNUM_EDIT (IDD_COLUMNEDIT + 17)
#endif// COLUMNEDITOR_RC_H #endif// COLUMNEDITOR_RC_H