2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 public class Table : Container
26 public Table(EvasObject parent) : base(parent)
30 public bool Homogeneous
34 return Interop.Elementary.elm_table_homogeneous_get(RealHandle);
38 Interop.Elementary.elm_table_homogeneous_set(RealHandle, value);
51 Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY);
64 Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY);
68 public void Pack(EvasObject obj, int col, int row, int colspan, int rowspan)
71 throw new ArgumentNullException("obj");
72 Interop.Elementary.elm_table_pack(RealHandle, obj, col, row, colspan, rowspan);
76 public void Unpack(EvasObject obj)
79 throw new ArgumentNullException("obj");
80 Interop.Elementary.elm_table_unpack(RealHandle, obj);
86 Interop.Elementary.elm_table_clear(RealHandle, false);
90 public override void SetPartColor(string part, Color color)
92 Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255,
93 color.G * color.A / 255,
94 color.B * color.A / 255,
98 public override Color GetPartColor(string part)
101 Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a);
102 return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
105 protected override IntPtr CreateHandle(EvasObject parent)
107 IntPtr handle = Interop.Elementary.elm_layout_add(parent);
108 Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
110 RealHandle = Interop.Elementary.elm_table_add(handle);
111 Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);