home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / ClassFree / CFsampleclass / readme.doc < prev    next >
Text File  |  1998-05-19  |  4KB  |  104 lines

  1. --------------------------------------
  2.  
  3.  sampleclass V0.10
  4.  
  5.  A BOOPSI class programming example.
  6.  
  7. --------------------------------------
  8.  
  9.  
  10. Description:
  11. ------------
  12.  
  13.  This is an example BOOPSI class project for StormC. Of course it works on other
  14. compilers too, but it will require some tweaking.
  15.  I have used this as a basis for the classes in the ClassFree archive.
  16.  
  17.  This document contains some notes and hints that might be usefull when
  18. programming new BOOPSI classes.
  19.  
  20.  Descriptions of the individual files are in the document files.doc.
  21.  
  22.  
  23. Programming notes:
  24. ------------------
  25.  
  26.  First of all. Some of the classes in the OS should be considered in BETA state,
  27. because they seem to be missing some features that are documentet. Some classes
  28. are not documentet very good and you have to do some experimenting to find out
  29. some of their quirks.
  30.  
  31.  The build-in button class (and frbuttonclass).
  32.  
  33.  The class leaves some to be desired. You have to do a lot of things yourself,
  34. for instance if you want to do a standard text gadget then you have to supply an
  35. image object as well as the text (frameiclass) because it is the image that
  36. handles the mousehit routines.
  37.  On the Amiga Developer CD there is a replacement buttonclass that corrects most
  38. of the problems that occure when using the build in class. But this one has
  39. problems too. It doesn't support (AFAICS) ICA_TARGET and ICA_MAP (which, by the
  40. way, for some reason is defined in capitalized letters and and not as it is
  41. written in all documentation ICA_Target and ICA_Map) which are essential if you
  42. want to use it as a basis for group gadgets.
  43.  
  44.  The groupgclass.
  45.  
  46.  Very poorly documentet if you ask me. I didn't even want to try to mess with
  47. LAYOUT stuff, I don't think it works, althought it might..
  48.  The main thing that fooled me a lot about this class is that when you hand the
  49. GA_Left, and GA_Top attributes to it, then all gadgets you add as members must be
  50. placed relative to this position, so if you want a button to appear right where
  51. you positioned the groupgadget then the botton must have the GA_Left and GA_Top
  52. set to 0.
  53.  When you change a gadgets attributes after it has been added to the membership
  54. the you should use either use SetGadgetAttrs() or supply the GadgetInfo to
  55. DoMethod in some way. Else the gadget rendering will fail (possibly intuition
  56. will hang but I'm not quite sure). I had a lot of problems with this myself.
  57.  If you are making a sub class of groupgclass:
  58.  If you have several gadgets communicating with ICA_TARGET, then be sure that
  59. you DON'T call the SuperClass (ie. groupgclass) before you are about to process
  60. the incoming data. You can target your own groupgclass object with ICA_TARGET
  61. for example with buttons. This way you will get the OM_UPDATE method issued and
  62. the GA_ID of the gadget that was hit will be in the in the attributes list.
  63.  Now. If you call DoSupermethod the groupgclass will go and send a
  64. IDCMP_GADGETUP message with your gadgets GA_ID to the applictation that is using
  65. your subclass object. Since the application is likely to have its own gadget
  66. with the GA_ID that you are using it will think that the user has hit one of the
  67. aplications gadgets and unwanted effects will occure.
  68.  
  69.  
  70. General hints:
  71. --------------
  72.  
  73.  Sometimes the Superclass must be overriden entirely. In the above example with
  74. OM_UPDATE in groupgclass you should not call the SuperMethod at all, because it
  75. will cause unwanted results. 
  76.  
  77.  Be very carefull to jump out of the dispatcher switch with break or return. You
  78. will be punished for running out of bounds..
  79.  
  80.  
  81. History:
  82. --------
  83.  
  84.  V0.01
  85.  
  86.    First test release.
  87.  
  88.  V0.10
  89.  
  90.    Put all OpenLibrary and CloseLibrary calls in
  91.     seperate routines.
  92.    Added debugging routines.
  93.  
  94.  V0.12
  95.  
  96.    I should have known better than to use
  97.     dos.library functions from within a library..
  98.     -replaced the debugging routines :)
  99.  
  100.  V0.13
  101.  
  102.    Removed some useless code left over from the class that
  103.    this sampleclass was based on.
  104.