_imageView.AnchorPoint = AnchorPoint.TopLeft;
_imageView.Position = new Position(5.0f, 5.0f, 0.0f);
_imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
+ _imageView.Size = new Size(200.0f, 80.0f, 0.0f);
//_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
layer.Add(_imageView);
_pushButton2.Clicked += OnPushButtonClicked2;
_layer2.Add(_pushButton2);
+ ImageView syncImage = new ImageView();
+ syncImage.ParentOrigin = ParentOrigin.CenterLeft;
+ syncImage.AnchorPoint = AnchorPoint.CenterLeft;
+ syncImage.PositionUsesAnchorPoint = true;
+ syncImage.Size2D = new Size2D(150, 150);
+ syncImage.ResourceUrl = resources+"/images/gallery-3.jpg";
+ syncImage.SynchronosLoading = true;
+ layer.Add(syncImage);
+
PropertyMap _map = new PropertyMap();
_map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
_map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resources+"/images/00_popup_bg.9.png"));
- _map.Add(NpatchImageVisualProperty.Border, new PropertyValue(new Rectangle(100, 100, 100, 100)));
+ _map.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue(true));
ImageView nPatchImage = new ImageView();
nPatchImage.ParentOrigin = ParentOrigin.BottomLeft;
nPatchImage.AnchorPoint = AnchorPoint.BottomLeft;
- nPatchImage.Size = new Size(300.0f, 512.0f, 0.0f);
+ nPatchImage.PositionUsesAnchorPoint = true;
+ nPatchImage.Size = new Size(300.0f, 100.0f, 0.0f);
nPatchImage.ImageMap = _map;
layer.Add(nPatchImage);
+ ImageView syncNineImage = new ImageView();
+ syncNineImage.ParentOrigin = ParentOrigin.CenterLeft;
+ syncNineImage.AnchorPoint = AnchorPoint.CenterLeft;
+ syncNineImage.Position2D = new Position2D(0, 200);
+ syncNineImage.PositionUsesAnchorPoint = true;
+ syncNineImage.Size = new Size(150.0f, 150.0f, 0.0f);
+ syncNineImage.ResourceUrl = resources+"/images/00_popup_bg.9.png";
+ syncNineImage.SynchronosLoading = true;
+ syncNineImage.Border = new Rectangle(0, 0, 0, 0);
+ layer.Add(syncNineImage);
}
public bool OnPushButtonClicked2(object sender, EventArgs e)
{
get
{
- return _borderOnly;
+ return _borderOnly ?? false;
}
set
{
}
}
- private void UpdateImage()
+ public bool SynchronosLoading
{
- if (_border != null && _url != null)
+ get
+ {
+ return _synchronousLoading ?? false;
+ }
+ set
{
- _nPatchMap = new PropertyMap();
- _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
- _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
- _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
- if (_borderOnly) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue(_borderOnly)); }
- SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap));
+ _synchronousLoading = value;
+ UpdateImage();
}
- else
+ }
+
+ private void UpdateImage()
+ {
+ if (_url != null)
{
- if (_url != null) { SetProperty(ImageView.Property.RESOURCE_URL, new PropertyValue(_url)); }
+ if (_border != null)
+ { // for nine-patch image
+ _nPatchMap = new PropertyMap();
+ _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
+ _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
+ _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
+ if (_borderOnly != null) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
+ if (_synchronousLoading != null) _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading));
+ SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap));
+ }
+ else if(_synchronousLoading != null)
+ { // for normal image, with synchronous loading property
+ PropertyMap imageMap = new PropertyMap();
+ imageMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
+ imageMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
+ imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading));
+ SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
+ }
+ else
+ { // just for normal image
+ SetProperty(ImageView.Property.RESOURCE_URL, new PropertyValue(_url));
+ }
}
}
private Rectangle _border = null;
- private bool _borderOnly = false;
- private string _url = null;
private PropertyMap _nPatchMap = null;
+ private bool? _synchronousLoading = null;
+ private bool? _borderOnly = null;
+ private string _url = null;
}
return ret;
}
+ /// <summary>
+ /// Search through this layer's hierarchy for an view with the given unique ID.
+ /// </summary>
+ /// <pre>This layer(the parent) has been initialized.</pre>
+ /// <remarks>The actor itself is also considered in the search.</remarks>
+ /// <param name="child">The id of the child to find</param>
+ /// <returns> A handle to the view if found, or an empty handle if not. </returns>
public View FindChildById(uint id)
{
View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
return ret;
}
+ /// <summary>
+ /// Adds a child view to this layer.
+ /// </summary>
+ /// <pre>This layer(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent layer.</pre>
+ /// <post>The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.</post>
+ /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this layer. This may change child's position, color, scale etc as it now inherits them from this layer.</remarks>
+ /// <param name="child">The child</param>
public void Add(View child)
{
NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Removes a child View from this layer. If the view was not a child of this layer, this is a no-op.
+ /// </summary>
+ /// <pre>This layer(the parent) has been initialized. The child view is not the same as the parent view.</pre>
+ /// <param name="child">The child</param>
public void Remove(View child)
{
NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
}
}
+ /// <summary>
+ /// Gets/Sets the Layer's name.
+ /// </summary>
+ public string Name
+ {
+ get
+ {
+ return GetName();
+ }
+ set
+ {
+ SetName(value);
+ }
+ }
+
+ internal string GetName()
+ {
+ string ret = NDalicPINVOKE.Actor_GetName(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal void SetName(string name)
+ {
+ NDalicPINVOKE.Actor_SetName(swigCPtr, name);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Retrieves the number of children held by the layer.
+ /// </summary>
+ /// <pre>The layer has been initialized.</pre>
+ /// <returns>The number of children</returns>
+ public uint GetChildCount()
+ {
+ uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
}
}
namespace Tizen.NUI
{
- using System;
- using System.Runtime.InteropServices;
- using Tizen.NUI.UIComponents;
using Tizen.NUI.BaseComponents;
/// <summary>
/// or absolute (in world units).<br>
/// Optional.
/// </summary>
- public Vector2 Size
+ public Size2D Size
{
get
{
- return _visualSize ?? (new Vector2(1.0f, 1.0f));
+ return _visualSize ?? (new Size2D(1, 1));
}
set
{
return ret;
}
-
-
- /// <summary>
- /// Creates an initialized handle to a new Window.
- /// </summary>
- /// <param name="windowPosition">The position and size of the Window</param>
- /// <param name="name">The Window title</param>
- /// <param name="isTransparent">Whether Window is transparent</param>
- public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
+ internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
- /// <summary>
- /// Creates an initialized handle to a new Window.
- /// </summary>
- /// <param name="windowPosition">The position and size of the Window</param>
- /// <param name="name">The Window title</param>
- public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
+ internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
- /// <summary>
- /// Creates an initialized handle to a new Window.
- /// </summary>
- /// <param name="windowPosition">The position and size of the Window</param>
- /// <param name="name">The Window title</param>
- /// <param name="className">The Window class name</param>
- /// <param name="isTransparent">Whether Window is transparent</param>
- public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
+ internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
- /// <summary>
- /// Creates an initialized handle to a new Window.
- /// </summary>
- /// <param name="windowPosition">The position and size of the Window</param>
- /// <param name="name">The Window title</param>
- /// <param name="className">The Window class name</param>
- public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
+ internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
+
internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- /// <summary>
- /// This sets whether the indicator bar should be shown or not.
- /// </summary>
- /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
{
NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- /// <summary>
- /// This sets the opacity mode of indicator bar.
- /// </summary>
- /// <param name="opacity">The opacity mode</param>
internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
{
NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- /// <summary>
- /// This sets the orientation of indicator bar.<br>
- /// It does not implicitly show the indicator if it is currently hidden.<br>
- /// </summary>
- /// <param name="orientation">The orientation</param>
internal void RotateIndicator(Window.WindowOrientation orientation)
{
NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+
/// <summary>
/// Grabs the key specified by a key for a window in a GrabMode. <br>
/// Details: This function can be used for following example scenarios: <br>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+
/// <summary>
/// Ungrabs the key specified by a key for a window. <br>
/// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+
internal System.IntPtr GetNativeWindowHandler()
{
System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
return ret;
}
-
-
/// <summary>
/// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
/// </summary>
/// <summary>
/// Window size property (read-only).
/// </summary>
- public Vector2 Size
+ public Size2D Size
{
get
{
- Vector2 ret = GetSize();
+ Size2D ret = GetSize();
return ret;
}
}
/// <summary>
/// Background color property.
/// </summary>
- public Vector4 BackgroundColor
+ public Color BackgroundColor
{
set
{
}
get
{
- Vector4 ret = GetBackgroundColor();
+ Color ret = GetBackgroundColor();
return ret;
}
}