Ejemplo n.º 1
0
        private void ribBtn_Click(object sender, EventArgs e)
        {
            try
            {
                RibBtnVA.RibBtnVA btn = (RibBtnVA.RibBtnVA)sender;
                foreach (Control ctrl in panelProcess.Controls)
                {
                    ctrl.BackColor = Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(227)))), ((int)(((byte)(227)))));
                }
                btn.BackColor = Color.PaleTurquoise;

                _iCurrProcessIndex = Convert.ToInt32(btn.Title.Split('.')[0]) - 1;

                ProcessActionButtonEnable();
            }
            catch (Exception)
            {
                _iCurrProcessIndex = 0;

                ProcessActionButtonEnable();
            }
        }
Ejemplo n.º 2
0
        private void ProcessActionsListRefresh()
        {
            try
            {
                if (VisionManage.iCurrSceneIndex < 0)
                {
                    return;
                }
                panelProcess.Controls.Clear();

                List <ActionBase> list = VisionManage.listScene[VisionManage.iCurrSceneIndex].listAction;
                for (int index = list.Count - 1; index >= 0; index--)
                {
                    RibBtnVA.RibBtnVA btn = new RibBtnVA.RibBtnVA();

                    #region Set button style
                    btn.Arrow                      = RibBtnVA.RibBtnVA.e_arrow.None;
                    btn.ColorBase                  = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(227)))), ((int)(((byte)(227)))));
                    btn.BackColor                  = btn.ColorBase;
                    btn.ColorBaseStroke            = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(76)))), ((int)(((byte)(76)))), ((int)(((byte)(76)))));
                    btn.ColorOn                    = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
                    btn.ColorOnStroke              = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
                    btn.ColorPress                 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
                    btn.ColorPressStroke           = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
                    btn.Dock                       = System.Windows.Forms.DockStyle.Top;
                    btn.FadingSpeed                = 35;
                    btn.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
                    btn.FlatAppearance.BorderSize  = 0;
                    btn.FlatStyle                  = System.Windows.Forms.FlatStyle.Flat;
                    btn.Font                       = new System.Drawing.Font("新宋体", 11.25F);
                    btn.ForeColor                  = System.Drawing.Color.Green;
                    btn.GroupPos                   = RibBtnVA.RibBtnVA.e_groupPos.None;
                    btn.Image                      = global::WorldGeneralLib.Properties.Resources.图像输入;
                    btn.ImageLocation              = RibBtnVA.RibBtnVA.e_imagelocation.Left;
                    btn.ImageOffset                = 10;
                    btn.ImageOffsetX               = 5;
                    btn.IsPressed                  = false;
                    btn.KeepPress                  = false;
                    btn.Location                   = new System.Drawing.Point(0, 0);
                    btn.Margin                     = new System.Windows.Forms.Padding(5);
                    btn.MaxImageSize               = new System.Drawing.Point(48, 48);
                    btn.MenuPos                    = new System.Drawing.Point(0, 0);
                    btn.Name                       = "ribBtnVA" + index.ToString();
                    btn.Radius                     = 6;
                    btn.ShowBase                   = RibBtnVA.RibBtnVA.e_showbase.Yes;
                    btn.Size                       = new System.Drawing.Size(256, 54);
                    btn.SplitButton                = RibBtnVA.RibBtnVA.e_splitbutton.No;
                    btn.SplitDistance              = 0;
                    btn.TabIndex                   = 1;
                    btn.TextOfsetX                 = 5;
                    btn.TextOfsetY                 = 3;
                    btn.TitleForeColor             = System.Drawing.Color.Gray;
                    btn.UseVisualStyleBackColor    = false;

                    btn.Title = (index + 1).ToString() + ". " + list[index].actionData.Name;
                    btn.Text  = " ";

                    btn.Click += new EventHandler(ribBtn_Click);
                    #endregion

                    if (_iCurrProcessIndex == index)
                    {
                        btn.ColorBase = Color.PaleTurquoise;
                        btn.BackColor = btn.ColorBase;
                    }

                    panelProcess.Controls.Add(btn);
                }
            }
            catch (Exception ex)
            {
                panelProcess.Controls.Clear();
                MessageBox.Show("刷新流程列表时发生错误!\r\n" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
            ProcessActionButtonEnable();
        }