Exemplo n.º 1
0
        public override void CreateButtons(TabButtons buttons, CustomHeaderButtonCollection userButtons)
        {
            if (this.keepButtons > 0)
            {
                return;
            }

            Buttons.Clear();
            if (TabViewInfo.AddActiveFilesButton)
            {
                this.Buttons.Add(CreateButton(TabButtonType.User));
            }
            if ((buttons & TabButtons.Prev) != 0)
            {
                this.Buttons.Add(CreateButton(TabButtonType.Prev));
            }
            if ((buttons & TabButtons.Next) != 0)
            {
                this.Buttons.Add(CreateButton(TabButtonType.Next));
            }
            if ((buttons & TabButtons.Close) != 0)
            {
                this.Buttons.Add(CreateButton(TabButtonType.Close));
            }
        }
Exemplo n.º 2
0
        protected override Size CalcButtonsSize(TabButtons btns)
        {
            Size buttonsSize = base.CalcButtonsSize(btns);

            if (buttonsSize == Size.Empty && ViewInfo.AddActiveFilesButton)
            {
                buttonsSize = Buttons.CalcSize(GraphicsInfo.Graphics);
            }

            return(buttonsSize);
        }
Exemplo n.º 3
0
    public void ButtonMouseClick(int id)
    {
        if (selectedButton != null)
        {
            selectedButton.ToggleActive();
        }

        selectedIndex  = id;
        selectedButton = buttons[selectedIndex];
        selectedButton.ToggleActive();
        HideAllPanels();
    }
Exemplo n.º 4
0
    void Awake()
    {
        buttonsPanel = transform.GetChild(0).gameObject.transform;
        panelsPanel  = transform.GetChild(1).gameObject.transform;

        for (int i = 0; i < buttonsPanel.transform.childCount; i++)
        {
            GameObject buttonTemp = buttonsPanel.transform.GetChild(i).gameObject;
            TabButtons button     = buttonTemp.GetComponent <TabButtons>();
            button.SetIndex(i);
            buttons.Add(button);
        }

        foreach (Transform item in panelsPanel.transform)
        {
            panels.Add(item);
        }

        ButtonMouseClick(0);
        gameObject.SetActive(false);
    }
Exemplo n.º 5
0
        public Button CreateTabButton(GridLayout parent, string name, string tooltip, int x, int y)
        {
            Button button = new Button(GUI, parent, name, GUI.SmallFont, Button.ButtonMode.ImageButton, new ImageFrame(Icons, 32, x, y))
            {
                CanToggle       = true,
                IsToggled       = false,
                KeepAspectRatio = true,
                DontMakeBigger  = true,
                ToolTip         = tooltip,
                TextColor       = Color.Black,
                HoverTextColor  = Color.DarkRed,
                DrawFrame       = true
            };

            button.OnClicked += () => ButtonClicked(button);

            parent.SetComponentPosition(button, TabButtons.Count, 0, 1, 1);
            TabButtons.Add(button);



            return(button);
        }
 protected override void CreateButtonsCore(TabButtons buttons, CustomHeaderButtonCollection userButtons)
 {
     base.CreateButtonsCore(buttons, PageDescendant.CustomButtons);
 }