Пример #1
0
 internal VisualBase(VisualBase handle) : this(Interop.VisualBase.NewVisualBase(VisualBase.getCPtr(handle)), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #2
0
 public void RegisterVisual(int index, VisualBase visual, bool enabled)
 {
     Interop.ViewWrapperImpl.RegisterVisual(SwigCPtr, index, VisualBase.getCPtr(visual), enabled);
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #3
0
 public void RegisterVisual(int index, VisualBase visual)
 {
     Interop.ViewWrapperImpl.ViewWrapperImpl_RegisterVisual__SWIG_0(swigCPtr, index, VisualBase.getCPtr(visual));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #4
0
        /// <summary>
        /// Overrides the method of OnInitialize() for the CustomView class.<br />
        /// This method is called after the control has been initialized.<br />
        /// Derived classes should do any second phase initialization by overriding this method.<br />
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        public override void OnInitialize()
        {
            // Initialize the propertiesControl
            arrowImage          = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
            textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
            currentValue        = 0;
            minValue            = 0;
            maxValue            = 0;
            singleStep          = 1;
            maxTextLength       = 0;

            // Create image visual for the arrow keys
            var temp = new PropertyValue(arrowImage);

            arrowVisualPropertyIndex = RegisterProperty("ArrowImage", temp, Tizen.NUI.PropertyAccessMode.ReadWrite);
            temp.Dispose();

            var ptMap = new PropertyMap();

            temp = new PropertyValue((int)Visual.Type.Image);
            ptMap.Add(Visual.Property.Type, temp);
            temp.Dispose();

            temp = new PropertyValue(arrowImage);
            ptMap.Add(ImageVisualProperty.URL, temp);
            temp.Dispose();

            temp = new PropertyValue(150);
            ptMap.Add(ImageVisualProperty.DesiredHeight, temp);
            temp.Dispose();

            temp = new PropertyValue(150);
            ptMap.Add(ImageVisualProperty.DesiredWidth, temp);
            temp.Dispose();

            arrowVisual = VisualFactory.Instance.CreateVisual(ptMap);
            ptMap.Dispose();
            RegisterVisual(arrowVisualPropertyIndex, arrowVisual);

            // Create a text field
            textField                     = new TextField();
            textField.PivotPoint          = Tizen.NUI.PivotPoint.Center;
            textField.WidthResizePolicy   = ResizePolicyType.SizeRelativeToParent;
            textField.HeightResizePolicy  = ResizePolicyType.SizeRelativeToParent;
            textField.SizeModeFactor      = new Vector3(1.0f, 0.45f, 1.0f);
            textField.PlaceholderText     = "----";
            textField.BackgroundColor     = textBackgroundColor;
            textField.HorizontalAlignment = HorizontalAlignment.Center;
            textField.VerticalAlignment   = VerticalAlignment.Center;
            textField.Focusable           = (true);
            textField.Name                = "_textField";
            textField.Position2D          = new Position2D(0, 40);

            this.Add(textField);

            textField.FocusGained += TextFieldKeyInputFocusGained;
            textField.FocusLost   += TextFieldKeyInputFocusLost;
        }
Пример #5
0
        /// <summary>
        /// Request the visual.
        /// </summary>
        /// <param name="propertyMap">The map contains the properties required by the visual. The content of the map determines the type of visual that will be returned.</param>
        /// <returns>The handle to the created visual.</returns>
        /// <since_tizen> 3 </since_tizen>
        public VisualBase CreateVisual(PropertyMap propertyMap)
        {
            VisualBase ret = new VisualBase(Interop.VisualFactory.VisualFactory_CreateVisual__SWIG_0(swigCPtr, PropertyMap.getCPtr(propertyMap)), true);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #6
0
        internal VisualBase CreateVisual(Image image)
        {
            VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_1(swigCPtr, Image.getCPtr(image)), true);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #7
0
        public VisualBase GetVisual(int index)
        {
            System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index);
            VisualBase    ret  = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as VisualBase;

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #8
0
        public VisualBase GetVisual(int index)
        {
            //to fix memory leak issue, match the handle count with native side.
            System.IntPtr cPtr = Interop.ViewWrapperImpl.GetVisual(SwigCPtr, index);
            VisualBase    ret  = this.GetInstanceSafely <VisualBase>(cPtr);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #9
0
        public VisualBase GetVisual(int index)
        {
            //to fix memory leak issue, match the handle count with native side.
            System.IntPtr cPtr = Interop.ViewWrapperImpl.ViewWrapperImpl_GetVisual(swigCPtr, index);
            HandleRef     CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
            VisualBase    ret  = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as VisualBase;

            Interop.BaseHandle.delete_BaseHandle(CPtr);
            CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Пример #10
0
        /// <summary>
        /// Overrides the method of OnInitialize() for the CustomView class.<br />
        /// This method is called after the control has been initialized.<br />
        /// Derived classes should do any second phase initialization by overriding this method.<br />
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        public override void OnInitialize()
        {
            // Initialize the propertiesControl
            //_arrowImage = "/home/tengxb/Workspace/nui-debug/examples/res/images/arrow.png";
            _arrowImage          = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
            _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
            _currentValue        = 0;
            _minValue            = 0;
            _maxValue            = 0;
            _singleStep          = 1;
            _maxTextLength       = 0;

            // Create image visual for the arrow keys
            _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new PropertyValue(_arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite);
            _arrowVisual = VisualFactory.Instance.CreateVisual(
                new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image))
                .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage))
                .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150))
                .Add(ImageVisualProperty.DesiredWidth, new PropertyValue(150)));
            RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual);

            // Create a text field
            _textField                     = new TextField();
            _textField.PivotPoint          = Tizen.NUI.PivotPoint.Center;
            _textField.WidthResizePolicy   = ResizePolicyType.SizeRelativeToParent;
            _textField.HeightResizePolicy  = ResizePolicyType.SizeRelativeToParent;
            _textField.SizeModeFactor      = new Vector3(1.0f, 0.45f, 1.0f);
            _textField.PlaceholderText     = "----";
            _textField.BackgroundColor     = _textBackgroundColor;
            _textField.HorizontalAlignment = HorizontalAlignment.Center;
            _textField.VerticalAlignment   = VerticalAlignment.Center;
            _textField.Focusable           = (true);
            _textField.Name                = "_textField";
            _textField.Position2D          = new Position2D(0, 40);

            this.Add(_textField);

            _textField.FocusGained += TextFieldKeyInputFocusGained;
            _textField.FocusLost   += TextFieldKeyInputFocusLost;
        }
Пример #11
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualBase obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr);
 }