Commit 7cfd8aab authored by David Brown's avatar David Brown
Browse files

Added run time RMEnsuring type behaviour for ColourDbox to save RMA space on...

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 :(
parent 107f0ddf
......@@ -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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment