{
}
+ public override Color BackgroundColor
+ {
+ set
+ {
+ if(value.IsDefault)
+ {
+ SetPartColor("bg", Color.Transparent);
+ }
+ else
+ {
+ SetPartColor("bg", value);
+ }
+ _backgroundColor = value;
+ }
+ }
+
protected virtual IntPtr GetRealHandle(IntPtr handle)
{
return Interop.Elementary.elm_object_part_content_get(handle, "elm.swallow.content");
{
get
{
- return Interop.Elementary.elm_table_homogeneous_get(Handle);
+ return Interop.Elementary.elm_table_homogeneous_get(GetRealHandle(Handle));
}
set
{
- Interop.Elementary.elm_table_homogeneous_set(Handle, value);
+ Interop.Elementary.elm_table_homogeneous_set(GetRealHandle(Handle), value);
}
}
set
{
_paddingX = value;
- Interop.Elementary.elm_table_padding_set(Handle, _paddingX, _paddingY);
+ Interop.Elementary.elm_table_padding_set(GetRealHandle(Handle), _paddingX, _paddingY);
}
}
set
{
_paddingY = value;
- Interop.Elementary.elm_table_padding_set(Handle, _paddingX, _paddingY);
+ Interop.Elementary.elm_table_padding_set(GetRealHandle(Handle), _paddingX, _paddingY);
}
}
{
if (obj == null)
throw new ArgumentNullException("obj");
- Interop.Elementary.elm_table_pack(Handle, obj, col, row, colspan, rowspan);
+ Interop.Elementary.elm_table_pack(GetRealHandle(Handle), obj, col, row, colspan, rowspan);
AddChild(obj);
}
{
if (obj == null)
throw new ArgumentNullException("obj");
- Interop.Elementary.elm_table_unpack(Handle, obj);
+ Interop.Elementary.elm_table_unpack(GetRealHandle(Handle), obj);
RemoveChild(obj);
}
public void Clear()
{
- Interop.Elementary.elm_table_clear(Handle, false);
+ Interop.Elementary.elm_table_clear(GetRealHandle(Handle), false);
ClearChildren();
}
protected override IntPtr CreateHandle(EvasObject parent)
{
- return Interop.Elementary.elm_table_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_table_add(handle);
+ Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", realHandle);
+
+ return handle;
}
}
}
<Compile Include="TC\GenListTest3.cs" />
<Compile Include="TC\GenListTest4.cs" />
<Compile Include="TC\GenListTest6.cs" />
+ <Compile Include="TC\TableTest1.cs" />
<Compile Include="TC\PerformanceTest.cs" />
<Compile Include="TC\GenListTest5.cs" />
<Compile Include="TC\IconTest1.cs" />
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class TableTest1 : TestCaseBase
+ {
+ public override string TestName => "TableTest1";
+ public override string TestDescription => "To test basic operation of Table";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Table table = new Table(window) {
+ PaddingX = 10,
+ PaddingY = 10
+ };
+ // table.BackgroundColor = Color.Orange;
+ conformant.SetContent(table);
+ table.Show();
+
+ Button button1 = new Button(window) {
+ Text = "Button (set Color.Oranage)",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ button1.Clicked += (e,o) =>
+ {
+ table.BackgroundColor = Color.Orange;
+ Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor);
+ };
+
+ Button button2 = new Button(window) {
+ Text = "Button 2 (set Color.Defalut)",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ BackgroundColor = new Color(50, 100, 200, 75)
+ };
+ button2.Clicked += (e, o) =>
+ {
+ table.BackgroundColor = Color.Default;
+ Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor);
+ };
+
+ table.Pack(button1,0,0,3,3);
+ table.Pack(button2,3,1,1,1);
+
+ button1.Show();
+ button2.Show();
+ }
+ }
+}