Пример #1
0
        private void CreateControls()
        {
            int cnt = 0;

            foreach (RaidTheCagesModes val in Enum.GetValues(typeof(RaidTheCagesModes)))
            {
                if (MultiLangualTexts.GetContinueTextEnglish(val) != "")
                {
                    Label lb = new Label();
                    lb.Text      = MultiLangualTexts.GetContinueTextEnglish(val);
                    lb.Location  = new Point(0, cnt * 22);
                    lb.Size      = new Size(280, 20);
                    lb.TextAlign = ContentAlignment.MiddleRight;
                    this.panel1.Controls.Add(lb);

                    wgtextbox tb = new wgtextbox();
                    tb.rtcmode = val;
                    if (MidiSettings.mMidiNotes[(int)val] != -1)
                    {
                        tb.Text = MidiSettings.mMidiNotes[(int)val].ToString();
                    }
                    tb.Size         = new Size(30, 20);
                    tb.TextChanged += tb_TextChanged;
                    tb.Location     = new Point(290, cnt++ *22);
                    this.panel1.Controls.Add(tb);
                }
            }


            cnt = 0;
            foreach (string str in MidiSettings.ExtraMidiNotes)
            {
                Label lb = new Label();
                lb.Text      = MidiSettings.ExtraMidiNotes[cnt];
                lb.Location  = new Point(0, cnt * 22);
                lb.Size      = new Size(280, 20);
                lb.TextAlign = ContentAlignment.MiddleRight;
                this.panel2.Controls.Add(lb);

                wgtextbox2 tb = new wgtextbox2();
                tb.mTextnr = cnt;
                if (MidiSettings.mExtraMidiNotes[cnt] != -1)
                {
                    tb.Text = MidiSettings.mExtraMidiNotes[cnt].ToString();
                }
                tb.Size         = new Size(30, 20);
                tb.TextChanged += tb_TextChanged2;
                tb.Location     = new Point(290, cnt++ *22);
                this.panel2.Controls.Add(tb);
            }
        }
        void tb_TextChanged2(object sender, EventArgs e)
        {
            if (mIsUpdating)
            {
                return;
            }

            wgtextbox2 tb = (wgtextbox2)sender;

            // ok.. we need to update the class... first set the mchanged to true, so everything will be saved
            Changed();

            MultiLangualTexts.SecondLanguageTexts[tb.mTextnr] = tb.Text;
        }
Пример #3
0
        void tb_TextChanged2(object sender, EventArgs e)
        {
            if (mIsUpdating)
            {
                return;
            }

            wgtextbox2 tb = (wgtextbox2)sender;

            // ok.. we need to update the class... first set the mchanged to true, so everything will be saved
            MidiSettings.mChanged = true;

            if (tb.Text == "" || tb.Text == " ")
            {
                MidiSettings.mExtraMidiNotes[tb.mTextnr] = -1;
            }
            else
            {
                int.TryParse(tb.Text, out MidiSettings.mExtraMidiNotes[tb.mTextnr]);
            }
        }