Example #1
0
 public void OnFocus()
 {
     if (currentTab != null)
     {
         currentTab.Refresh();
     }
 }
		public void OnGUI()
		{
			using (gui.Horizontal(EditorStyles.toolbar))
			{
				for (int i = 0; i < tabs.Length; i++)
				{
					var tab = tabs[i];
					using (gui.ColorBlock(tab == currentTab ? TabColor : (Color?)null))
					{
						if (gui.Button(tab.title, EditorStyles.toolbarButton))
						{
							currentTab = tab;
							currentTab.Refresh();
							lastTabIndex = i;
						}
					}
				}
				gui.FlexibleSpace();
			}
			
			gui.Space(3f);
			//GUI.SetNextControlName("SearchBox");
			search = gui.ToolbarSearch(search);
			//if (Event.current != null && Event.current.isKey && Event.current.keyCode == KeyCode.Tab)
			//{
			//	Debug.Log(GUI.GetNameOfFocusedControl());
			//	GUI.FocusControl("SearchBox");
			//	Debug.Log(GUI.GetNameOfFocusedControl());
			//}
			gui.Splitter();
			using (gui.ScrollView.Begin(ref scroll, BackgroundStyle))
				currentTab.OnGUI(search, maxSize.x - minSize.x);
		}
Example #3
0
        public void OnGUI()
        {
            using (gui.Horizontal(EditorStyles.toolbar)) {
                for (int i = 0; i < tabs.Length; i++)
                {
                    var tab = tabs[i];

                    using (gui.ColorBlock(tab == currentTab ? TabColor : (Color?)null)) {
                        if (gui.Button(tab.title, EditorStyles.toolbarButton))
                        {
                            currentTab = tab;
                            currentTab.Refresh();
                            lastTabIndex = i;
                        }
                    }
                }
                gui.FlexibleSpace();
            }

            gui.Space(3f);
            //GUI.SetNextControlName("SearchBox");
            search = gui.ToolbarSearch(search);
            //if (Event.current != null && Event.current.isKey && Event.current.keyCode == KeyCode.Tab)
            //{
            //	Debug.Log(GUI.GetNameOfFocusedControl());
            //	GUI.FocusControl("SearchBox");
            //	Debug.Log(GUI.GetNameOfFocusedControl());
            //}
            gui.Splitter();
            using (gui.ScrollView.Begin(ref scroll, BackgroundStyle))
                currentTab.OnGUI(search, maxSize.x - minSize.x);
        }