private void SelectionChanged(ExposablePopupMenu.ItemData item)
 {
   if (this.m_SelectionChangedCallback != null)
     this.m_SelectionChangedCallback(item);
   else
     Debug.LogError((object) "Callback is null");
 }
示例#2
0
 private static void SelectionCallback(object userData)
 {
     ExposablePopupMenu.ItemData item = (ExposablePopupMenu.ItemData)userData;
     m_Caller.SelectionChanged(item);
     m_Caller = null;
     m_Data   = null;
 }
		public void Init(List<ExposablePopupMenu.ItemData> items, float itemSpacing, float minWidthOfPopup, ExposablePopupMenu.PopupButtonData popupButtonData, Action<ExposablePopupMenu.ItemData> selectionChangedCallback)
		{
			this.m_Items = items;
			this.m_ItemSpacing = itemSpacing;
			this.m_PopupButtonData = popupButtonData;
			this.m_SelectionChangedCallback = selectionChangedCallback;
			this.m_MinWidthOfPopup = minWidthOfPopup;
			this.CalcWidths();
		}
            static void SelectionCallback(object userData)
            {
                ItemData item = (ItemData)userData;

                m_Caller.SelectionChanged(item);

                // Cleanup
                m_Caller = null;
                m_Data   = null;
            }
            internal static void Show(Rect activatorRect, List <ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
            {
                m_Data   = buttonData;
                m_Caller = caller;
                GenericMenu menu = new GenericMenu();

                foreach (ExposablePopupMenu.ItemData data in m_Data)
                {
                    if (data.m_Enabled)
                    {
                        if (< > f__mg$cache0 == null)
                        {
			internal static void Show(Rect activatorRect, List<ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
			{
				ExposablePopupMenu.PopUpMenu.m_Data = buttonData;
				ExposablePopupMenu.PopUpMenu.m_Caller = caller;
				GenericMenu genericMenu = new GenericMenu();
				foreach (ExposablePopupMenu.ItemData current in ExposablePopupMenu.PopUpMenu.m_Data)
				{
					if (current.m_Enabled)
					{
						genericMenu.AddItem(current.m_GUIContent, current.m_On, new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback), current);
					}
					else
					{
						genericMenu.AddDisabledItem(current.m_GUIContent);
					}
				}
				genericMenu.DropDown(activatorRect);
			}
示例#7
0
            internal static void Show(Rect activatorRect, List <ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
            {
                m_Data   = buttonData;
                m_Caller = caller;
                GenericMenu menu = new GenericMenu();

                foreach (ExposablePopupMenu.ItemData data in m_Data)
                {
                    if (data.m_Enabled)
                    {
                        menu.AddItem(data.m_GUIContent, data.m_On, new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback), data);
                    }
                    else
                    {
                        menu.AddDisabledItem(data.m_GUIContent);
                    }
                }
                menu.DropDown(activatorRect);
            }
            static internal void Show(Rect activatorRect, List <ItemData> buttonData, ExposablePopupMenu caller)
            {
                m_Data   = buttonData;
                m_Caller = caller;

                GenericMenu menu = new GenericMenu();

                foreach (ItemData item in m_Data)
                {
                    if (item.m_Enabled)
                    {
                        menu.AddItem(item.m_GUIContent, item.m_On, SelectionCallback, item);
                    }
                    else
                    {
                        menu.AddDisabledItem(item.m_GUIContent);
                    }
                }

                menu.DropDown(activatorRect);
            }
 private void SearchButtonClickedCallback(ExposablePopupMenu.ItemData itemClicked)
 {
   if (itemClicked.m_On)
     return;
   this.SetSearchViewState((ProjectBrowser.SearchViewState) itemClicked.m_UserData);
   if (this.m_SearchFilter.searchArea != SearchFilter.SearchArea.AllAssets && this.m_SearchFilter.searchArea != SearchFilter.SearchArea.SelectedFolders)
     return;
   this.m_LastLocalAssetsSearchArea = this.m_SearchFilter.searchArea;
 }
 public void Init()
 {
   if (this.Initialized())
     return;
   this.m_FocusSearchField = false;
   if (this.m_SearchFilter == null)
     this.m_DirectoriesAreaWidth = Mathf.Min(this.position.width / 2f, 200f);
   if (this.m_SearchFilter == null)
     this.m_SearchFilter = new SearchFilter();
   this.m_SearchFieldText = this.m_SearchFilter.FilterToSearchFieldString();
   this.CalculateRects();
   this.RefreshSelectedPath();
   this.SetupDroplists();
   if (this.m_ListAreaState == null)
     this.m_ListAreaState = new ObjectListAreaState();
   this.m_ListAreaState.m_RenameOverlay.isRenamingFilename = true;
   this.m_ListArea = new ObjectListArea(this.m_ListAreaState, (EditorWindow) this, false);
   this.m_ListArea.allowDeselection = true;
   this.m_ListArea.allowDragging = true;
   this.m_ListArea.allowFocusRendering = true;
   this.m_ListArea.allowMultiSelect = true;
   this.m_ListArea.allowRenaming = true;
   this.m_ListArea.allowBuiltinResources = false;
   this.m_ListArea.allowUserRenderingHook = true;
   this.m_ListArea.allowFindNextShortcut = true;
   this.m_ListArea.foldersFirst = this.GetShouldShowFoldersFirst();
   this.m_ListArea.repaintCallback += new System.Action(((EditorWindow) this).Repaint);
   this.m_ListArea.itemSelectedCallback += new System.Action<bool>(this.ListAreaItemSelectedCallback);
   this.m_ListArea.keyboardCallback += new System.Action(this.ListAreaKeyboardCallback);
   this.m_ListArea.gotKeyboardFocus += new System.Action(this.ListGotKeyboardFocus);
   this.m_ListArea.drawLocalAssetHeader += new Func<Rect, float>(this.DrawLocalAssetHeader);
   this.m_ListArea.assetStoreSearchEnded += new System.Action(this.AssetStoreSearchEndedCallback);
   this.m_ListArea.gridSize = this.m_StartGridSize;
   this.m_StartGridSize = Mathf.Clamp(this.m_StartGridSize, this.m_ListArea.minGridSize, this.m_ListArea.maxGridSize);
   this.m_LastFoldersGridSize = Mathf.Min(this.m_LastFoldersGridSize, (float) this.m_ListArea.maxGridSize);
   this.InitListArea();
   this.SyncFilterGUI();
   if (this.m_FolderTreeState == null)
     this.m_FolderTreeState = new TreeViewState();
   this.m_FolderTreeState.renameOverlay.isRenamingFilename = true;
   if (this.m_AssetTreeState == null)
     this.m_AssetTreeState = new TreeViewState();
   this.m_AssetTreeState.renameOverlay.isRenamingFilename = true;
   this.InitViewMode(this.m_ViewMode);
   this.m_SearchAreaMenu = new ExposablePopupMenu();
   this.RefreshSearchText();
   this.DefaultSetup();
 }
示例#11
0
            internal static void Show(Rect activatorRect, List <ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
            {
                ExposablePopupMenu.PopUpMenu.m_Data   = buttonData;
                ExposablePopupMenu.PopUpMenu.m_Caller = caller;
                GenericMenu genericMenu = new GenericMenu();

                using (List <ExposablePopupMenu.ItemData> .Enumerator enumerator = ExposablePopupMenu.PopUpMenu.m_Data.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ExposablePopupMenu.ItemData current = enumerator.Current;
                        if (current.m_Enabled)
                        {
                            genericMenu.AddItem(current.m_GUIContent, current.m_On, new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback), (object)current);
                        }
                        else
                        {
                            genericMenu.AddDisabledItem(current.m_GUIContent);
                        }
                    }
                }
                genericMenu.DropDown(activatorRect);
            }
示例#12
0
		public void Init()
		{
			if (this.Initialized())
			{
				return;
			}
			this.m_FocusSearchField = false;
			bool flag = this.m_SearchFilter == null;
			if (flag)
			{
				this.m_DirectoriesAreaWidth = Mathf.Min(base.position.width / 2f, 200f);
			}
			if (this.m_SearchFilter == null)
			{
				this.m_SearchFilter = new SearchFilter();
			}
			this.m_SearchFieldText = this.m_SearchFilter.FilterToSearchFieldString();
			this.CalculateRects();
			this.RefreshSelectedPath();
			this.SetupDroplists();
			if (this.m_ListAreaState == null)
			{
				this.m_ListAreaState = new ObjectListAreaState();
			}
			this.m_ListAreaState.m_RenameOverlay.isRenamingFilename = true;
			this.m_ListArea = new ObjectListArea(this.m_ListAreaState, this, false);
			this.m_ListArea.allowDeselection = true;
			this.m_ListArea.allowDragging = true;
			this.m_ListArea.allowFocusRendering = true;
			this.m_ListArea.allowMultiSelect = true;
			this.m_ListArea.allowRenaming = true;
			this.m_ListArea.allowBuiltinResources = false;
			this.m_ListArea.allowUserRenderingHook = true;
			this.m_ListArea.allowFindNextShortcut = true;
			this.m_ListArea.foldersFirst = this.GetShouldShowFoldersFirst();
			ObjectListArea expr_131 = this.m_ListArea;
			expr_131.repaintCallback = (Action)Delegate.Combine(expr_131.repaintCallback, new Action(base.Repaint));
			ObjectListArea expr_158 = this.m_ListArea;
			expr_158.itemSelectedCallback = (Action<bool>)Delegate.Combine(expr_158.itemSelectedCallback, new Action<bool>(this.ListAreaItemSelectedCallback));
			ObjectListArea expr_17F = this.m_ListArea;
			expr_17F.keyboardCallback = (Action)Delegate.Combine(expr_17F.keyboardCallback, new Action(this.ListAreaKeyboardCallback));
			ObjectListArea expr_1A6 = this.m_ListArea;
			expr_1A6.gotKeyboardFocus = (Action)Delegate.Combine(expr_1A6.gotKeyboardFocus, new Action(this.ListGotKeyboardFocus));
			ObjectListArea expr_1CD = this.m_ListArea;
			expr_1CD.drawLocalAssetHeader = (Func<Rect, float>)Delegate.Combine(expr_1CD.drawLocalAssetHeader, new Func<Rect, float>(this.DrawLocalAssetHeader));
			ObjectListArea expr_1F4 = this.m_ListArea;
			expr_1F4.assetStoreSearchEnded = (Action)Delegate.Combine(expr_1F4.assetStoreSearchEnded, new Action(this.AssetStoreSearchEndedCallback));
			this.m_ListArea.gridSize = this.m_StartGridSize;
			this.m_StartGridSize = Mathf.Clamp(this.m_StartGridSize, this.m_ListArea.minGridSize, this.m_ListArea.maxGridSize);
			this.m_LastFoldersGridSize = Mathf.Min(this.m_LastFoldersGridSize, (float)this.m_ListArea.maxGridSize);
			this.InitListArea();
			this.SyncFilterGUI();
			if (this.m_FolderTreeState == null)
			{
				this.m_FolderTreeState = new TreeViewState();
			}
			this.m_FolderTreeState.renameOverlay.isRenamingFilename = true;
			if (this.m_AssetTreeState == null)
			{
				this.m_AssetTreeState = new TreeViewState();
			}
			this.m_AssetTreeState.renameOverlay.isRenamingFilename = true;
			this.InitViewMode(this.m_ViewMode);
			this.m_SearchAreaMenu = new ExposablePopupMenu();
			this.RefreshSearchText();
			this.DefaultSetup();
		}
 internal static void Show(Rect activatorRect, List<ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
 {
   ExposablePopupMenu.PopUpMenu.m_Data = buttonData;
   ExposablePopupMenu.PopUpMenu.m_Caller = caller;
   GenericMenu genericMenu = new GenericMenu();
   using (List<ExposablePopupMenu.ItemData>.Enumerator enumerator = ExposablePopupMenu.PopUpMenu.m_Data.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       ExposablePopupMenu.ItemData current = enumerator.Current;
       if (current.m_Enabled)
         genericMenu.AddItem(current.m_GUIContent, current.m_On, new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback), (object) current);
       else
         genericMenu.AddDisabledItem(current.m_GUIContent);
     }
   }
   genericMenu.DropDown(activatorRect);
 }
示例#14
0
		private void SearchButtonClickedCallback(ExposablePopupMenu.ItemData itemClicked)
		{
			if (!itemClicked.m_On)
			{
				this.SetSearchViewState((ProjectBrowser.SearchViewState)((int)itemClicked.m_UserData));
				if (this.m_SearchFilter.searchArea == SearchFilter.SearchArea.AllAssets || this.m_SearchFilter.searchArea == SearchFilter.SearchArea.SelectedFolders)
				{
					this.m_LastLocalAssetsSearchArea = this.m_SearchFilter.searchArea;
				}
				Analytics.Event("ProjectBrowser", "UserChangedSearchArea", this.m_SearchFilter.searchArea.ToString(), 1);
			}
		}
示例#15
0
            internal static void Show(Rect activatorRect, List <ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
            {
                ExposablePopupMenu.PopUpMenu.m_Data   = buttonData;
                ExposablePopupMenu.PopUpMenu.m_Caller = caller;
                GenericMenu genericMenu = new GenericMenu();

                foreach (ExposablePopupMenu.ItemData current in ExposablePopupMenu.PopUpMenu.m_Data)
                {
                    if (current.m_Enabled)
                    {
                        GenericMenu arg_62_0 = genericMenu;
                        GUIContent  arg_62_1 = current.m_GUIContent;
                        bool        arg_62_2 = current.m_On;
                        if (ExposablePopupMenu.PopUpMenu.< > f__mg$cache0 == null)
                        {
                            ExposablePopupMenu.PopUpMenu.< > f__mg$cache0 = new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback);
                        }
                        arg_62_0.AddItem(arg_62_1, arg_62_2, ExposablePopupMenu.PopUpMenu.< > f__mg$cache0, current);
                    }
                    else
                    {
                        genericMenu.AddDisabledItem(current.m_GUIContent);
                    }
                }
                genericMenu.DropDown(activatorRect);
            }
 private static void SelectionCallback(object userData)
 {
     ExposablePopupMenu.ItemData item = (ExposablePopupMenu.ItemData) userData;
     m_Caller.SelectionChanged(item);
     m_Caller = null;
     m_Data = null;
 }
 internal static void Show(Rect activatorRect, List<ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
 {
     m_Data = buttonData;
     m_Caller = caller;
     GenericMenu menu = new GenericMenu();
     foreach (ExposablePopupMenu.ItemData data in m_Data)
     {
         if (data.m_Enabled)
         {
             if (<>f__mg$cache0 == null)
             {
示例#18
0
            internal static void Show(Rect activatorRect, List <ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
            {
                ExposablePopupMenu.PopUpMenu.m_Data   = buttonData;
                ExposablePopupMenu.PopUpMenu.m_Caller = caller;
                GenericMenu genericMenu = new GenericMenu();

                foreach (ExposablePopupMenu.ItemData current in ExposablePopupMenu.PopUpMenu.m_Data)
                {
                    if (current.m_Enabled)
                    {
                        genericMenu.AddItem(current.m_GUIContent, current.m_On, new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback), current);
                    }
                    else
                    {
                        genericMenu.AddDisabledItem(current.m_GUIContent);
                    }
                }
                genericMenu.DropDown(activatorRect);
            }
示例#19
0
 internal static void Show(Rect activatorRect, List<ExposablePopupMenu.ItemData> buttonData, ExposablePopupMenu caller)
 {
     m_Data = buttonData;
     m_Caller = caller;
     GenericMenu menu = new GenericMenu();
     foreach (ExposablePopupMenu.ItemData data in m_Data)
     {
         if (data.m_Enabled)
         {
             menu.AddItem(data.m_GUIContent, data.m_On, new GenericMenu.MenuFunction2(ExposablePopupMenu.PopUpMenu.SelectionCallback), data);
         }
         else
         {
             menu.AddDisabledItem(data.m_GUIContent);
         }
     }
     menu.DropDown(activatorRect);
 }