home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-09 | 1.7 KB | 68 lines | [TEXT/MPS ] |
- --
- -- File: SHAPE.k
- -- FrameWork Extension
- -- (c) The Carl Group, Inc., 1993
- --
- -- Major additions and alterations by Dan Crow, 1994, 1995
- --
- -- © 1994, 1995 Art of Memory Ltd.
- -- All Rights Reserved
- --
- -- This file is supplied as part of the TextPak demonstration. You are only
- -- entitled to use this software to understand how the demonstration works.
- -- You may not duplicate, modify, reproduce or distribute this software in
- -- any form. If you wish to purchase a licence to use this software, please
- -- contact Art of Memory Ltd.
- --
-
- class SHAPE is MEDIADELEGATOR; -- General Class for Shapes
-
- has
- PenColour; -- Color of shape outline
- PenSize; -- Size in pixels of shape outline
- myShape; -- Circle or Rectangle
- FillColour; -- Colour of inside of rectangle
-
- Draw(theX, theY, theWidth, theHeight)
- self.PenColour is? VECTOR;
- self.PenSize is? INTEGER;
-
- do
- if self.SetupOff(theX, theY, theWidth, theHeight) then
- if self.myShape=RECTANGLE then
- self.DrawRectangle();
- else if self.myShape=CIRCLE then
- self.DrawCircle();
- end;
- self.CleanupOff();
- end;
- end;
-
-
- DrawRectangle()
- external "DrawRectangle";
-
-
- DrawCircle()
- external "DrawCircle";
-
- end;
-
- -- R,G,B values for some standard colors
- object WHITE is {$FFFF, $FFFF, $FFFF};
- object RED is {$FFFF, 0, 0};
- object GREEN is { 0, $FFFF, 0};
- object BLUE is { 0, 0, $FFFF};
- object GREEN_BLUE is { 0, $8000, $9000};
- object YELLOW is {$FFFF, $FFFF, 0};
- object REED_YELLOW is {255, 235, 0};
- object CYAN is { 0, $FFFF, $FFFF};
- object MAGENTA is {$FFFF, 0, $FFFF};
- object BROWN is {$8000, $4000, 0};
- object BLACK is { 0, 0, 0};
-
- object RECTANGLE is 1;
- object CIRCLE is 2;
-
-
-