1 /********************************************************************
2 This file is part of the abs 0.907 distribution. abs is a spreadsheet
3 with graphical user interface.
4
5 Copyright (C) 1998-2001 Andr� Bertin (Andre.Bertin@ping.be)
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version if in the same spirit as version 2.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 Concact: abs@pi.be
22 http://home.pi.be/bertin/abs.shtml
23
24 *********************************************************************/
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 #include "workbook_vb.h"
52 #include "application.h"
53 #include "class.h"
54
55 obj
vb_getworkbook(narg,arg)56 vb_getworkbook (narg, arg)
57 int narg;
58 obj *arg;
59 {
60 obj o = arg[0];
61
62 if (o.type == STRING_CONSTANT)
63 {
64
65 }
66 else
67 {
68
69 }
70
71 o.type = WORKBOOK;
72 o.label = NULL;
73 return o;
74 }
75
76 obj
vb_get_ActiveWorkbook()77 vb_get_ActiveWorkbook ()
78 {
79 obj o;
80
81 o.rec.s = (char *) ActiveWorkbook;
82 o.type = WORKBOOK;
83 o.label = NULL;
84 return o;
85 }
86
87 obj
vb_workbook_setactivesheet(narg,arg)88 vb_workbook_setactivesheet (narg, arg)
89 int narg;
90 obj *arg;
91 {
92 obj o;
93 o.type = INTEGER;
94 o.label = NULL;
95 return o;
96 }
97
98 obj
vb_workbook_getactivesheet(narg,arg)99 vb_workbook_getactivesheet (narg, arg)
100 int narg;
101 obj *arg;
102 {
103 obj o;
104 o.rec.s = (char *) ActiveWorksheet;
105 o.type = WORKSHEET;
106
107 if (narg != 1)
108 return o;
109 if (arg[0].type == WORKBOOK)
110 {
111 o.rec.s = (char *) ((Workbook *) arg[0].rec.s)->activeworksheet;
112 }
113
114 return o;
115 }
116
117 obj
vb_workbook_activate(narg,arg)118 vb_workbook_activate (narg, arg)
119 int narg;
120 obj *arg;
121 {
122 obj o;
123 if (narg == 1)
124 if (arg[0].type == WORKBOOK)
125 {
126 ActivateWorkbook ((Workbook *) arg[0].rec.s);
127 }
128 o.rec.s = (char *) ActiveWorkbook;
129 o.type = WORKBOOK;
130 o.label = NULL;
131 return o;
132 }
133
134 obj
vb_workbook_calculate(narg,arg)135 vb_workbook_calculate (narg, arg)
136 int narg;
137 obj *arg;
138 {
139 obj o;
140 if (narg != 1)
141 return o;
142 if (arg[0].type == WORKBOOK)
143 {
144 workbook_calculate ((Workbook *) arg[0].rec.s);
145 }
146 o.label = NULL;
147 return o;
148 }
149
150 obj
vb_workbook_close(narg,arg)151 vb_workbook_close (narg, arg)
152 int narg;
153 obj *arg;
154 {
155 obj o;
156 if (narg != 1)
157 return o;
158 if (arg[0].type == WORKBOOK)
159 {
160
161 }
162 o.label = NULL;
163 return o;
164 }
165
166 obj
vb_workbook_printout(narg,arg)167 vb_workbook_printout (narg, arg)
168 int narg;
169 obj *arg;
170 {
171 obj o;
172 if (narg != 1)
173 return o;
174 if (arg[0].type == WORKBOOK)
175 {
176
177 }
178 o.label = NULL;
179 return o;
180 }
181
182 obj
vb_workbook_save(narg,arg)183 vb_workbook_save (narg, arg)
184 int narg;
185 obj *arg;
186 {
187 obj o;
188 if (narg != 1)
189 return o;
190 if (arg[0].type == WORKBOOK)
191 {
192
193 }
194 o.label = NULL;
195 return o;
196 }
197 obj
vb_workbook_saveas(narg,arg)198 vb_workbook_saveas (narg, arg)
199 int narg;
200 obj *arg;
201 {
202 obj o;
203 o.label = NULL;
204 return o;
205 }
206
207 obj
vb_get_Workbooks()208 vb_get_Workbooks ()
209 {
210 obj o;
211 o.type = WORKBOOKS;
212 o.rec.i = WORKBOOKS;
213 o.label = arrayclass[WORKBOOKS].name;
214 return o;
215 }
216 obj
vb_workbooks_setcount(narg,arg)217 vb_workbooks_setcount (narg, arg)
218 int narg;
219 obj *arg;
220 {
221 obj o;
222 o.type = INTEGER;
223 o.rec.i = application_nbwb ();
224 o.label = NULL;
225 return o;
226 }
227
228 obj
vb_workbooks_getcount(narg,arg)229 vb_workbooks_getcount (narg, arg)
230 int narg;
231 obj *arg;
232 {
233 obj o;
234 o.type = INTEGER;
235 o.rec.i = application_nbwb ();
236 o.label = NULL;
237 return o;
238 }
239
240 obj
vb_workbooks_add(narg,arg)241 vb_workbooks_add (narg, arg)
242 int narg;
243 obj *arg;
244 {
245 obj o;
246 o.rec.s = (char *) new_doc (NULL);
247 o.type = WORKBOOK;
248 o.label = NULL;
249 return o;
250 }
251
252 obj
vb_workbooks_open(narg,arg)253 vb_workbooks_open (narg, arg)
254 int narg;
255 obj *arg;
256 {
257 obj o;
258 o.type = INTEGER;
259 o.label = NULL;
260 return o;
261 }
262
263 obj
vb_workbooks_close(narg,arg)264 vb_workbooks_close (narg, arg)
265 int narg;
266 obj *arg;
267 {
268 obj o;
269 o.type = INTEGER;
270 o.label = NULL;
271 return o;
272 }
273