Ah, where do I start?
First, my recovery from the back op last year has stalled a fair bit since I weaned myself off the heavy-duty painkillers (opiates! yum! but also why they had to go
). I still can't spend much time sitting so I haven't been all that productive over the last few months. Things are improving, but progress is glacial... So my posts and output are a bit limited.
However, enough of my whining and back to the interesting bits.
hey, I just got the scroll wheel working in the editor by recording a macro - yeh
I must admit I never thought of that as a quick fix.
The editor uses two tables in its config file to control all keystrokes and their functionality. These start at .Ed_AutoLoad (the functions table) and .Ed_KFonc (the keystrokes table). These are loaded into the offsets at Ed_AutoLoad(a5) and Ed_KFonc(a5) when the editor starts. In +Edit.s, they match to the jump table at JFonc and the parallel flags table at FlagFonc. The tables, and all the strings in the editor config file, are editable using an AMOS Accessory program - have a look at Editor_Config.AMOS for how. I won't go into great detail here, but you will need to understand how the key instruction works:
Call Editor FunctionNumber, StringArrayNumber, NewStringValueFunctionNumber points to entries in the JFonc and FlagFonc tables in +Edit.s. The JFonc table entry contains the branch, the FlagFonc table entry contains flags to show what actions are allowed:
Bit 0: Refresh the Editor Buffer after function
Bit 1: Refresh the Current Line after function
Bit 2: Function is forbidden for a Closed Procedure
Bit 5: Function can be used within a Macro
Bit 6: Send a Command Line (in use but can't see it does anything)
Bit 7: Function can be called using "Call Editor"
FunctionNumber = 182 uses the branch to EdZ_NewConfig to do all the work changing the editor config file contents. It should only be used from an AMOS Accessory program. It does the work in memory (the loaded image of the config file) then forces a save and editor restart when accessory program is closed.
StringArrayNumber determines which set of config strings to change. There are five sets:
1 | System File Names | +Edit.s .Sys1 thru .Sys2: |
2 | Menu Messages | +Edit.s .Mn1 thru .Mn2 (from "Editor_Menus.Asc") |
3 | Dialog Messages | +Edit.s Ed1 thru Ed2 |
4 | Test-Time Messages | +Edit.s .Test1 thru Test2 |
5 | Run-Time Messages | +Edit.s .Error1 thru .Error2 |
NewStringValue this is where it gets a bit tricky! The format is:
dc.l | MessageNumber |
dc.b | Replacement string |
If you need to change any of the strings in the config file, the only sane way is to call this function as the editor's code takes care of all the necessary shuffling up or down to make room for a new string. Note that calls to this function can only be made from an AMOS Accessory program. This is because, after any calls to the function, a flag is set which forces the editor to save the config file and do a restart (using the new config file it just saved).
Okay, so that's fine for the strings, how are those keystroke tables edited? Answer, you have to make the changes in situ in the tables pointed to by Ed_AutoLoad(a5) and Ed_KFonc(a5). Then force the editor to save the config changes and do a restart when you close the AMOS Accessory from which you're making the changes. This is done by using any value for
StringArrayNumber that is greater than 5. When it encounters this situation, the string modification code is bypassed and just the flags set to force a config file save and the editor's restart.
So, in Editor_Config.AMOS you'll see some Pokes and Dokes followed by the enigmatic instruction:
Call Editor 182,100,"Null!"This has a
StringArrayNumber of 100 (definitely greater than 5!) so it just forces the save and restart. Any number greater than 5 will do, and the "Null!" is completely irrelevant as any other string would do (and will be completely ignored). The original authors obviously decided to use something consistent to do the job
.
That's the editor and what you'd need to change to incorporate the scancodes for a mouse wheel (122 = wheel forwards, 123 = wheel backwards).
You say you have done this for the File Requester - I know this is in +W.s but I can't find any edits - would be great to get the file selector working as well...
Almost all of the screen handling and all of the requester handling is done using DBL (Dialogue Box Language) code hidden away in Resource Banks. This code is a bugger to read and edit, so I wrote a DBL editor a long while ago to make it easier to edit and document. The thread is
here. It's slightly buggy but does the job. Read the thread for more info. The zip file includes a *.guide which is essential reading before using!!!
For the File Requester and Text Reader, the programs are in the AMOSPro_Default_Resource.Abk bank. You need to know that if you use your own Resource Bank, AMOS will substitute from that default resource bank for whichever groups you've left out. Eg. If your bank has no images, AMOS will automatically use the images from the default bank. Same for the DBL programs and the message strings. This is very useful as you don't need to design your own graphics (assuming the default ones will do) to maintain the AMOS Pro "look and feel" for your own requesters.
I've attached a zip of the DBL code and message strings from AMOSPro_Default_Resource.Abk. My text editor (CodeWright on the PC side) allows me to set up syntax highlighting for just about any language, so I've included PDFs of the "pretty coloured" code which might be easier to follow