home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / c / intuitionpp / doc / ipp_tutorial.txt < prev    next >
Encoding:
Text File  |  1993-04-07  |  5.2 KB  |  200 lines

  1.  
  2.  
  3.     Intuition++
  4.     Contact :
  5.  
  6.         Brulhart Dominique
  7.         12, rue Lissignol
  8.         1201 Geneva
  9.         Switzerland
  10.  
  11.         Phone : (41 22) 738 34 38
  12.  
  13.         E-Mail : brulhart@cuilima.unige.ch
  14.  
  15.  
  16.  
  17.     Intuition++ Tutorial
  18.  
  19.  
  20.     This is the first release of I++ I wrote in one week, so be indulgent.
  21.     The goal was to create classes for Windows and Screens that could be
  22.     more easy to create, don't need initialisation and cleaning from the
  23.     user and provide a way of handling events and messages easily.
  24.  
  25.     So I created 12 classes shortly described below. A list of all methods
  26.     are given in file 'Ipp_Reference_Guide'.
  27.  
  28.     The general way of using I++ is proach of XView programming, and may
  29.     seem different of normal Intuition, Exec and Graphics using. This is
  30.     one approach, but it's be pleasant to program with. 
  31.  
  32.     In fact, if you know Intuition and C++, you know I++. Here are explained
  33.     only methods that are not standard in Intuition.
  34.  
  35.  
  36.     Description of all classes:
  37.  
  38.         1)    The CFont class, which only opens a font and keep a
  39.             pointer to it so it can be used by windows and screens.
  40.  
  41.         2)    The CRastPortHdl class, which only handles a RastPort
  42.             the user pass to its constructor or to a method which
  43.             turn handling on. So, a window or a screen which possess
  44.             a valid RastPort can handle it trough this class.
  45.             No initialisation, creation, etc.. of RastPort is made
  46.             by it.
  47.  
  48.         3)    The CWindow class, which manages a NewWindow and TagItem
  49.             and a Window pointer. An instance of CWindow remembers
  50.             all its parameters between close() and open().
  51.             This class control window opening, closing, sizing,
  52.             positioning, changing its flags, etc...
  53.  
  54.         4)    The GfxWindow class, which inherits class CWindow and
  55.             class CRastPortHdl. This is a complete graphic window
  56.             encapsulation.
  57.  
  58.         5)    The IMessage and IEvent classes, which only encapsulates
  59.             IntuiMessage and a defines what I think an event is.
  60.  
  61.         6)    The MsgWindow class, which is the heart of event
  62.             handling. It derives class CWindow for general window
  63.             control and implement the following not standard methods:
  64.  
  65.             - linkIevent(class, code, qualifier, object, callback)
  66.  
  67.                 links an event to the window, so when it
  68.                 receives a message corresponding to the event,
  69.                 the desired callback is executed. For Gadget
  70.                 pass GADGETUP/DOWN for class, NULL for code,
  71.                 qualifier if you want, the address of the Gadget
  72.                 for object and a pointer to the function you
  73.                 to be executed when the Gadget is clicked for
  74.                 callback.
  75.                 For other types of message pass the desired
  76.                 class, code, qualifier, object that you normally
  77.                 test with Intuition.
  78.  
  79.                 The callback must be declared like that:
  80.  
  81.                     void mycallback(IMessage& message)
  82.                     {
  83.                         ....
  84.                     }
  85.  
  86.                 so you can watch to message which bring you
  87.                 there.
  88.                 See examples for further explanation.
  89.  
  90.  
  91.             - rmIevents()
  92.  
  93.                 removes all events linked to the window.
  94.  
  95.  
  96.             - getImsg(message)
  97.  
  98.                 standard GetMsg()
  99.  
  100.  
  101.             - waitImsg(message)
  102.     
  103.                 standard WaitMsg() + GetMsg()
  104.  
  105.  
  106.             - clearImsg()
  107.  
  108.                 clears UserPort message queue
  109.  
  110.  
  111.             - filterImsg(message)
  112.  
  113.                 tries to handle the passed message with the
  114.                 list of events for the current window.
  115.                 Return the message only if no events could
  116.                 have been matched and callback executed.
  117.  
  118.  
  119.             - softcontrol(message)
  120.  
  121.                 takes control of program execution and handle
  122.                 message flow by executing appropriate callback
  123.                 This method returns only if a message could not
  124.                 have been handled.
  125.  
  126.  
  127.             - hardcontrol()
  128.  
  129.                 takes control of program execution, execute the
  130.                 appropriate callback for message it receives.
  131.                 Warning : hardcontrol() never returns, unap-
  132.                 prpriate messages are ignored.
  133.  
  134.  
  135.  
  136.         7)    The MGWindow class, which simply inherits GfxWindow
  137.             and MsgWindow. This is a complete window handling.
  138.  
  139.  
  140.         8)    The Waiter class, to which you can link as many window
  141.             you want. The Waiter waits for messages concerning one
  142.             of the windows you linked to it, and dispatch them to
  143.             the right one.
  144.             Non standard methods:
  145.  
  146.             - linkwindow(window)
  147.  
  148.                 links a window to it.
  149.  
  150.  
  151.             - rmwindow(window);
  152.  
  153.                 removes a specified window from it.
  154.  
  155.  
  156.             - rmwindows();
  157.  
  158.                 removes all window linked to it.
  159.  
  160.  
  161.             - softcontrol(messagenothandled);
  162.             - hardcontrol();
  163.  
  164.                 take control of program execution like MsgWindow
  165.                 does , but for multiple window application.
  166.  
  167.  
  168.         9)    The CScreen class, which handles screen like CWindow does
  169.             for windows. You can link as many window you want to a
  170.             CScreen object so when a screen is closed, all its linked
  171.             windows are closed. When it's reopened all windows that
  172.             was opened reopen.
  173.             Non standard methods (no comment):
  174.  
  175.             - linkwindow(window)
  176.             - rmwindow(window)
  177.             - rmwindows()
  178.             - openallwindows()
  179.             - closeallwindows()
  180.  
  181.  
  182.         10)    The GScreen class, which inherits CScreen and CRastPortHdl
  183.             is an encapsulation of a complete graphic screen.
  184.  
  185.  
  186.         11)    The WScreen class, which inherits CScreen and Waiter. This
  187.             screen control totally the program execution, the windows
  188.             linked to it, ... everything.
  189.  
  190.  
  191.         12)    The WGScreen class, which inherits WScreen and GScreen.
  192.             A complete graphic, event handling screen.
  193.  
  194.  
  195.  
  196.     So, if you need more explanation, read Ipp_Reference_Guide, read the
  197.     examples, or e-mail me your questions to brulhart@cuilima.unige.ch.
  198.  
  199.     Please test it, and send me remarks, bug reports, etc...
  200.