reset status bar items at reset (#136)

When the user presses the "Reset" button on the gui ribbon, we need to
clear the active status of all statusbar items or they remain set after
the reset occurs.
This is mentioned in issue #123
This commit is contained in:
Benjamin David Lunt 2023-11-17 00:36:56 -07:00 committed by GitHub
parent 447f18e53b
commit c247b43718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -420,6 +420,7 @@ void bx_gui_c::cdrom1_handler(void)
void bx_gui_c::reset_handler(void)
{
BX_INFO(("system RESET callback"));
BX_GUI_THIS statusbar_setall(0);
bx_pc_system.Reset(BX_RESET_HARDWARE);
}
@ -986,6 +987,12 @@ void bx_gui_c::statusbar_setitem(int element, bool active, bool w)
}
}
void bx_gui_c::statusbar_setall(bool active)
{
for (int i=0; i<BX_MAX_STATUSITEMS; i++)
statusbar_setitem(i, active);
}
void bx_gui_c::led_timer_handler(void *this_ptr)
{
bx_gui_c *class_ptr = (bx_gui_c *) this_ptr;

View File

@ -192,6 +192,7 @@ public:
int register_statusitem(const char *text, bool auto_off=0);
void unregister_statusitem(int id);
void statusbar_setitem(int element, bool active, bool w=0);
void statusbar_setall(bool active);
static void init_signal_handlers();
static void toggle_mouse_enable(void);
bool mouse_toggle_check(Bit32u key, bool pressed);