// From Container Base class /// <summary> /// Adds a child view to this view. /// </summary> /// <seealso cref="Container.Add" /> /// <since_tizen> 4 </since_tizen> public override void Add(View child) { bool hasLayout = (layout != null); if (null == child) { Tizen.Log.Fatal("NUI", "Child is null"); return; } Container oldParent = child.GetParent(); if (oldParent != this) { // If child already has a parent then re-parent child if (oldParent != null) { if (child.Layout != null) { child.Layout.SetReplaceFlag(); } oldParent.Remove(child); } child.InternalParent = this; LayoutCount += child.LayoutCount; Interop.Actor.Add(SwigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } Children.Add(child); if (ChildAdded != null) { ChildAddedEventArgs e = new ChildAddedEventArgs { Added = child }; ChildAdded(this, e); } AddChildBindableObject(child); } }
internal void RemoveChild(View child) { // Do actual child removal Interop.Actor.Actor_Remove(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } Children.Remove(child); child.InternalParent = null; if (ChildRemoved != null) { ChildRemovedEventArgs e = new ChildRemovedEventArgs { Removed = child }; ChildRemoved(this, e); } }
internal ViewResourceReadySignal ResourceReadySignal(View view) { ViewResourceReadySignal ret = new ViewResourceReadySignal(Interop.View.ResourceReadySignal(View.getCPtr(view)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal VisualEventSignal VisualEventSignal() { VisualEventSignal ret = new VisualEventSignal(Interop.VisualEventSignal.NewWithView(View.getCPtr(this)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) { ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(Interop.Layout.LayoutDirectionChangedSignal(View.getCPtr(view)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) { ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(Interop.NDalic.VisibilityChangedSignal(View.getCPtr(view)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public void SetAccessibilityConstructor(Role role, AccessibilityInterface accessibilityInterface = AccessibilityInterface.None) { var size = Marshal.SizeOf <Interop.ControlDevel.AccessibilityDelegate>(); if (accessibilityDelegate == null) { accessibilityDelegate = new Interop.ControlDevel.AccessibilityDelegate() { GetName = () => DuplicateString(AccessibilityGetName()), GetDescription = () => DuplicateString(AccessibilityGetDescription()), DoAction = (name) => AccessibilityDoAction(Marshal.PtrToStringAnsi(name)), CalculateStates = () => DuplicateStates(AccessibilityCalculateStates()), GetActionCount = () => AccessibilityGetActionCount(), GetActionName = (index) => DuplicateString(AccessibilityGetActionName(index)), ShouldReportZeroChildren = () => AccessibilityShouldReportZeroChildren(), GetMinimum = () => AccessibilityGetMinimum(), GetCurrent = () => AccessibilityGetCurrent(), GetMaximum = () => AccessibilityGetMaximum(), SetCurrent = (value) => AccessibilitySetCurrent(value), GetMinimumIncrement = () => AccessibilityGetMinimumIncrement(), IsScrollable = () => AccessibilityIsScrollable(), GetText = (startOffset, endOffset) => DuplicateString(AccessibilityGetText(startOffset, endOffset)), GetCharacterCount = () => AccessibilityGetCharacterCount(), GetCursorOffset = () => AccessibilityGetCursorOffset(), SetCursorOffset = (offset) => AccessibilitySetCursorOffset(offset), GetTextAtOffset = (offset, boundary) => DuplicateRange(AccessibilityGetTextAtOffset(offset, (AccessibilityTextBoundary)boundary)), GetSelection = (selectionNumber) => DuplicateRange(AccessibilityGetSelection(selectionNumber)), RemoveSelection = (selectionNumber) => AccessibilityRemoveSelection(selectionNumber), SetSelection = (selectionNumber, startOffset, endOffset) => AccessibilitySetSelection(selectionNumber, startOffset, endOffset), CopyText = (startPosition, endPosition) => AccessibilityCopyText(startPosition, endPosition), CutText = (startPosition, endPosition) => AccessibilityCutText(startPosition, endPosition), InsertText = (startPosition, text) => AccessibilityInsertText(startPosition, Marshal.PtrToStringAnsi(text)), SetTextContents = (newContents) => AccessibilitySetTextContents(Marshal.PtrToStringAnsi(newContents)), DeleteText = (startPosition, endPosition) => AccessibilityDeleteText(startPosition, endPosition), ScrollToChild = (child) => { using (var view = new View(child, true)) { return(AccessibilityScrollToChild(view)); } }, GetSelectedChildrenCount = () => AccessibilityGetSelectedChildrenCount(), GetSelectedChild = (selectedChildIndex) => View.getCPtr(AccessibilityGetSelectedChild(selectedChildIndex)).Handle, SelectChild = (childIndex) => AccessibilitySelectChild(childIndex), DeselectSelectedChild = (selectedChildIndex) => AccessibilityDeselectSelectedChild(selectedChildIndex), IsChildSelected = (childIndex) => AccessibilityIsChildSelected(childIndex), SelectAll = () => AccessibilitySelectAll(), ClearSelection = () => AccessibilityClearSelection(), DeselectChild = (childIndex) => AccessibilityDeselectChild(childIndex), }; accessibilityDelegatePtr = Marshal.AllocHGlobal(size); Marshal.StructureToPtr(accessibilityDelegate, accessibilityDelegatePtr, false); } Interop.ControlDevel.DaliToolkitDevelControlSetAccessibilityConstructor(SwigCPtr, (int)role, (int)accessibilityInterface, accessibilityDelegatePtr, size); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } }
private static IntPtr AccessibilityGetSelectedChildWrapper(IntPtr self, int selectedChildIndex) { View child = GetInterfaceFromRefObject <IAtspiSelection>(self).AccessibilityGetSelectedChild(selectedChildIndex); return(View.getCPtr(child).Handle); }