protected override IntPtr CreateHandle(EvasObject parent) { var handle = base.CreateHandle(parent); AllowFocus(false); _editfieldLayout = CreateEditFieldLayout(parent); // If true, It means, there is no extra layout on the widget handle // We need to set RealHandle, becuase we replace Handle to Layout if (RealHandle == IntPtr.Zero) { RealHandle = handle; } Handle = handle; if (!_editfieldLayout.SetPartContent("elm.swallow.content", this)) { // Restore theme to default if editfield style is not available _editfieldLayout.SetTheme("layout", "application", "default"); _editfieldLayout.SetPartContent("elm.swallow.content", this); } _heightPadding = _editfieldLayout.EdjeObject["elm.swallow.content"].Geometry.Height; return(_editfieldLayout); }
public TwoButtonPageWidget(EvasObject parent) : base(parent) { _frame = new ElmSharp.Layout(parent); _frame.SetTheme("popup", "base", "circle"); SetPartContent("overlay", _frame); _frame.Show(); _buttonLayer = new ElmSharp.Layout(_frame); _buttonLayer.SetTheme("popup", "buttons2", "popup/circle"); _frame.SetPartContent("elm.swallow.action_area", _buttonLayer); _buttonLayer.Show(); _outbox = new ObservableBox(parent); _outbox.SetAlignment(NamedHint.Fill, NamedHint.Fill); _outbox.SetWeight(NamedHint.Expand, NamedHint.Expand); _outbox.SetLayoutCallback(() => { }); _frame.SetPartContent("elm.swallow.content", _outbox); _outbox.Show(); _canvas = new Canvas(_outbox); EcoreMainloop.Post(OnLayout); _outbox.PackEnd(_canvas); _canvas.Show(); _buttons = new ElmSharp.Button[2]; _overlap = false; }
public static bool SetContentPart(this ELayout layout, EvasObject content, bool preserveOldContent = false) { var ret = layout.SetPartContent(ThemeConstants.Layout.Parts.Content, content, preserveOldContent); if (!ret) { // Restore theme to default if given layout is not available layout.SetTheme("layout", "application", "default"); ret = layout.SetPartContent(ThemeConstants.Layout.Parts.Content, content, preserveOldContent); } return(ret); }
protected override IntPtr CreateHandle(EvasObject parent) { var bg = new ELayout(parent); bg.SetTheme("layout", "background", "default"); _editfieldLayout = new ELayout(parent); _editfieldLayout.SetTheme("layout", "editfield", "singleline"); var handle = base.CreateHandle(parent); // If true, It means, there is no extra layout on the widget handle // We need to set RealHandle, becuase we replace Handle to Layout if (RealHandle == IntPtr.Zero) { RealHandle = handle; } Handle = handle; _editfieldLayout.SetPartContent("elm.swallow.content", this); bg.SetPartContent("elm.swallow.content", _editfieldLayout); // The minimun size for the Content area of an Editfield. This is used to calculate the size when layouting. _heightPadding = _editfieldLayout.EdjeObject["elm.swallow.content"].Geometry.Height; return(bg); }
private void Initialize() { _outterLayout = new ElmSharp.Layout(TForms.NativeParent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; _outterLayout.Show(); _outterLayout.SetTheme("layout", "application", "default"); _index = new Index(_outterLayout) { IsHorizontal = true, AutoHide = false, }; _index.Show(); _outterLayout.SetPartContent("elm.swallow.content", _index); _scroller = new Scroller(_outterLayout); _scroller.PageScrolled += OnPageScrolled; // Disables the visibility of the scrollbar in both directions: _scroller.HorizontalScrollBarVisiblePolicy = ElmSharp.ScrollBarVisiblePolicy.Invisible; _scroller.VerticalScrollBarVisiblePolicy = ElmSharp.ScrollBarVisiblePolicy.Invisible; // Sets the limit of scroll to one page maximum: _scroller.HorizontalPageScrollLimit = 1; _scroller.SetPageSize(1.0, 1.0); _scroller.SetAlignment(-1, -1); _scroller.SetWeight(1.0, 1.0); _scroller.Show(); _innerContainer = new Box(_outterLayout); _innerContainer.SetLayoutCallback(OnInnerLayoutUpdate); _innerContainer.SetAlignment(-1, -1); _innerContainer.SetWeight(1.0, 1.0); _innerContainer.Show(); _scroller.SetContent(_innerContainer); _outterLayout.SetPartContent("elm.swallow.bg", _scroller); }
protected override ElmSharp.Layout CreateEditFieldLayout(EvasObject parent) { _layout = base.CreateEditFieldLayout(parent); _clearButton = new EButton(_layout) { Style = "editfield_clear" }; _clearButton.AllowFocus(false); _clearButton.Clicked += ClearButtonClicked; _layout.SetPartContent("elm.swallow.button", _clearButton); _layout.SignalEmit("elm,action,show,button", ""); return(_layout); }
public WatchDateTimePickerDialog(EvasObject parent) : base(parent) { AlignmentX = -1; AlignmentY = -1; WeightX = 1.0; WeightY = 1.0; Style = "circle"; _container = new Box(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; _container.BackgroundColor = ElmSharp.Color.Blue; _container.SetLayoutCallback(OnContainerLayout); _datetimeLayout = new ELayout(parent); _surfaceLayout = new ELayout(parent); _container.PackEnd(_datetimeLayout); _container.PackEnd(_surfaceLayout); _datetimeLayout.SetTheme("layout", "circle", "datetime"); _surface = new CircleSurface(_surfaceLayout); _picker = new WatchDateTimePicker(parent, _surface); _picker.Show(); _datetimeLayout.SetContent(_picker); _doneButton = new Button(parent) { Text = "Set", Style = "bottom", }; _datetimeLayout.SetPartContent("elm.swallow.btn", _doneButton); _doneButton.Clicked += OnDoneClicked; ActivateRotaryInteraction(); _datetimeLayout.Show(); _surfaceLayout.Show(); _container.Show(); SetContent(_container); ShowAnimationFinished += OnShowAnimationFinished; BackButtonPressed += OnBackButtonPressed; }
void CreatePopup() { var rect = Xamarin.Forms.Platform.Tizen.Forms.NativeParent.Geometry; var root = FindWindow(Xamarin.Forms.Platform.Tizen.Forms.NativeParent); _editorPopup = new ElmSharp.Background(root) { Geometry = rect }; var layout = new ElmSharp.Layout(_editorPopup); layout.SetTheme("layout", "entry", "default"); layout.Show(); _editorPopup.SetPartContent("overlay", layout); _editorPopup.Color = Control.BackgroundColor; _editor = new Xamarin.Forms.Platform.Tizen.Native.Entry(layout); _editor.IsSingleLine = true; _editor.Scrollable = true; _editor.SetInputPanelEnabled(false); _editor.AllowFocus(true); _editor.Show(); _editor.SetInputPanelReturnKeyType(ElmSharp.InputPanelReturnKeyType.Done); _editor.UpdateKeyboard(Element.Keyboard, Element.IsSpellCheckEnabled, Element.IsTextPredictionEnabled); _editorPopup.BackButtonPressed += (s, e) => HidePopup(); _editor.Activated += (s, e) => HidePopup(); IntPtr entryHandle = Interop.EFL.elm_entry_imf_context_get(_editor.RealHandle); _editorStateChanged = EditorStateChanged; Interop.EFL.ecore_imf_context_input_panel_event_callback_add(entryHandle, Interop.EFL.InputPanelEventType.State, _editorStateChanged, IntPtr.Zero); layout.SetPartContent("elm.swallow.content", _editor); }
protected override IntPtr CreateHandle(EvasObject parent) { var handle = base.CreateHandle(parent); AllowFocus(false); _editfieldLayout = CreateEditFieldLayout(parent); // If true, It means, there is no extra layout on the widget handle // We need to set RealHandle, becuase we replace Handle to Layout if (RealHandle == IntPtr.Zero) { RealHandle = handle; } Handle = handle; _editfieldLayout.SetPartContent("elm.swallow.content", this); // The minimun size for the Content area of an Editfield. This is used to calculate the size when layouting. _heightPadding = _editfieldLayout.EdjeObject["elm.swallow.content"].Geometry.Height; return(_editfieldLayout); }
public static bool SetOverlayPart(this ELayout layout, EvasObject content, bool preserveOldContent = false) { return(layout.SetPartContent(ThemeConstants.Layout.Parts.Overlay, content, preserveOldContent)); }
/// <summary> /// Initialize ThumbnailIndex View /// </summary> private void Initialize() { Console.WriteLine("Initialize"); _isFirstItem = true; _pbox = new PaddingBox(Forms.NativeParent) { Padding = new Thickness { Left = 0, Right = 0, Top = 22, Bottom = 0 }, HeaderSize = new ElmSharp.Size(200, 19), HeaderGap = 38 }; _pbox.Show(); _index = new ElmSharp.Index(_pbox) { Style = "thumbnail", AutoHide = false, IsHorizontal = true, AlignmentX = 0.5, AlignmentY = 0.5, }; _index.Show(); _pbox.Header = _index; //index.Geometry = new Rect(0, 22, 200, 19); _scroller = new ElmSharp.Scroller(_pbox) { HorizontalLoop = false, VerticalLoop = false, HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, HorizontalPageScrollLimit = 1, VerticalPageScrollLimit = 0, }; _scroller.PageScrolled += (s, e) => { Console.WriteLine($" _scroller PageScrolled"); var pageIndex = _scroller.HorizontalPageIndex; _items[pageIndex].Select(true); }; _scroller.Show(); _pbox.Content = _scroller; //_scroller.Geometry = new Rect(0, 79, 360, 281); var box = new ElmSharp.Box(_scroller) { IsHorizontal = true, AlignmentX = 0.5, AlignmentY = 0.5, }; _scroller.SetContent(box); box.Show(); // Create Rectangle for layout center align in Box var padder = new ElmSharp.Rectangle(box); box.PackEnd(padder); _items.Clear(); // Initialize ThumbnailItems foreach (var item in Element.ThumbnailItems) { // create layout var page = new ElmSharp.Layout(box) { WeightX = 1.0, WeightY = 1.0, AlignmentX = -1.0, AlignmentY = 0.5 }; page.SetTheme("layout", "body_thumbnail", "default"); page.Show(); // set icon var img = new ElmSharp.Image(page); var icon = item.Image; Console.WriteLine($"item.Image File:{icon.File}"); img.LoadAsync(ResourcePath.GetPath(icon.File)); page.SetPartContent("elm.icon", img); var indexItem = _index.Append(null); _items.Add(indexItem); // first item case if (_isFirstItem) { Console.WriteLine($"_isFirstItem is true"); page.Resized += (s, e) => { var g = _scroller.Geometry; var pg = page.Geometry; padder.MinimumWidth = (g.Width - pg.Width) / 2; padder.MinimumHeight = g.Height / 2; _scroller.SetPageSize(pg.Width, pg.Height); }; indexItem.Select(true); } _isFirstItem = false; box.PackEnd(page); } box.PackEnd(padder); _index.Update(0); }
public static bool SetBackgroundPart(this ELayout layout, EvasObject?content, bool preserveOldContent = false) { return(layout.SetPartContent(ThemeConstants.Layout.Parts.Background, content, preserveOldContent)); }