public GuiControl get_active_control() { string tabTitle = r2pw.guicontrol.selected_tab("title"); GuiControl gui_control = findControlBy_tabTitle(tabTitle); return(gui_control); }
public void remove_control_byName(string controlName, int skip = 0) { GuiControl c = findControlBy_name(controlName, skip); while (c != null) { controls.Remove(c); c = findControlBy_name(controlName, skip); } }
public webbrowser_container_form(R2PIPE_WRAPPER r2pw, GuiControl control) { this.r2pw = r2pw; this.control = control; MenuHandle = GetSystemMenu((System.IntPtr) this.Handle, false); InsertMenu(MenuHandle, 5, MF_BYPOSITION | MF_SEPARATOR, 0, string.Empty); InsertMenu(MenuHandle, 6, MF_BYPOSITION, MENU_SYNCHRONIZE, "Synchronize"); InsertMenu(MenuHandle, 7, MF_BYPOSITION, MENU_ALLWAYSONTOP, "Always on top"); InitializeComponent(); }
public void close_control_byName(string controlName) { GuiControl c = findControlBy_name(controlName); int skip = 0; while (c != null) { c.closed = true; c = findControlBy_name(controlName, ++skip); } }
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); }