From 7cfd8aab6631e1a909c2d66831688fc9135df824 Mon Sep 17 00:00:00 2001 From: David Brown <dbrown@gitlab.riscosopen.org> Date: Wed, 1 Oct 1997 09:13:19 +0000 Subject: [PATCH] Added run time RMEnsuring type behaviour for ColourDbox to save RMA space on start up of the browser. Also added additional deregistering of events which I forgot to do last time :( --- c/Choices | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/c/Choices b/c/Choices index f10795d..0f3baeb 100644 --- a/c/Choices +++ b/c/Choices @@ -393,6 +393,18 @@ int choices_hidden(int eventcode, ToolboxEvent * event, IdBlock * idb, void * ha if (e) {show_error_ret(e); return 1;} e = event_deregister_toolbox_handler(-1, ECD_ColourButton, choices_colour_button_handler, NULL); if (e) {show_error_ret(e); return 1;} + e = event_deregister_toolbox_handler(-1, ECD_HlDispBt, choices_display_m_button_handler, NULL); + if (e) {show_error_ret(e); return 1;} + e = event_deregister_toolbox_handler(-1, ECD_HiDispBt, choices_display_m_button_handler, NULL); + if (e) {show_error_ret(e); return 1;} + e = event_deregister_toolbox_handler(-1, ECD_HlSaveBt, choices_save_m_button_handler, NULL); + if (e) {show_error_ret(e); return 1;} + e = event_deregister_toolbox_handler(-1, ECD_HiSaveBt, choices_save_m_button_handler, NULL); + if (e) {show_error_ret(e); return 1;} + e = event_deregister_toolbox_handler(-1, ECDSaveMenuClick, choices_save_m_click_handler, NULL); + if (e) {show_error_ret(e); return 1;} + e = event_deregister_toolbox_handler(-1, ECDDispMenuClick, choices_display_m_click_handler, NULL); + if (e) {show_error_ret(e); return 1;} return 1; } @@ -782,6 +794,32 @@ static int choices_colour_button_handler(int eventcode, ToolboxEvent * event, Id WimpGetWindowStateBlock state; int colour[2]; + /* Is the ColourDbox module in RMA? */ + + e = _swix(OS_Module, _INR(0,1), 18, "ColourDbox"); + + /* No, well try and load it from system */ + + if (e) + { + e = _swix(OS_Module, _INR(0,1), 1, "System:Modules.Toolbox.ColourDbox"); + } + + /* That didn't work so try reinitialising it */ + + if (e) + { + e = _swix(OS_Module, _INR(0,1), 3, "ColourDbox"); + } + + /* That didn't work either! So it's tough you can't change the colours */ + + if (e) + { + show_error_ret(e); + return 1; + } + switch(idb->self_component) { case CD_BackColourBt: colour[0] = new_choices->background_colour; break; @@ -1012,7 +1050,7 @@ static int choices_display_m_button_handler(int eventcode, ToolboxEvent * event, } /*************************************************/ -/* choices_save_button_handler() */ +/* choices_save_m_button_handler() */ /* */ /* Opens the save menu with a value appropriate */ /* to either the hotlist or history. */ -- GitLab