public void MenuLeftContent_ParsingCorrectly_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                TabMenu tabMenu = new TabMenu(driver);

                /* Set of assertions */

                Assert.AreEqual(false, tabMenu.TabMenuPanelIsNull);
                Assert.AreEqual(0, tabMenu.TabMenuOptionsIsNull);
                Assert.AreEqual(4, tabMenu.TabMenuOptionListCount);
                Assert.AreEqual(1, tabMenu.OpenedProjectsListCount);
                Assert.IsTrue(tabMenu.IsParsingCorrect);
            }
        }
Ejemplo n.º 2
0
    public DebugConsole(string console_name)
    {
        save_file_index_counter = 0;
        isTabMenuActive         = false;
        is_active         = false;
        this.console_name = console_name;
        m_id = ++id;

        logs                = new LinkedList <string>();
        scroll_view         = Vector2.zero;
        log_board_size      = 0;
        current_alpha_value = GUI.color.a;
#if HAS_POINTING_DEVICE
        isWindowGrabbed = false;
#endif
        CreateSavingDirectories(console_name);

#if HAS_TOUCH_DEVICE
        touch_event           = new TouchEvent();
        touch_event.Condition = IsInRect;
        touch_event.LayerID   = 10;
        touch_event.OnMoved   =
            delegate
        {
            scroll_view += new Vector2(0, touch_event.touch.deltaPosition.y * drag_sensitivity);
        };
        TouchManager.RegisterEvent(touch_event);
#endif
        tab_menu = new TabMenu(new string[4] {
            "Clear", "SaveTxt", "SaveBin", "LoadBin"
        }, new string[4] {
            "Clear", "SaveTxt", "SaveBin", "LoadBin"
        }, TabMenuCallback);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (PortalId != string.Empty && RoleId != string.Empty)
         {
             string  XSLT_FilePath = "~/modules/menu/XsltTransformer.xslt";
             TabMenu admin_menu    = new TabMenu();
             string  result        = admin_menu.ExecuteXSLTransformation(Convert.ToInt32(PortalId), RoleId, XSLT_FilePath, 1);
             if (result != string.Empty)
             {
                 Literal_Menu.Text = result;
             }
             else
             {
                 Literal_Menu.Text = "Không tìm thấy dữ liệu";
             }
         }
         else
         {
             string scriptCode = "<script>alert('Session Timeout.');window.location.href='/login/'</script>";
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", scriptCode);
         }
     }
 }
Ejemplo n.º 4
0
    private static void Initialize()
    {
        active_consoles = new refList <DebugConsole>();
        tab_menu        = new TabMenu(new string[5] {
            "InteractOff", "HalfAlpha", "GamePlay", "Input", "Misc"
        },
                                      new string[5] {
            "InteractOn", "FullAlpha", "GamePlay", "Input", "Misc"
        },
                                      TabCallback);
        tab_menu.position        = new Vector2(180 + 10, Screen.height - 10);
        tab_menu.tab_height      = 40;
        tab_menu.tab_width       = 150;
        tab_menu.spacing         = 2;
        tab_menu.font_size       = 25;
        tab_menu.draw_background = false;
        tab_menu.SetAlignment(TabMenu.TabMenuAlignment.HorizontalRight);

        log_system_button_rect = new Rect(30, Screen.height - 50, 150, 40);

        DebugConsole.Size = new Vector2(400, 600);
        consoles          = new DebugConsole[3];
        consoles[0]       = new DebugConsole("GamePlay");
        consoles[1]       = new DebugConsole("Input");
        consoles[2]       = new DebugConsole("Misc");

        consoles[0].OnClose = delegate { consoles[0].IsActive = false; active_consoles.Remove(consoles[0], Comparer); RealignConsoles(); };
        consoles[1].OnClose = delegate { consoles[1].IsActive = false; active_consoles.Remove(consoles[1], Comparer); RealignConsoles(); };
        consoles[2].OnClose = delegate { consoles[2].IsActive = false; active_consoles.Remove(consoles[2], Comparer); RealignConsoles(); };

        consoles[0].position.y = 20;
        consoles[1].position.y = 20;
        consoles[2].position.y = 20;
        isInitialized          = true;
    }
Ejemplo n.º 5
0
 public TabCollection(TabMenu tabMenu)
 {
     if (tabMenu == null)
     {
         throw new ArgumentNullException("tabMenu");
     }
     this._tabMenu = tabMenu;
 }
Ejemplo n.º 6
0
        protected override void OnTabMenuShown(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            base.OnTabMenuShown(sender, e);

            TabMenu.Prepend(ReconnectItem);
            TabMenu.ShowAll();
        }
Ejemplo n.º 7
0
        private void OnClick(BaseEventData arg0)
        {
            PointerEventData ev = arg0 as PointerEventData;

            if (ev == null)
            {
                return;
            }
            if (ev.button == PointerEventData.InputButton.Left)
            {
                if (OutputVisual.status == OutputVisual.LINKING)
                {
                    //linking
                    if (OutputVisual.linkInitiator.host != host)
                    {
                        Disconnect();
                        OutputVisual.CompleteLink(this);
                    }
                }
                else
                {
                    //not linking
                    if (ev.clickCount == 2)
                    {
                        Disconnect();
                    }
                }
            }
            else if (ev.button == PointerEventData.InputButton.Right)
            {
                stay = !stay;
            }
            else if (ev.button == PointerEventData.InputButton.Middle)
            {
                List <Type> allowed = inputAttachedTo.GetAllowedDataTypes();
                if (allowed.Count != 0)
                {
                    StringBuilder builder = new StringBuilder("Allowed:\n");
                    for (int i = 0; i < allowed.Count; i++)
                    {
                        string cleanName = TabMenu.CleanClassName(allowed[i].ToString());
                        builder.Append(cleanName);
                        if (i != allowed.Count - 1)
                        {
                            builder.Append(", ");
                        }
                    }
                    MouseToast.MakeToastFixed(2f, builder.ToString(), UnityEngine.Input.mousePosition);
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string  XSLT_FilePath = "~/portals/news/controls/XsltTransformer.xslt";
         TabMenu admin_menu    = new TabMenu();
         int     portalid      = 0;
         string  result        = admin_menu.ExecuteXSLTransformation_FrontPage(portalid, XSLT_FilePath, 0);
         if (result != string.Empty)
         {
             Literal_Menu.Text = result;
         }
     }
 }
Ejemplo n.º 9
0
 //-------------------------------------------------------------------------------------------------
 // unity methods
 //-------------------------------------------------------------------------------------------------
 void Start()
 {
     //instantiate tab menu and set its position
     mTabMenu = Instantiate(ObjectManager.getMenu("TabMenu"), transform).GetComponent <TabMenu>();
     mTabMenu.setPositions(0, 0, 0, 0, 0, 0.1f, 1, 0.9f);
     //make the sub menus
     mInfoMenu      = Instantiate(ObjectManager.getMenu("InfoMenu"), mTabMenu.transform).GetComponent <InfoMenu>();
     mInventoryMenu = Instantiate(ObjectManager.getMenu("InventoryMenu"), mTabMenu.transform).GetComponent <InventoryMenu>();
     mActionMenu    = Instantiate(ObjectManager.getMenu("ActionMenu"), mTabMenu.transform).GetComponent <ActionMenu>();
     //add submenus as tabs
     mTabMenu.addMenu(0, mInfoMenu, "INFO");
     mTabMenu.addMenu(1, mInventoryMenu, "ITEMS");
     mTabMenu.addMenu(2, mActionMenu, "ACTIONS");
 }
Ejemplo n.º 10
0
        void TabControl_OnTabClicked(object TabData, Point Location, MouseButtons Buttons)
        {
            if (Buttons == System.Windows.Forms.MouseButtons.Right)
            {
                Activate();

                int InsertIdx = 0;

                while (TabMenu_RecentProjects.DropDownItems[InsertIdx] != TabMenu_Recent_Separator)
                {
                    TabMenu_RecentProjects.DropDownItems.RemoveAt(InsertIdx);
                }

                TabMenu_TabIdx = -1;
                for (int Idx = 0; Idx < TabControl.GetTabCount(); Idx++)
                {
                    if (TabControl.GetTabData(Idx) == TabData)
                    {
                        TabMenu_TabIdx = Idx;
                        break;
                    }
                }

                HashSet <string> ProjectList = new HashSet <string>(StringComparer.InvariantCultureIgnoreCase);
                foreach (string ProjectFileName in Settings.OtherProjectFileNames)
                {
                    if (!String.IsNullOrEmpty(ProjectFileName))
                    {
                        string FullProjectFileName = Path.GetFullPath(ProjectFileName);
                        if (ProjectList.Add(FullProjectFileName))
                        {
                            ToolStripMenuItem Item = new ToolStripMenuItem(FullProjectFileName, null, new EventHandler((o, e) => TryOpenProject(FullProjectFileName, TabMenu_TabIdx)));
                            TabMenu_RecentProjects.DropDownItems.Insert(InsertIdx, Item);
                            InsertIdx++;
                        }
                    }
                }

                TabMenu_RecentProjects.Visible = (ProjectList.Count > 0);

                TabMenu_TabNames_Stream.Checked        = Settings.TabLabels == TabLabels.Stream;
                TabMenu_TabNames_WorkspaceName.Checked = Settings.TabLabels == TabLabels.WorkspaceName;
                TabMenu_TabNames_WorkspaceRoot.Checked = Settings.TabLabels == TabLabels.WorkspaceRoot;
                TabMenu_TabNames_ProjectFile.Checked   = Settings.TabLabels == TabLabels.ProjectFile;
                TabMenu.Show(TabControl, Location);

                TabControl.LockHover();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string XSLT_FilePath = "~/portals/news/controls/XsltTransformer.xslt";
                TabMenu admin_menu = new TabMenu();
                int portalid = 0;
                string result = admin_menu.ExecuteXSLTransformation_FrontPage(portalid, XSLT_FilePath, 0);
                if (result != string.Empty)
                {
                    Literal_Menu.Text = result;
                }        

            }
        }
Ejemplo n.º 12
0
        public ProtocolChatView(ChatModel chat) : base(chat)
        {
            Trace.Call(chat);

            ProxySettings = new ProxySettings();

            Add(OutputScrolledWindow);

            ReconnectItem            = new Gtk.ImageMenuItem(_("Reconnect"));
            ReconnectItem.Image      = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
            ReconnectItem.Activated += new EventHandler(OnTabMenuReconnectActivated);
            TabMenu.Prepend(ReconnectItem);
            TabMenu.ShowAll();

            ShowAll();
        }
Ejemplo n.º 13
0
    void OnValueChange(string val)
    {
        switch (mode)
        {
        case MODE_STRING:
            UpdateList(TabMenu.GetListForString(val));
            break;

        case MODE_INPUT:
            UpdateList(TabMenu.GetListForInputTypesAndString(filterTypes, val));
            break;

        case MODE_OUTPUT:
            UpdateList(TabMenu.GetListForOutputTypesAndString(filterTypes, val));
            break;
        }
    }
Ejemplo n.º 14
0
        protected override void OnTabMenuShown(object sender, EventArgs e)
        {
            base.OnTabMenuShown(sender, e);

            var stack = new Stack <Gtk.MenuItem>();

            foreach (var menu_item in CreateContextMenuItems())
            {
                stack.Push(menu_item);
            }
            TabMenu.Prepend(new Gtk.SeparatorMenuItem());
            while (stack.Count != 0)
            {
                TabMenu.Prepend(stack.Pop());
            }
            TabMenu.ShowAll();
        }
        public void MenuLeftContent_CurrentProject_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://lionbridge.com/");

                TabMenu tabMenu = new TabMenu(driver);

                /* Set of assertions */

                Assert.IsTrue(tabMenu.CurrentProjectIsNull);
                Assert.AreEqual("", tabMenu.CurrentProjectName);
            }
        }
        /* Constructors */

        public ParticularProjectPage(IWebDriver driver)
        {
            if (driver.Url == "https://tms.lionbridge.com/")
            {
                IReadOnlyCollection <IWebElement> auxiliaryCollection;
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                myApplicationBoard = new ApplicationBoard(driver);
                myTabMenu          = new TabMenu(driver);
                myMenuLeftContent  = new ViewsMenu(driver);
            }
            else
            {
                myApplicationBoard = new ApplicationBoard();
                myTabMenu          = new TabMenu();
                myMenuLeftContent  = new ViewsMenu();
            }
        }
Ejemplo n.º 17
0
 public void TestCheck()
 {
     ConsoleMessage.StartTest("Search Test", "SearchTest");
     Appium.Instance.Driver.LaunchApp();
     LoginActivity.LoginStep(_user, _timeout);
     BrowserActivity.CreateAssay(_assay);
     BrowserActivity.CreateFlow(_flow);
     BrowserActivity.FlowList.FindAndTap(_flow);
     FlowActivity.AddElement("Add");
     FlowActivity.ElementList.VerifyElementCountByClass(1, "android.widget.EditText");
     //search
     TabMenu.Search.Tap();
     TabMenu.SearchItem(_flow);
     CommonOperation.HideKeyboard();
     SearchActivity.SearchResultList.FindAndTap(_flow);
     CommonOperation.Delay(3);
     FlowActivity.FlowName.VerifyText(_flow);
 }
Ejemplo n.º 18
0
        void TabControl_OnTabClicked(object TabData, Point Location, MouseButtons Buttons)
        {
            if (Buttons == System.Windows.Forms.MouseButtons.Right)
            {
                Activate();

                int InsertIdx = 0;

                while (TabMenu_RecentProjects.DropDownItems[InsertIdx] != TabMenu_Recent_Separator)
                {
                    TabMenu_RecentProjects.DropDownItems.RemoveAt(InsertIdx);
                }

                TabMenu_TabIdx = -1;
                for (int Idx = 0; Idx < TabControl.GetTabCount(); Idx++)
                {
                    if (TabControl.GetTabData(Idx) == TabData)
                    {
                        TabMenu_TabIdx = Idx;
                        break;
                    }
                }

                foreach (UserSelectedProjectSettings RecentProject in Settings.RecentProjects)
                {
                    ToolStripMenuItem Item = new ToolStripMenuItem(RecentProject.ToString(), null, new EventHandler((o, e) => TryOpenProject(RecentProject, TabMenu_TabIdx)));
                    TabMenu_RecentProjects.DropDownItems.Insert(InsertIdx, Item);
                    InsertIdx++;
                }

                TabMenu_RecentProjects.Visible = (Settings.RecentProjects.Count > 0);

                TabMenu_TabNames_Stream.Checked        = Settings.TabLabels == TabLabels.Stream;
                TabMenu_TabNames_WorkspaceName.Checked = Settings.TabLabels == TabLabels.WorkspaceName;
                TabMenu_TabNames_WorkspaceRoot.Checked = Settings.TabLabels == TabLabels.WorkspaceRoot;
                TabMenu_TabNames_ProjectFile.Checked   = Settings.TabLabels == TabLabels.ProjectFile;
                TabMenu.Show(TabControl, Location);

                TabControl.LockHover();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 { 
     if (!Page.IsPostBack)
     {
         if (PortalId != string.Empty && RoleId != string.Empty)
         {
             string XSLT_FilePath = "~/modules/menu/XsltTransformer.xslt";
             TabMenu admin_menu = new TabMenu();
             string result = admin_menu.ExecuteXSLTransformation(Convert.ToInt32(PortalId), RoleId, XSLT_FilePath, 1);
             if (result != string.Empty)
                 Literal_Menu.Text = result;
             else
                 Literal_Menu.Text = "Không tìm thấy dữ liệu";
         }
         else
         {
             string scriptCode = "<script>alert('Session Timeout.');window.location.href='/login/'</script>";
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", scriptCode);
         }
     }    
 }    
        public void MenuLeftContent_ParsingCorrectly_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://lionbridge.com/");

                TabMenu tabMenu = new TabMenu(driver);

                /* Set of assertions */

                Assert.AreEqual(true, tabMenu.TabMenuPanelIsNull);
                Assert.AreEqual(-1, tabMenu.TabMenuOptionsIsNull);
                Assert.AreEqual(0, tabMenu.TabMenuOptionListCount);
                Assert.AreEqual(0, tabMenu.OpenedProjectsListCount);
                Assert.IsFalse(tabMenu.IsParsingCorrect);
            }
        }
Ejemplo n.º 21
0
        private void OnClick(BaseEventData arg0)
        {
            PointerEventData ev = arg0 as PointerEventData;

            if (ev == null)
            {
                return;
            }

            if (ev.button == PointerEventData.InputButton.Left)
            {
                if (ev.clickCount == 2)
                {
                    if (status == LINKING)
                    {
                        CancelLink();
                    }
                    Disconnect();
                }
                if (status == IDLE)
                {
                    StartLinking(this);
                }
                else if (linkInitiator == this)
                {
                    CancelLink();
                }
            }
            else if (ev.button == PointerEventData.InputButton.Right)
            {
                stay = !stay;
            }
            else if (ev.button == PointerEventData.InputButton.Middle)
            {
                Type type = outputAttachedTo.GetDataType();
                MouseToast.MakeToastFixed(2f, "Type: " + TabMenu.CleanClassName(type.ToString()), UnityEngine.Input.mousePosition);
            }
        }
Ejemplo n.º 22
0
        public void InitViewData(TabMenu tabMenu = TabMenu.Default)
        {
            var currentUserId = User.Identity.Name;
            var isLoggedIn = false;

            if (!currentUserId.IsNullOrEmpty())
            {
                var currentUser = Db.UserLogins
                    .Where(x => x.UserId == currentUserId)
                    .Select(n => new VmUser()
                    {
                        UserLoginId = n.UserLoginId,
                        DisplayName = n.UserName,
                        EmailAddress = n.Email,
                        IsAdmin = n.AccessLevelId == 3,
                        UserLevel = n.AccessLevel.AccessLevelId,
                        UserLevelDescription = n.AccessLevel.Description
                    }).FirstOrDefault();

                isLoggedIn = currentUser != null;

                if (isLoggedIn)
                {
                    CurrentUser = currentUser;
                    ViewBag.IsAdmin = currentUser.IsAdmin;
                    ViewData.Add("DisplayName", currentUser.DisplayName);
                    ViewData.Add("AccessLevel", currentUser.UserLevelDescription);
                }
            }

            ViewBag.MenuOrderCentral = tabMenu == TabMenu.OrderCentral ? "active" : "";
            ViewBag.MenuViews = tabMenu == TabMenu.Views ? "active" : "";
            ViewBag.MenuAdmin = tabMenu == TabMenu.Admin ? "active" : "";

            ViewBag.SiteUrl = GetSiteUrl();
            ViewBag.IsLoggedIn = isLoggedIn;
        }
Ejemplo n.º 23
0
 // Use this for initialization
 void Start()
 {
     tabMenu = this;
     gameObject.SetActive(false);
     animator = gameObject.GetComponent <Animator>();
     objectiveButton.onClick.AddListener(delegate() { showPanel(TabPanelType.ObjectivePanel, true); });
     factionButton.onClick.AddListener(delegate() { showPanel(TabPanelType.FactionPanel, true); });
     sapeButton.onClick.AddListener(delegate() { showPanel(TabPanelType.SAPEPanel, true); });
     ciButton.onClick.AddListener(delegate() { showPanel(TabPanelType.CIPanel, true); });
     mainGearButton.onClick.AddListener(delegate() { showPanel(TabPanelType.MainGearPanel, true); });
     secGearButton.onClick.AddListener(delegate() { showPanel(TabPanelType.SecGearPanel, true); });
     inventoryButton.onClick.AddListener(delegate() { showPanel(TabPanelType.InventoryPanel, true); });
     troopButton.onClick.AddListener(delegate() { showPanel(TabPanelType.TroopPanel, true); });
     objectiveButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.ObjectivePanel, true); });
     factionButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.FactionPanel, true); });
     sapeButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.SAPEPanel, true); });
     ciButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.CIPanel, true); });
     mainGearButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.MainGearPanel, true); });
     secGearButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.SecGearPanel, true); });
     inventoryButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.InventoryPanel, true); });
     troopButtonQuick.onClick.AddListener(delegate() { showPanel(TabPanelType.TroopPanel, true); });
     closeTabButton.onClick.AddListener(delegate() { closeTabMenu(); });
     explainPanel.SetActive(false);
 }
Ejemplo n.º 24
0
        private void btnApplyUser_Click(object sender, RoutedEventArgs e)
        {
            // Getting a user and checking for a password


            try
            {
                using (ApplicationContext db = new ApplicationContext())
                {
                    string tempName = comboBoxUsers.SelectedItem.ToString();

                    User user = db.Users.FirstOrDefault(u => u.Username == tempName);

                    idUserForPassword = user.Id; // Getting User Id

                    if (passwordBoxApplyPassword.Password == user.Password)
                    {
                        TabMenu tabMenu = new TabMenu(idUserForPassword);
                        tabMenu.Show();
                        tabMenu.ShowInTaskbar = false;
                    }
                    else
                    {
                        passwordBoxApplyPassword.Clear();
                        ErrorPassword errorPassword = new ErrorPassword(idUserForPassword);
                        errorPassword.ShowDialog();
                        errorPassword.ShowInTaskbar = false;
                    }
                }
            }

            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void MenuLeftContent_CurrentProject_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                TabMenu tabMenu = new TabMenu(driver);

                /* Set of assertions */

                Assert.IsFalse(tabMenu.CurrentProjectIsNull);
                Assert.AreEqual("porsche bal 2.0", tabMenu.CurrentProjectName);
            }
        }
 void OnEnable()
 {
     m_selected = false;
     m_tabMenu  = GetComponentInParent <TabMenu>();
 }
Ejemplo n.º 27
0
 public TabMenuControlCollection(TabMenu owner) : base(owner)
 {
 }
Ejemplo n.º 28
0
 public void OpenTabMenu(TabMenu p_menu)
 {
     OpenTabMenu(p_menu, p_menu.m_currentTab);
 }
Ejemplo n.º 29
0
    public void OpenTabMenu(TabMenu p_menu, string p_tabName)
    {
        OpenMenu(p_menu);

        p_menu.Select(p_tabName);
    }
Ejemplo n.º 30
0
        private void OnSelectedRightClick(string s)
        {
            if (firstSelect)
            {
                firstSelect = false;
            }
            else
            {
                Destroy(splatRightClick.gameObject);
                switch (s)
                {
                case "doc":
                    //blabla
                    //
                    //Possible input types: blabla
                    //Possible output types: blabla
                    StringBuilder          str         = new StringBuilder(node.GetDocumentation() + "\n\n");
                    Type[]                 inputTypes  = node.GetPossibleInputTypes();
                    Type[]                 outputTypes = node.GetPossibleOutputTypes();
                    InputManagerSerializer example     = node.GetExample();

                    if (inputTypes.Length != 0)
                    {
                        str.Append("Possible input types: ");
                        for (int i = 0; i < inputTypes.Length; i++)
                        {
                            string cleanName = TabMenu.CleanClassName(inputTypes[i].ToString());
                            str.Append(cleanName);
                            if (i != inputTypes.Length - 1)
                            {
                                str.Append(", ");
                            }
                        }
                    }

                    if (outputTypes.Length != 0)
                    {
                        str.Append("\nPossible output types: ");
                        for (int i = 0; i < outputTypes.Length; i++)
                        {
                            string cleanName = TabMenu.CleanClassName(outputTypes[i].ToString());
                            str.Append(cleanName);
                            if (i != outputTypes.Length - 1)
                            {
                                str.Append(", ");
                            }
                        }
                    }
                    if (example == null)
                    {
                        MsgBox.Make(str.ToString());
                    }
                    else
                    {
                        MsgBox.Make(str.ToString(), new string[] { "Paste an example" }, new MsgBox.OnButtonClick[] {
                            (MsgBox msg, object o) => {
                                InputManagerSerializer exem = (InputManagerSerializer)o;
                                InputManager.clipboard      = exem.nodes;
                                InputManager.clipboardPos   = exem.PositionsToVector();
                                host.Paste();
                                msg.Close();
                            }
                        }, new object[] { example });
                    }
                    break;

                case "del":
                    Delete();
                    break;

                case "dis":
                    SetEnable(!node.enabled);
                    break;

                case "com":
                    StartComment();
                    break;
                }
            }
        }