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