Beispiel #1
0
        /// <summary>
        /// Handles when the overflow menu should be entirely destroyed
        /// </summary>
        /// <param name="sender">Sender of this Event</param>
        /// <param name="e">Event arguments</param>
        private void OverflowDestroyed(Object sender, EventArgs e)
        {
            //check we have the right type
            if (sender.GetType() == typeof(ShengAddressBarDropDownButton))
            {
                //get the button as the right type
                ShengAddressBarDropDownButton tsddb = (ShengAddressBarDropDownButton)sender;

                //if the button is no longer visible
                if (tsddb.Visible == false)
                {
                    //clear all items from the overflow
                    //this._overflowButton.DropDown.Items.Clear();
                    this._overflowDropDown.Items.Clear();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 创建指定地址栏项的子级(如果需要)
        /// </summary>
        /// <param name="button"></param>
        private void BuildChildItem(ShengAddressBarButton button)
        {
            IShengAddressNode addressNode = button.AddressNode;

            ShengAddressBarDropDownButton dropDownButton = null;

            //SEAddressBarDropDown dropDown = null;

            if (addressNode.Children != null && addressNode.Children.Length > 0)
            {
                dropDownButton        = new ShengAddressBarDropDownButton(String.Empty);
                button.DropDownButton = dropDownButton;

                //check if we have any tag data (we cache already built drop down items in the node TAG data.
                if (addressNode.DropDownMenu == null)
                {
                    addressNode.DropDownMenu = GetButtonDropDown(addressNode);
                }
                else
                {
                    if (addressNode.DropDownMenu.GetType() == typeof(ShengAddressBarDropDown))
                    {
                        //dropDown = (SEAddressBarDropDown)addressNode.DropDownMenu;

                        foreach (ShengAddressBarDropDownItem tsmi in addressNode.DropDownMenu.Items)
                        {
                            if (tsmi.Font.Style != _baseFont.Style)
                            {
                                tsmi.Font = _baseFont;
                            }
                        }
                    }
                }

                dropDownButton.DropDown     = addressNode.DropDownMenu;
                dropDownButton.DisplayStyle = ToolStripItemDisplayStyle.None;
                dropDownButton.ImageAlign   = ContentAlignment.MiddleCenter;
            }
        }