示例#1
0
        protected override void Awake()
        {
            base.Awake();
            listView.SetAdapter(this);

            aliveHierarchies++;

            m_canvas             = GetComponentInParent <Canvas>();
            nullPointerEventData = new PointerEventData(null);

            searchInputField.onValueChanged.AddListener(OnSearchTermChanged);
            OnSelectionChanged += (transform) =>
            {
                if (ConnectedInspector)
                {
                    if (!transform)
                    {
                        ConnectedInspector.StopInspect();
                    }
                    else
                    {
                        ConnectedInspector.Inspect(transform.gameObject);
                    }
                }
            };

            m_showHorizontalScrollbar = !m_showHorizontalScrollbar;
            ShowHorizontalScrollbar   = !m_showHorizontalScrollbar;

            RuntimeInspectorUtils.IgnoredTransformsInHierarchy.Add(drawArea);
        }
示例#2
0
        /// <summary>
        /// Creates a new GUI Element List Menu
        /// </summary>
        /// <param name="capi">The Client API.</param>
        /// <param name="values">The values of the list.</param>
        /// <param name="names">The names for each of the values.</param>
        /// <param name="selectedIndex">The default selected index.</param>
        /// <param name="onSelectionChanged">The event fired when the selection is changed.</param>
        /// <param name="bounds">The bounds of the GUI element.</param>
        public GuiElementListMenu(ICoreClientAPI capi, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, CairoFont font, bool multiSelect) : base(capi, "", font, bounds)
        {
            if (values.Length != names.Length)
            {
                throw new ArgumentException("Values and Names arrays must be of the same length!");
            }

            hoverTexture     = new LoadedTexture(capi);
            dropDownTexture  = new LoadedTexture(capi);
            scrollbarTexture = new LoadedTexture(capi);

            this.Values             = values;
            this.Names              = names;
            this.SelectedIndex      = selectedIndex;
            this.multiSelect        = multiSelect;
            this.onSelectionChanged = onSelectionChanged;
            HoveredIndex            = selectedIndex;

            ElementBounds scrollbarBounds = ElementBounds.Fixed(0, 0, 0, 0).WithEmptyParent();

            scrollbar = new GuiElementCompactScrollbar(api, OnNewScrollbarValue, scrollbarBounds);



            richtTextElem = new GuiElementRichtext[values.Length];
            for (int i = 0; i < values.Length; i++)
            {
                ElementBounds textBounds = ElementBounds.Fixed(0, 0, 700, 100).WithEmptyParent();
                richtTextElem[i] = new GuiElementRichtext(capi, new RichTextComponentBase[0], textBounds);
            }
        }
	protected override void OnDestroyed ()
	{
		if (selection_holder != null)
			selection_holder = null;

		if (zoom_holder != null)
			zoom_holder = null;
	}
        /// <summary> Handle the switched off event. </summary>
        /// <param name="selected"> The child widget, the SelectionChange event sets visible. <see cref="XrwRectObj"/> </param>
        public virtual void OnSelectionChanged(XrwRectObj selected)
        {
            SelectionChangedDelegate selectionChanged = SelectionChanged;

            if (selectionChanged != null)
            {
                selectionChanged(this, selected);
            }
        }
示例#5
0
        protected override void OnDestroyed()
        {
            if (selection_holder != null)
            {
                selection_holder = null;
            }

            if (zoom_holder != null)
            {
                zoom_holder = null;
            }
        }
示例#6
0
        public ImageView() : base(null, null)
        {
            Raw = f_image_view_new();

            g_signal_connect_data(Raw, "selection_changed",
                                  selection_holder = new SelectionChangedDelegate(SelectionChangedCallback), 0,
                                  IntPtr.Zero, 0);

            g_signal_connect_data(Raw, "zoom_changed",
                                  zoom_holder = new SelectionChangedDelegate(ZoomChangedCallback), 0,
                                  IntPtr.Zero, 0);
        }
	public ImageView () : base (null, null)
	{
		Raw = f_image_view_new ();

		g_signal_connect_data (Raw, "selection_changed", 
				       selection_holder = new SelectionChangedDelegate (SelectionChangedCallback), 0,
				       IntPtr.Zero, 0);

		g_signal_connect_data (Raw, "zoom_changed", 
				       zoom_holder = new SelectionChangedDelegate (ZoomChangedCallback), 0,
				       IntPtr.Zero, 0);
	}
示例#8
0
        protected override void Awake()
        {
            base.Awake();

            if (transformDrawerPool == null)
            {
                transformDrawerPool = new List <HierarchyItem>(poolCapacity);
            }
            if (searchEntryDrawerPool == null)
            {
                searchEntryDrawerPool = new List <HierarchyItem>(poolCapacity);
            }

            GameObject poolParentGO = GameObject.Find(POOL_OBJECT_NAME);

            if (poolParentGO == null)
            {
                poolParentGO = new GameObject(POOL_OBJECT_NAME);
                DontDestroyOnLoad(poolParentGO);
            }

            poolParent = poolParentGO.transform;
            aliveHierarchies++;

            OnSelectionChanged += (transform) =>
            {
                if (!ConnectedInspector.IsNull())
                {
                    if (transform.IsNull())
                    {
                        ConnectedInspector.StopInspect();
                    }
                    else
                    {
                        ConnectedInspector.Inspect(transform.gameObject);
                    }
                }
            };

            searchInputField.onValueChanged.AddListener(OnSearchTermChanged);

            RuntimeInspectorUtils.IgnoredTransformsInHierarchy.Add(drawAreaHierarchy);
            RuntimeInspectorUtils.IgnoredTransformsInHierarchy.Add(drawAreaSearchResults);
            RuntimeInspectorUtils.IgnoredTransformsInHierarchy.Add(poolParent);
        }
示例#9
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="capi">The client API</param>
        /// <param name="values">The values of the strings.</param>
        /// <param name="names">The names of the strings.</param>
        /// <param name="selectedIndex">The default selected index.</param>
        /// <param name="onSelectionChanged">The event that occurs when the selection is changed.</param>
        /// <param name="bounds">The bounds of the drop down.</param>
        public GuiElementDropDown(ICoreClientAPI capi, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, CairoFont font, bool multiSelect) : base(capi, "", font, bounds)
        {
            highlightTexture        = new LoadedTexture(capi);
            currentValueTexture     = new LoadedTexture(capi);
            arrowDownButtonReleased = new LoadedTexture(capi);
            arrowDownButtonPressed  = new LoadedTexture(capi);

            listMenu = new GuiElementListMenu(capi, values, names, selectedIndex, didSelect, bounds, font, multiSelect)
            {
                HoveredIndex = selectedIndex
            };

            ElementBounds textBounds = ElementBounds.Fixed(0, 0, 900, 100).WithEmptyParent();

            richTextElem = new GuiElementRichtext(capi, new RichTextComponentBase[0], textBounds);

            this.onSelectionChanged = onSelectionChanged;
            this.multiSelect        = multiSelect;
        }
示例#10
0
 /// <summary>
 /// Adds a dropdown to the current GUI instance.
 /// </summary>
 /// <param name="values">The values of the current drodown.</param>
 /// <param name="names">The names of those values.</param>
 /// <param name="selectedIndex">The default selected index.</param>
 /// <param name="onSelectionChanged">The event fired when the index is changed.</param>
 /// <param name="bounds">The bounds of the index.</param>
 /// <param name="key">The name of this dropdown.</param>
 public static GuiComposer AddDropDown(this GuiComposer composer, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, CairoFont font, string key = null)
 {
     if (!composer.composed)
     {
         composer.AddInteractiveElement(new GuiElementDropDown(composer.Api, values, names, selectedIndex, onSelectionChanged, bounds, font, false), key);
     }
     return(composer);
 }
示例#11
0
 static extern uint g_signal_connect_data(IntPtr obj, String name, SelectionChangedDelegate cb, int key, IntPtr p, int flags);
	static extern uint g_signal_connect_data (IntPtr obj, String name, SelectionChangedDelegate cb, int key, IntPtr p, int flags);