* Bug #13378 fixed - The console handle display was not conventional
[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.1-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             "datatips: "+fmtchildren(h.datatips)
67             "display_function: "++sci2exp(h.display_function)
68             "display_function_data: "+fmtuser_data(h.display_function_data)
69             "visible = "+sci2exp(h.visible)
70             "data = "+d
71             "closed = "+sci2exp(h.closed)
72             "line_mode = "+sci2exp(h.line_mode)
73             "fill_mode = "+sci2exp(h.fill_mode)
74             "line_style = "+string(h.line_style)
75             "thickness = "+string(h.thickness)
76             "arrow_size_factor = "+string(h.arrow_size_factor)
77             "polyline_style = "+string(h.polyline_style)
78             "foreground = "+string(h.foreground)
79             "background = "+string(h.background)
80             "interp_color_vector = "+sci2exp(h.interp_color_vector)
81             "interp_color_mode = "+sci2exp(h.interp_color_mode)
82             "mark_mode = "+sci2exp(h.mark_mode)
83             "mark_style = "+sci2exp(h.mark_style)
84             "mark_size_unit = "+sci2exp(h.mark_size_unit)
85             "mark_size = "+string(h.mark_size)
86             "mark_foreground = "+string(h.mark_foreground)
87             "mark_background = "+string(h.mark_background)
88             "mark_offset = "+string(h.mark_offset)
89             "mark_stride = "+string(h.mark_stride)
90             "x_shift = "+bxs
91             "y_shift = "+bys
92             "z_shift = "+bzs
93             "bar_width = "+sci2exp(h.bar_width)
94             "clip_state = "+sci2exp(h.clip_state)
95             "clip_box = "+sci2exp(h.clip_box)
96             "user_data = "+fmtuser_data(u)
97             "tag = "+h.tag
98             ]
99
100             // Compound
101             // =====================================================================
102
103         case "Compound"
104             u=h.user_data
105             t=[t;
106             "parent: "+h.parent.type
107             "children: "+fmtchildren(h.children)
108             "visible = "+sci2exp(h.visible)
109             "user_data = "+fmtuser_data(u)
110             "tag = "+h.tag
111             ]
112
113             // Axes
114             // =====================================================================
115
116         case "Axes"
117
118             T=h.x_ticks
119             if size(T.locations,"*")>9 then
120                 locx="matrix "+strcat(string(size(T.locations)),"x")
121                 labx="matrix "+strcat(string(size(T.labels)),"x")
122             else
123                 locx=sci2exp(T.locations,0)
124                 labx=sci2exp(T.labels,0)
125                 if length(locx)>70 then locx="matrix "+strcat(string(size(T.locations)),"x"), end
126                 if length(labx)>70 then labx="matrix "+strcat(string(size(T.labels)),"x"), end
127             end
128
129             T=h.y_ticks
130             if size(T.locations,"*")>9 then
131                 locy="matrix "+strcat(string(size(T.locations)),"x")
132                 laby="matrix "+strcat(string(size(T.labels)),"x")
133             else
134                 locy=sci2exp(T.locations,0)
135                 laby=sci2exp(T.labels,0)
136                 if length(locy)>70 then locx="matrix "+strcat(string(size(T.locations)),"x"), end
137                 if length(laby)>70 then labx="matrix "+strcat(string(size(T.labels)),"x"), end
138             end
139
140             T=h.z_ticks
141             if size(T.locations,"*")>9 then
142                 locz="matrix "+strcat(string(size(T.locations)),"x")
143                 labz="matrix "+strcat(string(size(T.labels)),"x")
144             else
145                 locz=sci2exp(T.locations,0)
146                 labz=sci2exp(T.labels,0)
147                 if length(locz)>70 then locx="matrix "+strcat(string(size(T.locations)),"x"), end
148                 if length(labz)>70 then labx="matrix "+strcat(string(size(T.labels)),"x"), end
149             end
150
151             u=h.user_data
152             t=[t;
153             "parent: "+h.parent.type
154             "children: "+fmtchildren(h.children)
155             " "
156             "visible = "+sci2exp(h.visible)
157             "axes_visible = "+sci2exp(h.axes_visible)
158             "axes_reverse = "+sci2exp(h.axes_reverse)
159             "grid = "+sci2exp(h.grid,0)
160             "grid_position = "+sci2exp(h.grid_position)
161             "grid_thickness = "+sci2exp(h.grid_thickness,0)
162             "grid_style = "+sci2exp(h.grid_style,0)
163             "x_location = "+sci2exp(h.x_location)
164             "y_location = "+sci2exp(h.y_location)
165             "title: "+fmtchildren(h.title)
166             "x_label: "+fmtchildren(h.x_label)
167             "y_label: "+fmtchildren(h.y_label)
168             "z_label: "+fmtchildren(h.z_label)
169             "auto_ticks = "+sci2exp(h.auto_ticks)
170             "x_ticks.locations = "+locx
171             "y_ticks.locations = "+locy
172             "z_ticks.locations = "+locz
173             "x_ticks.labels = "+labx
174             "y_ticks.labels = "+laby
175             "z_ticks.labels = "+labz
176             "ticks_format = "+sci2exp(h.ticks_format)
177             "ticks_st = "+sci2exp(h.ticks_st, 0)
178             "box = "+sci2exp(h.box)
179             "filled = " + sci2exp(h.filled)
180             "sub_ticks = "+sci2exp(h.sub_ticks,0)
181             "font_style = "+string(h.font_style)
182             "font_size = "+string(h.font_size)
183             "font_color = "+string(h.font_color)
184             "fractional_font = " + sci2exp(h.fractional_font)
185             " "
186             "isoview = "+sci2exp(h.isoview)
187             "cube_scaling = "+sci2exp(h.cube_scaling)
188             "view = "+sci2exp(h.view)
189             "rotation_angles = "+sci2exp(h.rotation_angles,0)
190             "log_flags = "+sci2exp(h.log_flags)
191             "tight_limits = "+sci2exp(h.tight_limits)
192             "data_bounds = "+sci2exp(h.data_bounds,0)
193             "zoom_box = "+sci2exp(h.zoom_box,0)
194             "margins = "+sci2exp(h.margins,0)
195             "auto_margins = "+sci2exp(h.auto_margins)
196             "axes_bounds = "+sci2exp(h.axes_bounds,0)
197             " "
198             "auto_clear = "+sci2exp(h.auto_clear)
199             "auto_scale = "+sci2exp(h.auto_scale)
200             " "
201             "hidden_axis_color = " + string(h.hidden_axis_color);
202             "hiddencolor = "+string(h.hiddencolor)
203             "line_mode = "+sci2exp(h.line_mode)
204             "line_style = "+string(h.line_style)
205             "thickness = "+string(h.thickness)
206             "mark_mode = "+sci2exp(h.mark_mode)
207             "mark_style = "+sci2exp(h.mark_style,0)
208             "mark_size_unit = "+sci2exp(h.mark_size_unit)
209             "mark_size = "+sci2exp(h.mark_size,0)
210             "mark_foreground = "+string(h.mark_foreground)
211             "mark_background = "+string(h.mark_background)
212             "foreground = "+string(h.foreground)
213             "background = "+string(h.background)
214             "arc_drawing_method = " + sci2exp(h.arc_drawing_method)
215             "clip_state = "+sci2exp(h.clip_state)
216             "clip_box = "+sci2exp(h.clip_box,0)
217             "user_data = "+fmtuser_data(h.user_data)
218             "tag = "+h.tag
219             ]
220
221             // Legend
222             // =====================================================================
223
224         case "Legend"
225             t=[t;
226             "parent: "+h.parent.type
227             "children: "+fmtchildren(h.children)
228             "visible = "+sci2exp(h.visible)
229             "text = "+sci2exp(h.text)
230             "font_style = "+string(h.font_style)
231             "font_size = "+string(h.font_size)
232             "font_color = "+string(h.font_color)
233             "fractional_font = " + sci2exp(h.fractional_font)
234             "links = " +  fmtchildren(h.links)
235             "legend_location = " + sci2exp(h.legend_location)
236             "position = " + sci2exp(h.position)
237             "line_width = "+sci2exp(h.line_width)
238             "line_mode = "+sci2exp(h.line_mode)
239             "thickness = "+string(h.thickness)
240             "foreground = "+string(h.foreground)
241             "fill_mode = "+sci2exp(h.fill_mode)
242             "background = "+string(h.background)
243             "marks_count = "+sci2exp(h.marks_count)
244             "clip_state = "+sci2exp(h.clip_state)
245             "clip_box = "+sci2exp(h.clip_box,0)
246             "user_data = "+fmtuser_data(h.user_data)
247             "tag = "+h.tag
248             ]
249
250             // Rectangle
251             // =====================================================================
252
253         case "Rectangle"
254             u=h.user_data
255             t=[t;
256             "parent: "+h.parent.type
257             "children: "+fmtchildren(h.children)
258             "mark_mode = "+sci2exp(h.mark_mode)
259             "mark_style = "+string(h.mark_style)
260             "mark_size_unit = "+sci2exp(h.mark_size_unit)
261             "mark_size = "+string(h.mark_size)
262             "mark_foreground = "+string(h.mark_foreground)
263             "mark_background = "+string(h.mark_background)
264             "line_mode = "+sci2exp(h.line_mode)
265             "fill_mode = "+sci2exp(h.fill_mode)
266             "line_style = "+string(h.line_style)
267             "thickness = "+string(h.thickness)
268             "foreground = "+string(h.foreground)
269             "background = "+string(h.background)
270             "data = "+sci2exp(h.data,0)
271             "visible = "+sci2exp(h.visible)
272             "clip_state = "+sci2exp(h.clip_state)
273             "clip_box = "+sci2exp(h.clip_box,0)
274             "user_data = "+fmtuser_data(u)
275             "tag = "+h.tag
276             ]
277
278             // Arc
279             // =====================================================================
280
281         case "Arc"
282             u=h.user_data
283             t=[t;
284             "parent: "+h.parent.type
285             "children: "+fmtchildren(h.children)
286             "thickness = "+string(h.thickness)
287             "line_style = "+string(h.line_style)
288             "line_mode = "+sci2exp(h.line_mode)
289             "fill_mode = "+sci2exp(h.fill_mode)
290             "foreground = "+string(h.foreground)
291             "background = "+string(h.background)
292             "data = "+sci2exp(h.data,0)
293             "visible = "+sci2exp(h.visible)
294             "arc_drawing_method = " + sci2exp(h.arc_drawing_method)
295             "clip_state = "+sci2exp(h.clip_state)
296             "clip_box = "+sci2exp(h.clip_box,0)
297             "user_data = "+fmtuser_data(u)
298             "tag = "+h.tag
299             ]
300
301             // Figure
302             // =====================================================================
303
304         case "Figure"
305             l = h.layout_options;
306             if type(l) == 16 then //tlist
307                 l = l(1);
308                 l = l(1);
309             end
310             u=h.user_data
311             t=[t;
312             "children: "+fmtchildren(h.children)
313             "figure_position = "+sci2exp(h.figure_position,0)
314             "figure_size = "+sci2exp(h.figure_size,0)
315             "axes_size = "+sci2exp(h.axes_size,0)
316             "auto_resize = "+sci2exp(h.auto_resize)
317             "viewport = "+sci2exp(h.viewport)
318             "figure_name = "+sci2exp(h.figure_name,0)
319             "figure_id = "+sci2exp(h.figure_id,0)
320             "info_message = "+sci2exp(h.info_message)
321             "color_map = matrix "+strcat(string(size(h.color_map)),"x")
322             "pixel_drawing_mode = "+sci2exp(h.pixel_drawing_mode,0)
323             "anti_aliasing = " + sci2exp(h.anti_aliasing)
324             "immediate_drawing = "+sci2exp(h.immediate_drawing)
325             "background =  "+string(h.background)
326             "visible = "+sci2exp(h.visible)
327             "rotation_style = "+sci2exp(h.rotation_style)
328             "event_handler = " + sci2exp( h.event_handler ) ;
329             "event_handler_enable = " + sci2exp( h.event_handler_enable ) ;
330             "user_data = "+fmtuser_data(u)
331             "resizefcn = "+sci2exp(h.resizefcn)
332             "closerequestfcn = "+sci2exp(h.closerequestfcn)
333             "resize = "+sci2exp(h.resize)
334             "toolbar = "+sci2exp(h.toolbar)
335             "toolbar_visible = "+sci2exp(h.toolbar_visible)
336             "menubar = "+sci2exp(h.menubar)
337             "menubar_visible = "+sci2exp(h.menubar_visible)
338             "infobar_visible = "+sci2exp(h.infobar_visible)
339             "dockable = "+sci2exp(h.dockable)
340             "layout = "+sci2exp(h.layout)
341             "layout_options = "+sci2exp(l)
342             "default_axes = "+sci2exp(h.default_axes)
343             "icon = "+fmtuser_data(h.icon)
344             "tag = "+sci2exp(h.tag)
345             ]
346
347             // Grayplot
348             // =====================================================================
349
350         case "Grayplot"
351             Data = h.data
352             if size(Data.x,"*") > 10 then
353                 dx="matrix "+strcat(string(size(Data.x)),"x")
354             else
355                 dx=sci2exp(Data.x,0)
356                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),"x"),end
357             end
358
359             if size(Data.y,"*") > 10 then
360                 dy="matrix "+strcat(string(size(Data.y)),"x")
361             else
362                 dy=sci2exp(Data.y,0)
363                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),"x"),end
364             end
365
366             if size(Data.z,"*") > 10 then
367                 dz="matrix "+strcat(string(size(Data.z)),"x")
368             else
369                 dz=sci2exp(Data.z,0)
370                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),"x"),end
371             end
372
373             u=h.user_data
374             t=[t;
375             "parent: "+h.parent.type
376             "children: "+fmtchildren(h.children)
377             "visible = "+sci2exp(h.visible)
378             "data.x = "+dx
379             "data.y = "+dy
380             "data.z = "+dz
381             "data_mapping = "+sci2exp(h.data_mapping)
382             "clip_state = "+sci2exp(h.clip_state)
383             "clip_box = "+sci2exp(h.clip_box,0)
384             "user_data = "+fmtuser_data(u)
385             "tag = "+h.tag
386             ]
387
388             // Matplot
389             // =====================================================================
390
391
392         case "Matplot"
393             if typeof(h.data) == "hypermat" then
394                 d="matrix "+strcat(string(h.data.dims),"x")
395             elseif size(h.data,"*") > 10 then
396                 d="matrix "+strcat(string(size(h.data)),"x")
397             else
398                 d=sci2exp(h.data,0)
399                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),"x"),end
400             end
401             u=h.user_data
402             t=[t;
403             "parent: "+h.parent.type
404             "children: "+fmtchildren(h.children)
405             "visible = "+sci2exp(h.visible)
406             "data = "+d
407             "rect = " + sci2exp(h.rect, 0)
408             "image_type = " + sci2exp(h.image_type)
409             "clip_state = "+sci2exp(h.clip_state)
410             "clip_box = "+sci2exp(h.clip_box,0)
411             "user_data = "+fmtuser_data(u)
412             "tag = "+h.tag
413             ]
414
415             // Fec
416             // =====================================================================
417         case "Fec"
418             u=h.user_data
419             if size(h.data,"*") > 10 then
420                 d="matrix "+strcat(string(size(h.data)),"x")
421             else
422                 d=sci2exp(h.data,0)
423                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),"x"),end
424             end
425
426             if size(h.triangles,"*") > 10 then
427                 f="matrix "+strcat(string(size(h.triangles)),"x")
428             else
429                 f=sci2exp(h.triangles,0)
430                 if length(f)>70 then f="matrix "+strcat(string(size(h.triangles)),"x"),end
431             end
432
433             t=[t;
434             "parent: "+h.parent.type
435             "children: "+fmtchildren(h.children)
436             "visible = "+sci2exp(h.visible)
437             "data = "+d
438             "triangles = "+f
439             "z_bounds = "+sci2exp(h.z_bounds,0)
440             "color_range = " + sci2exp(h.color_range, 0);
441             "outside_colors = " + sci2exp(h.outside_colors, 0);
442             "line_mode = " + sci2exp(h.line_mode);
443             "foreground = " + sci2exp(h.foreground);
444             "clip_state = "+sci2exp(h.clip_state)
445             "clip_box = "+sci2exp(h.clip_box,0)
446             "user_data = "+fmtuser_data(u)
447             "tag = "+h.tag
448             ]
449
450             // Segs
451             // =====================================================================
452
453         case "Segs"
454             if size(h.data,"*") > 10 then
455                 d="matrix "+strcat(string(size(h.data)),"x")
456             else
457                 d=sci2exp(h.data,0)
458                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),"x"),end
459             end
460
461             if size(h.segs_color,"*") > 10 then
462                 c="matrix "+strcat(string(size(h.segs_color)),"x")
463             else
464                 c=sci2exp(h.segs_color,0)
465                 if length(c)>70 then c="matrix "+strcat(string(size(h.segs_color)),"x"),end
466             end
467
468             u=h.user_data
469             t=[t;
470             "parent: "+h.parent.type
471             "children: "+fmtchildren(h.children)
472             "visible = "+sci2exp(h.visible)
473             "data = "+d
474             "line_mode = "+sci2exp(h.line_mode)
475             "line_style = "+string(h.line_style)
476             "thickness = "+string(h.thickness)
477             "arrow_size = "+string(h.arrow_size)
478             "segs_color = "+c
479             "mark_mode = "+sci2exp(h.mark_mode)
480             "mark_style = "+sci2exp(h.mark_style)
481             "mark_size_unit = "+sci2exp(h.mark_size_unit)
482             "mark_size = "+string(h.mark_size)
483             "mark_foreground = "+string(h.mark_foreground)
484             "mark_background = "+string(h.mark_background)
485             "clip_state = "+sci2exp(h.clip_state)
486             "clip_box = "+sci2exp(h.clip_box,0)
487             "user_data = "+fmtuser_data(u)
488             "tag = "+h.tag
489             ]
490
491             // Champ
492             // =====================================================================
493
494         case "Champ"
495             Data = h.data
496             if size(Data.x,"*") > 10 then
497                 dx="matrix "+strcat(string(size(Data.x)),"x")
498             else
499                 dx=sci2exp(Data.x,0)
500                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),"x"),end
501             end
502
503             if size(Data.y,"*") > 10 then
504                 dy="matrix "+strcat(string(size(Data.y)),"x")
505             else
506                 dy=sci2exp(Data.y,0)
507                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),"x"),end
508             end
509
510             if size(Data.fx,"*") > 10 then
511                 dfx="matrix "+strcat(string(size(Data.fx)),"x")
512             else
513                 dfx=sci2exp(Data.fx,0)
514                 if length(dfx)>70 then d="matrix "+strcat(string(size(Data.fx)),"x"),end
515             end
516
517             if size(Data.fy,"*") > 10 then
518                 dfy="matrix "+strcat(string(size(Data.fy)),"x")
519             else
520                 dfy=sci2exp(Data.fy,0)
521                 if length(dfy)>70 then d="matrix "+strcat(string(size(Data.fy)),"x"),end
522             end
523
524             u=h.user_data
525             t=[t;
526             "parent: "+h.parent.type
527             "children: "+fmtchildren(h.children)
528             "visible = "+sci2exp(h.visible)
529             "data.x = "+dx
530             "data.y = "+dy
531             "data.fx = "+dfx
532             "data.fy = "+dfy
533             "line_style = "+string(h.line_style)
534             "thickness = "+string(h.thickness)
535             "colored = "+sci2exp(h.colored)
536             "arrow_size = "+string(h.arrow_size)
537             "clip_state = "+sci2exp(h.clip_state)
538             "clip_box = "+sci2exp(h.clip_box,0)
539             "user_data = "+fmtuser_data(u)
540             "tag = "+h.tag
541             ]
542
543             // Text
544             // =====================================================================
545
546         case "Text"
547             u=h.user_data
548             T=sci2exp(h.text,0)
549             if length(T)>70 then T="string array "+strcat(string(size(h.text)),"x"),end
550             t=[t;
551             "parent: "+h.parent.type
552             "children: "+fmtchildren(h.children)
553             "visible = "+sci2exp(h.visible)
554             "text = "+T
555             "alignment = "+sci2exp(h.alignment) ;
556             "data = "+sci2exp(h.data,0)
557             "box = "+sci2exp(h.box)
558             "line_mode = " + sci2exp(h.line_mode);
559             "fill_mode = " + sci2exp(h.fill_mode);
560             "text_box = "+sci2exp(h.text_box,0)
561             "text_box_mode = "+sci2exp(h.text_box_mode,0)
562             "font_foreground = "+string(h.font_foreground)
563             "foreground = "+string(h.foreground)
564             "background = "+string(h.background)
565             "font_style = "+string(h.font_style)
566             "font_size = "+string(h.font_size)
567             "fractional_font = " + sci2exp(h.fractional_font)
568             "auto_dimensionning = " + sci2exp(h.auto_dimensionning)
569             "font_angle = "+string(h.font_angle)
570             "clip_state = "+sci2exp(h.clip_state)
571             "clip_box = "+sci2exp(h.clip_box,0)
572             "user_data = "+fmtuser_data(u)
573             "tag = "+h.tag
574             ]
575
576             // Datatip
577             // =====================================================================
578
579         case "Datatip"
580             u=h.user_data
581             t=[t;
582             "parent: "+h.parent.type
583             "children: "+fmtchildren(h.children)
584             "visible = "+sci2exp(h.visible)
585             "data = "+sci2exp(h.data)
586             "box_mode = "+sci2exp(h.box_mode)
587             "label_mode = "+sci2exp(h.label_mode)
588             "orientation = "+sci2exp(h.orientation)
589             "z_component = "+sci2exp(h.z_component)
590             "auto_orientation = "+sci2exp(h.auto_orientation)
591             "interp_mode = "+sci2exp(h.interp_mode)
592             "display_function = "+sci2exp(h.display_function)
593             "font_foreground = "+string(h.font_foreground)
594             "foreground = "+string(h.foreground)
595             "background = "+string(h.background)
596             "mark_mode = "+sci2exp(h.mark_mode)
597             "mark_style = "+sci2exp(h.mark_style)
598             "mark_size_unit = "+sci2exp(h.mark_size_unit)
599             "mark_size = "+string(h.mark_size)
600             "mark_foreground = "+string(h.mark_foreground)
601             "mark_background = "+string(h.mark_background)
602             "user_data = "+fmtuser_data(u)
603             "tag = "+h.tag
604             ]
605
606             // Title
607             // =====================================================================
608
609         case "Title"
610             T=sci2exp(h.text,0)
611             if length(T)>70 then T="string array "+strcat(string(size(h.text)),"x"),end
612             t=[t;
613             "parent: "+h.parent.type
614             "children: "+fmtchildren(h.children)
615             "visible = "+sci2exp(h.visible)
616             "text = "+T
617             "foreground = "+string(h.foreground)
618             "font_style = "+string(h.font_style)
619             "font_size = "+string(h.font_size)
620             "fractional_font = " + sci2exp(h.fractional_font)
621             "font_angle = "+string(h.font_angle)
622             "tag = "+h.tag
623             ]
624
625             // Label
626             // =====================================================================
627
628         case "Label"
629             T=sci2exp(h.text,0)
630             if length(T)>70 then T="string array "+strcat(string(size(h.text)),"x"),end
631             t=[t;
632             "parent: "+h.parent.type
633             "visible = "+sci2exp(h.visible)
634             "text = "+T;
635             "font_foreground = " + string(h.font_foreground) ;
636             "foreground = "+string(h.foreground)
637             "background = "+string(h.background)
638             "fill_mode = "+sci2exp(h.fill_mode)
639             "font_style = "+string(h.font_style)
640             "font_size = "+string(h.font_size)
641             "fractional_font = " + sci2exp(h.fractional_font)
642             "font_angle = "+string(h.font_angle)
643             "auto_position = "+sci2exp(h.auto_position)
644             "position = "+sci2exp(h.position,0)
645             "auto_rotation = "+sci2exp(h.auto_rotation)
646             "tag = "+h.tag
647             ]
648
649             // Plot3d
650             // =====================================================================
651         case "Plot3d"
652             Data = h.data
653             if size(Data.x,"*") > 10 then
654                 dx="matrix "+strcat(string(size(Data.x)),"x")
655             else
656                 dx=sci2exp(Data.x,0)
657                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),"x"),end
658             end
659
660             if size(Data.y,"*") > 10 then
661                 dy="matrix "+strcat(string(size(Data.y)),"x")
662             else
663                 dy=sci2exp(Data.y,0)
664                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),"x"),end
665             end
666
667             if size(Data.z,"*") > 10 then
668                 dz="matrix "+strcat(string(size(Data.z)),"x")
669             else
670                 dz=sci2exp(Data.z,0)
671                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),"x"),end
672             end
673
674             u=h.user_data
675
676             if size(Data) == 5 then // There is a color
677                 if size(Data.color,"*") > 10 then
678                     dcolor="matrix "+strcat(string(size(Data.color)),"x")
679                 else
680                     dcolor=sci2exp(Data.color,0)
681                     if length(dcolor)>70 then dcolor="matrix "+strcat(string(size(Data.color)),"x"),end
682                 end
683
684                 t=[t;
685                 "parent: "+h.parent.type
686                 "children: "+fmtchildren(h.children)
687                 "visible = "+sci2exp(h.visible)
688                 "surface_mode = "+sci2exp(h.surface_mode)
689                 "foreground = "+string(h.foreground)
690                 "thickness = "+string(h.thickness)
691                 "mark_mode = "+sci2exp(h.mark_mode)
692                 "mark_style = "+sci2exp(h.mark_style)
693                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
694                 "mark_size = "+string(h.mark_size)
695                 "mark_foreground = "+string(h.mark_foreground)
696                 "mark_background = "+string(h.mark_background)
697                 "data.x = "+dx
698                 "data.y = "+dy
699                 "data.z "+dz
700                 "data.color (not used) = "+dcolor
701                 "color_mode = "+string(h.color_mode)
702                 "color_flag = "+sci2exp(h.color_flag,0)
703                 "hiddencolor = "+string(h.hiddencolor)
704                 "clip_state = "+sci2exp(h.clip_state)
705                 "clip_box = "+sci2exp(h.clip_box,0)
706                 "ambient_color = "+sci2exp(h.ambient_color)
707                 "diffuse_color = "+sci2exp(h.diffuse_color)
708                 "specular_color = "+sci2exp(h.specular_color)
709                 "use_color_material = "+sci2exp(h.use_color_material)
710                 "material_shininess = "+sci2exp(h.material_shininess)
711                 "user_data = "+fmtuser_data(u)
712                 "tag = "+h.tag
713                 ]
714             else
715                 t=[t;
716                 "parent: "+h.parent.type
717                 "children: "+fmtchildren(h.children)
718                 "visible = "+sci2exp(h.visible)
719                 "surface_mode = "+sci2exp(h.surface_mode)
720                 "foreground = "+string(h.foreground)
721                 "thickness = "+string(h.thickness)
722                 "mark_mode = "+sci2exp(h.mark_mode)
723                 "mark_style = "+sci2exp(h.mark_style)
724                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
725                 "mark_size = "+string(h.mark_size)
726                 "mark_foreground = "+string(h.mark_foreground)
727                 "mark_background = "+string(h.mark_background)
728                 "data.x = "+dx
729                 "data.y = "+dy
730                 "data.z = "+dz
731                 "color_mode = "+string(h.color_mode)
732                 "color_flag = "+sci2exp(h.color_flag,0)
733                 "hiddencolor = "+string(h.hiddencolor)
734                 "clip_state = "+sci2exp(h.clip_state)
735                 "clip_box = "+sci2exp(h.clip_box,0)
736                 "ambient_color = "+sci2exp(h.ambient_color)
737                 "diffuse_color = "+sci2exp(h.diffuse_color)
738                 "specular_color = "+sci2exp(h.specular_color)
739                 "use_color_material = "+sci2exp(h.use_color_material)
740                 "material_shininess = "+sci2exp(h.material_shininess)
741                 "user_data = "+fmtuser_data(u)
742                 "tag = "+h.tag
743                 ]
744             end
745
746             // Fac3d
747             // =====================================================================
748
749         case "Fac3d"
750             Data = h.data
751             if size(Data.x,"*") > 10 then
752                 dx="matrix "+strcat(string(size(Data.x)),"x")
753             else
754                 dx=sci2exp(Data.x,0)
755                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),"x"),end
756             end
757
758             if size(Data.y,"*") > 10 then
759                 dy="matrix "+strcat(string(size(Data.y)),"x")
760             else
761                 dy=sci2exp(Data.y,0)
762                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),"x"),end
763             end
764
765             if size(Data.z,"*") > 10 then
766                 dz="matrix "+strcat(string(size(Data.z)),"x")
767             else
768                 dz=sci2exp(Data.z,0)
769                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),"x"),end
770             end
771
772             u=h.user_data;
773
774             if size(Data) == 5 then // There is a color
775                 if size(Data.color,"*") > 10 then
776                     dcolor="matrix "+strcat(string(size(Data.color)),"x")
777                 else
778                     dcolor=sci2exp(Data.color,0)
779                     if length(dcolor)>70 then dcolor="matrix "+strcat(string(size(Data.color)),"x"),end
780                 end
781
782                 t=[t;
783                 "parent: "+h.parent.type
784                 "children: "+fmtchildren(h.children)
785                 "visible = "+sci2exp(h.visible)
786                 "surface_mode = "+sci2exp(h.surface_mode)
787                 "foreground = "+string(h.foreground)
788                 "thickness = "+string(h.thickness)
789                 "mark_mode = "+sci2exp(h.mark_mode)
790                 "mark_style = "+sci2exp(h.mark_style)
791                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
792                 "mark_size = "+string(h.mark_size)
793                 "mark_foreground = "+string(h.mark_foreground)
794                 "mark_background = "+string(h.mark_background)
795                 "data.x = "+dx
796                 "data.y = "+dy
797                 "data.z = "+dz
798                 "data.color = "+dcolor
799                 "color_mode = "+string(h.color_mode)
800                 "color_flag = "+sci2exp(h.color_flag,0)
801                 "cdata_mapping = "+sci2exp(h.cdata_mapping)
802                 "hiddencolor = "+string(h.hiddencolor)
803                 "clip_state = "+sci2exp(h.clip_state)
804                 "clip_box = "+sci2exp(h.clip_box,0)
805                 "ambient_color = "+sci2exp(h.ambient_color)
806                 "diffuse_color = "+sci2exp(h.diffuse_color)
807                 "specular_color = "+sci2exp(h.specular_color)
808                 "use_color_material = "+sci2exp(h.use_color_material)
809                 "material_shininess = "+sci2exp(h.material_shininess)
810                 "user_data = "+fmtuser_data(u)
811                 "tag = "+h.tag
812                 ]
813             else
814                 t=[t;
815                 "parent: "+h.parent.type
816                 "children: "+fmtchildren(h.children)
817                 "visible = "+sci2exp(h.visible)
818                 "surface_mode = "+sci2exp(h.surface_mode)
819                 "foreground = "+string(h.foreground)
820                 "thickness = "+string(h.thickness)
821                 "mark_mode = "+sci2exp(h.mark_mode)
822                 "mark_style = "+sci2exp(h.mark_style)
823                 "mark_size_unit = "+sci2exp(h.mark_size_unit)
824                 "mark_size = "+string(h.mark_size)
825                 "mark_foreground = "+string(h.mark_foreground)
826                 "mark_background = "+string(h.mark_background)
827                 "data.x = "+dx
828                 "data.y = "+dy
829                 "data.z = "+dz
830                 "color_mode = "+string(h.color_mode)
831                 "color_flag = "+sci2exp(h.color_flag,0)
832                 "hiddencolor = "+string(h.hiddencolor)
833                 "clip_state = "+sci2exp(h.clip_state)
834                 "clip_box = "+sci2exp(h.clip_box,0)
835                 "ambient_color = "+sci2exp(h.ambient_color)
836                 "diffuse_color = "+sci2exp(h.diffuse_color)
837                 "specular_color = "+sci2exp(h.specular_color)
838                 "usecolor_material = "+sci2exp(h.use_color_material)
839                 "material_shininess = "+sci2exp(h.material_shininess)
840                 "user_data = "+fmtuser_data(u)
841                 "tag = "+h.tag
842                 ]
843             end
844
845             // Param3d
846             // =====================================================================
847
848         case "Param3d"
849             u=h.user_data;
850             if size(h.data,"*") > 10 then
851                 d="matrix "+strcat(string(size(h.data)),"x")
852             else
853                 d=sci2exp(h.data,0)
854                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),"x"),end
855             end
856
857             if size(h.surface_color,"*") > 10 then
858                 c="matrix "+strcat(string(size(h.surface_color)),"x")
859             else
860                 c=sci2exp(h.surface_color,0)
861                 if length(c)>70 then c="matrix "+strcat(string(size(h.surface_color)),"x"),end
862             end
863
864             t=[t;
865             "parent: "+h.parent.type
866             "children: "+fmtchildren(h.children)
867             "visible = "+sci2exp(h.visible)
868             "line_mode = "+sci2exp(h.line_mode)
869             "foreground = "+string(h.foreground)
870             "thickness = "+string(h.thickness)
871             "mark_mode = "+sci2exp(h.mark_mode)
872             "mark_style = "+sci2exp(h.mark_style)
873             "mark_size_unit = "+sci2exp(h.mark_size_unit)
874             "mark_size = "+string(h.mark_size)
875             "mark_foreground = "+string(h.mark_foreground)
876             "mark_background = "+string(h.mark_background)
877             "data = "+d
878             "clip_state = "+sci2exp(h.clip_state)
879             "clip_box = "+sci2exp(h.clip_box,0)
880             "color_mode = "+string(h.color_mode)
881             "surface_color = "+c
882             "user_data = "+fmtuser_data(u)
883             "tag = "+h.tag
884             ]
885
886             // Axis
887             // =====================================================================
888
889         case "Axis"
890             u=h.user_data;
891             T=sci2exp(h.tics_labels,0)
892             if length(T)>70 then T="string array "+strcat(string(size(h.tics_labels)),"x"),end
893             t=[t;
894             "parent: "+h.parent.type
895             "visible = "+sci2exp(h.visible)
896             "tics_direction = "+sci2exp(h.tics_direction)
897             "xtics_coord = "+sci2exp(h.xtics_coord,0)
898             "ytics_coord = "+sci2exp(h.ytics_coord,0)
899             "tics_color = "+string(h.tics_color)
900             "tics_segment = "+sci2exp(h.tics_segment)
901             "tics_style = "+sci2exp(h.tics_style)
902             "sub_tics = "+string(h.sub_tics)
903             "tics_labels = "+T
904             "format_n = "+sci2exp(h.format_n)
905             "labels_font_size = "+string(h.labels_font_size)
906             "labels_font_color = "+string(h.labels_font_color)
907             "labels_font_style = "+string(h.labels_font_style)
908             "fractional_font = " + sci2exp(h.fractional_font)
909             "clip_state = "+sci2exp(h.clip_state)
910             "clip_box = "+sci2exp(h.clip_box,0)
911             "user_data = "+fmtuser_data(u)
912             "tag = "+h.tag
913             ]
914
915             // uimenu
916             // =====================================================================
917
918         case "uimenu"
919             u=h.user_data;
920             t=[t;
921             "Parent: "+h.parent.type
922             "Children: "+fmtchildren(h.children)
923             "Enable = "+sci2exp(h.enable)
924             "Foregroundcolor = "+sci2exp(h.foregroundcolor,0)
925             "Label = "+h.label
926             "Handle_Visible = "+sci2exp(h.handle_visible)
927             "Visible = "+sci2exp(h.visible)
928             "Callback = "+h.callback
929             "Callback_Type = "+sci2exp(h.callback_type,0)
930             "Checked =  "+sci2exp(h.checked)
931             "Icon =  "+sci2exp(h.icon)
932             "Userdata = "+fmtuser_data(u)
933             "Tag = "+h.tag
934             ]
935
936             // uicontextmenu
937             // =====================================================================
938
939         case "uicontextmenu"
940             if isempty(h.parent) then // For an uicontextmenu, parent can be empty
941                 parent = "";
942             else
943                 parent = h.parent.type;
944             end
945             t=[t;
946             "Parent: "+parent
947             "Children: "+fmtchildren(h.children)
948             ]
949
950             // uicontrol
951             // =====================================================================
952
953         case "uicontrol"
954
955             u=h.user_data;
956             c = h.constraints;
957             if type(c) == 16 then //tlist
958                 c = c(1);
959                 c = c(1);
960             end
961             l = h.layout_options;
962             if type(l) == 16 then //tlist
963                 l = l(1);
964                 l = l(1);
965             end
966             b = h.border;
967             if type(b) == 16 then //tlist
968                 b = b(1);
969                 b = b(1);
970             end
971
972             showHiddenProperties = get(get(0), "ShowHiddenProperties") == "on";
973             t($ + 1) = "Parent: " + h.parent.type;
974             t($ + 1) = "Children: " + fmtchildren(h.children);
975             t($ + 1) = "Style = " + h.style;
976             if and(h.style <> ["popupmenu"]) | showHiddenProperties then
977                 t($ + 1) = "BackgroundColor = " + sci2exp(h.backgroundcolor,0);
978             end
979             if h.style == "frame" | showHiddenProperties then
980                 t($ + 1) = "Border = " + sci2exp(b);
981             end
982             if and(h.style <> ["frame", "layer", "text"]) | showHiddenProperties then
983                 t($ + 1) = "Callback = " + h.callback;
984                 t($ + 1) = "Callback_Type = " + sci2exp(h.callback_type,0);
985             end
986             t($ + 1) = "Constraints = " + sci2exp(c);
987             t($ + 1) = "Enable = " + sci2exp(h.enable);
988             if and(h.style <> ["image", "slider", "layer"]) | showHiddenProperties then
989                 t($ + 1) = "FontAngle = " + h.fontangle;
990                 t($ + 1) = "FontName = " + h.fontname;
991                 t($ + 1) = "FontSize = " + sci2exp(h.fontsize);
992                 t($ + 1) = "FontUnits = " + h.fontunits;
993                 t($ + 1) = "FontWeight = " + h.fontweight;
994             end
995             if and(h.style <> ["frame", "layer", "tab", "slider", "image", "popupmenu"]) | showHiddenProperties then
996                 t($ + 1) = "ForegroundColor = " + sci2exp(h.foregroundcolor,0);
997             end
998             if or(h.style == ["radiobutton", "checkbox"]) | showHiddenProperties then
999                 t($ + 1) = "Groupname = " + sci2exp(h.groupname);
1000             end
1001             if and(h.style <> ["frame", "layer", "tab", "listbox", "popupmenu"]) | showHiddenProperties then
1002                 t($ + 1) = "HorizontalAlignment = " + h.horizontalalignment;
1003             end
1004             if or(h.style == ["text", "pushbutton", "frame"]) | showHiddenProperties then
1005                 t($ + 1) = "Icon = " + fmtuser_data(h.icon);
1006             end
1007             if h.style == "frame" | showHiddenProperties then
1008                 t($ + 1) = "Layout = " + sci2exp(h.layout);
1009                 t($ + 1) = "Layout_options = " + sci2exp(l);
1010             end
1011             if h.style == "listbox" | showHiddenProperties then
1012                 t($ + 1) = "ListboxTop = " + sci2exp(h.listboxtop,0);
1013             end
1014             t($ + 1) = "Margins = " + sci2exp(h.margins);
1015             if or(h.style == ["checkbox", "radiobutton", "slider", "spinner", "listbox", "edit"]) | showHiddenProperties then
1016                 t($ + 1) = "Max = " + sci2exp(h.max);
1017                 t($ + 1) = "Min = " + sci2exp(h.min);
1018             end
1019             t($ + 1) = "Position = " + sci2exp(h.position,0);
1020             t($ + 1) = "Relief = " + h.relief;
1021             if or(h.style == ["frame", "edit"]) | showHiddenProperties then
1022                 t($ + 1) = "Scrollable = " + sci2exp(h.scrollable);
1023             end
1024             if or(h.style == ["slider", "spinner"]) | showHiddenProperties then
1025                 t($ + 1) = "SliderStep = " + sci2exp(h.sliderstep);
1026             end
1027             if h.style <> "slider" | showHiddenProperties then
1028                 t($ + 1) = "String = " + fmtuser_data(h.string);
1029             end
1030             t($ + 1) = "Tag = " + h.tag;
1031             if h.style == "tab" | showHiddenProperties then
1032                 t($ + 1) = "Title_position = " + sci2exp(h.title_position);
1033                 t($ + 1) = "Title_scroll = " + sci2exp(h.title_scroll);
1034             end
1035             t($ + 1) = "TooltipString = " + fmtuser_data(h.tooltipstring);
1036             t($ + 1) = "Units = " + h.units;
1037             t($ + 1) = "Userdata = " + fmtuser_data(u);
1038             if or(h.style == ["checkbox", "radiobutton", "slider", "spinner", "listbox", "edit", "layer", "tab", "popupmenu"]) | showHiddenProperties then
1039                 t($ + 1) = "Value = " + sci2exp(h.value,0);
1040             end
1041
1042             if and(h.style <> ["frame", "layer", "tab", "listbox", "popupmenu"]) | showHiddenProperties then
1043                 t($ + 1) = "VerticalAlignment = " + h.verticalalignment;
1044             end
1045             t($ + 1) = "Visible = " + sci2exp(h.visible);
1046
1047             // Console
1048             // =====================================================================
1049
1050         case "Console"
1051             t=[t;
1052             "Children: "+fmtchildren(h.children)
1053             "ShowHiddenHandles = "+sci2exp(h.showhiddenhandles)
1054             "ShowHiddenProperties = "+sci2exp(h.showhiddenproperties)
1055             "UseDeprecatedSkin = "+sci2exp(h.usedeprecatedskin)
1056             ]
1057             // Light
1058             // =====================================================================
1059
1060         case "Light"
1061             t=[t;
1062             "parent: "+h.parent.type
1063             "visible = "+sci2exp(h.visible)
1064             "light_type = "+sci2exp(h.light_type)
1065             "position = "+sci2exp(h.position)
1066             "direction = "+sci2exp(h.direction)
1067             "ambient_color = "+sci2exp(h.ambient_color)
1068             "diffuse_color = "+sci2exp(h.diffuse_color)
1069             "specular_color= "+sci2exp(h.specular_color)
1070             ]
1071         end
1072     end
1073     write(%io(2),t)
1074 endfunction
1075
1076
1077
1078
1079 function t=fmtchildren(c)
1080     if c==[] then
1081         t="[]"
1082     else
1083         if size(c,"*")<10 then
1084             t=sci2exp(c.type,0);
1085             if length(t)>70 then t="matrix "+strcat(string(size(c)),"x"),end
1086         else
1087             t="matrix "+strcat(string(size(c)),"x")
1088         end
1089     end
1090 endfunction
1091
1092
1093 function t=fmtuser_data(d)
1094     td= type(d)
1095     if or(td==[1 2 3 4 8 10 15]) then
1096         t=sci2exp(d,0)
1097         if length(t)>70 then
1098             if type(d) <> 15 then
1099                 t=typeof(d)+" "+strcat(string(size(d)),"x");
1100             else
1101                 t=typeof(d)+"(";
1102                 for i=1:length(d)
1103                     if type(d(i)) <> 9 then
1104                         t=t+typeof(d(i))+", ";
1105                     else
1106                         t=t+d(i).type +", ";
1107                     end
1108                 end
1109                 t=part(t,1:length(t)-2);
1110                 t=t+")";
1111             end
1112         end
1113     elseif or(td==16) then
1114         t=typeof(d)+" "+strcat(string(size(d)),"x"),
1115     elseif or(td==17) then
1116         if typeof(d)=="ce" then
1117             t="cell "+strcat(string(size(d)),"x"),
1118         elseif typeof(d)=="st" then
1119             T=getfield(1,d)
1120             t="struct with fields: "+strcat(T(3:$)," "),
1121         else
1122             t=typeof(d)
1123         end
1124     else
1125         t=typeof(d)
1126     end
1127 endfunction