1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2015 - Scilab Enterprises - Vincent COUVERT
4//
5//  This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- TEST WITH GRAPHIC -->
9
10// <-- Non-regression test for bug 13807 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/13807
14//
15// <-- Short Description -->
16// Invalid margins when the visibility of figure was to off
17
18fig = figure("figure_name", "TEST MARGINS", ...
19"dockable", "off", ...
20"axes_size", [950,550], ...
21"infobar_visible", "off", ...
22"toolbar", "none", ...
23"menubar_visible", "on", ...
24"menubar", "none", ...
25"default_axes", "off", ...
26"layout", "border", ...
27"visible", "off");
28
29f = uicontrol(fig, "style", "frame", ...
30"layout", "gridbag");
31
32f1 = uicontrol(f, "style", "frame", ...
33"layout", "gridbag", ...
34"constraints", createConstraints("gridbag", [1 1 1 1], [1 1], "both", "left"));
35a1 = newaxes(f1);
36//a1.auto_margins="off";
37a1.filled = "off";
38a1.tag = "axe";
39
40f2 = uicontrol(f, "style", "frame", ...
41"layout", "gridbag", ...
42"constraints", createConstraints("gridbag", [1 2 1 1], [1 1], "horizontal", "left"));
43uicontrol(f2, "style", "text", ...
44"string", "test", ...
45"layout", "gridbag", ...
46"constraints", createConstraints("gridbag", [1 1 1 1], [1 1], "none", "left"));
47
48sca(a1);
49plot2d(1:10, 1:10);
50a1.tight_limits = "on";
51a1.x_label.text = "Time (s)";
52a1.x_label.font_size = 2;
53a1.x_location = "top";
54legend("text", -1);
55fig.visible="on";
56
57// Check that the margins ont the top are visually correct.
58
59