Commit 7c360ff6 authored by Ben Avison's avatar Ben Avison
Browse files

Fix interactive help on iconbar menu

Detail:
  There were actually two problems:
  * No account was taken of the fact that the menu item indexes were different
    in the shortened menu.
  * The static variable "menu_userblk" was needed for decoding help messages,
    but its initialisation in the icon bar menu case was accidentally chopped
    out along with the code that customised the third menu item (the one that
    said "Task display" on the icon bar menu and says "Task '<taskname>'" on
    the task display menu). This bug does not seem to have been reproducible
    on all platforms due to the nature of uninitialised variables.
Admin:
  Tested on Raspberry Pi. Joint work by Willi Theiss and Ben Avison.

Version 1.41. Tagged as 'Switcher-1_41'
parent bfb57fdf
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.40"
Module_Version SETA 140
Module_MajorVersion SETS "1.41"
Module_Version SETA 141
Module_MinorVersion SETS ""
Module_Date SETS "31 Oct 2012"
Module_ApplicationDate SETS "31-Oct-12"
Module_Date SETS "17 Nov 2012"
Module_ApplicationDate SETS "17-Nov-12"
Module_ComponentName SETS "Switcher"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Switcher"
Module_FullVersion SETS "1.40"
Module_HelpVersion SETS "1.40 (31 Oct 2012)"
Module_FullVersion SETS "1.41"
Module_HelpVersion SETS "1.41 (17 Nov 2012)"
END
/* (1.40)
/* (1.41)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.40
#define Module_MajorVersion_CMHG 1.41
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 31 Oct 2012
#define Module_Date_CMHG 17 Nov 2012
#define Module_MajorVersion "1.40"
#define Module_Version 140
#define Module_MajorVersion "1.41"
#define Module_Version 141
#define Module_MinorVersion ""
#define Module_Date "31 Oct 2012"
#define Module_Date "17 Nov 2012"
#define Module_ApplicationDate "31-Oct-12"
#define Module_ApplicationDate "17-Nov-12"
#define Module_ComponentName "Switcher"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Switcher"
#define Module_FullVersion "1.40"
#define Module_HelpVersion "1.40 (31 Oct 2012)"
#define Module_LibraryVersionInfo "1:40"
#define Module_FullVersion "1.41"
#define Module_HelpVersion "1.41 (17 Nov 2012)"
#define Module_LibraryVersionInfo "1:41"
......@@ -2003,7 +2003,7 @@ repollwimp
; STRVS R2,[R1]
ADRVSL R2,TaskName
MOVVS R1,#1 ; OK button
STRVSB R1,errorendeddrag
STRVSB R1,errorendeddrag
SWIVS XWimp_ReportError
;
MOV R0,#null_bit :OR: pointerchange_bits
......@@ -4010,13 +4010,8 @@ returnhelp
; try menu item
; FIXME - Switcher-1_39 broke the code below. This needs actually
; debugging and fixing. For now, we'll just disable all help on
; menu items...
; CMP r3, #0 ; no help if not on an item
; BLT %FT99
B %FT99
; end of FIXME.
CMP r3, #0 ; no help if not on an item
BLT %FT99
Push "r1, r2-r4"
ADD r1, sp, #4 ; r1 -> buffer for result
......@@ -4025,6 +4020,17 @@ returnhelp
Pull "r1, r2-r4" ; r2, r3 = menu selections
BVS %FT99
; correct icon bar menu index
ADRL r14, m_iconbarmenu
LDR r0, menuhandle
CMP r0, r14
BNE %FT03
ADRL r14, m_iconbarmenu_offset
CMP r2, #0
LDRGTB r0, [r14, r2]
ADDGT r2, r2, r0
03
ADDS r0, r2, #1 ; NB: item -1 is translated into 0
ADDGTS r14, r3, #1
ADDGT r0, r0, r14, LSL #4 ; r0 = first entry + 16*second entry
......@@ -5592,6 +5598,9 @@ notinfobox
CMP R0,#iconbar_whandle ; forget it unless iconbar
Pull "PC",NE
MOV userblk,#-2
STR userblk,menu_userblk ; for help stuff
LDR R2,[R1] ; mouse x
MOV R3,#96 + 4*44 - 12
ADRL R1,m_iconbarmenu
......@@ -6602,6 +6611,21 @@ mo_nt_oscli Item M11,,W
DCB 0 ; terminator
ALIGN
; offset table for correcting reduced iconbar menu index
m_iconbarmenu_offset
MACRO
TranslateMenuItem $name
ASSERT . - m_iconbarmenu_offset = mo_ic_$name
DCB mo_td_$name - mo_ic_$name
MEND
TranslateMenuItem info
TranslateMenuItem config
TranslateMenuItem taskw
TranslateMenuItem shutdown
ALIGN
;.............................................................................
CopyMenus Entry "r1-r7"
......
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