{
private Interop.Elementary.BoxLayoutCallback _layoutCallback;
- public Box(EvasObject parent) : base(parent) { }
+ public Box(EvasObject parent) : base(parent)
+ {
+ }
+
public bool IsHorizontal
{
get
{
- return Interop.Elementary.elm_box_horizontal_get(Handle);
+ return Interop.Elementary.elm_box_horizontal_get(GetRealHandle(Handle));
}
set
{
- Interop.Elementary.elm_box_horizontal_set(Handle, value);
+ Interop.Elementary.elm_box_horizontal_set(GetRealHandle(Handle), value);
}
}
public void PackEnd(EvasObject content)
{
- Interop.Elementary.elm_box_pack_end(Handle, content);
+ Interop.Elementary.elm_box_pack_end(GetRealHandle(Handle), content);
AddChild(content);
}
public void PackStart(EvasObject content)
{
- Interop.Elementary.elm_box_pack_start(Handle, content);
+ Interop.Elementary.elm_box_pack_start(GetRealHandle(Handle), content);
AddChild(content);
}
public void PackAfter(EvasObject content, EvasObject after)
{
- Interop.Elementary.elm_box_pack_after(Handle, content, after);
+ Interop.Elementary.elm_box_pack_after(GetRealHandle(Handle), content, after);
AddChild(content);
}
public void UnPack(EvasObject content)
{
- Interop.Elementary.elm_box_unpack(Handle, content);
+ Interop.Elementary.elm_box_unpack(GetRealHandle(Handle), content);
RemoveChild(content);
}
public void UnPackAll()
{
- Interop.Elementary.elm_box_unpack_all(Handle);
+ Interop.Elementary.elm_box_unpack_all(GetRealHandle(Handle));
ClearChildren();
}
{
action();
};
- Interop.Elementary.elm_box_layout_set(Handle, _layoutCallback, IntPtr.Zero, null);
+ Interop.Elementary.elm_box_layout_set(GetRealHandle(Handle), _layoutCallback, IntPtr.Zero, null);
}
protected override IntPtr CreateHandle(EvasObject parent)
{
- return Interop.Elementary.elm_box_add(parent);
+ IntPtr handle = Interop.Elementary.elm_layout_add(parent);
+ Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
+
+ IntPtr realHandle = Interop.Elementary.elm_box_add(handle);
+ Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", realHandle);
+
+ return handle;
}
}
}
{
}
+ protected virtual IntPtr GetRealHandle(IntPtr handle)
+ {
+ return Interop.Elementary.elm_object_part_content_get(handle, "elm.swallow.content");
+ }
+
internal void AddChild(EvasObject obj)
{
_children.Add(obj);
color_classes {
/*
+ * Layout
+ */
+ color_class {
+ name: "layout/background/bg";
+ color: 0 0 0 0;
+ }
+ /*
* Colorselector
*/
color_class {
#include "widgets/entry.edc"
#include "widgets/label.edc"
#include "widgets/radio.edc"
+#include "widgets/layout.edc"
}
--- /dev/null
+/*
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+group { "elm/layout/background/default";
+ parts {
+ rect { "bg";
+ scale;
+ desc { "default";
+ color_class: "layout/background/bg";
+ }
+ }
+ swallow { "elm.swallow.content";
+ scale;
+ desc { "default"; }
+ }
+ }
+}
public override string TestName => "BoxTest1";
public override string TestDescription => "To test basic operation of Box";
+ Box box;
+
public override void Run(Window window)
{
Conformant conformant = new Conformant(window);
conformant.Show();
- Box box = new Box(window);
+ box = new Box(window);
+ box.BackgroundColor = Color.Orange;
conformant.SetContent(box);
box.Show();
AlignmentX = -1,
AlignmentY = -1,
WeightX = 1,
- WeightY = 1
+ WeightY = 1,
+ BackgroundColor = new Color(50,100,200,75)
};
Button button3 = new Button(window) {
Text = "Button 3",
AlignmentX = -1,
AlignmentY = -1,
WeightX = 1,
- WeightY = 1
+ WeightY = 1,
+ BackgroundColor = Color.Olive
};
box.PackEnd(button1);
private void Button1_Clicked(object sender, EventArgs e)
{
- Console.WriteLine("{0} Clicked!", ((Button)sender).Text);
+ Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Box's BG Color : {2}", ((Button)sender).Text, ((Button)sender).BackgroundColor, box.BackgroundColor);
}
}
}