1 |
149 |
jeremybenn |
-- FA11B00.A
|
2 |
|
|
--
|
3 |
|
|
-- Grant of Unlimited Rights
|
4 |
|
|
--
|
5 |
|
|
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
|
6 |
|
|
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
|
7 |
|
|
-- unlimited rights in the software and documentation contained herein.
|
8 |
|
|
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
|
9 |
|
|
-- this public release, the Government intends to confer upon all
|
10 |
|
|
-- recipients unlimited rights equal to those held by the Government.
|
11 |
|
|
-- These rights include rights to use, duplicate, release or disclose the
|
12 |
|
|
-- released technical data and computer software in whole or in part, in
|
13 |
|
|
-- any manner and for any purpose whatsoever, and to have or permit others
|
14 |
|
|
-- to do so.
|
15 |
|
|
--
|
16 |
|
|
-- DISCLAIMER
|
17 |
|
|
--
|
18 |
|
|
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
|
19 |
|
|
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
|
20 |
|
|
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
|
21 |
|
|
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
|
22 |
|
|
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
|
23 |
|
|
-- PARTICULAR PURPOSE OF SAID MATERIAL.
|
24 |
|
|
--*
|
25 |
|
|
--
|
26 |
|
|
-- FOUNDATION DESCRIPTION:
|
27 |
|
|
-- This foundation declares parent types and operations that can
|
28 |
|
|
-- be inherited by its children.
|
29 |
|
|
--
|
30 |
|
|
-- CHANGE HISTORY:
|
31 |
|
|
-- 06 Dec 94 SAIC ACVC 2.0
|
32 |
|
|
--
|
33 |
|
|
--!
|
34 |
|
|
|
35 |
|
|
package FA11B00 is -- Application_One_Widget
|
36 |
|
|
-- This foundation simulates code that might be obtained as an already
|
37 |
|
|
-- implemented set of objects and services, perhaps from a source code
|
38 |
|
|
-- vendor. It represents processing of widgets in a window system.
|
39 |
|
|
-- These widgets all have the same characteristics, but they are application
|
40 |
|
|
-- specific, so we do not allow assignment of an App_1_Widget to App_2_Widget.
|
41 |
|
|
|
42 |
|
|
-- The dimension measurement is in pixels (dots on the screen).
|
43 |
|
|
type Pixels is range 0 .. 10_000;
|
44 |
|
|
type Widget_Id is new Integer;
|
45 |
|
|
type Widget_Color_Enum is (Amber, Green, White, None);
|
46 |
|
|
subtype Widget_Label_Str is string (1 .. 15);
|
47 |
|
|
|
48 |
|
|
type Widget_Location is
|
49 |
|
|
record
|
50 |
|
|
X_Location, Y_Location : Pixels;
|
51 |
|
|
end record;
|
52 |
|
|
|
53 |
|
|
type Widget_Size is
|
54 |
|
|
record
|
55 |
|
|
X_Length, Y_Length : Pixels;
|
56 |
|
|
end record;
|
57 |
|
|
|
58 |
|
|
-- NOTE : not a tagged record.
|
59 |
|
|
type App1_Widget (Maximum_Size : Pixels := Pixels'Last)
|
60 |
|
|
is record -- Parent type
|
61 |
|
|
Size : Widget_Size := (Maximum_Size, Maximum_Size);
|
62 |
|
|
ID : Widget_Id := 1;
|
63 |
|
|
Location : Widget_Location := (0,0);
|
64 |
|
|
Color : Widget_Color_Enum := None;
|
65 |
|
|
Label : Widget_Label_Str := " ";
|
66 |
|
|
end record;
|
67 |
|
|
|
68 |
|
|
-- Primitive operation of type Widget.
|
69 |
|
|
-- To be inherited by its children derivatives.
|
70 |
|
|
procedure App1_Widget_Specific_Oper (The_Widget : in out App1_Widget;
|
71 |
|
|
I : in Widget_Id;
|
72 |
|
|
C : in Widget_Color_Enum;
|
73 |
|
|
L : in Widget_Label_Str);
|
74 |
|
|
|
75 |
|
|
end FA11B00; -- Application_One_Widget
|
76 |
|
|
|
77 |
|
|
--=======================================================================--
|
78 |
|
|
|
79 |
|
|
package body FA11B00 is -- Application_One_Widget
|
80 |
|
|
|
81 |
|
|
procedure Set_Color (The_Widget : in out App1_Widget;
|
82 |
|
|
C : in Widget_Color_Enum) is
|
83 |
|
|
begin
|
84 |
|
|
The_Widget.Color := C;
|
85 |
|
|
end Set_Color;
|
86 |
|
|
-------------------------------------------------------------
|
87 |
|
|
procedure Set_Label (The_Widget : in out App1_Widget;
|
88 |
|
|
L : in Widget_Label_Str) is
|
89 |
|
|
begin
|
90 |
|
|
The_Widget.Label := L;
|
91 |
|
|
end Set_Label;
|
92 |
|
|
-------------------------------------------------------------
|
93 |
|
|
procedure Set_Id (The_Widget : in out App1_Widget;
|
94 |
|
|
I : in Widget_Id) is
|
95 |
|
|
begin
|
96 |
|
|
The_Widget.Id := I;
|
97 |
|
|
end Set_Id;
|
98 |
|
|
-------------------------------------------------------------
|
99 |
|
|
procedure App1_Widget_Specific_Oper
|
100 |
|
|
(The_Widget : in out App1_Widget;
|
101 |
|
|
I : in Widget_Id;
|
102 |
|
|
C : in Widget_Color_Enum;
|
103 |
|
|
L : in Widget_Label_Str) is
|
104 |
|
|
begin
|
105 |
|
|
Set_Color (The_Widget, C);
|
106 |
|
|
Set_Label (The_Widget, L);
|
107 |
|
|
Set_Id (The_Widget, I);
|
108 |
|
|
end App1_Widget_Specific_Oper;
|
109 |
|
|
|
110 |
|
|
end FA11B00; -- Application_One_Widget
|