Esempio n. 1
0
 public GuiControl(object control, string name, string sName, string cmds, string tabTitle,
                   List <string> column_titles   = null, string pre_cmd = null, string pos_cmd = null, int tab_index = -1,
                   webbrowser_container_form wcf = null)
 {
     this.control       = control;
     this.name          = name;
     this.sName         = sName;
     this.cmds          = cmds;
     this.tabTitle      = tabTitle;
     this.column_titles = column_titles;
     this.pre_cmd       = pre_cmd;
     this.pos_cmd       = pos_cmd;
     this.tab_index     = tab_index;
     this.wcf           = wcf;
 }
Esempio n. 2
0
        public GuiControl add_control(string name, object control, string tabTitle = null, string cmds = null,
                                      string pre_cmd = null, string pos_cmd = null, int tab_index = -1,
                                      webbrowser_container_form wcf = null)
        {
            GuiControl gui_control = null;

            if (name == null || name.Length == 0)
            {
                return(null);
            }

            /*
             * if (control == null)
             * {
             *  Console.WriteLine("warning: GuiControl: add_control(): control name='" + name + "' is null", "control is null");
             *  //return null;
             * }*/
            gui_control = findControlBy_name(name);
            if (gui_control != null)
            {
                gui_control.closed = false;
                gui_control.cmds   = cmds;
                return(gui_control);
            }
            try
            {
                string sName = name;
                if (sName.Contains("_"))
                {
                    int pos = sName.IndexOf("_");
                    sName = sName.Substring(0, pos);
                }
                gui_control = new GuiControl(
                    control, name, sName, cmds, tabTitle, null,
                    pre_cmd, pos_cmd, tab_index, wcf);
                controls.Add(gui_control);
            }
            catch (Exception e)
            {
                r2pw.Show(e.ToString(), "GuiControls: add_control()");
            }
            return(gui_control);
        }