public SledTreeListViewEditor( string name, string image, string[] columns, TreeListView.Style style, StandardControlGroup controlGroup) : base(style) { TreeListView.Name = name; foreach (var column in columns) { TreeListView.Columns.Add(new TreeListView.Column(column)); } { var theImage = (!string.IsNullOrEmpty(image) && ResourceUtil.GetImageList16().Images.ContainsKey(image)) ? ResourceUtil.GetImageList16().Images[image] : null; m_controlInfo = new ControlInfo( TreeListView.Name, TreeListView.Name, controlGroup, theImage); } }
public SledTreeListViewEditor( string name, string image, string[] columns, TreeListView.Style style, StandardControlGroup controlGroup) : base(style) { TreeListView.Name = name; foreach (var column in columns) TreeListView.Columns.Add(new TreeListView.Column(column)); { var theImage = (!string.IsNullOrEmpty(image) && ResourceUtil.GetImageList16().Images.ContainsKey(image)) ? ResourceUtil.GetImageList16().Images[image] : null; m_controlInfo = new ControlInfo( TreeListView.Name, TreeListView.Name, controlGroup, theImage); } }
/// <summary> /// Constructor</summary> /// <param name="name">Control name, which may be displayed as the title of a hosting /// control or form</param> /// <param name="description">Control description, which may be displayed as a tooltip /// when the user hovers over a hosting control or form</param> /// <param name="group">Desired initial control hosting group</param> /// <param name="image">Control image, which may be displayed on a hosting control /// or form</param> /// <param name="helpUrl">URL to open when the user presses F1 and this Control has focus. /// If null or the empty string, then this feature is disabled. It is better to use this /// parameter than to use the WebHelp object directly, so that the container in the docking /// framework will have a WebHelp object attached.</param> public ControlInfo(string name, string description, StandardControlGroup group, Image image, string helpUrl = null) { m_name = name; m_description = description; m_group = group; m_image = image; m_helpUrl = helpUrl; }
/// <summary> /// Registers a control with the control host service</summary> /// <param name="controlHostService">Control host service</param> /// <param name="control">Control</param> /// <param name="name">Control name</param> /// <param name="description">Control description</param> /// <param name="group">Initial location of control on main form</param> /// <param name="client">Client that owns control, or null</param> /// <returns>ControlInfo for registered control</returns> public static ControlInfo RegisterControl( this IControlHostService controlHostService, Control control, string name, string description, StandardControlGroup group, IControlHostClient client) { var info = new ControlInfo(name, description, group); controlHostService.RegisterControl(control, info, client); return info; }
/// <summary> /// Registers a control with the control host service</summary> /// <param name="controlHostService">Control host service</param> /// <param name="control">Control</param> /// <param name="name">Control name</param> /// <param name="description">Control description</param> /// <param name="group">Initial location of control on main form</param> /// <param name="client">Client that owns control, or null</param> /// <returns>ControlInfo for registered control</returns> public static ControlInfo RegisterControl( this IControlHostService controlHostService, Control control, string name, string description, StandardControlGroup group, IControlHostClient client) { var info = new ControlInfo(name, description, group); controlHostService.RegisterControl(control, info, client); return(info); }
protected SledLuaTreeListViewEditor( string name, string image, string[] columns, StandardControlGroup controlGroup) : base(name, image, columns, TreeListView.Style.TreeList, controlGroup) { TreeListView.AllowDrop = true; TreeListView.NodeSorter = new LuaVarSorter(TreeListView); TreeListView.Renderer = new LuaVarRenderer(TreeListView); TreeListView.Columns.ElementAt(ValueColumnIndexValue).AllowPropertyEdit = true; // TODO: //AllowDrag = true; AllowDebugFreeze = true; TreeListView.NodeExpandedChanged += TreeListViewNodeExpandedChanged; TreeListViewAdapter.CanItemPropertyChange += TreeListViewAdapterCanItemPropertyChange; TreeListViewAdapter.ItemPropertyChanged += TreeListViewAdapterItemPropertyChanged; MouseDoubleClick += SledLuaTreeListViewEditorMouseDoubleClick; }
private static bool IsCenterGroup(StandardControlGroup groupTag) { return (groupTag == StandardControlGroup.Center || groupTag == StandardControlGroup.CenterPermanent); }
private static bool IsCenterGroup(StandardControlGroup groupTag) { return groupTag == StandardControlGroup.Center || groupTag == StandardControlGroup.CenterPermanent; }
/// <summary> /// Sets the relative size of the specified portion of the given docking panel.</summary> /// <param name="panel">An object representing a docking panel (like by calling GetPanel), or null, /// to specify the top-level docking panel owned by this ControlHostService.</param> /// <param name="group">An enum specifying the left, right, top, or bottom portion of the panel</param> /// <param name="portion">The size, as a non-zero fraction of the panel, between 0 and 1 or /// as an absolute extent in pixels greater than or equal to 1</param> public void SetPanelPortion(object panel, StandardControlGroup group, float portion) { DockPanel dockPanel; if (panel == null) dockPanel = m_dockPanel; else dockPanel = (DockPanel)panel; if (portion <= 0) throw new ArgumentOutOfRangeException("portion", "Must be greater than 0"); switch (group) { case StandardControlGroup.Left: dockPanel.DockLeftPortion = portion; break; case StandardControlGroup.Right: dockPanel.DockRightPortion = portion; break; case StandardControlGroup.Top: dockPanel.DockTopPortion = portion; break; case StandardControlGroup.Bottom: dockPanel.DockBottomPortion = portion; break; default: throw new ArgumentOutOfRangeException("group", "Can only be the left, top, bottom, or right portions"); } }
/// <summary> /// Constructor</summary> /// <param name="name">Control name, which may be displayed as the title of a hosting /// control or form</param> /// <param name="description">Control description, which may be displayed as a tooltip /// when the user hovers over a hosting control or form</param> /// <param name="group">Desired initial control hosting group</param> public ControlInfo(string name, string description, StandardControlGroup group) : this(name, description, group, null) { }