Ejemplo n.º 1
0
 public TimePicker()
 {
     if (!ControlUtil.GetIsInDesignMode(this))
     {
         Items.AddRange(Values);
     }
 }
Ejemplo n.º 2
0
        public TextBox()
        {
            _inDesignMode = ControlUtil.GetIsInDesignMode(this);

            LeftButtons          = new EditButtonCollection();
            LeftButtons.Changed += new EventHandler(LeftButtons_Changed);

            RightButtons          = new EditButtonCollection();
            RightButtons.Changed += new EventHandler(RightButtons_Changed);
        }
Ejemplo n.º 3
0
        public ProcessingPanel()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, false);

            _processingSize = Forms.ProcessingSize.Large;
            _updateInterval = 25;
            _inDesignMode   = ControlUtil.GetIsInDesignMode(this);

            UpdateFromSize();
        }
Ejemplo n.º 4
0
        public FlyoutForm()
        {
            _designMode = ControlUtil.GetIsInDesignMode(this);

            FormBorderStyle      = FormBorderStyle.SizableToolWindow;
            ControlBox           = false;
            StartPosition        = FormStartPosition.Manual;
            ShowInTaskbar        = false;
            FadeDuration         = 500;
            Animate              = true;
            DelayHideOnMouseOver = true;
            DismissOnDeactivate  = true;

            _timer       = new Timer();
            _timer.Tick += new EventHandler(_timer_Tick);
        }
Ejemplo n.º 5
0
        private void UpdateThemeData()
        {
            if (!ControlUtil.GetIsInDesignMode(this) && _visualStyles)
            {
#if USE_TAB_RENDERER
                _tabRenderer = new VisualStyleRenderer(VisualStyleElement.Tab.Body.Normal);
#endif
                _borderColor = new VisualStyleRenderer("ListView", 0, 0).GetColor(ColorProperty.BorderColor);

                if (_borderColor == Color.Black)
                {
                    _borderColor = SystemColors.ControlDark;
                }
            }
            else
            {
#if USE_TAB_RENDERER
                _tabRenderer = null;
#endif
                _borderColor = SystemColors.ControlDark;
            }
        }
Ejemplo n.º 6
0
        public void Reload()
        {
            if (ControlUtil.GetIsInDesignMode(this))
            {
                return;
            }
            if (!IsHandleCreated)
            {
                return;
            }

            BeginUpdate();

            Nodes.Clear();

            if (!String.IsNullOrEmpty(_root))
            {
                var node = CreateNode(_root);

                if (node != null)
                {
                    Nodes.Add(node.TreeNode);
                }

                OnNodeCreated(new FileSystemNodeEventArgs(node));

                StartResolver();
            }

            if (Nodes.Count > 0)
            {
                Nodes[0].Expand();
            }

            EndUpdate();
        }
Ejemplo n.º 7
0
        private void PerformEditButtonLayout(LayoutEventArgs levent)
        {
            var nonClientSize = ControlUtil.GetNonClientSize(this);

            // If we have no border, we keep the size equal to the control
            // size. Otherwise, we fall on pixel out of the border size.

            int leftOffset   = Math.Min(nonClientSize.Left, EditButtonOffset);
            int topOffset    = Math.Min(nonClientSize.Top, EditButtonOffset);
            int rightOffset  = Math.Min(nonClientSize.Right, EditButtonOffset);
            int bottomOffset = Math.Min(nonClientSize.Bottom, EditButtonOffset);

            int height = Height - ((nonClientSize.Top - topOffset) + (nonClientSize.Bottom - bottomOffset));

            // We require the text box to at least be the width of all buttons.

            _minimumWidth =
                (_editButtons.Count * EditButtonWidth) +
                Math.Max(LeftButtons.Count - 1, 0) * EditButtonSpacing +
                Math.Max(RightButtons.Count - 1, 0) * EditButtonSpacing +
                (leftOffset + rightOffset);

            // Force a resize when applicable.

            if (Width < _minimumWidth)
            {
                Width = _minimumWidth;
            }

            // Layout the left buttons.

            for (int i = 0; i < LeftButtons.Count; i++)
            {
                LeftButtons[i].SetBounds(
                    i * (EditButtonSpacing + EditButtonWidth) - leftOffset,
                    -topOffset,
                    EditButtonWidth,
                    height
                    );
            }

            // And layout the right buttons.

            int clientWidth = ClientSize.Width;

            for (int i = 0; i < RightButtons.Count; i++)
            {
                RightButtons[i].SetBounds(
                    clientWidth - ((((i + 1) * EditButtonWidth) + (i * EditButtonSpacing)) - rightOffset),
                    -topOffset,
                    EditButtonWidth,
                    height
                    );
            }

            // Set the margins.

            if (LeftButtons.Count == 0)
            {
                LeftMargin = 0;
            }
            else
            {
                LeftMargin = (((LeftButtons.Count) * EditButtonWidth) + (Math.Min(LeftButtons.Count - 1, 0) * EditButtonSpacing)) - leftOffset + 1;
            }

            if (RightButtons.Count == 0)
            {
                RightMargin = 0;
            }
            else
            {
                RightMargin = (((RightButtons.Count) * EditButtonWidth) + (Math.Min(RightButtons.Count - 1, 0) * EditButtonSpacing)) - rightOffset + 1;
            }
        }