Example #1
0
        public void ShowDropDown()
        {
            if (this.dropdown != null)
            {
                return;
            }
            if (this.ReadOnly)
            {
                return;
            }
            PropertyGrid parentGrid = this.Parent.ParentGrid;

            this.dropdown = new BitmaskSelectorDropDown(this.dropdownItems);
            this.dropdown.BitmaskValue = this.bitmask;

            Size dropDownSize = new Size(
                this.rect.Width,
                Math.Min(this.dropdownHeight, this.dropdown.PreferredHeight));

            Point dropDownLoc = parentGrid.GetEditorLocation(this.Parent, true);

            //dropDownLoc = parentGrid.PointToScreen(dropDownLoc);
            dropDownLoc.Y += this.rect.Height + 1;
            dropDownLoc.X += this.Parent.Width - this.rect.Width;

            this.dropdown.Location         = dropDownLoc;
            this.dropdown.Size             = dropDownSize;
            this.dropdown.RequestClose    += this.dropdown_RequestClose;
            this.dropdown.AcceptSelection += this.dropdown_AcceptSelection;

            this.popupControl.Show(parentGrid, this.dropdown, dropDownLoc.X, dropDownLoc.Y, dropDownSize.Width, dropDownSize.Height, PopupResizeMode.None);

            this.EmitInvalidate();
        }
Example #2
0
        public void HideDropDown()
        {
            if (this.popupControl.Visible)
            {
                this.popupControl.Hide();
            }

            if (this.dropdown != null)
            {
                if (!this.dropdown.Disposing && !this.dropdown.IsDisposed)
                {
                    this.dropdown.Dispose();
                }
                this.dropdown = null;
            }

            this.EmitInvalidate();
        }
		public void HideDropDown()
		{
			if (this.popupControl.Visible)
				this.popupControl.Hide();
			
			if (this.dropdown != null)
			{
				if (!this.dropdown.Disposing && !this.dropdown.IsDisposed)
					this.dropdown.Dispose();
				this.dropdown = null;
			}

			this.EmitInvalidate();
		}
		public void ShowDropDown()
		{
			if (this.dropdown != null) return;
			if (this.ReadOnly) return;
			PropertyGrid parentGrid = this.Parent.ParentGrid;

			this.dropdown = new BitmaskSelectorDropDown(this.dropdownItems);
			this.dropdown.BitmaskValue = this.bitmask;

			Size dropDownSize = new Size(
				this.rect.Width, 
				Math.Min(this.dropdownHeight, this.dropdown.PreferredHeight));

			Point dropDownLoc = parentGrid.GetEditorLocation(this.Parent, true);
			//dropDownLoc = parentGrid.PointToScreen(dropDownLoc);
			dropDownLoc.Y += this.rect.Height + 1;
			dropDownLoc.X += this.Parent.Width - this.rect.Width;
			
			this.dropdown.Location = dropDownLoc;
			this.dropdown.Size = dropDownSize;
			this.dropdown.RequestClose += this.dropdown_RequestClose;
			this.dropdown.AcceptSelection += this.dropdown_AcceptSelection;

			this.popupControl.Show(parentGrid, this.dropdown, dropDownLoc.X, dropDownLoc.Y, dropDownSize.Width, dropDownSize.Height, PopupResizeMode.None);

			this.EmitInvalidate();
		}