home *** CD-ROM | disk | FTP | other *** search
- Timslib © Tim Browse 1993
- ~~~~~~~
-
- Help? Dream on, sucker!
-
-
- -----------------------------------------------------------------------------
-
- This is source for use with the 'DeskLib' Wimp C programming library for
- Risc OS. I currently use v1.04 of DeskLib. This source is FreeWare, which
- means you can use it to write commercial applications, but you may not charge
- *in any way* for the distribution of this source. I (Tim Browse) retain
- all copyright on this source.
-
- This source is provided 'as is' and I offer no guarantees that is useful,
- bug-free, commented, that it will compile, or even that it exists.
-
- If it breaks in half, you own both pieces.
-
- -----------------------------------------------------------------------------
-
-
- Having said that, I hope this of some use. Refer elsewhere in this
- distribution for other modules which are semi-developed and hence not yet
- moved into my library, but which may be of use to DeskLib programmers.
- You may of course compile this source into your application, and then sell
- that - but you can't charge for the source.
-
- There is one exception to all this - the amended RISCOS_lib SWIs module...
- I probably shouldn't be distributing the SWIs header but I doubt Acorn
- will mind - it's only a list of SWI numbers after all, and it saves you
- the bother of deleting the ones that clash with DeskLib.
-
- NOTE:
- Whenever I use Desklib include files I refer to them specifically, e.g.
- #include "DeskLib.Wimp.h"
- as
- #include "Wimp.h"
- usually picks up the RiscOsLib version, and, surprisingly enough, I like to
- be able to compile programs which use either library (or both as Glazier
- does) without hassle about directory paths...
-
- Some of these are 'extensions' to DeskLib - i.e. they include the DeskLib
- header and then add some more nice bits. Files in this category are:
-
- GFX.h:
- Adds nice Vdu and Gcol macros.
-
- Msgs.h:
- Useful when converting from RiscOsLib - provides a msgs_lookup() that works
- like RiscOsLib's function of the same name. NB. DeskLib has different format
- for tags.
-
- LinkList:
- Adds some nicer #defines and a function to free Linked Lists. Really ought
- to take another parameter - a deallocation function.
-
- So include these files with #include "Timslib.LinkList.h" for example - you
- don't need to specifically include the DeskLib ones first (although it
- shouldn't matter if you do).
-
- Other bits:
-
- IconLib:
- Pretty spartan at the mo - just a function for de-allocating storage used by
- an indirected icon. May not seem very useful to you, but used all the time in
- Glazier...
-
- Interface:
- A nice set of #defines to access Interface SWIs. A bit cleaner than the standard
- header (+ C source!) version distributed with Interface. NB. There is no .c file
- for this - it's just #defines. Just say no to gratuitous function calls!
-
- Lib:
- Various little functions wot come in handy.
-
- SWIs.h:
- For use with DeskLib as RISCOSLib SWI.h file can cause clashes - read file
- for details.
-
- stdhdr.h:
- Wot I used before DeskLib.Core.h came along.
-
- Kbd.h:
- Just provides a function to poll the Alt key (you know - that function that's
- missing from RISCOS_Lib).
-
- Menu.h:
- Wot you've been waiting for!
- A bit of a biggy, but well useful, and easy to use...pretty similar to
- RISCOS_lib's attempt, but more flexible.
- Naming's a bit odd still - all internal functions are called Menu__... as I
- haven't decided how to split up this module. See DeskLib docs for naming
- conventions inside library modules.
-
-
- You could make this lot into a library with LibFile, but it's probably best
- just to tack it on to your own source directory while you work out how
- everything fits together. Some of the source for Menu is a bit hairy (lots
- of linked lists/trees etc) but you should be able to work out what you want
- just looking at the header file - it's well commented (but about the only one
- that is!).
- Basically, call Menu_New to create your menu, use Menu_Attach to attach it
- to window or icon, then call Menu_Detach to detach it(!) and Menu_Dispose
- if you want to get rid of it. However this last step often isn't necessary
- as you usually only dump your menus when you quit the program anyway, but
- it's up to you.
- If you want to do an 'info' type dialogue box hanging off a menu, you should
- have something like the following in your menu selection handler:
-
- case INFO_ABOUT_PROGRAM:
- window = Window_Create("ProgInfo", 30);
- Menu_AddDynamicDialogBox(window);
- break;
-
- (Taken from Glazier source, and it works!)
-
- i.e. a bit easier than Risc OS lib - compare this with equivalent code in the
- RISCOS_lib example program !WExample supplied with Acorn C and you'll see
- what I mean!
-
- I've got most of the bugs out of the Menu module - it seems to cope with all
- the menus in Glazier's Window/Icon Data windows.
-
- Note that not all Risc OS lib's menu functions are mirrored in my
- implementation - they will be eventually, but they're not yet as I never use
- them! Well, not so far, anyway...
-
- Cheers,
- Tim
-