Пример #1
0
 /// <summary>
 /// Add item handler.
 /// </summary>
 /// <param name="item">Item added.</param>
 protected override void OnAddItem(MenuItem item)
 {
     item.Dock        = Pos.Left;
     item.TextPadding = new Padding(5, 0, 5, 0);
     item.Padding     = new Padding(10, 0, 10, 0);
     item.SizeToContents();
     item.IsOnStrip   = true;
     item.HoverEnter += OnHoverItem;
 }
Пример #2
0
 /// <summary>
 /// Add item handler.
 /// </summary>
 /// <param name="item">Item added.</param>
 protected override void OnAddItem(MenuItem item)
 {
     item.Dock = Pos.Left;
     item.TextPadding = new Padding(5, 0, 5, 0);
     item.Padding = new Padding(10, 0, 10, 0);
     item.SizeToContents();
     item.IsOnStrip = true;
     item.HoverEnter += OnHoverItem;
 }
Пример #3
0
        /// <summary>
        /// Add item handler.
        /// </summary>
        /// <param name="item">Item added.</param>
        protected virtual void OnAddItem(MenuItem item)
        {
            item.TextPadding = new Padding(IconMarginDisabled ? 0 : 24, 0, 16, 0);
            item.Dock        = Pos.Top;
            item.SizeToContents();
            item.Alignment   = Pos.CenterV | Pos.Left;
            item.HoverEnter += OnHoverItem;

            // Do this here - after Top Docking these values mean nothing in layout
            int w = item.Width + 10 + 32;

            if (w < Width)
            {
                w = Width;
            }
            SetSize(w, Height);
        }
Пример #4
0
        /// <summary>
        /// Add item handler.
        /// </summary>
        /// <param name="item">Item added.</param>
        protected virtual void OnAddItem(MenuItem item)
        {
            item.TextPadding = new Padding(IconMarginDisabled ? 0 : 24, 0, 16, 0);
            item.Dock = Pos.Top;
            item.SizeToContents();
            item.Alignment = Pos.CenterV | Pos.Left;
            item.HoverEnter += OnHoverItem;

            // Do this here - after Top Docking these values mean nothing in layout
            int w = item.Width + 10 + 32;
            if (w < Width) w = Width;
            SetSize(w, Height);
        }