From 9acf79a52e372a16a1e4e30901841493c5cb57de Mon Sep 17 00:00:00 2001 From: VinsWorldcom Date: Wed, 5 Jul 2023 08:49:03 -0400 Subject: [PATCH 1/2] Change input box get focus after run command Currently, after running a command, the focus goes to the output window with the cursor blinking in it. One needs press `Tab` twice to return to the input combobox to enter a subsequent command. It seems to be stemming from a `SetFocus()` command to the handle of `m_hInput` which is defined: PythonScript/PythonScript/src/ConsoleDialog.cpp: ``` 126: m_hInput = FindWindowEx(m_hCombo, NULL, L"Edit", NULL); ``` Though I'm not sure what that returns since I don't see an Edit box in the PythonScript dockable dialog. There is however a combobox which is set to `m_hCombo` and that is where the commands are entered. This changes the `giveInputFocus()` method in ConsoleDialog class to give focus to the combobox. The only "issue" is that when gaining focus, the text in the combobox is not cleared, it is highlighted. One can simply start typing and it will overwrite. I think a vast improvement. Fix #184 --- PythonScript/src/ConsoleDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonScript/src/ConsoleDialog.h b/PythonScript/src/ConsoleDialog.h index 7dba1784..e9966fd3 100644 --- a/PythonScript/src/ConsoleDialog.h +++ b/PythonScript/src/ConsoleDialog.h @@ -37,7 +37,7 @@ class ConsoleDialog : public DockingDlgInterface std::string getContinuePrompt(); HWND getScintillaHwnd() { return m_scintilla; } - void giveInputFocus() { SetFocus(m_hInput); } + void giveInputFocus() { SetFocus(m_hCombo); } void runEnabled(bool enabled); From 816f747e4142c878c146af596521f2508c66edf6 Mon Sep 17 00:00:00 2001 From: VinsWorldcom Date: Wed, 5 Jul 2023 08:49:03 -0400 Subject: [PATCH 2/2] Change input box get focus after run command Currently, after running a command, the focus goes to the output window with the cursor blinking in it. One needs press `Tab` twice to return to the input combobox to enter a subsequent command. It seems to be stemming from a `SetFocus()` command to the handle of `m_hInput` which is defined: PythonScript/PythonScript/src/ConsoleDialog.cpp: ``` 126: m_hInput = FindWindowEx(m_hCombo, NULL, L"Edit", NULL); ``` Though I'm not sure what that returns since I don't see an Edit box in the PythonScript dockable dialog. There is however a combobox which is set to `m_hCombo` and that is where the commands are entered. This changes the `giveInputFocus()` method in ConsoleDialog class to give focus to the combobox. The only "issue" is that when gaining focus, the text in the combobox is not cleared, it is highlighted. One can simply start typing and it will overwrite. I think a vast improvement. Fix #184 --- PythonScript/src/ConsoleDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonScript/src/ConsoleDialog.h b/PythonScript/src/ConsoleDialog.h index 7dba1784..e9966fd3 100644 --- a/PythonScript/src/ConsoleDialog.h +++ b/PythonScript/src/ConsoleDialog.h @@ -37,7 +37,7 @@ class ConsoleDialog : public DockingDlgInterface std::string getContinuePrompt(); HWND getScintillaHwnd() { return m_scintilla; } - void giveInputFocus() { SetFocus(m_hInput); } + void giveInputFocus() { SetFocus(m_hCombo); } void runEnabled(bool enabled);