home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 5 / amigaformatcd05.iso / mui / developer / modula / doc / muiclasssupport.doc
Encoding:
Text File  |  1996-08-13  |  3.5 KB  |  128 lines

  1. TABLE OF CONTENTS
  2.  
  3. MuiClassSupport/DoSuperNew
  4. MuiClassSupport/InitClass
  5. MuiClassSupport/RemoveClass
  6. MuiClassSupport/DoSuperNew                         MuiClassSupport/DoSuperNew
  7.  
  8.    NAME
  9.      DoSuperNew
  10.  
  11.    SYNOPSIS
  12.      DoSuperNew(cl       : IClassPtr;
  13.                 obj      : ObjectPtr ;
  14.                 attrList : TagItemPtr) : ADDRESS ;
  15.  
  16.    FUNCTION
  17.      calls the OM_NEW method for the superclass to create an instance of
  18.      your custom-class. Most likely you will call this in the NEW-Method
  19.      of your customclass.
  20.  
  21.    INPUTS
  22.      cl
  23.        a pointer to a customclass structure, if DoSuperMethod ist called
  24.        from the NEW method of your customclass, use the ClassPtr you got
  25.        as parameter for your NEW method.
  26.  
  27.      obj
  28.        also use the ObjectPtr you got as parameter for your NEW method.
  29.  
  30.      attrList
  31.        a taglist to set attributes of the superclass your customclass is
  32.        an instance of.
  33.  
  34.    RESULT
  35.      an instance of your customclass.
  36.  
  37.    SEE ALSO
  38.      amiga.lib/DoSuperMethodA
  39.  
  40. MuiClassSupport/InitClass                           MuiClassSupport/InitClass
  41.  
  42.    NAME
  43.      InitClass
  44.  
  45.    SYNOPSIS
  46.      InitClass(VAR mcc        : mCustomClassPtr;
  47.                    base       : LibraryPtr ;
  48.                    supername  : StrPtr ;
  49.                    supermcc   : mCustomClassPtr ;
  50.                    datasize   : LONGINT ;
  51.                    dispatcher : DispatcherDef) : BOOLEAN ;
  52.  
  53.    FUNCTION
  54.  
  55.      Easily allocate and initialize a MUI-CustomClass structure.
  56.  
  57.      Be sure to call RemoveClass when you're done with the class (most
  58.      likely InitClass() will be called from the startup-code of a module
  59.      whereas RemoveClass will be called from the closing code.)
  60.  
  61.    INPUTS
  62.      mcc
  63.        the structure to be initialized. It will also be allocated for you,
  64.        so be sure to not handle a valid pointer to InitClass(), it will be
  65.        overwritten!
  66.  
  67.      base, supername, supermcc, datasize
  68.        see muimaster.library/MUI_CreateCustomClass
  69.  
  70.      dispatcher
  71.        this is the dispatcher function of your customclass, it must match
  72.        the following prototype:
  73.  
  74.          PROCEDURE ( (* class   *) id.IClassPtr,
  75.                      (* object  *) ADDRESS,
  76.                      (* message *) ADDRESS) : ADDRESS;
  77.  
  78.        No need to call MakeDispatcher as InitClass does this for you.
  79.  
  80.    RESULT
  81.      TRUE if the initialization was successful, FALSE otherwise
  82.  
  83.    EXAMPLE
  84.      IMPLEMENTATION MODULE TestClass ;
  85.  
  86.      [...]
  87.  
  88.      BEGIN
  89.        IF NOT (InitClass(class1, NIL, ADR(mcPopobject), NIL,
  90.                          SIZE(Class1Data), Class1Dispatcher) AND
  91.                InitClass(class2, NIL, NIL,              class1,
  92.                          SIZE(Class2Data), Class2Dispatcher)) THEN
  93.          [Fail]
  94.        END ;
  95.      CLOSE
  96.        RemoveClass(class2) ;
  97.        RemoveClass(class1) ;
  98.      END TestClass .
  99.  
  100.      This will create the to classes class1 and class2 where class1 is a
  101.      subclass of mcPopobject and class2 is a subclass of class1.
  102.  
  103.    SEE ALSO
  104.      MuiClassSupport/RemoveClass muimaster.library/MUI_CreateCustomClass
  105.  
  106. MuiClassSupport/RemoveClass                       MuiClassSupport/RemoveClass
  107.  
  108.    NAME
  109.      RemoveClass
  110.  
  111.    SYNOPSIS
  112.      RemoveClass(VAR mcc : mCustomClassPtr) ;
  113.  
  114.    FUNCTION
  115.      dispose of the MUI-CustomClass.
  116.  
  117.    INPUTS
  118.      mcc
  119.        the customclass to dispose of.
  120.  
  121.        Note that this is a VAR parameter, it will be set to NIL after the
  122.        call, so you may call RemoveClass() more often on the same
  123.        structure without any bad results.
  124.  
  125.    SEE ALSO
  126.      MuiClassSupport/InitClass
  127.  
  128.