Example #1
0
 public ListBox(ListBoxStyle style) : base(new Grid())
 {
     if (style != null)
     {
         ApplyListBoxStyle(style);
     }
 }
Example #2
0
        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);
                }
            }
        }
Example #3
0
 public ListBox(ListBoxStyle style) : base(new ScrollPane())
 {
     _grid = new Grid();
     InternalChild.Content = _grid;
     if (style != null)
     {
         ApplyListBoxStyle(style);
     }
 }
Example #4
0
        public ListBox(ListBoxStyle style) : base(style)
        {
            HorizontalAlignment = HorizontalAlignment.Stretch;
            VerticalAlignment   = VerticalAlignment.Top;

            if (style != null)
            {
                ApplyListBoxStyle(style);
            }

            _items.CollectionChanged += ItemsOnCollectionChanged;
        }
Example #5
0
        public ListBox(ListBoxStyle style)
        {
            InternalChild = new Grid();

            HorizontalAlignment = HorizontalAlignment.Left;
            VerticalAlignment   = VerticalAlignment.Top;

            if (style != null)
            {
                ApplyListBoxStyle(style);
            }

            _items.CollectionChanged += ItemsOnCollectionChanged;
        }
Example #6
0
        /// <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();
        }
Example #7
0
        public void ApplyListBoxStyle(ListBoxStyle style)
        {
            ApplyGridStyle(style);

            ListBoxStyle = style;
        }
Example #8
0
        /// <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();
        }
Example #9
0
        /// <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;
        }
Example #10
0
 public ComboBoxStyle(ComboBoxStyle style) : base(style)
 {
     ListBoxStyle = style.ListBoxStyle != null ? new ListBoxStyle(style.ListBoxStyle) : null;
 }
Example #11
0
        public void ApplyListBoxStyle(ListBoxStyle style)
        {
            ApplyWidgetStyle(style);

            ListBoxItemStyle = style.ListItemStyle;
        }
Example #12
0
 public ListBoxStyle(ListBoxStyle style) : base(style)
 {
     ListItemStyle = new ButtonStyle(style.ListItemStyle);
 }
Example #13
0
 public ListBoxStyle(ListBoxStyle style) : base(style)
 {
     ListItemStyle  = style.ListItemStyle != null ? new ImageTextButtonStyle(style.ListItemStyle) : null;
     SeparatorStyle = style.SeparatorStyle != null ? new SeparatorStyle(style.SeparatorStyle) : null;
 }
Example #14
0
 public ListBoxStyle(ListBoxStyle style) : base(style)
 {
     ListItemStyle  = new ButtonStyle(style.ListItemStyle);
     SeparatorStyle = new SeparatorStyle(style.SeparatorStyle);
 }