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