/ gui-lib / framework / doc.txt
doc.txt
 1  
 2  _Framework Extras_
 3  
 4  _decorated-editor-snip.ss_ defines two classes:
 5  
 6  --------------------------------------------------
 7  
 8  > decorated-editor-snip%, derived from editor-snip%
 9     
10  This class operated just like a regular editor snip, except
11  that it has a color and an icon in the top right hand corner.
12  
13  Overridable methods:
14  
15  Each of these methods must be overridden in a derived class
16  to specify this class's behavior.
17  
18  >  make-snip :: (send a-des make-snip) - returns an instance
19       of one of these snips. Defaults to returning an
20       instance of decorated-editor-snip%. Override this when
21       deriving a new class from decorated-editor-snip%.
22  
23  >  make-editor :: (send a-des make-editor) - returns the
24       editor to be used in the snip. Returns an instance of
25       text% by default.
26  
27  >  get-color :: (send a-des get-color) - returns a color%
28       object or a string in the color-database%
29       that is used for the border of the snip. Defaults to
30       return "black".
31  
32  > get-corner-bitmap :: (send a-des get-corner-bitmap) -
33       returns the bitmap to be used in the corner of the
34       snip, or #f. Defaults to returning #f.
35  
36  > get-menu :: (send a-des get-menu) - returns the menu to be
37       used when someone clicks on the top portion of the
38       snip, or #f (in which case there is no menu). Defaults
39       to return #f.
40  
41  Overridden methods:
42  
43  >  write : writes the editor's contents to the file.
44  
45  >  copy : uses the `make-snip' method to copy the
46            snip. Creates a copy of the editor in the snip using
47            the `copy-self' method and sets the style of the
48            copy to be the style of the original.
49  
50  >  on-event : handles the popup menu 
51  
52  >  draw : draws the icon
53  
54  --------------------------------------------------
55  
56  > decorated-editor-snipclass%, derived from snip-class%
57  
58  Overridable method:
59  
60  >  make-snip :: (send a-desc make-snip stream-in) - returns
61     an instance of the snip to be created by this snipclass.
62  
63  Overridden method:
64  
65  >  write : This method matches decorated-editor-snip%'s
66             `write' method. It first calls `make-snip' to
67             create the snip and then reads the editor from
68             the stream.