diff options
author | Seungkeun Lee <sngn.lee@samsung.com> | 2017-06-09 00:37:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-06-09 00:37:33 +0000 |
commit | 49ffe50f7e579acbb5578bdf5bd5c8f3a5970366 (patch) | |
tree | 52937cbab198171cbfb708b671651ca8e8bc5d06 /ElmSharp | |
parent | a477a5840c748f769279adb9fe5dc07c6201a0f9 (diff) | |
parent | 53bad7c6e78039c6290724a6f04d9bec02810593 (diff) | |
download | elm-sharp-49ffe50f7e579acbb5578bdf5bd5c8f3a5970366.tar.gz elm-sharp-49ffe50f7e579acbb5578bdf5bd5c8f3a5970366.tar.bz2 elm-sharp-49ffe50f7e579acbb5578bdf5bd5c8f3a5970366.zip |
Merge "Enhance Box Widget" into tizen
Diffstat (limited to 'ElmSharp')
-rw-r--r--[-rwxr-xr-x] | ElmSharp/ElmSharp/Box.cs | 73 | ||||
-rw-r--r--[-rwxr-xr-x] | ElmSharp/ElmSharp/Container.cs | 2 | ||||
-rw-r--r-- | ElmSharp/Interop/Interop.Elementary.Box.cs | 6 |
3 files changed, 77 insertions, 4 deletions
diff --git a/ElmSharp/ElmSharp/Box.cs b/ElmSharp/ElmSharp/Box.cs index d66a80c..3436c64 100755..100644 --- a/ElmSharp/ElmSharp/Box.cs +++ b/ElmSharp/ElmSharp/Box.cs @@ -49,6 +49,21 @@ namespace ElmSharp } /// <summary> + /// Sets or gets whether the box to arrange its children homogeneously. + /// </summary> + public bool IsHomogeneous + { + get + { + return Interop.Elementary.elm_box_homogeneous_get(RealHandle); + } + set + { + Interop.Elementary.elm_box_homogeneous_set(RealHandle, value); + } + } + + /// <summary> /// Adds an object at the end of the pack list. /// </summary> /// <remarks> @@ -97,6 +112,22 @@ namespace ElmSharp } /// <summary> + /// Adds an "content "object to the Box before the "before" object. + /// </summary> + /// <remarks> + /// This will add the "content" to the Box indicated before the object indicated with "before". + /// If "before" is not already in the Box, results are undefined. + /// before means either to the left of the "before" object or below it depending on orientation. + /// </remarks> + /// <param name="content">The object will be added in Box</param> + /// <param name="before">The object has been added in Box</param> + public void PackBefore(EvasObject content, EvasObject before) + { + Interop.Elementary.elm_box_pack_before(RealHandle, content, before); + AddChild(content); + } + + /// <summary> /// Remove the "content" oject from Box without deleting it. /// </summary> /// <param name="content">The object to unpack</param> @@ -154,6 +185,46 @@ namespace ElmSharp return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); } + /// <summary> + /// Force the box to recalculate its children packing. + /// If any children was added or removed, box will not calculate the values immediately rather leaving it to the next main loop iteration. + /// While this is great as it would save lots of recalculation, whenever you need to get the position of a just added item you must force recalculate before doing so. + /// </summary> + public void Recalculate() + { + Interop.Elementary.elm_box_recalculate(RealHandle); + } + + /// <summary> + /// Clear the box of all children. + /// Remove all the elements contained by the box, deleting the respective objects. + /// </summary> + public void Clear() + { + Interop.Elementary.elm_box_clear(RealHandle); + ClearChildren(); + } + + /// <summary> + /// Sets or gets the alignment of the whole bounding box of contents. + /// </summary> + /// <param name="horizontal">Horizontal alignment</param> + /// <param name="vertical">Vertical alignment</param> + public void SetBoxAlignment(double horizontal, double vertical) + { + Interop.Elementary.elm_box_align_set(RealHandle, horizontal, vertical); + } + + /// <summary> + /// Sets or gets the space(padding) between the box's elements. + /// </summary> + /// <param name="horizontal">Horizontal padding</param> + /// <param name="vertical">vertical padding</param> + public void SetPadding(int horizontal, int vertical) + { + Interop.Elementary.elm_box_padding_set(RealHandle, horizontal, vertical); + } + protected override IntPtr CreateHandle(EvasObject parent) { IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); @@ -165,4 +236,4 @@ namespace ElmSharp return handle; } } -} +}
\ No newline at end of file diff --git a/ElmSharp/ElmSharp/Container.cs b/ElmSharp/ElmSharp/Container.cs index aa73ba2..f9e87c1 100755..100644 --- a/ElmSharp/ElmSharp/Container.cs +++ b/ElmSharp/ElmSharp/Container.cs @@ -78,4 +78,4 @@ namespace ElmSharp _children.Remove((EvasObject)sender); } } -} +}
\ No newline at end of file diff --git a/ElmSharp/Interop/Interop.Elementary.Box.cs b/ElmSharp/Interop/Interop.Elementary.Box.cs index 5a5700a..cb104a6 100644 --- a/ElmSharp/Interop/Interop.Elementary.Box.cs +++ b/ElmSharp/Interop/Interop.Elementary.Box.cs @@ -83,10 +83,12 @@ internal static partial class Interop internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, IntPtr dataFreeCb); [DllImport(Libraries.Elementary)] + internal static extern bool elm_box_homogeneous_get(IntPtr obj); + + [DllImport(Libraries.Elementary)] internal static extern void elm_box_homogeneous_set(IntPtr obj, bool ishomogeneous); [DllImport(Libraries.Elementary)] internal static extern void elm_box_recalculate(IntPtr obj); } -} - +}
\ No newline at end of file |