Beispiel #1
0
        private void adjust(Panel thing)
        {
            int n;

            chkSign.Checked = thing.sign == 1;
            chkSign.Visible = thing.sign != -1;

            switch (thing.ui_mode)
            {
            case UI_Mode.UI_Combo:
                n = osd.getAlt(thing) / 2;
                cbNumber.SelectedIndex = n;
                cbNumber.Visible       = true;
                chkAlt.Visible         = false;
                chkAlt2.Visible        = false;
                chkAlt3.Visible        = false;
                chkAlt4.Visible        = false;
                cbNumber.Text          = n.ToString();
                labNumber.Text         = thing.alt_text;
                labNumber.Visible      = true;
                break;

            case UI_Mode.UI_Combo_Cb:
                n = osd.getAlt(thing) / 2;
                cbNumber.SelectedIndex = n;
                cbNumber.Visible       = true;
                chkAlt.Visible         = true;
                chkAlt2.Visible        = false;
                chkAlt3.Visible        = false;
                chkAlt4.Visible        = false;
                cbNumber.Text          = n.ToString();

                labNumber.Text    = thing.alt_text;
                chkAlt.Text       = thing.alt2_text;
                labNumber.Visible = true;
                break;

            case UI_Mode.UI_Checkbox:
            default:
                labNumber.Visible = false;
                cbNumber.Visible  = false;

                chkAlt.Text    = thing.alt_text;
                chkAlt.Visible = thing.Altf != -1 && thing.alt_text != "";
                chkAlt.Checked = thing.Altf == 1;

                chkAlt2.Text    = thing.alt2_text;
                chkAlt2.Visible = thing.Alt2 != -1 && thing.alt2_text != "";
                chkAlt2.Checked = thing.Alt2 == 1;

                chkAlt3.Text    = thing.alt3_text;
                chkAlt3.Visible = thing.Alt3 != -1 && thing.alt3_text != "";
                chkAlt3.Checked = thing.Alt3 == 1;

                chkAlt4.Text    = thing.alt4_text;
                chkAlt4.Visible = thing.Alt4 != -1 && thing.alt4_text != "";
                chkAlt4.Checked = thing.Alt4 == 1;
                break;
            }
        }
Beispiel #2
0
        private void showPanelControls(Panel thing)
        {
            int n;

            fReenter = true;

            adjustGroupbox();

            NUM_X.Value = Constrain(thing.x, 0, osd.get_basesize().Width - 1);
            NUM_Y.Value = Constrain(thing.y, 0, OSD.SCREEN_H - 1);

            chkSign.Checked = thing.sign == 1;
            chkSign.Visible = (thing.sign >= 0);

            labStrings.Visible = false;
            txtStrings.Visible = false;

            switch (thing.ui_mode)
            {
            case UI_Mode.UI_Combo:
                n = osd.getAlt(thing) / 2;
                cbNumber.SelectedIndex = n;
                cbNumber.Visible       = true;
                chkAlt.Visible         = false;
                chkAlt2.Visible        = false;
                chkAlt3.Visible        = false;
                chkAlt4.Visible        = false;
                cbNumber.Text          = n.ToString();
                labNumber.Text         = thing.alt_text;
                labNumber.Visible      = true;
                break;

            case  UI_Mode.UI_Combo_Cb_Strings:
                labStrings.Visible = true;
                txtStrings.Visible = true;
                txtStrings.Text    = thing.strings;
                goto as_combo_cb;
            //labStrings

            case UI_Mode.UI_Combo_Cb:
as_combo_cb:
                n = osd.getAlt(thing) / 2;
                cbNumber.SelectedIndex = n;
                cbNumber.Visible       = true;
                chkAlt.Visible         = true;
                chkAlt2.Visible        = false;
                chkAlt3.Visible        = false;
                chkAlt4.Visible        = false;
                cbNumber.Text          = n.ToString();

                labNumber.Text    = thing.alt_text;
                chkAlt.Text       = thing.alt2_text;
                labNumber.Visible = true;
                break;

            case UI_Mode.UI_Checkbox:
            default:
                labNumber.Visible = false;
                cbNumber.Visible  = false;

                chkAlt.Text    = thing.alt_text;
                chkAlt.Visible = thing.Altf != -1 && thing.alt_text != "";
                chkAlt.Checked = thing.Altf == 1;

                chkAlt2.Text    = thing.alt2_text;
                chkAlt2.Visible = thing.Alt2 != -1 && thing.alt2_text != "";
                chkAlt2.Checked = thing.Alt2 == 1;

                chkAlt3.Text    = thing.alt3_text;
                chkAlt3.Visible = thing.Alt3 != -1 && thing.alt3_text != "";
                chkAlt3.Checked = thing.Alt3 == 1;

                chkAlt4.Text    = thing.alt4_text;
                chkAlt4.Visible = thing.Alt4 != -1 && thing.alt4_text != "";
                chkAlt4.Checked = thing.Alt4 == 1;
                break;
            }
            fReenter = false;
        }
        private void showPanelControls(Panel thing)
        {
            int n;

            fReenter = true;

            adjustGroupbox();

            NUM_X.Value = Constrain(thing.x, 0, osd.get_basesize().Width - 1);
            NUM_Y.Value = Constrain(thing.y, 0, OSD.SCREEN_H - 1);

            chkSign.Checked = thing.sign == 1;
            chkSign.Visible = (thing.sign >= 0);

            // all invisible
            labStrings.Visible = false;
            txtStrings.Visible = false;
            labNumber.Visible  = false;
            cbNumber.Visible   = false;
            cbFilter.Visible   = false;
            chkAlt.Visible     = false;
            chkAlt2.Visible    = false;
            chkAlt3.Visible    = false;
            chkAlt4.Visible    = false;
            chkAlt5.Visible    = false;
            chkAlt6.Visible    = false;
            cbTime.Visible     = false;

            labNumber.Location = new System.Drawing.Point(10, 70); // std
            chkAlt3.Location   = new System.Drawing.Point(10, 83);
            chkAlt4.Location   = new System.Drawing.Point(10, 98);

            switch (thing.ui_mode)
            {
            case UI_Mode.UI_Combo:
                n = osd.getAlt(thing) / 2;
                cbNumber.SelectedIndex = n;
                cbNumber.Visible       = true;
                cbNumber.Text          = n.ToString();
                labNumber.Text         = thing.alt_text;
                labNumber.Visible      = true;
                break;

            case  UI_Mode.UI_Combo_Cb_Strings:
                labStrings.Visible = true;
                txtStrings.Visible = true;
                txtStrings.Text    = thing.strings;
                goto as_combo_cb;
            //labStrings

            case UI_Mode.UI_Combo_Cb:
as_combo_cb:
                n = osd.getAlt(thing) / 2;
                cbNumber.SelectedIndex = n;
                cbNumber.Visible       = true;
                chkAlt.Visible         = true;
                cbNumber.Text          = n.ToString();

                labNumber.Text    = thing.alt_text;
                chkAlt.Text       = thing.alt2_text;
                labNumber.Visible = true;
                break;

            case UI_Mode.UI_Combo_Time:
                n = osd.getAlt(thing) / 2;
                cbTime.SelectedIndex = n;
                cbTime.Visible       = true;
                chkAlt.Visible       = true;
                //cbNumber.Text = n.ToString();

                labNumber.Text    = thing.alt_text;
                chkAlt.Text       = thing.alt2_text;
                labNumber.Visible = true;
                break;


            case UI_Mode.UI_Checkbox_1:
                chkAlt5.Text    = thing.alt5_text;
                chkAlt5.Visible = thing.alt5_text != "";
                chkAlt5.Checked = thing.Alt5 != 0;

                chkAlt6.Text    = thing.alt6_text;
                chkAlt6.Visible = thing.alt6_text != "";
                chkAlt6.Checked = thing.Alt6 != 0;
                goto as_checkbox;

            case UI_Mode.UI_Checkbox:
            default:
as_checkbox:
                chkAlt.Visible  = true;
                chkAlt2.Visible = true;
                chkAlt3.Visible = true;
                chkAlt4.Visible = true;

                chkAlt.Text    = thing.alt_text;
                chkAlt.Visible = thing.Altf != -1 && thing.alt_text != "";
                chkAlt.Checked = thing.Altf == 1;

                chkAlt2.Text    = thing.alt2_text;
                chkAlt2.Visible = thing.Alt2 != -1 && thing.alt2_text != "";
                chkAlt2.Checked = thing.Alt2 == 1;

                chkAlt3.Text    = thing.alt3_text;
                chkAlt3.Visible = thing.Alt3 != -1 && thing.alt3_text != "";
                chkAlt3.Checked = thing.Alt3 == 1;

                chkAlt4.Text    = thing.alt4_text;
                chkAlt4.Visible = thing.Alt4 != -1 && thing.alt4_text != "";
                chkAlt4.Checked = thing.Alt4 == 1;
                break;

            case UI_Mode.UI_Filter:
                n = osd.getAlt(thing) & 3;
                try {
                    cbFilter.SelectedIndex = n;
                } catch {
                    cbFilter.SelectedIndex = 0;
                }
                cbFilter.Visible   = true;
                labNumber.Text     = thing.alt_text;
                labNumber.Location = new System.Drawing.Point(10, 70 - 14); // moved
                labNumber.Visible  = true;

                chkAlt3.Location = new System.Drawing.Point(10, 83 + 10);
                chkAlt4.Location = new System.Drawing.Point(10, 98 + 10);


                chkAlt3.Text    = thing.alt3_text;
                chkAlt3.Visible = thing.Alt3 != -1 && thing.alt3_text != "";
                chkAlt3.Checked = thing.Alt3 == 1;

                chkAlt4.Text    = thing.alt4_text;
                chkAlt4.Visible = thing.Alt4 != -1 && thing.alt4_text != "";
                chkAlt4.Checked = thing.Alt4 == 1;

                break;
            }
            fReenter = false;
        }