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

« back to all changes in this revision

Viewing changes to test/xaml/enums/fontweight-inline.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>FontWeight (Inline) 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
                <TextBlock>
 
10
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24">No value</Run>
 
11
                        <LineBreak/>
 
12
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Thin">Thin</Run>
 
13
                        <LineBreak/>
 
14
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="ExtraLight">ExtraLight</Run>
 
15
                        <LineBreak/>
 
16
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Light">Light</Run>
 
17
                        <LineBreak/>
 
18
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Normal">Normal</Run>
 
19
                        <LineBreak/>
 
20
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Medium">Medium</Run>
 
21
                        <LineBreak/>
 
22
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="SemiBold">SemiBold</Run>
 
23
                        <LineBreak/>
 
24
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Bold">Bold</Run>
 
25
                        <LineBreak/>
 
26
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="ExtraBold">ExtraBold</Run>
 
27
                        <LineBreak/>
 
28
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Black">Black</Run>
 
29
                        <LineBreak/>
 
30
                        <Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="ExtraBlack">ExtraBlack</Run>
 
31
                </TextBlock>
 
32
                <TextBlock Canvas.Left="200">
 
33
                        <Run x:Name="testcase1" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 1</Run>
 
34
                        <LineBreak/>
 
35
                        <Run x:Name="testcase2" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 2</Run>
 
36
                        <LineBreak/>
 
37
                        <Run x:Name="testcase3" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 3</Run>
 
38
                        <LineBreak/>
 
39
                        <Run x:Name="testcase4" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 4</Run>
 
40
                        <LineBreak/>
 
41
                        <Run x:Name="testcase5" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 5</Run>
 
42
                        <LineBreak/>
 
43
                        <Run x:Name="testcase6" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 6</Run>
 
44
                        <LineBreak/>
 
45
                        <Run x:Name="testcase7" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 7</Run>
 
46
                        <LineBreak/>
 
47
                        <Run x:Name="testcase8" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 8</Run>
 
48
                        <LineBreak/>
 
49
                        <Run x:Name="testcase9" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 9</Run>
 
50
                        <LineBreak/>
 
51
                        <Run x:Name="testcase10" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 10</Run>
 
52
                        <LineBreak/>
 
53
                        <Run x:Name="testcase11" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 11</Run>
 
54
                </TextBlock>
 
55
        </Canvas>
 
56
      </script>
 
57
 
 
58
      <script language="javascript">
 
59
function onLoaded (sender, args)
 
60
{
 
61
        // invalid values defaults to None (no value is Default)
 
62
        sender.findName ("testcase1").FontWeight = 1024;
 
63
        sender.findName ("testcase2").FontWeight = 0;
 
64
        sender.findName ("testcase3").FontWeight = "eXtrAlIgHt";
 
65
        sender.findName ("testcase4").FontWeight = -475;
 
66
        sender.findName ("testcase5").FontWeight = 32768;
 
67
        sender.findName ("testcase6").FontWeight = 549;
 
68
 
 
69
        sender.findName ("testcase7").FontWeight = 550;
 
70
        sender.findName ("testcase8").FontWeight = -1;
 
71
        sender.findName ("testcase9").FontWeight = 1023;
 
72
        sender.findName ("testcase10").FontWeight = -474;
 
73
        sender.findName ("testcase11").FontWeight = "eXtRaBlaCk";
 
74
 
 
75
        // Silverlight shows an Alert
 
76
        // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: FontWeight
 
77
/*
 
78
        sender.findName ("testcase3").Cursor = sender.findName ("testcase2");
 
79
        sender.findName ("testcase3").Cursor = null;
 
80
        sender.findName ("testcase3").Cursor = true;
 
81
*/
 
82
}
 
83
      </script>
 
84
  </head>
 
85
 
 
86
  <body>
 
87
  <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
 
88
 
 
89
  <script type="text/javascript">
 
90
        var pe = document.getElementById("SilverlightPluginHost");
 
91
        Silverlight.createObject("#xaml", pe, "AgControl1", {
 
92
                        width:'600px',
 
93
                        height:'300px',
 
94
                        inplaceInstallPrompt:false,
 
95
                        background:'#FFFFFF',
 
96
                        isWindowless:'false',
 
97
                        framerate:'24',
 
98
                        version:'1.0'
 
99
                }, {
 
100
                        onError:null,
 
101
                        onLoad:null
 
102
                },
 
103
                null);
 
104
  </script>
 
105
  <div style="position:absolute; top:400px; left:50px">
 
106
<p>First column: "No value" to "Medium" are normal, "SemiBold" to "ExtraBlack" are <b>bold</b>
 
107
<p>Second column: "Test case 1-6" are normal, "Test case 7-11" are <b>bold</b>
 
108
  </div>
 
109
  </body>
 
110
</html>