Example #1
0
        /// <summary>
        /// Displays drop-down area of combo box, if not already shown.
        /// </summary>
        public virtual void ShowDropDown()
        {
            if (m_popupCtrl != null && !IsDroppedDown)
            {
                // Raise drop-down event.
                RaiseDropDownEvent();

                // Restore original control size.
                AutoSizeDropDown();

                Point location = PointToScreen(new Point(0, Height));

                // Actually show popup.
                PopupResizeMode resizeMode = (this.m_bIsResizable ? PopupResizeMode.BottomRight : PopupResizeMode.None);
                m_popupCtrl.Show(this.DropDownControl, location.X, location.Y, Width, Height, resizeMode);
                m_bDroppedDown = true;

                m_popupCtrl.PopupControlHost = this;

                // Initialize automatic focus timer?
                if (m_timerAutoFocus == null)
                {
                    m_timerAutoFocus          = new Timer();
                    m_timerAutoFocus.Interval = 10;
                    m_timerAutoFocus.Tick    += new EventHandler(timerAutoFocus_Tick);
                }
                // Enable the timer!
                m_timerAutoFocus.Enabled = true;
                m_sShowTime = DateTime.Now;
            }
        }
Example #2
0
        public void Show(Control parent, int x, int y, int width, int height)
        {
            // If no hosted control is associated, this procedure is pointless!
            Control hostedControl = GetHostedControl();

            if (hostedControl == null)
            {
                return;
            }

            // Initially hosted control should be displayed within a drop down of 1x1, however
            // its size should exceed the dimensions of the drop-down.
            {
                m_lockedHostedControlSize = true;
                m_lockedThisSize          = true;

                // Display actual popup and occupy just 1x1 pixel to avoid automatic reposition.
                Size = new Size(1, 1);
                base.Show(parent, x, y);

                m_lockedHostedControlSize = false;
                m_lockedThisSize          = false;
            }

            // Resize drop-down to fit its contents.
            ResizeFromContent(width);

            // If client area was enlarged using the minimum width paramater, then the hosted
            // control must also be enlarged.
            if (m_refreshSize)
            {
                RecalculateHostedControlLayout();
            }

            // If popup is overlapping the initial position then move above!
            if (y > Top && y <= Bottom)
            {
                Top = y - Height - (height != -1 ? height : 0);

                PopupResizeMode previous = ResizeMode;
                if (ResizeMode == PopupResizeMode.BottomLeft)
                {
                    ResizeMode = PopupResizeMode.TopLeft;
                }
                else if (ResizeMode == PopupResizeMode.BottomRight)
                {
                    ResizeMode = PopupResizeMode.TopRight;
                }

                if (ResizeMode != previous)
                {
                    RecalculateHostedControlLayout();
                }
            }

            // Assign event handler to control.
            hostedControl.SizeChanged += hostedControl_SizeChanged;
        }
Example #3
0
        public void Show(Control control, int x, int y, int width, int height, PopupResizeMode resizeMode)
        {
            InitializeHost(control);

            m_dropDown.ResizeMode = resizeMode;
            m_dropDown.Show(x, y, width, height);

            control.Focus();
        }
Example #4
0
        public void Show(Control control, int x, int y, int width, int height, PopupResizeMode resizeMode)
        {
            Size controlSize = control.Size;

            InitializeHost(control);

            m_dropDown.ResizeMode = resizeMode;
            m_dropDown.Show(x, y, width, height);

			m_Cancelled = false;

            control.Focus();
        }
Example #5
0
        public void Show(int x, int y, int width, int height, PopupResizeMode resizeMode)
        {
            if (m_ListBox.Items.Count > 0)
            {
                if (height == -1)
                {
                    m_ListBox.Height = Math.Min(200, (m_ListBox.Items.Count * m_ListBox.GetItemRectangle(0).Height));
                }

                m_ListBox.SelectedIndex = 0;
            }

            base.Show(m_ListBox, x, y, width, height, resizeMode);
        }
Example #6
0
            /// <summary>
            /// Displays drop-down area of combo box, if not already shown</summary>
            public void ShowDropDown()
            {
                if (m_popupCtrl != null && !IsDroppedDown)
                {
                    Point location = PointToScreen(new Point(0, Height));

                    // Actually show popup.
                    PopupResizeMode resizeMode = PopupResizeMode.BottomRight;
                    m_popupCtrl.Show(this.DropDownControl, location.X, location.Y, Width, Height, resizeMode);
                    m_isDroppedDown = true;

                    m_popupCtrl.PopupControlHost = this;
                }
            }
        public void Show(Control control, int x, int y, int width, int height, PopupResizeMode resizeMode)
        {
            if (control == null)
            {
                return;
            }
            Size controlSize = control.Size;

            InitializeHost(control);

            m_dropDown.ResizeMode = resizeMode;
            m_dropDown.Show(x, y, width, height);

            control.Focus();
        }
 public bool CompareResizeMode(PopupResizeMode resizeMode)
 {
     return (ResizeMode & resizeMode) == resizeMode;
 }
            public void Show(Control control, int x, int y, int width, int height, PopupResizeMode resizeMode)
            {
                Size controlSize = control.Size;

                InitializeHost(control);

                m_dropDown.ResizeMode = resizeMode;
                m_dropDown.Show(x, y, width, height);

                control.Focus();
            }
 public void Show(Control control, int x, int y, PopupResizeMode resizeMode)
 {
     Show(control, x, y, -1, -1, resizeMode);
 }
Example #11
0
 public bool CompareResizeMode(PopupResizeMode resizeMode)
 {
     return((ResizeMode & resizeMode) == resizeMode);
 }
 public void Show(Control parent, Control control, int x, int y, PopupResizeMode resizeMode)
 {
     Show(parent, control, x, y, -1, -1, resizeMode);
 }
        public void Show(System.Windows.Forms.Control control, int x, int y, int width, int height, PopupResizeMode resizeMode)
        {
            Size controlSize = control.Size;

            InitializeHost(control);

            m_dropDown.ResizeMode = resizeMode;
            m_dropDown.Show(x, y, width, height);

            control.Focus();
        }
 public void Show(System.Windows.Forms.Control control, int x, int y, PopupResizeMode resizeMode)
 {
     Show(control, x, y, -1, -1, resizeMode);
 }
Example #15
0
 public void Show(int x, int y, PopupResizeMode resizeMode)
 {
     Show(x, y, -1, -1, resizeMode);
 }