WinEd 3.25
Steve Fryatt (216) 2044 posts |
After a slightly premature start last month, I’m pleased to announce the availability of WinEd 3.25. WinEd 3.25 is the first significant update to the popular template editor in over a decade, and thanks to the help received from a number of developers, addresses several stability issues that the application had begun to suffer on modern versions of RISC OS. Despite this, there was also time for some changes and improvements to the interface, including:
For those who would like to check if their pet gripe has been resolved, the following bugs have been addressed:
For those who haven’t encountered it before, WinEd is a template editor whose founding aim was “to do everything which TemplEd could do, only better!” It was originally written by Tony Houghton, who developed it until 2003; his work was continued by Adam Richardson, who maintained and improved WinEd until 2009. WinEd’s most attractive features include the fact that its main editing interfaces use dialogue boxes. Icons can be dragged between windows, including a customisable ‘Picker’ window containing the most commonly used icons, and multiple template files can be loaded by one instantiation of WinEd. Optional tool panes and keyboard short cuts enhance convenience. It contains powerful features for positioning icons relative to each other, and rounding of coordinates in high resolution modes to ensure low resolution compatibility. Conventions are based on ROOL’s Style Guide. Statistics are available on the size and content of template files, to assist with loading them into simple applications. WinEd is licenced under the GPLv2, and copies of 3.25 can be found in the PlingStore and at http://www.stevefryatt.org.uk/software/wined/The source code is held in a Subversion repository on RISC OS.info, at http://www.riscos.info/websvn/listing.php?repname=wined |
Paul Sprangers (346) 483 posts |
WinEd 3.25 still refuses to load some of my templates. Clicking or dragging them locks up the computer and a hard reset is needed. Other editors display them without problems. Here is such template |
Martin Avison (27) 1417 posts |
Strange, as I have just downloaded your example (in Windows, thanks to Google Drive) but it worked just fine here in WinEd v3.25 on RO5.27 (5 Jul 2020) |
Alan Adams (2486) 1125 posts |
This will give me a problem, as I use ESG values up to 31. What’s the rationale behind this change?
Could this be due to the change above? |
Rick Murray (539) 13385 posts |
Ctation needed. The UrsulaLog file doesn’t mention this. The entire CVS history of VersionAsm makes no mention of either “esg” or “e.s.g.”. A search of the entire Wimp source doesn’t indicate any notes regarding changes to esg… And, more specifically, PRM3 indicates that ESG can be in the range 1-31 if used, with PRM 5a making no alterations to that. As such, one should expect templates with ESGs in the documented range. |
Alan Adams (2486) 1125 posts |
and my code which uses esgs up to 30 works on RO 5.24. |
Martin Avison (27) 1417 posts |
@Adam: No, the sample template Paul provided loads ok into v3.25 here. And I can see no ESGs above zero. But I agree that there are 4 bits used for ESG in IconFlags, which should be 0-31. In the source ‘if_esg2’ is 4 bits, but ‘if_esg’ is 5 bits (includes the numeric bit). Perhaps the change was from 0-63 to 0-31? The variable ‘if_esg’ seems only to be used for a check if ESG was 13 – dunno why. Edit: This was stupidly wrong! 4 bits is obviously 0-15. |
Steve Fryatt (216) 2044 posts |
The Ursula reference came from the WinEd source. For the change to the Wimp, see both ROL’s PRM updates, or if you prefer, ROOL’s PRM. Or the printed ROL Wimp PRM from the mid-2000s. None suggest that this can vary on modern systems. Or even the Wimp source code, which looks to bear out my belief that this isn’t conditional.
Highly unlikely, given that all I’ve done is limit the value entered into the field in the Icon Edit dialogue to the range 0-15. There has been no change to the underlying data storage, which has been using 4 bits since some time unknown (I’ve not checked, but I’d put money on it changing before DeskLib went into revision control). Edit: Actually, I tell a lie. It changed in r371, late 2007 or early 2008. So as I said in the newsgroups, if ESGs > 15 have been working for you in any WinEd since 2008, you’ve been quite lucky.
4 bits is 0 to 15, isn’t it?
The numeric bit is the one that was “stolen” from the ESG. The Wimp source code is odd here. if_esg2 is used throughout, except for one location. I have to wonder if this was once a build option that got removed, and that reference should also be if_esg2 but never got updated.
All the references that I can find say 5 bits to 4 bits (0-31 to 0-15).
There seem to be some magic numbers involved when creating menus: Wimp05 has a reference to non-writable menu icons getting an ESG of 12 and writable menu entries getting 13. The reference to if_esg seems to be in a bit of code related to menu entries only. |
Martin Avison (27) 1417 posts |
Oh dear – of couse it is. I realized I could not count after a glass or two. But you beat me to it. I will go back to sleep now… |
Stuart Swales (1481) 351 posts |
Best tell RISC_OSLib fontselect.c then! [Edit: amusingly, my patches for dbox.c that’s used in PipeDream also use a five bit field] Might be helpful to define bit 20 of iconflags in tboxlibs’ wimp.h as a quick inspection would lead you to believe there were still five bits of ESG. |
Chris Mahoney (1684) 2099 posts |
I’m not surprised that there’s confusion here; as Rick mentioned, PRM 3 does indeed list 5 bits (in multiple places) and 5a doesn’t say that it’s changed. ROL’s site says that it was changed to 4 bits in OS 3.5 so it looks like it was missed from PRM 5a. |
Steve Fryatt (216) 2044 posts |
Are you absolutely sure about that? The following test program, when run on RISC OS 4.02, 4.37 and 5.24, says that the fifth bit of the ESG value isn’t important to the Wimp.
Edit: Oops. Out by one error, which didn’t seem to affect the result. |
Steve Fryatt (216) 2044 posts |
You’ll need to give me some more clues, I’m afraid, because that template loads fine into WinEd 3.25 on RISC OS 5.24 and 5.27 for me. |
Rick Murray (539) 13385 posts |
Nice. So since the icon flags are full and another flag is needed, they retcon an existing bit to a totally different purpose – what could possibly go wrong? 🤦🤦🤦 |
Sprow (202) 1112 posts |
I think it predates even that. Disassembling Wimp 3.16 I find the sequence LDR R6,[R12,#572]which corresponds to this bit testing the newly purposed bit 20. Well, I don’t count 03-Apr-1992 as new any more, much more likely it got missed in the PRM text. It is covered in the StrongHelp Wimp manual though. |
Rick Murray (539) 13385 posts |
So, which one should be taken to be correct, given that the official documentation says one thing and the actual code does another. Somebody to prod the slumbering nemo, I’m sure he’d have a few words to say… |
Steve Pampling (1551) 7921 posts |
After being subjected to a collection of insults I suspect he’s staying well away from here1. He has updated various of the stuff on his site (as of May – when I couldn’t see) 1 I’m sure he doesn’t need the grief. |
Clive Semmens (2335) 3122 posts |
I hope I wasn’t an offender – I certainly never intended to be and wasn’t aware of having been; but I’m socially awkward (to put it mildly) so might have offended unintentionally. I suspect I’m not the only one of this kind in this respect in a forum like this. |
Alan Adams (2486) 1125 posts |
OK, I see what you mean. I can set one of the radio buttons in esg 17 for example, and when read back from the window the correct icon is returned when asking for esg 17 using Wimp_WhichIcon. However changing the button in esg17 also affects the button in esg1. Asking for esg1 now returns -1. So I now either have to ensure that I never need more than 14 rows of buttons (31/15 is used for a menu), or I have to use non-radio buttons, and do all the selection logic myself. Messy. What idiot decided to introduce a non-backward-compatible change like this? |
Steve Drain (222) 1620 posts |
I cannot say how relevant it is, but out of curiosity I looked at the Toolbox. In ResEd I could create RadioButtons with Group numbers above 31 and they would act correctly in ResTest. I imaging the TB uses a completly different mechanism from ESGs. Edit: In the light of the above post I checked, and there is no corresponding cycling of group numbers. |
Alan Adams (2486) 1125 posts |
So the fifth bit of the esg now means "this value is a number, and when using right-to-left text, don’t write this right-to-left. Which manes me wonder what happens if some text in the icon has a number embedded in it, e.g. “The value is 42”. How would that be written, assuming the words were Hebrew for example? |
Alan Adams (2486) 1125 posts |
So the fifth bit of the esg now means "this value is a number, and when using right-to-left text, don’t write this right-to-left. Which manes me wonder what happens if some text in the icon has a number embedded in it, e.g. “The value is 42”. How would that be written, assuming the words were Hebrew for example? |
Steve Fryatt (216) 2044 posts |
What do you mean by “official”? The online docs from both ROL and ROOL say that ESGs are 4 bits. If you require it to be printed on dead trees to be “official”, then page 373 of the Window Manager PRM (pub 2007) says bits 16 to 19 hold the ESG, which can be in the range 0 to 15. If the only “official” documentation for our OS is the PRM published by Acorn in 1994, then we can’t change much, can we? Also, given the size of the Errata in PRM5, the fact that something was or wasn’t in PRM1 to PRM4 didn’t tell you much, either.
I’m rather dubious about Alan’s claim. My test program, posted upthread, shows that ESGs are treated modulo 16 on all versions of the OS that I had to hand yesterday. I’d like some evidence that Alan’s code does indeed work on RO5.24.
“Change the documentation to match the implemented API”, isn’t it?
Acorn, some time before 1995, we think? Personally, I’d suggest we leave it be now. The behavior has been there since the mid 90s, and whatever we do will probably upset someone or break something. Given that all documentation from the past 20-odd years says 0 to 15, perhaps it’s best to leave it that way and move on? PS. I don’t know why the venom from Rick and Alan for the change in WinEd 3.25. WinEd since 2008(?) has treated values put into the ESG field as being modulo 16 from what I can see: enter a bigger number, close the dialogue and re-open it to see. All this release changes is to stop you entering a value that will be changed by the data structure that it gets saved into. |
Alan Adams (2486) 1125 posts |
Apology due to Steve.
So am I. As you see further back in the thread, it is being treated as modulo 16.
Misplaced somewhat in my case, as I’m creating these high esg numbers on the fly, not in ResED. I knew i was using high ones, but it’s only when going through the code I discovered they weren’t done in the template file. However the only printed documentation which doesn’t say 5 bits for an ESG is the Window Manager manual. I do have that, but the code in question was written before I bought it. I prefer printed manuals, because it’s not easy to have several program windows, several source windows, Reporter and several manual pages all shown on one screen, even my 2560×1440 one. |
Clive Semmens (2335) 3122 posts |
It’s a bit easier on my 3840×2160 one, but even I run out of screen estate sometimes. As for when I’m having to use the laptop, as for example now, that’s just 1366×768... |