home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / acorn / tech / 1031 < prev    next >
Encoding:
Text File  |  1992-12-15  |  2.6 KB  |  59 lines

  1. Newsgroups: comp.sys.acorn.tech
  2. Path: sparky!uunet!pipex!warwick!nott-cs!unicorn.nott.ac.uk!rsxdp
  3. From: rsxdp@unicorn.nott.ac.uk (D.Pead)
  4. Subject: Re: CFD: Icon names in templates
  5. Message-ID: <1992Dec15.191512.24656@cs.nott.ac.uk>
  6. Sender: news@cs.nott.ac.uk
  7. Organization: Shell Centre for Maths Education, University of Nottingham
  8. References: <4814@svin09.info.win.tue.nl>
  9. Date: Tue, 15 Dec 92 19:15:12 GMT
  10. Lines: 47
  11.  
  12. For C programmers, a partial solution would be to have a template editor
  13. which maintained a .h file containing constant definitions for the icon
  14. numbers (e.g. #define I_LOAD_CANCEL 1 ).
  15.  
  16. I think this would also work for Norcroft Pascal (which has the C
  17. preprocessor) and could be adapted for basic (use variables instead of
  18. constants and include them as a library).
  19.  
  20. If you edit the template, the .h file is updated and running MAKE will
  21. re-compile any modules affected.
  22.  
  23. You need some way of remembering the constant names assigned to each
  24. icon.  I can see 4 ways of doing this:
  25.  
  26. 1.  The template editor saves its templates in it's own format, which
  27.     could include the icon names and any other extras. When you
  28.     save your file, you actually save 3 things:
  29.  
  30.     * The new format template editor file
  31.     * The original format template file (this is what your program loads)
  32.     * The header file
  33.  
  34. 2.  When the template editor loads the template file, it also loads and
  35.     interprets the .h file.  You'd need some "smart comments" and such
  36.     in the .h file to hold other info.  Problem here is if the template
  37.     and .h files get out of step you're stuffed.
  38.  
  39. 3.  Use the validation string to hold the icon name.  This means that 
  40.     everything has to be an indirected text or indirected text+sprite
  41.     icon, but that is only a problem if you need to use indirected sprite
  42.     only icons (which !FormEd won't do anyway).  If you're using RO3's
  43.     slabbed icons or Interface then you're in this position already.
  44.  
  45. 4.  Tack some extra data on the end of the template file and hope...
  46.  
  47. The whole point of this idea is that, at the end of the day, your program
  48. doesn't need any non-standard template files or new libraries, and users
  49. can still use !FormEd to tweak the templates if they feel inclined.
  50.  
  51. The problem with using a new template file standard is (a) I don't think
  52. you could ever get it to work with RISC-OS lib without horrendous kludges.
  53. (Yes, RISC-OS Lib is c**p, but I wrote a few programs before I realised
  54. that and I don't fancy re-writing them!) and (b) If those lads and lasses
  55. at Acorn & Norcroft sort us out with a nice C++ compiler and class
  56. library, you'd be back to square one.
  57.  
  58.  
  59.