From: Seunghyun Choi Date: Wed, 24 May 2017 02:30:05 +0000 (+0900) Subject: Enhance Box Widget X-Git-Tag: submit/trunk/20170823.075128~110^2~66^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dab10404bde9f24dcb830b2ffdeff8fc9539092c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Enhance Box Widget Change-Id: Ib15fc5dfc430e50bc88caf7a0e1af9dd98c909fe Signed-off-by: Seunghyun Choi --- diff --git a/src/ElmSharp/ElmSharp/Box.cs b/src/ElmSharp/ElmSharp/Box.cs old mode 100755 new mode 100644 index d66a80c..3436c64 --- a/src/ElmSharp/ElmSharp/Box.cs +++ b/src/ElmSharp/ElmSharp/Box.cs @@ -49,6 +49,21 @@ namespace ElmSharp } /// + /// Sets or gets whether the box to arrange its children homogeneously. + /// + public bool IsHomogeneous + { + get + { + return Interop.Elementary.elm_box_homogeneous_get(RealHandle); + } + set + { + Interop.Elementary.elm_box_homogeneous_set(RealHandle, value); + } + } + + /// /// Adds an object at the end of the pack list. /// /// @@ -97,6 +112,22 @@ namespace ElmSharp } /// + /// Adds an "content "object to the Box before the "before" object. + /// + /// + /// 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. + /// + /// The object will be added in Box + /// The object has been added in Box + public void PackBefore(EvasObject content, EvasObject before) + { + Interop.Elementary.elm_box_pack_before(RealHandle, content, before); + AddChild(content); + } + + /// /// Remove the "content" oject from Box without deleting it. /// /// The object to unpack @@ -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); } + /// + /// 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. + /// + public void Recalculate() + { + Interop.Elementary.elm_box_recalculate(RealHandle); + } + + /// + /// Clear the box of all children. + /// Remove all the elements contained by the box, deleting the respective objects. + /// + public void Clear() + { + Interop.Elementary.elm_box_clear(RealHandle); + ClearChildren(); + } + + /// + /// Sets or gets the alignment of the whole bounding box of contents. + /// + /// Horizontal alignment + /// Vertical alignment + public void SetBoxAlignment(double horizontal, double vertical) + { + Interop.Elementary.elm_box_align_set(RealHandle, horizontal, vertical); + } + + /// + /// Sets or gets the space(padding) between the box's elements. + /// + /// Horizontal padding + /// vertical padding + 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/src/ElmSharp/ElmSharp/Container.cs b/src/ElmSharp/ElmSharp/Container.cs old mode 100755 new mode 100644 index aa73ba2..f9e87c1 --- a/src/ElmSharp/ElmSharp/Container.cs +++ b/src/ElmSharp/ElmSharp/Container.cs @@ -78,4 +78,4 @@ namespace ElmSharp _children.Remove((EvasObject)sender); } } -} +} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Box.cs b/src/ElmSharp/Interop/Interop.Elementary.Box.cs index 5a5700a..cb104a6 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.Box.cs +++ b/src/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