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