4417027466a37a4a85604725b23a02c95e82f9c6
[scilab.git] / scilab / modules / graphics / tests / unit_tests / layout.dia.ref
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 // <-- TEST WITH GRAPHIC -->
8 function fig = createFigure(layout)
9     fig = scf();
10     fig.layout = layout;
11     fig.toolbar_visible = "off";
12     fig.menubar_visible = "off";
13     fig.infobar_visible = "off";
14 endfunction
15 //no border
16 createFigure("none");
17 c = createConstraints("nolayout");
18 u = uicontrol("constraints", c);
19 assert_checkequal(u.constraints, c);
20 delete(gcf());
21 //border layout
22 createFigure("border");
23 c = createConstraints("border", "center");
24 u = uicontrol("constraints", c, "string", "center");
25 assert_checkequal(u.constraints, c);
26 c = createConstraints("border", "left");
27 u = uicontrol("constraints", c, "string", "left");
28 assert_checkequal(u.constraints, c);
29 c = createConstraints("border", "right");
30 u = uicontrol("constraints", c, "string", "right");
31 assert_checkequal(u.constraints, c);
32 c = createConstraints("border", "top");
33 u = uicontrol("constraints", c, "string", "top");
34 assert_checkequal(u.constraints, c);
35 c = createConstraints("border", "bottom");
36 u = uicontrol("constraints", c, "string", "bottom");
37 assert_checkequal(u.constraints, c);
38 delete(gcf());
39 //grid layout
40 createFigure("grid");
41 c = createConstraints("grid", [1 2]);
42 u = uicontrol("constraints", c);
43 assert_checkequal(u.constraints, c);
44 c = createConstraints("grid", [1 2], [10 20]);
45 u = uicontrol("constraints", c);
46 assert_checkequal(u.constraints, c);
47 delete(gcf());
48 //gridbag layout
49 createFigure("gridbag");
50 c = createConstraints("gridbag", [1 2 3 4]);
51 u = uicontrol("constraints", c);
52 assert_checkequal(u.constraints, c);
53 c = createConstraints("gridbag", [1 2 3 4], [1.1 2.1]);
54 u = uicontrol("constraints", c);
55 assert_checkequal(u.constraints, c);
56 c = createConstraints("gridbag", [1 2 3 4], [1.1 2.1], "both");
57 u = uicontrol("constraints", c);
58 assert_checkequal(u.constraints, c);
59 c = createConstraints("gridbag", [1 2 3 4], [1.1 2.1], "both", "lower_left");
60 u = uicontrol("constraints", c);
61 assert_checkequal(u.constraints, c);
62 c = createConstraints("gridbag", [1 2 3 4], [1.1 2.1], "both", "lower_left", [10 20]);
63 u = uicontrol("constraints", c);
64 assert_checkequal(u.constraints, c);
65 delete(gcf());