Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change input box get focus after run command #293

Merged
merged 3 commits into from
Jul 5, 2023

Conversation

vinsworldcom
Copy link
Contributor

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

VinsWorldcom added 3 commits July 5, 2023 08:49
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 bruderstein#184
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 bruderstein#184
@alankilborn
Copy link

Some of the existing behavior can be attributed to desires of @Yaron10

@chcg chcg merged commit 2ac5692 into bruderstein:master Jul 5, 2023
@vinsworldcom vinsworldcom deleted the 184_focus branch July 5, 2023 21:31
@Yaron10
Copy link

Yaron10 commented Jul 6, 2023

@alankilborn,

I can't remember that "desire" now.
And if there was such a request, it was approved by @chcg, Claudia and yourself. :)

Why is v3 still Alpha? - I'm still using v2.

@alankilborn
Copy link

I can't remember that "desire" now.

I'm really surprised by that statement. :-)

it was approved by @chcg, Claudia and yourself

Not me, unless not negatively commenting constitutes tacit approval. :-)

Why is v3 still Alpha? - I'm still using v2.

Not my place to comment, but since I'm replying for the above anyway...
I think the reason is that PS3 (by way of Python3) doesn't have a clean way to handle non-unicode encodings, and maybe the hope is that some way will be discovered at some point?
IMO, just push forward without support for antiquated encodings.

@Yaron10
Copy link

Yaron10 commented Jul 6, 2023

Not me, unless not negatively commenting constitutes tacit approval.

If I can't remember that request, I surely can't remember the relevant discussion. :)

I think the reason is that PS3 (by way of Python3) doesn't have a clean way to handle non-unicode encodings...

👍
Thank you for the explanation and advice.

@chcg
Copy link
Collaborator

chcg commented Jul 7, 2023

Indeed the currently blocking point to switch to python3 as stable version is:

Missing features:
support for files with encodings that are not unicode

@Yaron10
Copy link

Yaron10 commented Jul 8, 2023

@chcg,

Thank you.
This might an issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input focus jump after typing into console's >>> prompt and pressing Enter
4 participants