Пример #1
0
 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);
 }
Пример #2
0
 public MacButton(NSButtonPlus button, NSColor nsButtonText, NSColor nsButtonDeselected, NSColor nsButtonSelected)
 {
     this.control         = button;
     this.button          = button;
     this.textColor       = nsButtonText;
     this.backgroundColor = nsButtonDeselected;
     this.selectedColor   = nsButtonSelected;
     this.isSelected      = false;
     SetupButton(button, nsButtonText, nsButtonDeselected);
     MacControls.allMacOnOffButtons.Add(this);
 }
Пример #3
0
 private static void SetupButton(NSButtonPlus buttonPlus, NSColor textColor, NSColor backgroundColor)
 {
     buttonPlus.SetBackgroundColor(backgroundColor);
     buttonPlus.ContentTintColor = textColor;
     buttonPlus.Bordered         = false;
 }
Пример #4
0
 private KButton MenuButton(NSButtonPlus button)
 {
     return(new MacButton(button, nsMenuButtonText, nsMainButtonDeselected, nsMainButtonSelected));
 }