1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data <http://www.neurondata.com>.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998
21 * the Initial Developer. All Rights Reserved.
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * In addition, as a special exception to the GNU GPL, the copyright holders
38 * give permission to link the code of this program with the Motif and Open
39 * Motif libraries (or with modified versions of these that use the same
40 * license), and distribute linked combinations including the two. You
41 * must obey the GNU General Public License in all respects for all of
42 * the code used other than linking with Motif/Open Motif. If you modify
43 * this file, you may extend this exception to your version of the file,
44 * but you are not obligated to do so. If you do not wish to do so,
45 * delete this exception statement from your version.
47 * ***** END LICENSE BLOCK ***** */
53 #define TITLEFONT "-*-helvetica-bold-r-*--*-140-*-*-*-*-iso8859-1"
54 #define BOLDFONT "-*-helvetica-bold-r-*--*-120-*-*-*-*-iso8859-1"
55 #define TEXTFONT "-*-helvetica-medium-r-*--*-100-*-*-*-*-iso8859-1"
58 "|1996 Income Summary\n\
59 |Shampoo|Conditioner|Soap|Total\n\
61 Sales|$ 1,600,000|$ 1,000,000|$ 800,000|$ 3,400,000\n\
62 Less Discounts|(16,000)|(10,000)|(8,000)|(34,000)\n\
63 Less Return Allowance|(8,000)|(5,000)|(4,000)|(17,000)\n\
64 Net Revenue|1,576,000|985,000|792,000|3,349,000\n\
67 Cost of Goods Sold|(640,000)|(330,000)|(264,000)|(1,234,000)\n\
68 Salary Expense|(380,000)|(280,000)|(180,000)|(840,000)\n\
69 Marketing Expense|(157,600)|(98,500)|(79,200)|(335,300)\n\
70 Rent Expense|(36,000)|(36,000)|(36,000)|(108,000)\n\
71 Misc. Other Expense|(36,408)|(22,335)|(16,776)|(75,519)\n\
72 Total Expenses|(1,250,008)|(766,835)|(575,976)|(2,592,819)\n\
74 Income Tax Expense|(130,397)|(87,266)|(86,410)|(304,072)\n\
75 Net Income|195,595|130,899|129,614|456,109";
85 shell
= XtAppInitialize(&app
, "Grid5", NULL
, 0,
86 &argc
, argv
, NULL
, NULL
, 0);
88 grid
= XtVaCreateManagedWidget("grid",
89 xmlGridWidgetClass
, shell
,
90 XtVaTypedArg
, XmNbackground
, XmRString
, "#C0C0C0", 8,
91 XtVaTypedArg
, XmNforeground
, XmRString
, "black", 6,
95 XmNsimpleWidths
, "24c 11c 11c 11c 11c",
96 XmNvisibleColumns
, 10,
98 XtVaTypedArg
, XmNfontList
, XmRString
, TEXTFONT
,
100 XmNselectionPolicy
, XmSELECT_NONE
,
104 XmNlayoutFrozen
, True
,
107 /* Add 'Income Summary' heading row with yellow background */
109 XmNcellDefaults
, True
,
110 XtVaTypedArg
, XmNcellBackground
, XmRString
, "#FFFF00", 8,
111 XtVaTypedArg
, XmNcellForeground
, XmRString
, "#000080", 8,
112 XmNcellLeftBorderType
, XmBORDER_NONE
,
113 XmNcellRightBorderType
, XmBORDER_NONE
,
114 XmNcellTopBorderType
, XmBORDER_NONE
,
115 XtVaTypedArg
, XmNcellBottomBorderColor
, XmRString
, "black", 6,
116 XmNcellAlignment
, XmALIGNMENT_CENTER
,
118 XmLGridAddRows(grid
, XmHEADING
, -1, 1);
120 /* Set span on '1996 Income Summary' cell in heading row */
122 XmNrowType
, XmHEADING
,
125 XmNcellColumnSpan
, 2,
126 XtVaTypedArg
, XmNcellFontList
, XmRString
, TITLEFONT
,
127 strlen(TITLEFONT
) + 1,
130 /* Add 'Shampoo Conditioner Soap' heading row with white background */
132 XmNcellDefaults
, True
,
133 XtVaTypedArg
, XmNcellFontList
, XmRString
, BOLDFONT
,
134 strlen(BOLDFONT
) + 1,
135 XtVaTypedArg
, XmNcellBackground
, XmRString
, "white", 6,
136 XtVaTypedArg
, XmNcellForeground
, XmRString
, "black", 6,
137 XmNcellBottomBorderType
, XmBORDER_NONE
,
139 XmLGridAddRows(grid
, XmHEADING
, -1, 1);
141 /* Add content and footer rows with heading column 0 left justified */
143 XmNcellDefaults
, True
,
144 XmNcellAlignment
, XmALIGNMENT_RIGHT
,
145 XtVaTypedArg
, XmNcellFontList
, XmRString
, TEXTFONT
,
146 strlen(TEXTFONT
) + 1,
149 XmNcellDefaults
, True
,
150 XmNcolumnType
, XmHEADING
,
152 XmNcellAlignment
, XmALIGNMENT_LEFT
,
154 XmLGridAddRows(grid
, XmCONTENT
, -1, 15);
156 /* Add footer row with blue background */
158 XmNcellDefaults
, True
,
159 XtVaTypedArg
, XmNcellForeground
, XmRString
, "white", 6,
160 XtVaTypedArg
, XmNcellBackground
, XmRString
, "#000080", 8,
161 XtVaTypedArg
, XmNcellFontList
, XmRString
, BOLDFONT
,
162 strlen(BOLDFONT
) + 1,
164 XmLGridAddRows(grid
, XmFOOTER
, -1, 1);
166 /* Bold 'Revenues' cell */
168 XmNcolumnType
, XmHEADING
,
171 XtVaTypedArg
, XmNcellFontList
, XmRString
, BOLDFONT
,
172 strlen(BOLDFONT
) + 1,
175 /* Bold 'Less Expenses' cell */
177 XmNcolumnType
, XmHEADING
,
180 XtVaTypedArg
, XmNcellFontList
, XmRString
, BOLDFONT
,
181 strlen(BOLDFONT
) + 1,
184 /* Grey middle and footer content column */
186 XmNcolumnType
, XmALL_TYPES
,
187 XmNcolumnRangeStart
, 2,
188 XmNcolumnRangeEnd
, 4,
190 XtVaTypedArg
, XmNcellBackground
, XmRString
, "#E8E8E8", 8,
193 /* Grey 'Conditioner' and 'Total' cell in heading row 1 */
195 XmNrowType
, XmHEADING
,
197 XmNcolumnType
, XmALL_TYPES
,
198 XmNcolumnRangeStart
, 2,
199 XmNcolumnRangeEnd
, 4,
201 XtVaTypedArg
, XmNcellBackground
, XmRString
, "#E8E8E8", 8,
204 /* Blue and bold 'Net Revenue' and 'Total Expenses' rows */
209 XmNcolumnType
, XmALL_TYPES
,
210 XtVaTypedArg
, XmNcellForeground
, XmRString
, "white", 6,
211 XtVaTypedArg
, XmNcellBackground
, XmRString
, "#000080", 8,
212 XtVaTypedArg
, XmNcellFontList
, XmRString
, BOLDFONT
,
213 strlen(BOLDFONT
) + 1,
217 XmNlayoutFrozen
, False
,
220 XmLGridSetStrings(grid
, data
);
222 XtRealizeWidget(shell
);