diff --git a/Resources/UK/Messages b/Resources/UK/Messages index be37cd1eac1807a853081695081e9445da08b0e3..a2a75e270a2c2397dd9590b57ac2b1908db4990d 100644 --- a/Resources/UK/Messages +++ b/Resources/UK/Messages @@ -9,4 +9,3 @@ Mystery:Unrecognised NoneAvail:No mouse drivers are available NewType:You are about to change the mouse type to '%s'. If you do not have this sort of mouse connected the pointer will stop working. Do you want to continue with the reconfiguration? Err_NoDefCMOS:Cannot find default CMOS file -Err_BadClass:Resource file is corrupt diff --git a/Resources/UK/Res,fae b/Resources/UK/Res,fae index 8862745bdb0f60e27a7e50d486eb66302347b5c0..cee54d9029220ad509a7391c2ef8165e5d2c0887 100644 Binary files a/Resources/UK/Res,fae and b/Resources/UK/Res,fae differ diff --git a/VersionNum b/VersionNum index d15b959ae46e1595a92b993a59b37aaf6af07b6c..3848a32ef78f21cc2be9b58b1a56b6a4df631c0c 100644 --- a/VersionNum +++ b/VersionNum @@ -1,23 +1,23 @@ -/* (0.15) +/* (0.16) * * This file is automatically maintained by srccommit, do not edit manually. * Last processed by srccommit version: 1.1. * */ -#define Module_MajorVersion_CMHG 0.15 +#define Module_MajorVersion_CMHG 0.16 #define Module_MinorVersion_CMHG -#define Module_Date_CMHG 17 Jul 2013 +#define Module_Date_CMHG 03 Aug 2013 -#define Module_MajorVersion "0.15" -#define Module_Version 15 +#define Module_MajorVersion "0.16" +#define Module_Version 16 #define Module_MinorVersion "" -#define Module_Date "17 Jul 2013" +#define Module_Date "03 Aug 2013" -#define Module_ApplicationDate "17-Jul-13" +#define Module_ApplicationDate "03-Aug-13" #define Module_ComponentName "MousSetup" #define Module_ComponentPath "castle/RiscOS/Sources/SystemRes/Configure2/PlugIns/MousSetup" -#define Module_FullVersion "0.15" -#define Module_HelpVersion "0.15 (17 Jul 2013)" -#define Module_LibraryVersionInfo "0:15" +#define Module_FullVersion "0.16" +#define Module_HelpVersion "0.16 (03 Aug 2013)" +#define Module_LibraryVersionInfo "0:16" diff --git a/c/Main b/c/Main index 6507bc21da169c64c5cad5f78e0cc91a8c887c9e..53faac3da619ca9bb996e4ad7b10c2ec64af20d6 100644 --- a/c/Main +++ b/c/Main @@ -28,18 +28,13 @@ Date Who Change /* CLib */ #include <stdlib.h> -#include <string.h> -#include "swis.h" /* Toolbox */ #include "event.h" #include "toolbox.h" -#include "window.h" /* Common */ #include "error.h" #include "misc.h" -#include "message.h" /* Local headers */ -#include "Settings.h" #include "Main.h" /* includes prototypes for this file */ #include "ToolboxE.h" #include "WimpE.h" @@ -68,11 +63,6 @@ In: Command line option: int main (int argc, char *argv[]) { - int screeny; - ObjectTemplateHeader *objtemplate; - WindowTemplate *wintemplate; - WimpWindow *windef; - error_initialise (); throw (toolbox_initialise (0, WimpVersion, wimpm_messages, toolboxe_events, "<MousSetup$Dir>", &messages, &id_block, NULL, NULL, NULL)); @@ -85,32 +75,6 @@ int main (int argc, char *argv[]) wimpe_register (); toolboxe_register (); - /* Read the window object in by hand */ - throw (toolbox_template_lookup (0, "Mouse", (void **)&objtemplate)); - if (objtemplate->object_class != Window_ObjectClass) { - _kernel_oserror e = { 0, "" }; - - strcpy (e.errmess, message_lookup_direct (messages,"Err_BadClass")); - _swi (OS_GenerateError, _IN(0), &e); - } - wintemplate = objtemplate->body; - windef = &wintemplate->window; - screeny = _swi (OS_ReadModeVariable, _INR(0,1) | _RETURN(2), -1, 12) << - _swi (OS_ReadModeVariable, _INR(0,1) | _RETURN(2), -1, 5); - - /* Calculate the window height compared with the screen and - * turn the vertical scrollbar on if it doesn't fit - */ - if ((windef->visible_area.ymax - windef->visible_area.ymin) >= screeny) { - windef->flags |= WimpWindow_VScroll; - } - else { - windef->flags &= ~WimpWindow_VScroll; - } - throw (toolbox_create_object (Toolbox_CreateObject_InCore, objtemplate, &mainwindow_id)); - misc_openwindow (mainwindow_id, TRUE); - settings_read (cmos_read); - /* Go */ error_recover_point(); while (!quit) { diff --git a/c/Settings b/c/Settings index 4b03f1429389163925bb9738cab6734f4b28c65d..baa73750f8c700e688d380f0261f7a0aa1885d79 100644 --- a/c/Settings +++ b/c/Settings @@ -52,28 +52,17 @@ const cmos cmos_details [18] = { { 0xC2, 0, 8 }, /* MouseMultiplier */ { 0x1D, 0, 8 }, /* MouseType */ { 0xDD, 0, 4 }, /* (WimpDragDelay EOR 5) */ - { 0xDD, 4, 4 }, /* (WimpAutoScrollDelay EOR 5) */ - { 0xDE, 0, 1 }, /* WimpDragDelayUnit */ - { 0xDE, 1, 1 }, /* WimpAutoScrollDelayUnit */ + { 0xDE, 2, 5 }, /* (WimpDragMove/4 EOR 8) */ { 0xDF, 0, 4 }, /* (WimpDoubleClickDelay EOR 10) */ - { 0xDF, 4, 4 }, /* (WimpAutoFrontDelay EOR 5) */ - { 0x16, 0, 1 }, /* WimpDoubleClickDelayUnit */ - { 0x16, 1, 1 }, /* WimpAutoFrontDelayUnit */ - { 0x16, 2, 5 }, /* (WimpDoubleClickMove/4 EOR 8) */ - { 0x16, 7, 1 }, /* WimpAutoFrontIconBar */ - - { 0xC5, 7, 1 }, /* WimpFlagsSubMenus */ - - { 0x17, 0, 4 }, /* (WimpAutoMenuDelay EOR 10) */ - { 0x17, 4, 1 }, /* WimpAutoMenuDelayUnit */ - { 0x1B, 0, 4 }, /* (WimpMenuDragDelay EOR 10) */ - { 0x1B, 4, 1 } }; /* WimpMenuDragDelayUnit */ + { 0x16, 2, 5 }, /* (WimpDoubleClickMove/4 EOR 8) */ + { 0xDD, 4, 4 }, /* (WimpAutoScrollDelay EOR 5) */ + { 0xDE, 1, 1 } }; /* WimpAutoScrollDelayUnit */ /****** settings_read() ***************************************************\ @@ -111,21 +100,6 @@ void settings_read (int(*get)(cmos item, void *messages)) value = get (WimpAutoScrollDelay, &messages) ^ 5; if (1 == get (WimpAutoScrollDelayUnit, &messages)) value *= 10; throw (numberrange_set_value (0, mainwindow_id, mainwindow_autoscr, value)); -// - throw (optionbutton_set_state (0, mainwindow_id, mainwindow_openmenu, value = get (WimpFlagsSubMenus, &messages))); - misc_shadecomponents (!value, mainwindow_id, mainwindow_openmenu_shademin, mainwindow_openmenu_shademax); - value = get (WimpAutoMenuDelay, &messages) ^ 10; - if (1 == get (WimpAutoMenuDelayUnit, &messages)) value *= 10; - throw (numberrange_set_value (0, mainwindow_id, mainwindow_openmenudelay, value)); - value = get (WimpMenuDragDelay, &messages) ^ 10; - if (1 == get (WimpMenuDragDelayUnit, &messages)) value *= 10; - throw (numberrange_set_value (0, mainwindow_id, mainwindow_closemenudelay, value)); -// - throw (optionbutton_set_state (0, mainwindow_id, mainwindow_autofront, value = !get (WimpAutoFrontIconBar, &messages))); - misc_shadecomponents (!value, mainwindow_id, mainwindow_autofront_shademin, mainwindow_autofront_shademax); - value = get (WimpAutoFrontDelay, &messages) ^ 5; - if (1 == get (WimpAutoFrontDelayUnit, &messages)) value *= 10; - throw (numberrange_set_value (0, mainwindow_id, mainwindow_autofrontdelay, value)); // } @@ -157,44 +131,22 @@ BOOL settings_write (void) throw (numberrange_get_value (0, mainwindow_id, mainwindow_dragdelay, &value)); sprintf (string, "Configure WimpDragDelay %i", value); _swi (OS_CLI, _IN(0), string); +// throw (numberrange_get_value (0, mainwindow_id, mainwindow_dragdist, &value)); sprintf (string, "Configure WimpDragMove %i", value); _swi (OS_CLI, _IN(0), string); +// throw (numberrange_get_value (0, mainwindow_id, mainwindow_dclickdelay, &value)); sprintf (string, "Configure WimpDoubleClickDelay %i", value); _swi (OS_CLI, _IN(0), string); +// throw (numberrange_get_value (0, mainwindow_id, mainwindow_dclickdist, &value)); sprintf (string, "Configure WimpDoubleClickMove %i", value); _swi (OS_CLI, _IN(0), string); +// throw (numberrange_get_value (0, mainwindow_id, mainwindow_autoscr, &value)); sprintf (string, "Configure WimpAutoScrollDelay %i", value); _swi (OS_CLI, _IN(0), string); // - throw (optionbutton_get_state (0, mainwindow_id, mainwindow_openmenu, &value)); - if (value) { - cmos_write (WimpFlagsSubMenus, TRUE); - misc_applywimpflags (); - throw (numberrange_get_value (0, mainwindow_id, mainwindow_openmenudelay, &value)); - sprintf (string, "Configure WimpAutoMenuDelay %i", value); - _swi (OS_CLI, _IN(0), string); - throw (numberrange_get_value (0, mainwindow_id, mainwindow_closemenudelay, &value)); - sprintf (string, "Configure WimpMenuDragDelay %i", value); - _swi (OS_CLI, _IN(0), string); - } - else { - cmos_write (WimpFlagsSubMenus, FALSE); - misc_applywimpflags (); - } -// - throw (optionbutton_get_state (0, mainwindow_id, mainwindow_autofront, &value)); - if (value) { - _swi (OS_CLI, _IN(0), "Configure WimpAutoFrontIconBar On"); - throw (numberrange_get_value (0, mainwindow_id, mainwindow_autofrontdelay, &value)); - sprintf (string, "Configure WimpAutoFrontDelay %i", value); - _swi (OS_CLI, _IN(0), string); - } - else { - _swi (OS_CLI, _IN(0), "Configure WimpAutoFrontIconBar Off"); - } return TRUE; } diff --git a/c/ToolboxE b/c/ToolboxE index 6766a6bf492b6c7d2edb0114fb71a8350954e229..749d02b58fd61e92ab92ad626876372bdbade806 100644 --- a/c/ToolboxE +++ b/c/ToolboxE @@ -41,19 +41,19 @@ Date Who Change #include "ToolboxE.h" /* includes prototypes for this file */ static int toolboxe_actionbuttonselected (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); -static int toolboxe_optionbuttonstatechanged (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); static int toolboxe_stringsetabouttobeshown (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); +static int toolboxe_objectautocreated (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); int toolboxe_events [5] = { ActionButton_Selected, - OptionButton_StateChanged, StringSet_AboutToBeShown, + Toolbox_ObjectAutoCreated, 0 }; void toolboxe_register (void) { throw (event_register_toolbox_handler (-1, ActionButton_Selected, toolboxe_actionbuttonselected, NULL)); - throw (event_register_toolbox_handler (-1, OptionButton_StateChanged, toolboxe_optionbuttonstatechanged, NULL)); throw (event_register_toolbox_handler (-1, StringSet_AboutToBeShown, toolboxe_stringsetabouttobeshown, NULL)); + throw (event_register_toolbox_handler (-1, Toolbox_ObjectAutoCreated, toolboxe_objectautocreated, NULL)); } /****** toolboxe_actionbuttonselected() ***********************************\ @@ -79,23 +79,6 @@ static int toolboxe_actionbuttonselected (int event_code, ToolboxEvent *event, I return 1; } -/****** toolboxe_optionbuttonstatechanged() *******************************\ - -Purpose: Handles OptionButton_StateChanged event - -\**************************************************************************/ - -static int toolboxe_optionbuttonstatechanged (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle) -{ - if (id_block->self_component == mainwindow_openmenu) - misc_shadecomponents (!((OptionButtonStateChangedEvent *) event)->new_state, - mainwindow_id, mainwindow_openmenu_shademin, mainwindow_openmenu_shademax); - if (id_block->self_component == mainwindow_autofront) - misc_shadecomponents (!((OptionButtonStateChangedEvent *) event)->new_state, - mainwindow_id, mainwindow_autofront_shademin, mainwindow_autofront_shademax); - return 1; -} - /****** toolboxe_stringsetabouttobeshown() ********************************\ Purpose: Handles StringSet_AboutToBeShown event @@ -113,3 +96,17 @@ static int toolboxe_stringsetabouttobeshown (int event_code, ToolboxEvent *event } return 1; } + +/****** toolboxe_objectautocreated() **************************************\ + +Purpose: Handles Toolbox_ObjectAutoCreated event + +\**************************************************************************/ + +static int toolboxe_objectautocreated (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle) +{ + mainwindow_id = id_block->self_id; + misc_openwindow (mainwindow_id, TRUE); + settings_read (cmos_read); + return 1; +} diff --git a/h/Settings b/h/Settings index fd6af9c84232d4a3eadec23fd5a3799e776058b0..17b21b1220057643be058edec27a9f384066429f 100644 --- a/h/Settings +++ b/h/Settings @@ -41,21 +41,13 @@ Date Who Change #define MouseMultiplier ((cmos) cmos_details[0]) #define MouseType ((cmos) cmos_details[1]) #define WimpDragDelay ((cmos) cmos_details[2]) -#define WimpAutoScrollDelay ((cmos) cmos_details[3]) -#define WimpDragDelayUnit ((cmos) cmos_details[4]) -#define WimpAutoScrollDelayUnit ((cmos) cmos_details[5]) -#define WimpDragMove ((cmos) cmos_details[6]) -#define WimpDoubleClickDelay ((cmos) cmos_details[7]) -#define WimpAutoFrontDelay ((cmos) cmos_details[8]) -#define WimpDoubleClickDelayUnit ((cmos) cmos_details[9]) -#define WimpAutoFrontDelayUnit ((cmos) cmos_details[10]) -#define WimpDoubleClickMove ((cmos) cmos_details[11]) -#define WimpAutoFrontIconBar ((cmos) cmos_details[12]) -#define WimpFlagsSubMenus ((cmos) cmos_details[13]) -#define WimpAutoMenuDelay ((cmos) cmos_details[14]) -#define WimpAutoMenuDelayUnit ((cmos) cmos_details[15]) -#define WimpMenuDragDelay ((cmos) cmos_details[16]) -#define WimpMenuDragDelayUnit ((cmos) cmos_details[17]) +#define WimpDragDelayUnit ((cmos) cmos_details[3]) +#define WimpDragMove ((cmos) cmos_details[4]) +#define WimpDoubleClickDelay ((cmos) cmos_details[5]) +#define WimpDoubleClickDelayUnit ((cmos) cmos_details[6]) +#define WimpDoubleClickMove ((cmos) cmos_details[7]) +#define WimpAutoScrollDelay ((cmos) cmos_details[8]) +#define WimpAutoScrollDelayUnit ((cmos) cmos_details[9]) #define mainwindow_mousespeed ((ComponentId) 0x002) #define mainwindow_mousetype ((ComponentId) 0x005) @@ -64,21 +56,10 @@ Date Who Change #define mainwindow_dclickdelay ((ComponentId) 0x00d) #define mainwindow_dclickdist ((ComponentId) 0x010) #define mainwindow_autoscr ((ComponentId) 0x01e) -#define mainwindow_openmenu ((ComponentId) 0x012) -#define mainwindow_openmenudelay ((ComponentId) 0x014) -#define mainwindow_closemenudelay ((ComponentId) 0x017) -#define mainwindow_autofront ((ComponentId) 0x019) -#define mainwindow_autofrontdelay ((ComponentId) 0x01b) #define mainwindow_set ((ComponentId) 0x100) #define mainwindow_cancel ((ComponentId) 0x101) #define mainwindow_default ((ComponentId) 0x102) -#define mainwindow_openmenu_shademin ((ComponentId) 0x013) -#define mainwindow_openmenu_shademax ((ComponentId) 0x018) - -#define mainwindow_autofront_shademin ((ComponentId) 0x01a) -#define mainwindow_autofront_shademax ((ComponentId) 0x01c) - /* Global variables */ extern const cmos cmos_details [];