topLabel.HorizontalAlignment = HorizontalAlignment.Begin;
topLabel.VerticalAlignment = VerticalAlignment.Center;
topLabel.PointSize = 42.0f;
- _window.GetDefaultLayer().Add(topLabel);
+ _window.Add(topLabel);
//StyleManager.Get().ApplyStyle(topLabel, _resPath + "/json/control-dashboard-theme.json", "TextFieldFontSize4");
topLabel.SetStyleName("TextFieldFontSize4");
_contentContainer.SetRelativeHeight(4, 0.07f);
_contentContainer.SetRelativeHeight(5, 0.26f);
_contentContainer.Focusable = (true);
- _window.GetDefaultLayer().Add(_contentContainer);
+ _window.Add(_contentContainer);
CreateContent();
button.Clicked += (obj, ee) =>
{
- _window.GetDefaultLayer().Add(_popup);
+ _window.Add(_popup);
_popup.SetDisplayState(Popup.DisplayStateType.Shown);
FocusManager.Instance.SetCurrentFocusView(View.DownCast((_popup.FindChildByName("Footer")).FindChildByName("OKButton")));
return true;
text.MultiLine = true;
text.HorizontalAlignment = HorizontalAlignment.Center;
toast.SetTitle(text);
- _window.GetDefaultLayer().Add(toast);
+ _window.Add(toast);
toast.SetDisplayState(Popup.DisplayStateType.Shown);
}
}
container.WidthResizePolicy = ResizePolicyType.FillToParent;
container.HeightResizePolicy = ResizePolicyType.FillToParent;
- window.GetDefaultLayer().Add(container);
+ window.Add(container);
Random random = new Random();
window.BackgroundColor = Color.White;
Size windowSize = new Size(window.Size.Width, window.Size.Height, 0.0f);
Tizen.Log.Debug("NUI", "Window size: " + windowSize.Width + ", " + windowSize.Height);
- window.GetDefaultLayer().Add(view);
+ window.Add(view);
TextLabel text = new TextLabel("Hello Mono World");
text.ParentOrigin = ParentOrigin.Center;
text.PivotPoint = PivotPoint.Center;
text.HorizontalAlignment = HorizontalAlignment.Center;
- window.GetDefaultLayer().Add(text);
+ window.Add(text);
Tizen.Log.Debug("NUI", "Text label text: " + text.Text );
downView = new View();
downView.Name = "downView";
- Window.Instance.GetDefaultLayer().Add(leftView);
- Window.Instance.GetDefaultLayer().Add(rightView);
- Window.Instance.GetDefaultLayer().Add(upView);
- Window.Instance.GetDefaultLayer().Add(downView);
+ Window.Instance.Add(leftView);
+ Window.Instance.Add(rightView);
+ Window.Instance.Add(upView);
+ Window.Instance.Add(downView);
view.LeftFocusableView = leftView;
tmpView = view.LeftFocusableView;
Tizen.Log.Debug("NUI", "Failed: RightFocusedView = " + tmpView.Name);
}
- Window.Instance.GetDefaultLayer().Add(view);
+ Window.Instance.Add(view);
view.UpFocusableView = upView;
tmpView = view.UpFocusableView;
Tizen.Log.Debug("NUI", "Failed: DownFocusedView = " + tmpView.Name);
}
- Window.Instance.GetDefaultLayer().Remove(leftView);
+ Window.Instance.Remove(leftView);
tmpView = view.LeftFocusableView;
if (!tmpView)
{
label.ParentOrigin = ParentOrigin.TopLeft;
label.PivotPoint = PivotPoint.TopLeft;
label.Position = new Position(0.0f, 50.0f, 0.0f);
- Window.Instance.GetDefaultLayer().Add(label);
+ Window.Instance.Add(label);
label.VisibilityChanged += (sender, e) =>
{
if (e.Visibility)
button.LabelText = "Change Visibility";
button.ParentOrigin = ParentOrigin.TopLeft;
button.PivotPoint = PivotPoint.TopLeft;
- Window.Instance.GetDefaultLayer().Add(button);
+ Window.Instance.Add(button);
button.Clicked += (sender, e) =>
{
if (label.Visible)
{
Tizen.Log.Debug("NUI", "Resource is ready!");
};
- Window.Instance.GetDefaultLayer().Add(image);
+ Window.Instance.Add(image);
}
public void WindowDevelPropertyTest()
background = spin.Background;
Color backgroundColor = new Color();
- background.Find(ColorVisualProperty.MixColor).Get(backgroundColor);
+ background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
if( backgroundColor == Color.Red )
{
Tizen.Log.Debug("NUI", "Custom View Background property : test passed");
{
View container = new View();
container.Position = new Position(-800.0f, -800.0f, 0.0f);
- Window.Instance.GetDefaultLayer().Add(container);
+ Window.Instance.Add(container);
Tizen.Log.Debug("NUI", "winow layer count is "+Window.Instance.GetLayerCount());
Tizen.Log.Debug("NUI", "winow default layer child at 0 is "+Window.Instance.GetDefaultLayer().GetChildAt(0));
// Test downcast for native control
View actorTree = View.DownCast( handle );
- window.GetDefaultLayer().Add( actorTree );
+ window.Add( actorTree );
View year = actorTree.FindChildByName("Year");
View month = actorTree.FindChildByName("Month" );
_container.Size = new Vector3(480.0f, 150.0f, 0.0f);
_container.Position2D = new Position2D(400, 400);
- window.GetDefaultLayer().Add(_container);
+ window.Add(_container);
// Create a Spin control for year
_spinYear = new Spin();
_textField.Text = "imf manager test!";
_textField.BackgroundColor = Color.Blue;
_textField.TextColor = Color.White;
- window.GetDefaultLayer().Add(_textField);
+ window.Add(_textField);
keyboardFocusManager.SetCurrentFocusView(_textField);
_pushButton.Size2D = new Size2D(900, 100);
_pushButton.LabelText = "imf activate";
_pushButton.Clicked += _pushButton_Clicked;
- window.GetDefaultLayer().Add(_pushButton);
+ window.Add(_pushButton);
}
private bool _pushButton_Clicked(object source, EventArgs e)
container.FlexWrap = FlexContainer.WrapType.Wrap;
container.FlexDirection = FlexContainer.FlexDirectionType.Column;
- Window.Instance.GetDefaultLayer().Add(container);
+ Window.Instance.Add(container);
numOfSamples = samples.GetLength(0);
Tizen.Log.Debug("NUI", "NUM = " + numOfSamples);
pushButton2.LabelText = "Remove Handler" + _cnt;
return true;
};
- Window.Instance.GetDefaultLayer().Add(pushButton1);
+ Window.Instance.Add(pushButton1);
pushButton2 = new PushButton();
pushButton2.MinimumSize = new Size2D(400, 200);
pushButton2.LabelText = "Remove Handler" + _cnt;
return true;
};
- Window.Instance.GetDefaultLayer().Add(pushButton2);
+ Window.Instance.Add(pushButton2);
//added
_ani = new Animation(2000);
_text.HorizontalAlignment = HorizontalAlignment.Center;
_text.PointSize = 32.0f;
- _window.GetDefaultLayer().Add(_text);
+ _window.Add(_text);
}
// Callback for _animation finished signal handling
TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f");
pixelLabel.Position2D = new Position2D(10, 10);
pixelLabel.PixelSize = 32.0f;
- window.GetDefaultLayer().Add(pixelLabel);
+ window.Add(pixelLabel);
TextLabel pointLabel = new TextLabel("Test Point Size 32.0f");
pointLabel.Position2D = new Position2D(10, 100);
pointLabel.PointSize = 32.0f;
- window.GetDefaultLayer().Add(pointLabel);
+ window.Add(pointLabel);
TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled.");
ellipsis.Size2D = new Size2D(100, 100);
ellipsis.Position2D = new Position2D(10, 250);
ellipsis.PointSize = 20.0f;
ellipsis.Ellipsis = true;
- window.GetDefaultLayer().Add(ellipsis);
+ window.Add(ellipsis);
TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop.");
autoScrollStopMode.Size2D = new Size2D(400, 100);
autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop;
//autoScrollStopMode.AutoScrollLoopDelay = 10.0f;
autoScrollStopMode.EnableAutoScroll = true;
- window.GetDefaultLayer().Add(autoScrollStopMode);
+ window.Add(autoScrollStopMode);
_text = new TextLabel("Hello NUI World");
_text.ParentOrigin = ParentOrigin.Center;
_text.HorizontalAlignment = HorizontalAlignment.Center;
_text.PointSize = 32.0f;
_text.TextColor = Color.Magenta;
- window.GetDefaultLayer().Add(_text);
+ window.Add(_text);
_view = new View();
_view.Size = new Size(100, 100, 100);
_text1.Size2D = new Size2D(200, 100);
_text1.PointSize = 10.0f;
_text1.BackgroundColor = Color.Blue;
- _window.GetDefaultLayer().Add(_text1);
+ _window.Add(_text1);
_text2 = new TextLabel("PositionNotUsesAnchorPoint");
_text2.ParentOrigin = ParentOrigin.Center;
_text2.Size2D = new Size2D(200, 100);
_text2.PointSize = 10.0f;
_text2.BackgroundColor = Color.Red;
- _window.GetDefaultLayer().Add(_text2);
+ _window.Add(_text2);
}
_imageView.PivotPoint = PivotPoint.Center;
_imageView.PixelArea = new RelativeVector4(0.0f, 0.0f, 0.0f, 0.0f);
- _window.GetDefaultLayer().Add(_imageView);
+ _window.Add(_imageView);
}
// Callback for window touched signal handling
_scrollView.Size = new Size(windowSize.Width, windowSize.Height, 0.0f);
_scrollView.ParentOrigin = ParentOrigin.Center;
_scrollView.PivotPoint = PivotPoint.Center;
- window.GetDefaultLayer().Add(_scrollView);
+ window.Add(_scrollView);
// Add actors to a scroll view with 3 pages
int pageRows = 1;
_view.PivotPoint = PivotPoint.TopLeft;
_view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
- _window.GetDefaultLayer().Add(_view);
+ _window.Add(_view);
}
}
_view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
_view.SiblingOrder = i;
- _window.GetDefaultLayer().Add(_view);
+ _window.Add(_view);
}
}
_view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
_view.SiblingOrder = 10-i;
- _window.GetDefaultLayer().Add(_view);
+ _window.Add(_view);
}
}
_view.SiblingOrder = i-5;
}
- _window.GetDefaultLayer().Add(_view);
+ _window.Add(_view);
}
}
_view.SiblingOrder = 10-i;
}
- _window.GetDefaultLayer().Add(_view);
+ _window.Add(_view);
}
}
for (int i = 0; i < 10; i++)
{
- _window.GetDefaultLayer().Add(list_view[i]);
+ _window.Add(list_view[i]);
Tizen.Log.Debug("NUI", list_view[i].Name + "'s sibling order=" + list_view[i].SiblingOrder);
}
_txt.Text = "on top: sibling#, sibling order=?";
_txt.Position2D = _myPos + new Position2D(-50, 200);
_txt.TextColor = Color.Blue;
- _window.GetDefaultLayer().Add(_txt);
+ _window.Add(_txt);
}
_visualTest.Size2D = new Size2D(600, 200);
_visualTest.Position2D = new Position2D(50, 400);
_visualTest.BackgroundColor = Color.Yellow;
- _window.GetDefaultLayer().Add(_visualTest);
+ _window.Add(_visualTest);
}
catch (Exception e)
{
view.PivotPoint = PivotPoint.TopLeft;
view.MinimumSize = new Size2D(100, 100);
view.BackgroundColor = Color.Red;
- _window.GetDefaultLayer().Add(view);
+ _window.Add(view);
Position position0 = new Position(200.0f, 200.0f, 0.0f);
Position position1 = new Position(300.0f, 300.0f, 0.0f);
/*
-* Copyright (c) 2016 Samsung Electronics Co., Ltd.
+* Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
pixelLabel.Position2D = new Position2D(10, 10);
pixelLabel.PixelSize = 32.0f;
pixelLabel.BackgroundColor = Color.Magenta;
- window.GetDefaultLayer().Add(pixelLabel);
+ window.Add(pixelLabel);
TextLabel pointLabel = new TextLabel("Test Point Size 32.0f");
pointLabel.Position2D = new Position2D(10, 100);
pointLabel.PointSize = 32.0f;
pointLabel.BackgroundColor = Color.Red;
- window.GetDefaultLayer().Add(pointLabel);
+ window.Add(pointLabel);
TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled.");
ellipsis.Size2D = new Size2D(100, 80);
ellipsis.PointSize = 20.0f;
ellipsis.Ellipsis = true;
ellipsis.BackgroundColor = Color.Cyan;
- window.GetDefaultLayer().Add(ellipsis);
+ window.Add(ellipsis);
TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop.");
autoScrollStopMode.Size2D = new Size2D(400, 50);
autoScrollStopMode.BackgroundColor = Color.Green;
autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop;
autoScrollStopMode.EnableAutoScroll = true;
- window.GetDefaultLayer().Add(autoScrollStopMode);
+ window.Add(autoScrollStopMode);
TextField field = new TextField();
field.Size2D = new Size2D(400, 100);
hiddenMap.Add(HiddenInputProperty.SubstituteCount, new PropertyValue(4));
hiddenMap.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x23));
field.HiddenInputSettings = hiddenMap;
- window.GetDefaultLayer().Add(field);
+ window.Add(field);
}
[STAThread]
_text.PivotPoint = PivotPoint.BottomCenter;
_text.HorizontalAlignment = HorizontalAlignment.Center;
_text.PointSize = 32.0f;
- window.GetDefaultLayer().Add(_text);
+ window.Add(_text);
_view1 = new View();
_view1.Size = new Vector3(200.0f, 200.0f, 0.0f);
_view1.WidthResizePolicy = ResizePolicyType.Fixed;
_view1.HeightResizePolicy = ResizePolicyType.Fixed;
_view1.AddedToWindow += OnWindow;
- window.GetDefaultLayer().Add(_view1);
+ window.Add(_view1);
_view2 = new View();
_view2.BackgroundColor = Color.Red;
view[i].Position = new Position(300 + i * 300, 300, 0);
view[i].Name = "MyView" + i;
view[i].Focusable = true;
- Window.Instance.GetDefaultLayer().Add(view[i]);
+ Window.Instance.Add(view[i]);
view[i].FocusGained += FocusNavigationSample_FocusGained;
view[i].FocusLost += FocusNavigationSample_FocusLost;
view[i].Key += FocusNavigationSample_KeyEvent;
titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f));
titleLayout.SetCellPadding(new Size2D(10, 10));
titleLayout.BackgroundColor = Color.Cyan;
- window.GetDefaultLayer().Add(titleLayout);
+ window.Add(titleLayout);
_title = new TextLabel("Visual Transition / SVG / AGIF Example");
_title.Name = ("Title");
titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f));
titleLayout.SetCellPadding(new Size2D(10, 10));
titleLayout.BackgroundColor = Color.Cyan;
- window.GetDefaultLayer().Add(titleLayout);
+ window.Add(titleLayout);
_title = new TextLabel("Visual Transition Example");
_title.Name = ("Title");
titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f));
titleLayout.SetCellPadding(new Size2D(10, 10));
titleLayout.BackgroundColor = Color.Cyan;
- window.GetDefaultLayer().Add(titleLayout);
+ window.Add(titleLayout);
_title = new TextLabel("Visual Transition Example");
_title.Name = ("Title");
colorVisualMap1.Color = Color.Green;
_visualView.Background = colorVisualMap1.OutputVisualMap;
- window.GetDefaultLayer().Add(_visualView);
+ window.Add(_visualView);
/* image visual 1. */
imageVisualMap1 = new ImageVisual();
view[i].Position = new Position(400 + i * 800, 600, 0);
view[i].Focusable = true;
view[i].Name = "MyView" + i;
- Window.Instance.GetDefaultLayer().Add(view[i]);
+ Window.Instance.Add(view[i]);
view[i].FocusGained += VisualSample_FocusGained;
view[i].FocusLost += VisualSample_FocusLost;
view[i].Key += VisualSample_KeyEvent;
guide.Text = "Left/Right - Move focus\n" +
"Up/Down - Change Text\n" +
"Enter - Change BG image\n";
- Window.Instance.GetDefaultLayer().Add(guide);
+ Window.Instance.Add(guide);
Window.Instance.KeyEvent += Instance_Key;
FocusManager.Instance.SetCurrentFocusView(view[0]);
colorVisualMap1.Color = Color.Green;
_visualView.Background = colorVisualMap1.OutputVisualMap;
- window.GetDefaultLayer().Add(_visualView);
+ window.Add(_visualView);
/* image visual 1. No transform setting case. */
imageVisualMap1 = new ImageVisual();
contentLayout.SetCellPadding(new Size2D(0, 5));
contentLayout.BackgroundColor = Color.Red;//new Color(0.949f, 0.949f, 0.949f, 1.0f);
- window.GetDefaultLayer().Add(contentLayout);
+ window.Add(contentLayout);
_title = new TextLabel("Visuals Example");
_title.Name = "Title";
contentLayout.SetCellPadding(new Size2D(5, 5));
contentLayout.BackgroundColor = new Color(0.949f, 0.949f, 0.949f, 1.0f);
- window.GetDefaultLayer().Add(contentLayout);
+ window.Add(contentLayout);
TextLabel title = new TextLabel("Contacts List with Visuals");
title.Name = "Title";
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal void Add(View view)
+ public void Add(View view)
{
NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal void Remove(View view)
+ public void Remove(View view)
{
NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();