~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to test/xaml/enums/visibility-textblock.html

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
  <head>
 
3
      <title>Visibility (TextBlock) Test Page</title>
 
4
 
 
5
      <script language="javascript" src="Silverlight.js"></script>
 
6
 
 
7
      <script type="text/xaml" id="xaml">
 
8
        <Canvas x:Name="canvas" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="100" Height="100" Loaded="onLoaded">
 
9
                <Rectangle Canvas.Top="0" Canvas.Left="000" Width="90" Height="50" Stroke="Red" />
 
10
                <TextBlock Canvas.Top="0" Canvas.Left="0" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24" >
 
11
                ABRA CADA BRA
 
12
                </TextBlock>
 
13
 
 
14
                <Rectangle Canvas.Top="0" Canvas.Left="200" Width="90" Height="50" Stroke="Red" />
 
15
                <TextBlock Canvas.Top="0" Canvas.Left="200" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24" Visibility="Visible">
 
16
                ABRA CADA BRA
 
17
                </TextBlock>
 
18
 
 
19
                <Rectangle Canvas.Top="0" Canvas.Left="400" Width="90" Height="50" Stroke="Red" />
 
20
                <TextBlock Canvas.Top="0" Canvas.Left="400" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24" Visibility="Collapsed">
 
21
                ABRA CADA BRA
 
22
                </TextBlock>
 
23
        
 
24
 
 
25
                <Rectangle Canvas.Top="100" Canvas.Left="0"   Width="90" Height="50" Stroke="Red" />
 
26
                <TextBlock x:Name="testcase1" Canvas.Top="100" Canvas.Left="0" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
 
27
                ABRA CADA BRA
 
28
                </TextBlock>
 
29
 
 
30
                <Rectangle Canvas.Top="100" Canvas.Left="200" Width="90" Height="50" Stroke="Red" />
 
31
                <TextBlock x:Name="testcase2" Canvas.Top="100" Canvas.Left="200" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
 
32
                ABRA CADA BRA
 
33
                </TextBlock>
 
34
 
 
35
                <Rectangle Canvas.Top="100" Canvas.Left="400" Width="90" Height="50" Stroke="Red" />
 
36
                <TextBlock x:Name="testcase3" Canvas.Top="100" Canvas.Left="400" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
 
37
                ABRA CADA BRA
 
38
                </TextBlock>
 
39
 
 
40
 
 
41
                <Rectangle Canvas.Top="200" Canvas.Left="0"   Width="90" Height="50" Stroke="Red" />
 
42
                <TextBlock x:Name="testcase4" Canvas.Top="200" Canvas.Left="0" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
 
43
                ABRA CADA BRA
 
44
                </TextBlock>
 
45
 
 
46
                <Rectangle Canvas.Top="200" Canvas.Left="200" Width="90" Height="50" Stroke="Red" />
 
47
                <TextBlock x:Name="testcase5" Canvas.Top="200" Canvas.Left="200" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
 
48
                ABRA CADA BRA
 
49
                </TextBlock>
 
50
 
 
51
                <Rectangle Canvas.Top="200" Canvas.Left="400" Width="90" Height="50" Stroke="Red" />
 
52
                <TextBlock x:Name="testcase6" Canvas.Top="200" Canvas.Left="400" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
 
53
                ABRA CADA BRA
 
54
                </TextBlock>
 
55
        </Canvas>
 
56
      </script>
 
57
 
 
58
      <script language="javascript">
 
59
function onLoaded (sender, args)
 
60
{
 
61
        sender.findName ("testcase1").Visibility = 0;
 
62
        sender.findName ("testcase2").Visibility = 1;
 
63
        sender.findName ("testcase3").Visibility = -1;
 
64
        sender.findName ("testcase4").Visibility = 1000;
 
65
        sender.findName ("testcase5").Visibility = "vIsIbLe";
 
66
        sender.findName ("testcase6").Visibility = "cOlLaPsEd";
 
67
 
 
68
        // Silverlight shows an Alert
 
69
        // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: Visibility
 
70
/*
 
71
        sender.findName ("testcase5").Visibility = "nOnE";
 
72
        sender.findName ("testcase3").Visibility = sender.findName ("testcase2");
 
73
        sender.findName ("testcase3").Visibility = null;
 
74
        sender.findName ("testcase3").Visibility = true;
 
75
*/
 
76
}
 
77
      </script>
 
78
  </head>
 
79
 
 
80
  <body>
 
81
  <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
 
82
 
 
83
  <script type="text/javascript">
 
84
        var pe = document.getElementById("SilverlightPluginHost");
 
85
        Silverlight.createObject("#xaml", pe, "AgControl1", {
 
86
                        width:'600px',
 
87
                        height:'300px',
 
88
                        inplaceInstallPrompt:false,
 
89
                        background:'#FFFFFF',
 
90
                        isWindowless:'false',
 
91
                        framerate:'24',
 
92
                        version:'1.0'
 
93
                }, {
 
94
                        onError:null,
 
95
                        onLoad:null
 
96
                },
 
97
                null);
 
98
  </script>
 
99
  <div style="position:absolute; top:400px; left:50px">
 
100
<p>0,0: "ABRA C" inside rectangle, "ADA" outside
 
101
<br>1,0: "ABRA C" inside rectangle, "ADA" outside
 
102
<br>2,0: Empty rectangle
 
103
<p>0,1: "ABRA C" inside rectangle, "ADA" outside
 
104
<br>1,1: Empty rectangle
 
105
<br>2,1: Empty rectangle
 
106
<p>0,2: Empty rectangle
 
107
<br>1,2: "ABRA C" inside rectangle, "ADA" outside
 
108
<br>2,2: Empty rectangle
 
109
  </div>
 
110
  </body>
 
111
</html>