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

« back to all changes in this revision

Viewing changes to test/xaml/enums/textdecorations-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>TextDecorations (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
 
 
10
                <TextBlock Canvas.Top="0" Canvas.Left="0"   Foreground="Black" FontFamily="Arial" FontSize="24" Text="No value" />
 
11
                <TextBlock Canvas.Top="0" Canvas.Left="150" Foreground="Black" FontFamily="Arial" FontSize="24" TextDecorations="None" Text="None" />
 
12
                <TextBlock Canvas.Top="0" Canvas.Left="300" Foreground="Black" FontFamily="Arial" FontSize="24" TextDecorations="Underline" Text="Underline" />
 
13
 
 
14
                <TextBlock x:Name="testcase1" Canvas.Top="50" Canvas.Left="0"   Foreground="Black" FontFamily="Arial" FontSize="24" Text="testcase1 " />
 
15
                <TextBlock x:Name="testcase2" Canvas.Top="50" Canvas.Left="150" Foreground="Black" FontFamily="Arial" FontSize="24" Text=" testcase2 " />
 
16
                <TextBlock x:Name="testcase3" Canvas.Top="50" Canvas.Left="300" Foreground="Black" FontFamily="Arial" FontSize="24" Text=" testcase3" />
 
17
 
 
18
                <TextBlock x:Name="testcase4" Canvas.Top="100" Canvas.Left="0"   Foreground="Black" FontFamily="Arial" FontSize="24" Text="testcase4 " />
 
19
                <TextBlock x:Name="testcase5" Canvas.Top="100" Canvas.Left="150" Foreground="Black" FontFamily="Arial" FontSize="24" Text=" testcase5 " />
 
20
                <TextBlock x:Name="testcase6" Canvas.Top="100" Canvas.Left="300" Foreground="Black" FontFamily="Arial" FontSize="24" Text=" testcase6" />
 
21
 
 
22
                <TextBlock x:Name="testcase7"  Canvas.Top="150" Canvas.Left="0"   Foreground="Black" FontFamily="Arial" FontSize="24" Text="-5" />
 
23
                <TextBlock x:Name="testcase8"  Canvas.Top="150" Canvas.Left="30"  Foreground="Black" FontFamily="Arial" FontSize="24" Text="-4" />
 
24
                <TextBlock x:Name="testcase9"  Canvas.Top="150" Canvas.Left="60"  Foreground="Black" FontFamily="Arial" FontSize="24" Text="-3" />
 
25
                <TextBlock x:Name="testcase10" Canvas.Top="150" Canvas.Left="90"  Foreground="Black" FontFamily="Arial" FontSize="24" Text="-2" />
 
26
                <TextBlock x:Name="testcase11" Canvas.Top="150" Canvas.Left="120" Foreground="Black" FontFamily="Arial" FontSize="24" Text="-1" />
 
27
                <TextBlock x:Name="testcase12" Canvas.Top="150" Canvas.Left="150" Foreground="Black" FontFamily="Arial" FontSize="24" Text="0" />
 
28
                <TextBlock x:Name="testcase13" Canvas.Top="150" Canvas.Left="180" Foreground="Black" FontFamily="Arial" FontSize="24" Text="1" />
 
29
                <TextBlock x:Name="testcase14" Canvas.Top="150" Canvas.Left="210" Foreground="Black" FontFamily="Arial" FontSize="24" Text="2" />
 
30
                <TextBlock x:Name="testcase15" Canvas.Top="150" Canvas.Left="240" Foreground="Black" FontFamily="Arial" FontSize="24" Text="3" />
 
31
                <TextBlock x:Name="testcase16" Canvas.Top="150" Canvas.Left="270" Foreground="Black" FontFamily="Arial" FontSize="24" Text="4" />
 
32
                <TextBlock x:Name="testcase17" Canvas.Top="150" Canvas.Left="300" Foreground="Black" FontFamily="Arial" FontSize="24" Text="5" />
 
33
        </Canvas>
 
34
      </script>
 
35
 
 
36
      <script language="javascript">
 
37
function onLoaded (sender, args)
 
38
{
 
39
        sender.findName ("testcase1").TextDecorations = -1001;
 
40
        sender.findName ("testcase2").TextDecorations = 0;
 
41
        sender.findName ("testcase3").TextDecorations = 1;
 
42
        sender.findName ("testcase4").TextDecorations = 1000;
 
43
 
 
44
        sender.findName ("testcase5").TextDecorations = "nOnE";
 
45
        sender.findName ("testcase6").TextDecorations = "uNdErLiNe";
 
46
 
 
47
        sender.findName ("testcase7").TextDecorations = -5;
 
48
        sender.findName ("testcase8").TextDecorations = -4;
 
49
        sender.findName ("testcase9").TextDecorations = -3;
 
50
        sender.findName ("testcase10").TextDecorations = -2;
 
51
        sender.findName ("testcase11").TextDecorations = -1;
 
52
        sender.findName ("testcase12").TextDecorations = 0;
 
53
        sender.findName ("testcase13").TextDecorations = 1;
 
54
        sender.findName ("testcase14").TextDecorations = 2;
 
55
        sender.findName ("testcase15").TextDecorations = 3;
 
56
        sender.findName ("testcase16").TextDecorations = 4;
 
57
        sender.findName ("testcase17").TextDecorations = 5;
 
58
 
 
59
        // Silverlight shows an Alert
 
60
        // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: TextDecorations
 
61
/*
 
62
        sender.findName ("testcase3").TextDecorations = sender.findName ("testcase2");
 
63
        sender.findName ("testcase3").TextDecorations = null;
 
64
        sender.findName ("testcase3").TextDecorations = true;
 
65
*/
 
66
}
 
67
      </script>
 
68
  </head>
 
69
 
 
70
  <body>
 
71
  <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
 
72
 
 
73
  <script type="text/javascript">
 
74
        var pe = document.getElementById("SilverlightPluginHost");
 
75
        Silverlight.createObject("#xaml", pe, "AgControl1", {
 
76
                        width:'600px',
 
77
                        height:'300px',
 
78
                        inplaceInstallPrompt:false,
 
79
                        background:'#FFFFFF',
 
80
                        isWindowless:'false',
 
81
                        framerate:'24',
 
82
                        version:'1.0'
 
83
                }, {
 
84
                        onError:null,
 
85
                        onLoad:null
 
86
                },
 
87
                null);
 
88
  </script>
 
89
  <div style="position:absolute; top:400px; left:50px">
 
90
<p>Line 1: Only underline is underlined.
 
91
<p>Line 2: testcase1 and testcase3 are underlined
 
92
<p>Line 3: Only testcase6 is underlined.
 
93
<p>Line 4: Odd numbers are underlined, Even numbers are not.
 
94
  </div>
 
95
  </body>
 
96
</html>