Exemplo n.º 1
0
        public void SetFormat(List <ControlEntryProperties> cep)
        {
            for (int i = 0; i < items.Count; i++)
            {
                items[i].Font      = cep[i].font;
                items[i].ForeColor = cep[i].colour;

                int nexttabpos = (i < items.Count - 1) ? cep[i + 1].tabstop : 2000;

                if (items[i] is ExtendedControls.DrawnPanel)
                {
                    ExtendedControls.DrawnPanel dp = items[i] as ExtendedControls.DrawnPanel;
                    dp.MouseOverColor     = ButtonExt.Multiply(cep[i].colour, 1.3F);
                    dp.MouseSelectedColor = ButtonExt.Multiply(cep[i].colour, 1.5F);
                    dp.BackColor          = Color.Black;
                    items[i].Location     = new Point(cep[i].tabstop, items[i].Location.Y + 3);
                    items[i].Size         = new Size(nexttabpos - cep[i].tabstop - 4, items[i].Size.Height - 6);
                }
                else
                {
                    items[i].BackColor = Color.Transparent;
                    items[i].Location  = new Point(cep[i].tabstop, items[i].Location.Y);
                    items[i].Size      = new Size(nexttabpos - cep[i].tabstop - 4, items[i].Size.Height - 4);
                }
            }
        }
Exemplo n.º 2
0
        public void SetGripperColour(Color grip)
        {
            if (grip.GetBrightness() < 0.15)       // override if its too dark..
            {
                grip = Color.Orange;
            }

            labelExt_NoSystems.ForeColor = grip;

            panel_grip.ForeColor          = grip;
            panel_grip.MouseOverColor     = ButtonExt.Multiply(grip, 1.3F);
            panel_grip.MouseSelectedColor = ButtonExt.Multiply(grip, 1.5F);

            transparentkey       = (grip == Color.Red) ? Color.Green : Color.Red;
            this.BackColor       = transparentkey;
            this.TransparencyKey = transparentkey;
        }
Exemplo n.º 3
0
    public override void Reg()
    {
        Level = 2;
        // 按钮赋值
        groupBtn       = ((this["GroupBtn"] as GUButton).button) as ButtonExt;
        teamBtn        = ((this["TeamBtn"] as GUButton).button) as ButtonExt;
        commandPostBtn = ((this["CommandPostBtn"] as GUButton).button) as ButtonExt;

        groupRect      = groupBtn.GetComponent <RectTransform>();
        teamRect       = teamBtn.GetComponent <RectTransform>();
        comandPostRect = commandPostBtn.GetComponent <RectTransform>();

        // 注册鼠标点击事件
        groupBtn.onClick.AddListener(() => { OnClick(UIName.Group); });
        teamBtn.onClick.AddListener(() => { OnClick(UIName.Team); });
        commandPostBtn.onClick.AddListener(() => { OnClick(UIName.CommandPost); });

        groupBtn.AddNormal(OutButton);
        teamBtn.AddNormal(OutButton);
        commandPostBtn.AddNormal(OutButton);
    }
Exemplo n.º 4
0
        private void ShowDividers(bool show)
        {
            foreach (ButtonExt p in dividers)
            {
                p.Visible = false;
            }

            //System.Diagnostics.Debug.WriteLine("Dividers " + show);
            if (show)
            {
                dividercapture = -1;

                for (int i = 1; i < columnpos.Count; i++)              // bring up the number of dividers needed
                {
                    ButtonExt b = dividers[i - 1];
                    b.Location           = new Point(scanpostextoffset.X + columnpos[i] - b.Width / 2, 0);
                    b.ButtonColorScaling = 1.0F;
                    if (b.FlatStyle == FlatStyle.System)            // System can't do bitmaps.. we need standard.
                    {
                        b.FlatStyle = FlatStyle.Standard;
                    }
                    else if (b.FlatStyle == FlatStyle.Popup)        // if in Popup (ours) we can adjust the look further.
                    {
                        b.FlatAppearance.BorderColor = dividers[i - 1].BackColor;
                    }
                    b.Visible = true;
                }

                dividercheck.Start();
            }
            else
            {
                dividercapture = -2;
                dividercheck.Stop();
            }
        }