public MacFlyoutMenu(NSButtonPlus button, NSGridView menu, NSBox menuBox, NSBox buttonBar, FlyoutAttachment attachment, float pointSize, bool fixedWidth, CGSize padding,
                      NSColor nsMainButtonText, NSColor nsMainButtonDeselected, NSColor nsMainButtonSelected, NSColor nsMenuButtonText, NSColor nsMenuButtonDeselected, NSColor nsMenuButtonSelected)
     : base(button, nsMainButtonText, nsMainButtonDeselected, nsMainButtonSelected)
 {
     this.menu                   = menu;
     this.namedControls          = new Dictionary <string, KButton>();
     this.menu.RowSpacing        = 1;
     this.menu.ColumnSpacing     = 6;
     this.menuBox                = menuBox;
     this.menuBox.BorderWidth    = 1; // does not affect the origin
     this.menuBox.CornerRadius   = 0;
     this.menuBox.BorderColor    = NSColor.TertiaryLabelColor;
     this.buttonBar              = buttonBar;
     this.autoClose              = false;
     this.pointSize              = pointSize;
     this.fixedWidth             = fixedWidth;
     this.padding                = padding;
     this.attachment             = attachment;
     this.nsMenuButtonText       = nsMenuButtonText;
     this.nsMenuButtonDeselected = nsMenuButtonDeselected;
     this.nsMenuButtonSelected   = nsMenuButtonSelected;
     menuBox.FillColor           = nsMenuButtonDeselected;
     menuBox.Hidden              = true;
     MacControls.allMacFlyoutMenus.Add(this);
 }
Exemple #2
0
        public WinFlyoutMenu(Button button, TableLayoutPanel menu, Panel buttonBar, FlyoutAttachment attachment, float pointSize, bool fixedWidth, Padding padding,
                             Color cMainButtonText, Color cMainButtonDeselected, Color cMainButtonSelected, Color cMenuButtonText, Color cMenuButtonDeselected, Color cMenuButtonSelected)
            : base(button, cMainButtonText, cMainButtonDeselected, cMainButtonSelected)
        {
            this.menu          = menu;
            this.namedControls = new Dictionary <string, KButton>();
            this.menu.Margin   = new Padding(0);
            this.menu.Padding  = padding;
            this.buttonBar     = buttonBar;
            this.autoClose     = false;
            this.pointSize     = pointSize;
            this.fixedWidth    = fixedWidth;
            this.attachment    = attachment;

            this.cMenuButtonText       = cMenuButtonText;
            this.cMenuButtonDeselected = cMenuButtonDeselected;
            this.cMenuButtonSelected   = cMenuButtonSelected;
            menu.BackColor             = cMenuButtonDeselected;
            menu.AutoSize     = true;
            menu.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            menu.AutoScroll   = false; // or it will flow horizontally and add a scrollbar
            menu.Visible      = false;
            menu.BringToFront();
        }