Beispiel #1
0
        private void lblCheck_CheckedChanged(System.Object sender, System.Windows.Forms.MouseEventArgs e)
        {
            int    idx   = TableLayoutPanel1.GetRow((Control)sender);
            tParam param = paramList[idx];

            if (paramTableCheckedChangedEvent != null)
            {
                paramTableCheckedChangedEvent(param.paramName, ((CheckBox)sender).Checked);
            }
        }
Beispiel #2
0
        private void lblBut_Click(System.Object sender, System.EventArgs e)
        {
            int    idx   = TableLayoutPanel1.GetRow((Control)sender);
            tParam param = paramList[idx];

            if (paramTableButtonClickedEvent != null)
            {
                paramTableButtonClickedEvent(param.paramName, param.value);
            }
        }
Beispiel #3
0
        // Mouse events for selection and modification of parameters
        //Private Sub ParamTable_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        private void Param_MouseEnter(System.Object sender, System.EventArgs e)
        {
            //Debug.Print("Param_MouseEnter")
            bool bDoFocus = true;
            int  iRow     = -1;

            // 29/07/2015 no pintar ni cambiar foco cuando estoy editando un valor
            if (curInputIndex >= 0)
            {
                // no cambiar focus para que no haga validating del tbEdit
                bDoFocus = false;
            }

            if (ReferenceEquals(((Control)sender).Parent, TableLayoutPanel1))
            {
                iRow = TableLayoutPanel1.GetRow((Control)sender);
                //Debug.Print("iRow=" & iRow.ToString & " - mouseOverIndex=" & mouseOverIndex.ToString)
                //If iRow < 0 Then Exit Sub
                if (iRow != mouseOverIndex)
                {
                    // set previous labels
                    if (mouseOverIndex >= 0)
                    {
                        paramList[mouseOverIndex].lblText.Font       = textFont;
                        paramList[mouseOverIndex].lblText.ForeColor  = textColor;
                        paramList[mouseOverIndex].lblText.BackColor  = Color.Transparent;
                        paramList[mouseOverIndex].lblValue.Font      = textFont;
                        paramList[mouseOverIndex].lblValue.ForeColor = textColor;
                        paramList[mouseOverIndex].lblValue.BackColor = Color.Transparent;
                        paramList[mouseOverIndex].lblValue.Cursor    = Cursors.Default;
                    }
                    paramList[iRow].lblText.Font       = textMouseOverFont;
                    paramList[iRow].lblText.ForeColor  = textMouseOverColor;
                    paramList[iRow].lblText.BackColor  = Color.Transparent;
                    paramList[iRow].lblValue.Font      = textMouseOverFont;
                    paramList[iRow].lblValue.ForeColor = textMouseOverColor;
                    paramList[iRow].lblValue.BackColor = Color.Transparent;
                    if (paramList[iRow].input == cInputType.SWITCH & paramList[iRow].enabled)
                    {
                        // set focus to get key events
                        if (bDoFocus)
                        {
                            paramList[iRow].lblValue.Focus();
                        }
                        if (bControlDown)
                        {
                            paramList[iRow].lblValue.Cursor = Configuration.cursor_switch_minus; // Cursors.PanSouth
                        }
                        else
                        {
                            paramList[iRow].lblValue.Cursor = Configuration.cursor_switch_plus; // Cursors.PanNorth
                        }
                    }
                    else if (paramList[iRow].input != cInputType.FIX & paramList[iRow].enabled)
                    {
                        if (bDoFocus)
                        {
                            paramList[iRow].lblValue.Focus();
                        }
                        paramList[iRow].lblValue.Cursor = Configuration.cursor_hand;
                    }
                    else
                    {
                        if (bDoFocus)
                        {
                            paramList[iRow].lblValue.Focus();
                        }
                        paramList[iRow].lblValue.Cursor = Cursors.Default;
                    }
                }
                mouseOverIndex = TableLayoutPanel1.GetRow((Control)sender);
            }
        }