summaryrefslogtreecommitdiff
path: root/modules/graphics/tests/unit_tests/datatipRemove.dia.ref
blob: e4534f2aac6cd4430a2bebc90987e1a7df336489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2012 - Scilab Enterprises - Cedric Delamarre
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- TEST WITH GRAPHIC -->
x = linspace(0,1,100)';
y = x.^3;
clf();
plot(x,x.^2,"r");
e = gce();
e = e.children;
datatipCreate(e(1),50);
datatipCreate(e(1),60);
datatipCreate(e(1),70);
datatipCreate(e(1),80);
a = gca();
// Get the last datatip.
cpound = a.children(1); // Compound
pline = cpound.children(1); // Polyline
lastTipTxt = pline.datatips(4).text;
// Delete the second datatip.
datatipRemove(e(1), 2);
// Check the new size.
assert_checkequal(length(a.children(1).children(1).datatips), 3);
// Check that the last datatip is the drop to the third position.
assert_checkequal(lastTipTxt, a.children(1).children(1).datatips(3).text);