IBM1130: Bring focus to the SCP window at appropriate times with GUI console
As suggested by Jim Fehlinger in #450
This commit is contained in:
parent
fee3e81208
commit
17c56a0c88
1 changed files with 9 additions and 1 deletions
|
@ -115,11 +115,16 @@ extern UNIT prt_unit;
|
||||||
void remark_cmd (char *remark) {sim_printf("%s\n", remark);}
|
void remark_cmd (char *remark) {sim_printf("%s\n", remark);}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
static HWND hConsoleWindow = NULL;
|
||||||
|
|
||||||
t_stat console_reset (DEVICE *dptr)
|
t_stat console_reset (DEVICE *dptr)
|
||||||
{
|
{
|
||||||
if (! sim_gui) {
|
if (! sim_gui) {
|
||||||
SETBIT(console_unit.flags, UNIT_DIS); /* disable the GUI */
|
SETBIT(console_unit.flags, UNIT_DIS); /* disable the GUI */
|
||||||
CLRBIT(console_unit.flags, UNIT_DISPLAY); /* turn the GUI off */
|
CLRBIT(console_unit.flags, UNIT_DISPLAY); /* turn the GUI off */
|
||||||
|
} else {
|
||||||
|
if (!hConsoleWindow)
|
||||||
|
hConsoleWindow = GetConsoleWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
update_gui(FALSE);
|
update_gui(FALSE);
|
||||||
|
@ -1223,6 +1228,7 @@ void HandleCommand (HWND hWnd, WORD wNotify, WORD idCtl, HWND hwCtl)
|
||||||
* while (running)
|
* while (running)
|
||||||
* Sleep(10);
|
* Sleep(10);
|
||||||
*/
|
*/
|
||||||
|
SetForegroundWindow(hConsoleWindow);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1400,6 +1406,8 @@ void keyboard_selected (int select)
|
||||||
{
|
{
|
||||||
btn[IDC_KEYBOARD_SELECT].state = select;
|
btn[IDC_KEYBOARD_SELECT].state = select;
|
||||||
|
|
||||||
|
if (select)
|
||||||
|
SetForegroundWindow(hConsoleWindow);
|
||||||
if (btn[IDC_KEYBOARD_SELECT].hBtn != NULL)
|
if (btn[IDC_KEYBOARD_SELECT].hBtn != NULL)
|
||||||
EnableWindow(btn[IDC_KEYBOARD_SELECT].hBtn, select);
|
EnableWindow(btn[IDC_KEYBOARD_SELECT].hBtn, select);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue