コード例 #1
0
        public void Init(ActionFile af, Condition c, ActionCoreController ac, string apf, Icon i, ToolTip toolTip,
                         ActionProgram.ProgramConditionClass cls)
        {
            cd                   = c; // point at common condition, we never new it, just update action data/action
            actionfile           = af;
            actioncorecontroller = ac;
            applicationfolder    = apf;
            Icon                 = i;
            classifier           = cls;

            progmajortype = new ExtendedControls.PanelSelectionList();
            progmajortype.Items.AddRange(new string[] { "Key", "Say", "Key+Say", "Full Program" });
            indextoclassifier = new ActionProgram.ProgramConditionClass[] { ActionProgram.ProgramConditionClass.Key, ActionProgram.ProgramConditionClass.Say,
                                                                            ActionProgram.ProgramConditionClass.KeySay, ActionProgram.ProgramConditionClass.Full };
            progmajortype.Location              = new Point(0, 0);
            progmajortype.Size                  = new Size(this.Width, this.Height); // outer panel aligns with this UC
            progmajortype.SelectedIndexChanged += PanelType_SelectedIndexChanged;
            toolTip.SetToolTip(progmajortype, "Use the selector (click on bottom right arrow) to select program class type");

            proglist = new ExtendedControls.ComboBoxCustom();
            proglist.Items.Add("New");
            proglist.Items.AddRange(actionfile.actionprogramlist.GetActionProgramList());
            proglist.Location              = new Point(panelxmargin, panelymargin);
            proglist.Size                  = new Size((this.Width - 24 - 8 - 8 - 8 - panelxmargin * 2) / 2, 24); // 24 button, 8+8 gaps, 8 for selector
            proglist.DropDownHeight        = 400;
            proglist.DropDownWidth         = proglist.Width * 3 / 2;
            proglist.SelectedIndexChanged += Proglist_SelectedIndexChanged;
            proglist.SetTipDynamically(toolTip, "Select program to associate with this event");

            progedit          = new ExtendedControls.ButtonExt();
            progedit.Text     = "P";
            progedit.Location = new Point(proglist.Right + 8, panelymargin);
            progedit.Size     = new Size(24, 24);
            progedit.Click   += Progedit_Click;
            toolTip.SetToolTip(progedit, "Edit associated program");

            paras          = new ExtendedControls.TextBoxBorder();
            paras.Text     = (cd.actiondata != null) ? cd.actiondata : "";
            paras.Location = new Point(progedit.Right + 8, panelymargin + 2);
            paras.Size     = proglist.Size;
            paras.ReadOnly = true;
            paras.Click   += Paras_Click;
            paras.SetTipDynamically(toolTip, "Click to enter parameters to pass to program");

            buttonKeys          = new ExtendedControls.ButtonExt();
            buttonKeys.Location = proglist.Location;
            buttonKeys.Size     = new Size((this.Width - 8 - 8 - panelxmargin * 2) / 2, 24);
            buttonKeys.Click   += Keypress_Click;
            toolTip.SetToolTip(buttonKeys, "Click to define keystrokes to send");

            buttonSay          = new ExtendedControls.ButtonExt();
            buttonSay.Location = new Point(buttonKeys.Right + 8, buttonKeys.Top);
            buttonSay.Size     = buttonKeys.Size;
            buttonSay.Click   += Saypress_Click;
            toolTip.SetToolTip(buttonSay, "Click to set speech to say");

            SuspendLayout();
            progmajortype.Controls.Add(proglist);
            progmajortype.Controls.Add(progedit);
            progmajortype.Controls.Add(paras);
            progmajortype.Controls.Add(buttonKeys);
            progmajortype.Controls.Add(buttonSay);
            Controls.Add(progmajortype);

            UpdateControls();

            ResumeLayout();
        }