public ListBox(ListBoxStyle style) : base(new Grid()) { if (style != null) { ApplyListBoxStyle(style); } }
public void ApplyListBoxStyle(ListBoxStyle style) { ApplyWidgetStyle(style); ListBoxStyle = style; foreach (var item in Items) { var asButton = item.Widget as ImageTextButton; if (asButton != null) { asButton.ApplyImageTextButtonStyle(style.ListItemStyle); if (item.Color != null) { asButton.TextColor = item.Color.Value; } } var asSeparator = item.Widget as SeparatorWidget; if (asSeparator != null) { asSeparator.ApplyMenuSeparatorStyle(style.SeparatorStyle); } } }
public ListBox(ListBoxStyle style) : base(new ScrollPane()) { _grid = new Grid(); InternalChild.Content = _grid; if (style != null) { ApplyListBoxStyle(style); } }
public ListBox(ListBoxStyle style) : base(style) { HorizontalAlignment = HorizontalAlignment.Stretch; VerticalAlignment = VerticalAlignment.Top; if (style != null) { ApplyListBoxStyle(style); } _items.CollectionChanged += ItemsOnCollectionChanged; }
public ListBox(ListBoxStyle style) { InternalChild = new Grid(); HorizontalAlignment = HorizontalAlignment.Left; VerticalAlignment = VerticalAlignment.Top; if (style != null) { ApplyListBoxStyle(style); } _items.CollectionChanged += ItemsOnCollectionChanged; }
/// <summary>Create a new list box control</summary> public ListBox(Dialog parent) : base(parent) { // Store control type and parent dialog controlType = ControlType.ListBox; parentDialog = parent; // Create the scrollbar control too scrollbarControl = new ScrollBar(parent); // Set some default items style = ListBoxStyle.SingleSelection; scrollWidth = 16; selectedIndex = -1; selectedStarted = 0; isDragging = false; margin = 5; border = 6; textHeight = 0; isScrollBarInit = false; // Create the item list array itemList = new ArrayList(); }
public void ApplyListBoxStyle(ListBoxStyle style) { ApplyGridStyle(style); ListBoxStyle = style; }
/// <summary>Adds a listbox control to the dialog</summary> public ListBox AddListBox(int id, int x, int y, int w, int h, ListBoxStyle style) { // First create the listbox ListBox c = new ListBox(this); // Now call the add control method AddControl(c); // Set the properties of the button now c.ID = id; c.SetLocation(x, y); c.SetSize(w,h); c.Style = style; return c; }
public ComboBoxStyle(ComboBoxStyle style) : base(style) { ListBoxStyle = style.ListBoxStyle != null ? new ListBoxStyle(style.ListBoxStyle) : null; }
public void ApplyListBoxStyle(ListBoxStyle style) { ApplyWidgetStyle(style); ListBoxItemStyle = style.ListItemStyle; }
public ListBoxStyle(ListBoxStyle style) : base(style) { ListItemStyle = new ButtonStyle(style.ListItemStyle); }
public ListBoxStyle(ListBoxStyle style) : base(style) { ListItemStyle = style.ListItemStyle != null ? new ImageTextButtonStyle(style.ListItemStyle) : null; SeparatorStyle = style.SeparatorStyle != null ? new SeparatorStyle(style.SeparatorStyle) : null; }
public ListBoxStyle(ListBoxStyle style) : base(style) { ListItemStyle = new ButtonStyle(style.ListItemStyle); SeparatorStyle = new SeparatorStyle(style.SeparatorStyle); }