Learning to program the Wimp in BASIC
Stuart Swales (8827) 1357 posts |
It does hurt your brain though trying to remember to keep things so they do work on ‘old’ systems, which are hard to get away from! Back at Acorn, having been spoiled by BASIC V, I had to try to remember how to code BASIC II for FileStore production test code as they wouldn’t swap out the BBC Bs they’d put aside for this job even for ‘obsolete’ Arthur A310s. |
Rick Murray (539) 13850 posts |
My philosophy is to write stuff for contemporary hardware. If it works on the Mesolithic Machines, then that’s good, bit it’s not a design criteria. |
Clive Semmens (2335) 3276 posts |
I’m with Rick on this. I just wish some of the old software would work on the new machines. I’m thinking especially of !IKHG here… |
Rick Murray (539) 13850 posts |
Yes. Having a less modifiable keyboard seems like stumbling backwards. But, my thoughts on the keyboard handling are well known so I’ll end here. ;) |
Colin Ferris (399) 1818 posts |
I wonder if Rick could be persuaded to do a RISC OS version of his Windows Veroboard prog? |
Chris Dewhurst (1709) 167 posts |
Hello Patrick
Don’t forget The Application Tutorial and Listings book and we are always featuring WIMP programs in Drag N Drop, over at www.dragdrop.co.uk Chris |
Egon Rath (2225) 54 posts |
@Chris |
Steve Drain (222) 1620 posts |
We have had a bit of a discussion about creating windows – ab initio or Templates – but the thing that has always bugged me is dealing with menus. Over the decades I have tried a plethora of different ways, mostly involving some sort of coded text fed to a routine, but I have also explored other ways including the defunct MenuMod (?). I was hugely relieved when I could use the Toolbox to design and manipulate Menus as easily as Windows. How do others cope, in BASIC? |
Steve Fryatt (216) 2105 posts |
MenuGen – there are routines to load and fix up the files in BASIC and C, which can be found in the respective libraries (the source to the BASIC one is here). They’re treated like templates files in that the “built” menus are stored in the relevant resources folder (if the app is internationalised) and so other languages just means other menu definition files with the text translated. I suppose it could vector through MessageTrans, but I never got around to doing that. In hindsight, I’d have at least attempted to obtain a template type allocation for the files, as it seems to be the intended use case. However, there’s 25+ years’ of code using a data filetype, and it seems to be OK. |
Paolo Fabio Zaino (28) 1882 posts |
@ Steve Drain
I am not (anymore) a BBC BASIC skilled coder. I have refreshed my memory in the last year working on the Launchpad component, so bare in mind my main languages are C/C++. Anyway, to deal with the Menu creation I just coded a macro language that ended up being just few BBC BASIC functions. It allows to create menues of all sorts and works really nice with translations in the usual Resource.LanguageID. kinda structure. The macro language obviously allows the use of all the menu bits (included icons) and, on top of that, allows the creation of “combined menus” (menu created from multiple sources either static or dynamic). The macro language is stack based, so one can create multi-structured menus by “including” multiple sources and from different locations and nature (again either static or dynamic). It also has a set of functions to easly control the menus themselves (which is a bit of a stretch over the goal of just creating them super quickly). All the sources will be released OpenSource with Launchpad code, if anyone wants to play or improve them. |
Rick Murray (539) 13850 posts |
For BASIC, I used to use a very hacked and patched version of WimpEd by, I think, Joe Taylor? This would take a set of templates and menu descriptions and create a “template” as in the minimal code necessary to get something happening. It would create menus with a syntax like “Title\Item 1\Item 2\Submenu>!\Item 4”. I don’t remember exactly, just looking at the messages file to an old program, as it’s been ages since I have used something other than DeskLib for stuff like that. And since DeskLib (and the Wimp) both cope with creating a menu with about thirty items that point to submenus totalling about six thousand things, I don’t think I have anything to worry about there. ;) (actually, some “for the hell of it” code built a menu on the fly with twelve thousand entries (well, 12345), just because) |
Clive Semmens (2335) 3276 posts |
I’ve never had any bother creating menus “the hard way” – but then I’ve never created vast menu systems, just really simple ones… |
Rick Murray (539) 13850 posts |
Having library functions available means it doesn’t matter. Write the code once (or nab it off a cover disc/BBS) and then it’s done. ;) |