Skip to content

Commit 2ac5692

Browse files
vinsworldcomVinsWorldcom
andauthored
Change input box get focus after run command (#293)
* 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 * 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 --------- Co-authored-by: VinsWorldcom <[email protected]>
1 parent 5c42c49 commit 2ac5692

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PythonScript/src/ConsoleDialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ConsoleDialog : public DockingDlgInterface
3737
std::string getContinuePrompt();
3838
HWND getScintillaHwnd() { return m_scintilla; }
3939

40-
void giveInputFocus() { SetFocus(m_hInput); }
40+
void giveInputFocus() { SetFocus(m_hCombo); }
4141

4242
void runEnabled(bool enabled);
4343

0 commit comments

Comments
 (0)