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.
22 /// Enumeration for paneldirection type.
24 public enum PanelDirection
45 /// The Panel is a container that can contain subobjects.
47 public class Panel : Layout
52 /// Creates and initializes a new instance of Panel class.
54 /// <param name="parent">The EvasObject to which the new Panel will be attached as a child.</param>
55 public Panel(EvasObject parent) : base(parent)
57 _toggled = new SmartEvent(this, this.RealHandle, "toggled");
58 _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
62 /// Sets or gets the hidden status of a given Panel widget.
68 return !Interop.Elementary.elm_panel_hidden_get(RealHandle);
72 Interop.Elementary.elm_panel_hidden_set(RealHandle, !value);
77 /// Sets or gets the direction of a given Panel widget.
79 public PanelDirection Direction
83 return (PanelDirection)Interop.Elementary.elm_panel_orient_get(RealHandle);
87 Interop.Elementary.elm_panel_orient_set(RealHandle, (int)value);
92 /// Toggled will be triggered when toggles Panel.
94 public event EventHandler Toggled;
97 /// Enable or disable scrolling in the Panel.
99 /// <param name="enable">
100 /// Bool value can be false or true.
102 public void SetScrollable(bool enable)
104 Interop.Elementary.elm_panel_scrollable_set(RealHandle, enable);
108 /// Sets the scroll size of Panel.
110 /// <param name="ratio">
111 /// The size of scroll area.
113 public void SetScrollableArea(double ratio)
115 Interop.Elementary.elm_panel_scrollable_content_size_set(RealHandle, ratio);
119 /// Toggles the hidden state of the Panel.
123 Interop.Elementary.elm_panel_toggle(RealHandle);
126 protected override IntPtr CreateHandle(EvasObject parent)
128 IntPtr handle = Interop.Elementary.elm_layout_add(parent);
129 Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
131 RealHandle = Interop.Elementary.elm_panel_add(handle);
132 Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);