public void Initialize(object source, NUIApplicationInitEventArgs e)
{
+ NavigationPropertiesTests();
+
OperatorTests();
CustomViewPropertyTest();
Actor actor = new Actor();
actor.Size = new Position(200.0f, 200.0f, 0.0f);
actor.Name = "MyActor";
- actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f);
+
Console.WriteLine("Actor id: {0}", actor.GetId());
Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
Console.WriteLine("Actor name: " + actor.Name);
Console.WriteLine( " *************************" );
- using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
+ using (Rectangle r2 = new Rectangle(2, 5, 20.0f, 30.0f))
{
Console.WriteLine( " Created " + r2 );
r2.Set(1,1,40,40);
}
}
+ public void NavigationPropertiesTests()
+ {
+ View view = new View();
+ View leftView, rightView, upView, downView, tmpView;
+
+ leftView = new View();
+ leftView.Name = "leftView";
+ rightView = new View();
+ rightView.Name = "rightView";
+ upView = new View();
+ upView.Name = "upView";
+ downView = new View();
+ downView.Name = "downView";
+
+ Stage.Instance.Add(leftView);
+ Stage.Instance.Add(rightView);
+ Stage.Instance.Add(upView);
+ Stage.Instance.Add(downView);
+
+ view.LeftFocusableView = leftView;
+ tmpView = view.LeftFocusableView;
+ if (string.Compare(tmpView.Name, "leftView") == 0)
+ {
+ Console.WriteLine("Passed: LeftFocusedView = " + tmpView.Name);
+ }
+ else
+ {
+ Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
+ }
+
+ view.RightFocusableView = rightView;
+ tmpView = view.RightFocusableView;
+ if (string.Compare(tmpView.Name, "rightView") == 0)
+ {
+ Console.WriteLine("Passed: RightFocusedView = " + tmpView.Name);
+ }
+ else
+ {
+ Console.WriteLine("Failed: RightFocusedView = " + tmpView.Name);
+ }
+
+ Stage.Instance.Add(view);
+
+ view.UpFocusableView = upView;
+ tmpView = view.UpFocusableView;
+ if (string.Compare(tmpView.Name, "upView") == 0)
+ {
+ Console.WriteLine("Passed: UpFocusedView = " + tmpView.Name);
+ }
+ else
+ {
+ Console.WriteLine("Failed: UpFocusedView = " + tmpView.Name);
+ }
+
+ view.DownFocusableView = downView;
+ tmpView = view.DownFocusableView;
+ if (string.Compare(tmpView.Name, "downView") == 0)
+ {
+ Console.WriteLine("Passed: DownFocusedView = " + tmpView.Name);
+ }
+ else
+ {
+ Console.WriteLine("Failed: DownFocusedView = " + tmpView.Name);
+ }
+
+ Stage.Instance.Remove(leftView);
+ tmpView = view.LeftFocusableView;
+ if (!tmpView)
+ {
+ Console.WriteLine("Passed: NULL LeftFocusedView");
+ }
+ else
+ {
+ Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
+ }
+ }
+
public void OperatorTests()
{
Actor actor = new Actor();
// Background property
Property.Map background = new Property.Map();
background.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color) )
- .Add( Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red) );
+ .Add( Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red) );
spin.Background = background;
background = spin.Background;
Console.WriteLine ("Custom View BackgroundColor property : test failed");
}
+ // BackgroundImage property
+ spin.BackgroundImage = "background-image.jpg";
+ if(spin.BackgroundImage == "background-image.jpg")
+ {
+ Console.WriteLine ("Custom View BackgroundImage property : test passed");
+ }
+ else
+ {
+ Console.WriteLine ("Custom View BackgroundImage property : test failed");
+ }
+
// StyleName property
spin.StyleName = "MyCustomStyle";
if(spin.StyleName == "MyCustomStyle")