99b65886d7e7dc1fbcf8896625deddc720938571
[scilab.git] / scilab / modules / graphics / macros / %h_p.sci
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) INRIA
3 // This file must be used under the terms of the CeCILL.
4 // This source file is licensed as described in the file COPYING, which
5 // you should have received as part of this distribution.  The terms
6 // are also available at
7 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
8
9 function %h_p(h)
10     if size(h,'*')>1 then
11             T=matrix(h.type,size(h))
12             t=''
13         for k=1:size(h,2)
14             t=t+part(T(:,k),1:max(length(T(:,k)))+1)
15         end
16         t1=string(size(h,1))+' by '+string(size(h,2))+' matrix of handles:'
17         t1=[t1;part('=',ones(1,length(t1)))]
18         t=[t1;t]
19     else
20         if (h.type=="Waitbar" | h.type=="Progressionbar")
21             t="Handle of type """+h.type+"""";
22         else
23             t="Handle of type """+h.type+""" with properties:"
24             t=[t;part('=',ones(1,length(t)))]
25         end
26         
27         select h.type
28         
29         // Polyline
30         // =====================================================================
31         
32         case "Polyline"
33             
34             if size(h.data,'*') > 10 then 
35                 d="matrix "+strcat(string(size(h.data)),'x')
36             else
37                 d=sci2exp(h.data,0)
38                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
39             end
40             
41             if size(h.x_shift,'*') > 10 then 
42                 bxs="matrix "+strcat(string(size(h.x_shift)),'x')
43             else
44                 bxs=sci2exp(h.x_shift,0)
45                 if length(bxs)>70 then bxs="matrix "+strcat(string(size(h.x_shift)),'x'),end
46             end
47             
48             if size(h.y_shift,'*') > 10 then 
49                 bys="matrix "+strcat(string(size(h.y_shift)),'x')
50             else
51                 bys=sci2exp(h.y_shift,0)
52                 if length(bys)>70 then bys="matrix "+strcat(string(size(h.y_shift)),'x'),end
53             end
54             
55             if size(h.z_shift,'*') > 10 then 
56                 bzs="matrix "+strcat(string(size(h.z_shift)),'x')
57             else
58                 bzs=sci2exp(h.z_shift,0)
59                 if length(bzs)>70 then bzs="matrix "+strcat(string(size(h.z_shift)),'x'),end
60             end
61             
62             u=h.user_data;
63             t=[t;
64                 "parent: "+h.parent.type
65                 "children: "+fmtchildren(h.children)
66                 "visible = "+sci2exp(h.visible)
67                 "data = "+d
68                 "closed = "+sci2exp(h.closed)
69                 "line_mode = "+sci2exp(h.line_mode)
70                 "fill_mode = "+sci2exp(h.fill_mode)
71                 "line_style = "+string(h.line_style)
72                 "thickness = "+string(h.thickness)
73                 "arrow_size_factor = "+string(h.arrow_size_factor)
74                 "polyline_style = "+string(h.polyline_style)
75                 "foreground = "+string(h.foreground)
76                 "background = "+string(h.background)
77                 "interp_color_vector = "+sci2exp(h.interp_color_vector)
78                 "interp_color_mode = "+sci2exp(h.interp_color_mode)
79                 "mark_mode = "+sci2exp(h.mark_mode)
80                 "mark_style = "+sci2exp(h.mark_style)
81                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
82                 "mark_size = "+string(h.mark_size)
83                 "mark_foreground = "+string(h.mark_foreground)
84                 "mark_background = "+string(h.mark_background)
85                 "x_shift = "+bxs
86                 "y_shift = "+bys
87                 "z_shift = "+bzs
88                 "bar_width = "+sci2exp(h.bar_width)
89                 "clip_state = "+sci2exp(h.clip_state)
90                 "clip_box = "+sci2exp(h.clip_box)
91                 "user_data = "+fmtuser_data(u)
92             ]
93         
94         // Compound
95         // =====================================================================
96         
97         case "Compound"
98             u=h.user_data
99             t=[t;
100             "parent: "+h.parent.type
101             "children: "+fmtchildren(h.children)
102             "visible = "+sci2exp(h.visible)
103             "user_data = "+fmtuser_data(u)]
104         
105         // Axes
106         // =====================================================================
107         
108         case "Axes"
109     
110             T=h.x_ticks
111             if size(T.locations,'*')>9 then
112                 locx="matrix "+strcat(string(size(T.locations)),'x')
113                 labx="matrix "+strcat(string(size(T.labels)),'x')
114             else
115                 locx=sci2exp(T.locations,0)
116                 labx=sci2exp(T.labels,0)
117                 if length(locx)>70 then locx="matrix "+strcat(string(size(T.locations)),'x'), end
118                 if length(labx)>70 then labx="matrix "+strcat(string(size(T.labels)),'x'), end
119             end
120             
121             T=h.y_ticks
122             if size(T.locations,'*')>9 then
123                 locy="matrix "+strcat(string(size(T.locations)),'x')
124                 laby="matrix "+strcat(string(size(T.labels)),'x')
125             else
126                 locy=sci2exp(T.locations,0)
127                 laby=sci2exp(T.labels,0)
128                 if length(locy)>70 then locx="matrix "+strcat(string(size(T.locations)),'x'), end
129                 if length(laby)>70 then labx="matrix "+strcat(string(size(T.labels)),'x'), end
130             end
131             
132             T=h.z_ticks
133             if size(T.locations,'*')>9 then
134                 locz="matrix "+strcat(string(size(T.locations)),'x')
135                 labz="matrix "+strcat(string(size(T.labels)),'x')
136             else
137                 locz=sci2exp(T.locations,0)
138                 labz=sci2exp(T.labels,0)
139                 if length(locz)>70 then locx="matrix "+strcat(string(size(T.locations)),'x'), end
140                 if length(labz)>70 then labx="matrix "+strcat(string(size(T.labels)),'x'), end
141             end
142             
143             u=h.user_data
144             t=[t;
145                 "parent: "+h.parent.type
146                 "children: "+fmtchildren(h.children)
147                 " "
148                 "visible = "+sci2exp(h.visible)
149                 "axes_visible = "+sci2exp(h.axes_visible)
150                 "axes_reverse = "+sci2exp(h.axes_reverse)
151                 "grid = "+sci2exp(h.grid,0)
152                                 "grid_position = "+sci2exp(h.grid_position)
153                 "x_location = "+sci2exp(h.x_location)
154                 "y_location = "+sci2exp(h.y_location)
155                 "title: "+fmtchildren(h.title)
156                 "x_label: "+fmtchildren(h.x_label)
157                 "y_label: "+fmtchildren(h.y_label)
158                 "z_label: "+fmtchildren(h.z_label)
159                 "auto_ticks = "+sci2exp(h.auto_ticks)
160                 "x_ticks.locations = "+locx
161                 "y_ticks.locations = "+locy
162                 "z_ticks.locations = "+locz
163                 "x_ticks.labels = "+labx
164                 "y_ticks.labels = "+laby
165                 "z_ticks.labels = "+labz
166                 "box = "+sci2exp(h.box)
167                 "filled = " + sci2exp(h.filled)
168                 "sub_ticks = "+sci2exp(h.sub_ticks,0)
169                 "font_style = "+string(h.font_style)
170                 "font_size = "+string(h.font_size)
171                 "font_color = "+string(h.font_color)
172                 "fractional_font = " + sci2exp(h.fractional_font)
173                 " "
174                 "isoview = "+sci2exp(h.isoview)
175                 "cube_scaling = "+sci2exp(h.cube_scaling)
176                 "view = "+sci2exp(h.view)
177                 "rotation_angles = "+sci2exp(h.rotation_angles,0)
178                 "log_flags = "+sci2exp(h.log_flags)
179                 "tight_limits = "+sci2exp(h.tight_limits)
180                 "data_bounds = "+sci2exp(h.data_bounds,0)
181                 "zoom_box = "+sci2exp(h.zoom_box,0)
182                 "margins = "+sci2exp(h.margins,0)
183                 "axes_bounds = "+sci2exp(h.axes_bounds,0)
184                 " "
185                 "auto_clear = "+sci2exp(h.auto_clear)
186                 "auto_scale = "+sci2exp(h.auto_scale)
187                 " "
188                 "hidden_axis_color = " + string(h.hidden_axis_color);
189                 "hiddencolor = "+string(h.hiddencolor)
190                 "line_mode = "+sci2exp(h.line_mode)
191                 "line_style = "+string(h.line_style)
192                 "thickness = "+string(h.thickness)
193                 "mark_mode = "+sci2exp(h.mark_mode)
194                 "mark_style = "+sci2exp(h.mark_style,0)
195                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
196                 "mark_size = "+sci2exp(h.mark_size,0)
197                 "mark_foreground = "+string(h.mark_foreground)
198                 "mark_background = "+string(h.mark_background)
199                 "foreground = "+string(h.foreground)
200                 "background = "+string(h.background)
201                 "arc_drawing_method = " + sci2exp(h.arc_drawing_method)
202                 "clip_state = "+sci2exp(h.clip_state)
203                 "clip_box = "+sci2exp(h.clip_box,0)
204                 "user_data = "+fmtuser_data(h.user_data)
205             ]
206         
207         // Legend
208         // =====================================================================
209         
210         case "Legend"
211           t=[t;
212              "parent: "+h.parent.type
213              "children: "+fmtchildren(h.children)
214              "visible = "+sci2exp(h.visible)
215              "text = "+sci2exp(h.text)
216              "font_style = "+string(h.font_style)
217              "font_size = "+string(h.font_size)
218              "font_color = "+string(h.font_color)
219              "fractional_font = " + sci2exp(h.fractional_font)
220              "links = " +  fmtchildren(h.links) 
221              "legend_location = " + sci2exp(h.legend_location)
222              "position = " + sci2exp(h.position)
223              "line_mode = "+sci2exp(h.line_mode)
224              "thickness = "+string(h.thickness)
225              "foreground = "+string(h.foreground)
226              "fill_mode = "+sci2exp(h.fill_mode)
227              "background = "+string(h.background)
228              "clip_state = "+sci2exp(h.clip_state)
229              "clip_box = "+sci2exp(h.clip_box,0)
230              "user_data = "+fmtuser_data(h.user_data)
231               ]
232         
233         // Rectangle
234         // =====================================================================
235         
236         case "Rectangle"
237             u=h.user_data
238             t=[t;
239                 "parent: "+h.parent.type
240                 "children: "+fmtchildren(h.children)
241                 "mark_mode = "+sci2exp(h.mark_mode)
242                 "mark_style = "+string(h.mark_style)
243                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
244                 "mark_size = "+string(h.mark_size)
245                 "mark_foreground = "+string(h.mark_foreground)
246                 "mark_background = "+string(h.mark_background)
247                 "line_mode = "+sci2exp(h.line_mode)
248                 "fill_mode = "+sci2exp(h.fill_mode)
249                 "line_style = "+string(h.line_style)
250                 "thickness = "+string(h.thickness)
251                 "foreground = "+string(h.foreground)
252                 "background = "+string(h.background)
253                 "data = "+sci2exp(h.data,0)
254                 "visible = "+sci2exp(h.visible)
255                 "clip_state = "+sci2exp(h.clip_state)
256                 "clip_box = "+sci2exp(h.clip_box,0)
257                 "user_data = "+fmtuser_data(u)
258             ]
259         
260         // Arc
261         // =====================================================================
262         
263         case "Arc"
264             u=h.user_data
265             t=[t;
266                 "parent: "+h.parent.type
267                 "children: "+fmtchildren(h.children)
268                 "thickness = "+string(h.thickness)
269                 "line_style = "+string(h.line_style)
270                 "line_mode = "+sci2exp(h.line_mode)
271                 "fill_mode = "+sci2exp(h.fill_mode)
272                 "foreground = "+string(h.foreground)
273                 "background = "+string(h.background)
274                 "data = "+sci2exp(h.data,0)
275                 "visible = "+sci2exp(h.visible)
276                 "arc_drawing_method = " + sci2exp(h.arc_drawing_method) 
277                 "clip_state = "+sci2exp(h.clip_state)
278                 "clip_box = "+sci2exp(h.clip_box,0)
279                 "user_data = "+fmtuser_data(u)
280             ]
281         
282         // Figure
283         // =====================================================================
284         
285         case "Figure"
286             u=h.user_data
287             t=[t;
288                 "children: "+fmtchildren(h.children)
289                 "figure_position = "+sci2exp(h.figure_position,0)
290                 "figure_size = "+sci2exp(h.figure_size,0)
291                 "axes_size = "+sci2exp(h.axes_size,0)
292                 "auto_resize = "+sci2exp(h.auto_resize)
293                 "viewport = "+sci2exp(h.viewport)
294                 "figure_name = "+sci2exp(h.figure_name,0)
295                 "figure_id = "+sci2exp(h.figure_id,0)
296                 "info_message = "+sci2exp(h.info_message)
297                 "color_map= matrix "+strcat(string(size(h.color_map)),'x')
298                 "pixmap = "+sci2exp(h.pixmap)
299                 "pixel_drawing_mode = "+sci2exp(h.pixel_drawing_mode,0)
300                                 "anti_aliasing = " + sci2exp(h.anti_aliasing)
301                 "immediate_drawing = "+sci2exp(h.immediate_drawing)
302                 "background =  "+string(h.background)
303                 "visible = "+sci2exp(h.visible)
304                 "rotation_style = "+sci2exp(h.rotation_style)
305                 "event_handler = " + sci2exp( h.event_handler ) ;
306                 "event_handler_enable = " + sci2exp( h.event_handler_enable ) ;
307                 "user_data = "+fmtuser_data(u)
308                 "tag = "+sci2exp(h.tag)
309             ]
310         
311         // Grayplot
312         // =====================================================================
313         
314         case "Grayplot"
315             Data = h.data
316             if size(Data.x,'*') > 10 then 
317                 dx="matrix "+strcat(string(size(Data.x)),'x')
318             else
319                 dx=sci2exp(Data.x,0)
320                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
321             end
322             
323             if size(Data.y,'*') > 10 then 
324                 dy="matrix "+strcat(string(size(Data.y)),'x')
325             else
326                 dy=sci2exp(Data.y,0)
327                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
328             end
329         
330             if size(Data.z,'*') > 10 then 
331                 dz="matrix "+strcat(string(size(Data.z)),'x')
332             else
333                 dz=sci2exp(Data.z,0)
334                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),'x'),end
335             end
336             
337             u=h.user_data
338             t=[t;
339                 "parent: "+h.parent.type
340                 "children: "+fmtchildren(h.children)
341                 "visible = "+sci2exp(h.visible) 
342                 "data.x = "+dx
343                 "data.y = "+dy
344                 "data.z = "+dz
345                 "data_mapping = "+sci2exp(h.data_mapping)
346                 "clip_state = "+sci2exp(h.clip_state)
347                 "clip_box = "+sci2exp(h.clip_box,0)
348                 "user_data = "+fmtuser_data(u)
349             ]
350         
351         // Matplot
352         // =====================================================================
353         
354         
355         case "Matplot"
356             if size(h.data,'*') > 10 then 
357                 d="matrix "+strcat(string(size(h.data)),'x')
358             else     
359                 d=sci2exp(h.data,0)
360                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
361             end
362             u=h.user_data
363             t=[t;
364                 "parent: "+h.parent.type
365                 "children: "+fmtchildren(h.children)
366                 "visible = "+sci2exp(h.visible)
367                 "data = "+d
368                 "clip_state = "+sci2exp(h.clip_state)
369                 "clip_box = "+sci2exp(h.clip_box,0)
370                 "user_data = "+fmtuser_data(u)
371             ]
372         
373         // Fec
374         // =====================================================================
375         case "Fec"
376             u=h.user_data
377             if size(h.data,'*') > 10 then 
378                 d="matrix "+strcat(string(size(h.data)),'x')
379             else
380                 d=sci2exp(h.data,0)
381                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
382             end
383             
384             if size(h.triangles,'*') > 10 then 
385                 f="matrix "+strcat(string(size(h.triangles)),'x')
386             else
387                 f=sci2exp(h.triangles,0)
388                 if length(f)>70 then f="matrix "+strcat(string(size(h.triangles)),'x'),end
389             end
390             
391             t=[t;
392                 "parent: "+h.parent.type
393                 "children: "+fmtchildren(h.children)
394                 "visible = "+sci2exp(h.visible) 
395                 "data = "+d
396                 "triangles = "+f
397                 "z_bounds = "+sci2exp(h.z_bounds,0)
398                                 "color_range = " + sci2exp(h.color_range, 0);
399                                 "outside_colors = " + sci2exp(h.outside_colors, 0);
400                                 "line_mode = " + sci2exp(h.line_mode);
401                                 "foreground = " + sci2exp(h.foreground);
402                 "clip_state = "+sci2exp(h.clip_state)
403                 "clip_box = "+sci2exp(h.clip_box,0)
404                 "user_data = "+fmtuser_data(u)
405             ]
406
407         // Segs
408         // =====================================================================
409         
410         case "Segs"
411             if size(h.data,'*') > 10 then 
412                 d="matrix "+strcat(string(size(h.data)),'x')
413             else
414                 d=sci2exp(h.data,0)
415                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
416             end
417             
418             if size(h.segs_color,'*') > 10 then 
419                 c="matrix "+strcat(string(size(h.segs_color)),'x')
420             else
421                 c=sci2exp(h.segs_color,0)
422                 if length(c)>70 then c="matrix "+strcat(string(size(h.segs_color)),'x'),end
423             end
424             
425             u=h.user_data
426             t=[t;
427                 "parent: "+h.parent.type
428                 "children: "+fmtchildren(h.children)
429                 "visible = "+sci2exp(h.visible) 
430                 "data = "+d
431                 "line_mode = "+sci2exp(h.line_mode)
432                 "line_style = "+string(h.line_style)
433                 "thickness = "+string(h.thickness)
434                 "arrow_size = "+string(h.arrow_size)
435                 "segs_color = "+c
436                 "mark_mode = "+sci2exp(h.mark_mode)
437                 "mark_style = "+sci2exp(h.mark_style)
438                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
439                 "mark_size = "+string(h.mark_size)
440                 "mark_foreground = "+string(h.mark_foreground)
441                 "mark_background = "+string(h.mark_background)
442                 "clip_state = "+sci2exp(h.clip_state)
443                 "clip_box = "+sci2exp(h.clip_box,0)
444                 "user_data = "+fmtuser_data(u)
445             ]
446
447         // Champ
448         // =====================================================================
449         
450         case "Champ"
451             Data = h.data
452             if size(Data.x,'*') > 10 then 
453                 dx="matrix "+strcat(string(size(Data.x)),'x')
454             else
455                 dx=sci2exp(Data.x,0)
456                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
457             end
458             
459             if size(Data.y,'*') > 10 then 
460                 dy="matrix "+strcat(string(size(Data.y)),'x')
461             else
462                 dy=sci2exp(Data.y,0)
463                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
464             end
465             
466             if size(Data.fx,'*') > 10 then 
467                 dfx="matrix "+strcat(string(size(Data.fx)),'x')
468             else
469                 dfx=sci2exp(Data.fx,0)
470                 if length(dfx)>70 then d="matrix "+strcat(string(size(Data.fx)),'x'),end
471             end
472             
473             if size(Data.fy,'*') > 10 then 
474                 dfy="matrix "+strcat(string(size(Data.fy)),'x')
475             else
476                 dfy=sci2exp(Data.fy,0)
477                 if length(dfy)>70 then d="matrix "+strcat(string(size(Data.fy)),'x'),end
478             end
479             
480             u=h.user_data
481             t=[t;
482                 "parent: "+h.parent.type
483                 "children: "+fmtchildren(h.children)
484                 "visible = "+sci2exp(h.visible) 
485                 "data.x = "+dx
486                 "data.y = "+dy
487                 "data.fx = "+dfx
488                 "data.fy = "+dfy
489                 "line_style = "+string(h.line_style)
490                 "thickness = "+string(h.thickness)
491                 "colored = "+sci2exp(h.colored)
492                 "arrow_size = "+string(h.arrow_size)
493                 "clip_state = "+sci2exp(h.clip_state)
494                 "clip_box = "+sci2exp(h.clip_box,0)
495                 "user_data = "+fmtuser_data(u)
496             ]
497         
498         // Text
499         // =====================================================================
500         
501         case "Text"
502             u=h.user_data
503             T=sci2exp(h.text,0)
504             if length(T)>70 then T="string array "+strcat(string(size(h.text)),'x'),end
505             t=[t;
506                 "parent: "+h.parent.type
507                 "children: "+fmtchildren(h.children)
508                 "visible = "+sci2exp(h.visible) 
509                 "text = "+T
510                 "alignment = "+sci2exp(h.alignment) ;
511                 "data = "+sci2exp(h.data,0)
512                 "box = "+sci2exp(h.box) 
513                 "line_mode = " + sci2exp(h.line_mode);
514                 "fill_mode = " + sci2exp(h.fill_mode);
515                 "text_box = "+sci2exp(h.text_box,0)
516                 "text_box_mode = "+sci2exp(h.text_box_mode,0)
517                 "font_foreground = "+string(h.font_foreground)
518                 "foreground = "+string(h.foreground)
519                 "background = "+string(h.background)
520                 "font_style = "+string(h.font_style)
521                 "font_size = "+string(h.font_size)
522                 "fractional_font = " + sci2exp(h.fractional_font)
523                 "auto_dimensionning = " + sci2exp(h.auto_dimensionning)
524                 "font_angle = "+string(h.font_angle)
525                 "clip_state = "+sci2exp(h.clip_state)
526                 "clip_box = "+sci2exp(h.clip_box,0)
527                 "user_data = "+fmtuser_data(u)
528             ]
529         
530         // Title
531         // =====================================================================
532         
533         case "Title"
534             T=sci2exp(h.text,0)
535             if length(T)>70 then T="string array "+strcat(string(size(h.text)),'x'),end
536             t=[t;
537                 "parent: "+h.parent.type
538                 "children: "+fmtchildren(h.children)
539                 "visible = "+sci2exp(h.visible) 
540                 "text = "+T
541                 "foreground = "+string(h.foreground)
542                 "font_style = "+string(h.font_style)
543                 "font_size = "+string(h.font_size)
544                 "fractional_font = " + sci2exp(h.fractional_font)
545                 "font_angle = "+string(h.font_angle)
546             ]
547         
548         // Label
549         // =====================================================================
550
551         case "Label"
552             T=sci2exp(h.text,0)
553             if length(T)>70 then T="string array "+strcat(string(size(h.text)),'x'),end
554             t=[t;
555                 "parent: "+h.parent.type
556                 "visible = "+sci2exp(h.visible) 
557                 "text = "+T;
558                 "font_foreground = " + string(h.font_foreground) ;
559                 "foreground = "+string(h.foreground)
560                 "background = "+string(h.background)
561                 "fill_mode = "+sci2exp(h.fill_mode)
562                 "font_style = "+string(h.font_style)
563                 "font_size = "+string(h.font_size)
564                 "fractional_font = " + sci2exp(h.fractional_font)
565                 "font_angle = "+string(h.font_angle)
566                 "auto_position = "+sci2exp(h.auto_position)
567                 "position = "+sci2exp(h.position,0)
568                 "auto_rotation = "+sci2exp(h.auto_rotation)
569             ]
570         
571         // Plot3d
572         // =====================================================================
573         case "Plot3d"
574             Data = h.data
575             if size(Data.x,'*') > 10 then 
576                 dx="matrix "+strcat(string(size(Data.x)),'x')
577             else
578                 dx=sci2exp(Data.x,0)
579                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
580             end
581             
582             if size(Data.y,'*') > 10 then 
583                 dy="matrix "+strcat(string(size(Data.y)),'x')
584             else
585                 dy=sci2exp(Data.y,0)
586                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
587             end
588             
589             if size(Data.z,'*') > 10 then 
590                 dz="matrix "+strcat(string(size(Data.z)),'x')
591             else
592                 dz=sci2exp(Data.z,0)
593                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),'x'),end
594             end
595             
596             u=h.user_data
597             
598             if size(Data) == 5 then // There is a color
599                 if size(Data.color,'*') > 10 then
600                     dcolor="matrix "+strcat(string(size(Data.color)),'x')
601                 else
602                     dcolor=sci2exp(Data.color,0)
603                     if length(dcolor)>70 then dcolor="matrix "+strcat(string(size(Data.color)),'x'),end
604                 end
605                 
606                 t=[t;
607                     "parent: "+h.parent.type
608                     "children: "+fmtchildren(h.children)
609                     "visible = "+sci2exp(h.visible) 
610                     "surface_mode = "+sci2exp(h.surface_mode)
611                     "foreground = "+string(h.foreground)
612                     "thickness = "+string(h.thickness)
613                     "mark_mode = "+sci2exp(h.mark_mode)
614                     "mark_style = "+sci2exp(h.mark_style)
615                     "mark_size_unit = "+sci2exp(h.mark_size_unit)
616                     "mark_size = "+string(h.mark_size)
617                     "mark_foreground = "+string(h.mark_foreground)
618                     "mark_background = "+string(h.mark_background)
619                     "data.x = "+dx
620                     "data.y = "+dy
621                     "data.z "+dz  
622                     "data.color (not used) = "+dcolor
623                     "color_mode = "+string(h.color_mode)
624                     "color_flag = "+sci2exp(h.color_flag,0)
625                     "hiddencolor = "+string(h.hiddencolor)
626                     "clip_state = "+sci2exp(h.clip_state)
627                     "clip_box = "+sci2exp(h.clip_box,0)
628                     "user_data = "+fmtuser_data(u)
629                 ]
630             else
631                 t=[t;
632                     "parent: "+h.parent.type
633                     "children: "+fmtchildren(h.children)
634                     "visible = "+sci2exp(h.visible) 
635                     "surface_mode = "+sci2exp(h.surface_mode)
636                     "foreground = "+string(h.foreground)
637                     "thickness = "+string(h.thickness)
638                     "mark_mode = "+sci2exp(h.mark_mode)
639                     "mark_style = "+sci2exp(h.mark_style)
640                     "mark_size_unit = "+sci2exp(h.mark_size_unit)
641                     "mark_size = "+string(h.mark_size)
642                     "mark_foreground = "+string(h.mark_foreground)
643                     "mark_background = "+string(h.mark_background)
644                     "data.x = "+dx
645                     "data.y = "+dy
646                     "data.z = "+dz
647                     "color_mode = "+string(h.color_mode)
648                     "color_flag = "+sci2exp(h.color_flag,0)
649                     "hiddencolor = "+string(h.hiddencolor)
650                     "clip_state = "+sci2exp(h.clip_state)
651                     "clip_box = "+sci2exp(h.clip_box,0)
652                     "user_data = "+fmtuser_data(u)
653                 ]
654             end
655         
656         // Fac3d
657         // =====================================================================
658         
659         case "Fac3d"
660             Data = h.data
661             if size(Data.x,'*') > 10 then 
662                 dx="matrix "+strcat(string(size(Data.x)),'x')
663             else
664                 dx=sci2exp(Data.x,0)
665                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
666             end
667             
668             if size(Data.y,'*') > 10 then 
669                 dy="matrix "+strcat(string(size(Data.y)),'x')
670             else
671                 dy=sci2exp(Data.y,0)
672                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
673             end
674         
675             if size(Data.z,'*') > 10 then 
676                 dz="matrix "+strcat(string(size(Data.z)),'x')
677             else
678                 dz=sci2exp(Data.z,0)
679                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),'x'),end
680             end
681         
682             u=h.user_data;
683         
684             if size(Data) == 5 then // There is a color
685                 if size(Data.color,'*') > 10 then
686                     dcolor="matrix "+strcat(string(size(Data.color)),'x')
687                 else
688                     dcolor=sci2exp(Data.color,0)
689                     if length(dcolor)>70 then dcolor="matrix "+strcat(string(size(Data.color)),'x'),end
690                 end
691                 
692                 t=[t;
693                     "parent: "+h.parent.type
694                     "children: "+fmtchildren(h.children)
695                     "visible = "+sci2exp(h.visible) 
696                     "surface_mode = "+sci2exp(h.surface_mode)
697                     "foreground = "+string(h.foreground)
698                     "thickness = "+string(h.thickness)
699                     "mark_mode = "+sci2exp(h.mark_mode)
700                     "mark_style = "+sci2exp(h.mark_style)
701                     "mark_size_unit = "+sci2exp(h.mark_size_unit)
702                     "mark_size = "+string(h.mark_size)
703                     "mark_foreground = "+string(h.mark_foreground)
704                     "mark_background = "+string(h.mark_background)
705                     "data.x = "+dx
706                     "data.y = "+dy
707                     "data.z = "+dz  
708                     "data.color = "+dcolor
709                     "color_mode = "+string(h.color_mode)
710                     "color_flag = "+sci2exp(h.color_flag,0)
711                     "cdata_mapping = "+sci2exp(h.cdata_mapping)
712                     "hiddencolor = "+string(h.hiddencolor)
713                     "clip_state = "+sci2exp(h.clip_state)
714                     "clip_box = "+sci2exp(h.clip_box,0)
715                     "user_data = "+fmtuser_data(u)
716                 ]
717             else
718                 t=[t;
719                     "parent: "+h.parent.type
720                     "children: "+fmtchildren(h.children)
721                     "visible = "+sci2exp(h.visible) 
722                     "surface_mode = "+sci2exp(h.surface_mode)
723                     "foreground = "+string(h.foreground)
724                     "thickness = "+string(h.thickness)
725                     "mark_mode = "+sci2exp(h.mark_mode)
726                     "mark_style = "+sci2exp(h.mark_style)
727                     "mark_size_unit = "+sci2exp(h.mark_size_unit)
728                     "mark_size = "+string(h.mark_size)
729                     "mark_foreground = "+string(h.mark_foreground)
730                     "mark_background = "+string(h.mark_background)
731                     "data.x = "+dx
732                     "data.y = "+dy
733                     "data.z = "+dz
734                     "color_mode = "+string(h.color_mode)
735                     "color_flag = "+sci2exp(h.color_flag,0)
736                     "hiddencolor = "+string(h.hiddencolor)
737                     "clip_state = "+sci2exp(h.clip_state)
738                     "clip_box = "+sci2exp(h.clip_box,0)
739                     "user_data = "+fmtuser_data(u)
740                 ]
741             end
742         
743         // Param3d
744         // =====================================================================
745         
746         case "Param3d"
747             u=h.user_data;
748             if size(h.data,'*') > 10 then 
749                 d="matrix "+strcat(string(size(h.data)),'x')
750             else
751                 d=sci2exp(h.data,0)
752                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
753             end
754             
755             if size(h.surface_color,'*') > 10 then 
756                 c="matrix "+strcat(string(size(h.surface_color)),'x')
757             else
758                 c=sci2exp(h.surface_color,0)
759                 if length(c)>70 then c="matrix "+strcat(string(size(h.surface_color)),'x'),end
760             end
761             
762             t=[t;
763                 "parent: "+h.parent.type
764                 "children: "+fmtchildren(h.children)
765                 "visible = "+sci2exp(h.visible) 
766                 "line_mode = "+sci2exp(h.line_mode)
767                 "foreground = "+string(h.foreground)
768                 "thickness = "+string(h.thickness)
769                 "mark_mode = "+sci2exp(h.mark_mode)
770                 "mark_style = "+sci2exp(h.mark_style)
771                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
772                 "mark_size = "+string(h.mark_size)
773                 "mark_foreground = "+string(h.mark_foreground)
774                 "mark_background = "+string(h.mark_background)
775                 "data = "+d
776                 "clip_state = "+sci2exp(h.clip_state)
777                 "clip_box = "+sci2exp(h.clip_box,0)
778                 "color_mode = "+string(h.color_mode)
779                 "surface_color = "+c
780                 "user_data = "+fmtuser_data(u)
781             ]
782         
783         // Axis
784         // =====================================================================
785     
786         case "Axis"
787             u=h.user_data;
788             T=sci2exp(h.tics_labels,0)
789             if length(T)>70 then T="string array "+strcat(string(size(h.tics_labels)),'x'),end
790             t=[t;
791                 "parent: "+h.parent.type
792                 "visible = "+sci2exp(h.visible)
793                 "tics_direction = "+sci2exp(h.tics_direction)
794                 "xtics_coord = "+sci2exp(h.xtics_coord,0)
795                 "ytics_coord = "+sci2exp(h.ytics_coord,0)
796                 "tics_color = "+string(h.tics_color)
797                 "tics_segment = "+sci2exp(h.tics_segment)
798                 "tics_style = "+sci2exp(h.tics_style)
799                 "sub_tics = "+string(h.sub_tics)
800                 "tics_labels = "+T
801                 "format_n = "+sci2exp(h.format_n)
802                 "labels_font_size = "+string(h.labels_font_size)
803                 "labels_font_color = "+string(h.labels_font_color)
804                 "fractional_font = " + sci2exp(h.fractional_font)
805                 "clip_state = "+sci2exp(h.clip_state)
806                 "clip_box = "+sci2exp(h.clip_box,0)
807                 "user_data = "+fmtuser_data(u)
808             ]
809         
810         // uimenu
811         // =====================================================================
812         
813         case "uimenu"
814             t=[t;
815                 "Parent: "+h.parent.type
816                 "Children: "+fmtchildren(h.children)
817                 "Enable = "+sci2exp(h.enable)
818                 "Foregroundcolor = "+sci2exp(h.foregroundcolor,0)
819                 "Label = "+h.label 
820                 //"Handle_visible = "+sci2exp(h.handle_visible)
821                 //"Position = "+sci2exp(h.position,0)
822                 "Visible = "+sci2exp(h.visible)
823                 "Callback = "+h.callback
824                 "CallbackType = "+sci2exp(h.callback_type,0)
825                 "Checked: "+sci2exp(h.checked)
826                 "Tag = "+h.tag
827             ]
828         
829         // uicontextmenu
830         // =====================================================================
831         
832         case "uicontextmenu"
833             t=[t;
834                 "Parent: "+h.parent.type
835                 "Children: "+fmtchildren(h.children)
836                 ]
837
838         // uicontrol
839         // =====================================================================
840         
841         case "uicontrol"
842             u=h.user_data;
843             t=[t;
844             "Parent: "+h.parent.type
845             "Children: "+fmtchildren(h.children)
846             "BackgroundColor = "+sci2exp(h.backgroundcolor,0)
847             "Enable = "+sci2exp(h.enable)
848             "FontAngle = "+h.fontangle
849             "FontName = "+h.fontname
850             "FontSize = "+sci2exp(h.fontsize)
851             "FontUnits = "+h.fontunits
852             "FontWeight = "+h.fontweight
853             "ForegroundColor = "+sci2exp(h.foregroundcolor,0)
854             "HorizontalAlignment = "+h.horizontalalignment
855             "ListboxTop = "+sci2exp(h.listboxtop,0)
856             "Max = "+sci2exp(h.max)
857             "Min = "+sci2exp(h.min)
858             "Position = "+sci2exp(h.position,0)
859             "Relief = "+h.relief
860             "SliderStep = "+sci2exp(h.sliderstep)
861             "String = "+fmtuser_data(h.string)
862             "Style = "+h.style
863             "Units = "+h.units
864             "Value = "+sci2exp(h.value,0)
865             "VerticalAlignment = "+h.verticalalignment
866             "Visible = "+sci2exp(h.visible)
867             "Callback = "+h.callback
868             "CallbackType = "+sci2exp(h.callback_type,0)
869             //"Handle_visible = "+sci2exp(h.handle_visible)
870             "Userdata = "+fmtuser_data(u)
871             "Tag = "+h.tag
872             ]
873             
874         end
875     end
876     write(%io(2),t)
877 endfunction
878
879
880
881
882 function t=fmtchildren(c)
883     if c==[] then 
884         t='[]'
885     else
886         if size(c,'*')<10 then
887             t=sci2exp(c.type,0)
888             if length(t)>70 then t="matrix "+strcat(string(size(c)),'x'),end 
889         else
890             t="matrix "+strcat(string(size(c)),'x')   
891         end
892     end
893 endfunction
894
895
896 function t=fmtuser_data(d)
897     td= type(d)
898     if or(td==[1 2 3 4 8 10 15]) then
899         t=sci2exp(d,0)
900         if length(t)>70 then t=typeof(d)+" "+strcat(string(size(d)),'x'),end 
901     elseif or(td==16) then
902         t=typeof(d)+" "+strcat(string(size(d)),'x'),
903     elseif or(td==17) then
904         if typeof(d)=="ce" then
905             t="cell "+strcat(string(size(d)),'x'),
906         elseif typeof(d)=="st" then
907             T=getfield(1,d)
908             t="struct with fields: "+strcat(T(3:$),' '),
909         else
910             t=typeof(d)
911         end
912     else
913         t=typeof(d)
914     end
915 endfunction