home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / timslib / TimsLib / !Help next >
Encoding:
Text File  |  1993-01-22  |  4.8 KB  |  131 lines

  1. Timslib © Tim Browse 1993
  2. ~~~~~~~
  3.  
  4. Help? Dream on, sucker!
  5.  
  6.  
  7. -----------------------------------------------------------------------------
  8.  
  9. This is source for use with the 'DeskLib' Wimp C programming library for
  10. Risc OS. I currently use v1.04 of DeskLib.  This source is FreeWare, which
  11. means you can use it to write commercial applications, but you may not charge
  12. *in any way* for the distribution of this source.  I (Tim Browse) retain
  13. all copyright on this source.
  14.  
  15. This source is provided 'as is' and I offer no guarantees that is useful,
  16. bug-free, commented, that it will compile, or even that it exists.
  17.  
  18. If it breaks in half, you own both pieces.
  19.  
  20. -----------------------------------------------------------------------------
  21.  
  22.  
  23. Having said that, I hope this of some use. Refer elsewhere in this
  24. distribution for other modules which are semi-developed and hence not yet
  25. moved into my library, but which may be of use to DeskLib programmers.
  26. You may of course compile this source into your application, and then sell
  27. that - but you can't charge for the source.
  28.  
  29. There is one exception to all this - the amended RISCOS_lib SWIs module...
  30. I probably shouldn't be distributing the SWIs header but I doubt Acorn
  31. will mind - it's only a list of SWI numbers after all, and it saves you
  32. the bother of deleting the ones that clash with DeskLib.
  33.  
  34. NOTE:
  35. Whenever I use Desklib include files I refer to them specifically, e.g.
  36. #include "DeskLib.Wimp.h"
  37. as
  38. #include "Wimp.h"
  39. usually picks up the RiscOsLib version, and, surprisingly enough, I like to 
  40. be able to compile programs which use either library (or both as Glazier
  41. does) without hassle about directory paths...
  42.  
  43. Some of these are 'extensions' to DeskLib - i.e. they include the DeskLib
  44. header and then add some more nice bits.  Files in this category are: 
  45.  
  46. GFX.h: 
  47. Adds nice Vdu and Gcol macros.
  48.  
  49. Msgs.h:
  50. Useful when converting from RiscOsLib - provides a msgs_lookup() that works
  51. like RiscOsLib's function of the same name. NB. DeskLib has different format
  52. for tags.
  53.  
  54. LinkList:
  55. Adds some nicer #defines and a function to free Linked Lists.  Really ought
  56. to take another parameter - a deallocation function.
  57.  
  58. So include these files with #include "Timslib.LinkList.h" for example - you
  59. don't need to specifically include the DeskLib ones first (although it 
  60. shouldn't matter if you do).
  61.  
  62. Other bits:
  63.  
  64. IconLib:
  65. Pretty spartan at the mo - just a function for de-allocating storage used by 
  66. an indirected icon. May not seem very useful to you, but used all the time in
  67. Glazier...
  68.  
  69. Interface:
  70. A nice set of #defines to access Interface SWIs. A bit cleaner than the standard
  71. header (+ C source!) version distributed with Interface.  NB. There is no .c file
  72. for this - it's just #defines.  Just say no to gratuitous function calls!
  73.  
  74. Lib:
  75. Various little functions wot come in handy.
  76.  
  77. SWIs.h:
  78. For use with DeskLib as RISCOSLib SWI.h file can cause clashes - read file 
  79. for details.
  80.  
  81. stdhdr.h:
  82. Wot I used before DeskLib.Core.h came along.
  83.  
  84. Kbd.h:
  85. Just provides a function to poll the Alt key (you know - that function that's
  86. missing from RISCOS_Lib).
  87.  
  88. Menu.h:
  89. Wot you've been waiting for!
  90. A bit of a biggy, but well useful, and easy to use...pretty similar to 
  91. RISCOS_lib's attempt, but more flexible.
  92. Naming's a bit odd still - all internal functions are called Menu__... as I 
  93. haven't decided how to split up this module.  See DeskLib docs for naming 
  94. conventions inside library modules.
  95.  
  96.  
  97. You could make this lot into a library with LibFile, but it's probably best
  98. just to tack it on to your own source directory while you work out how 
  99. everything fits together.  Some of the source for Menu is a bit hairy (lots 
  100. of linked lists/trees etc) but you should be able to work out what you want 
  101. just looking at the header file - it's well commented (but about the only one
  102. that is!).
  103. Basically, call Menu_New to create your menu, use Menu_Attach to attach it
  104. to window or icon, then call Menu_Detach to detach it(!) and Menu_Dispose 
  105. if you want to get rid of it.  However this last step often isn't necessary
  106. as you usually only dump your menus when you quit the program anyway, but 
  107. it's up to you.
  108. If you want to do an 'info' type dialogue box hanging off a menu, you should
  109. have something like the following in your menu selection handler:
  110.  
  111. case INFO_ABOUT_PROGRAM:
  112.   window = Window_Create("ProgInfo", 30);
  113.   Menu_AddDynamicDialogBox(window);
  114.   break;
  115.  
  116. (Taken from Glazier source, and it works!)
  117.  
  118. i.e. a bit easier than Risc OS lib - compare this with equivalent code in the
  119. RISCOS_lib example program !WExample supplied with Acorn C and you'll see 
  120. what I mean!
  121.  
  122. I've got most of the bugs out of the Menu module - it seems to cope with all
  123. the menus in Glazier's Window/Icon Data windows.
  124.  
  125. Note that not all Risc OS lib's menu functions are mirrored in my 
  126. implementation - they will be eventually, but they're not yet as I never use
  127. them! Well, not so far, anyway...
  128.  
  129. Cheers,
  130. Tim
  131.