Exemple #1
0
        public RadCommandBarOverflowButton(CommandBarStripElement owner)
        {
            this.dialogProvider = new CommandBarCustomizeDialogProvider();

            this.owner = owner;
            this.dropDownMenuElement             = new RadDropDownMenu();
            this.dropDownMenuElement.MinimumSize = this.owner.OverflowMenuMinSize;
            this.dropDownMenuElement.MaximumSize = this.owner.OverflowMenuMaxSize;
            this.dropDownMenuElement.RightToLeft = this.RightToLeft ? System.Windows.Forms.RightToLeft.Yes : System.Windows.Forms.RightToLeft.No;

            panel = new RadCommandBarOverflowPanelElement();
            RadMenuSeparatorItem separator = new RadMenuSeparatorItem();

            panel.Visibility     = ElementVisibility.Collapsed;
            separator.Visibility = ElementVisibility.Collapsed;
            this.dropDownMenuElement.Items.Add(panel);
            this.dropDownMenuElement.Items.Add(separator);

            addRemoveButtonsMenuItem = new RadMenuItem(CommandBarLocalizationProvider.CurrentProvider.GetLocalizedString(CommandBarStringId.OverflowMenuAddOrRemoveButtonsText));

            this.dropDownMenuElement.Items.Add(addRemoveButtonsMenuItem);

            this.dropDownMenuElement.Items.Add(new RadMenuSeparatorItem());

            this.customizeButtonMenuItem = new RadMenuItem(CommandBarLocalizationProvider.CurrentProvider.GetLocalizedString(CommandBarStringId.OverflowMenuCustomizeText));


            this.dropDownMenuElement.Items.Add(customizeButtonMenuItem);

            this.layout         = panel.Layout;
            this.layout.MaxSize = this.owner.OverflowMenuMaxSize;

            WireEvents();
        }
Exemple #2
0
        public RadCommandBarOverflowButton(CommandBarStripElement owner)
        {
            this.dialogProvider      = new CommandBarCustomizeDialogProvider();
            this.owner               = owner;
            this.dropDownMenuElement = new RadDropDownMenu((RadElement)this);
            this.dropDownMenuElement.HorizontalAlignmentCorrectionMode = AlignmentCorrectionMode.SnapToEdges;
            this.dropDownMenuElement.MinimumSize = this.owner.OverflowMenuMinSize;
            this.dropDownMenuElement.MaximumSize = this.owner.OverflowMenuMaxSize;
            this.dropDownMenuElement.RightToLeft = this.RightToLeft ? RightToLeft.Yes : RightToLeft.No;
            this.panel = new RadCommandBarOverflowPanelElement();
            RadMenuSeparatorItem menuSeparatorItem = new RadMenuSeparatorItem();

            this.panel.Visibility        = ElementVisibility.Collapsed;
            menuSeparatorItem.Visibility = ElementVisibility.Collapsed;
            this.dropDownMenuElement.Items.Add((RadItem)this.panel);
            this.dropDownMenuElement.Items.Add((RadItem)menuSeparatorItem);
            this.addRemoveButtonsMenuItem = new RadMenuItem(LocalizationProvider <CommandBarLocalizationProvider> .CurrentProvider.GetLocalizedString("OverflowMenuAddOrRemoveButtonsText"));
            this.dropDownMenuElement.Items.Add((RadItem)this.addRemoveButtonsMenuItem);
            this.dropDownMenuElement.Items.Add((RadItem) new RadMenuSeparatorItem());
            this.customizeButtonMenuItem = new RadMenuItem(LocalizationProvider <CommandBarLocalizationProvider> .CurrentProvider.GetLocalizedString("OverflowMenuCustomizeText"));
            this.dropDownMenuElement.Items.Add((RadItem)this.customizeButtonMenuItem);
            this.layout         = this.panel.Layout;
            this.layout.MaxSize = this.owner.OverflowMenuMaxSize;
            this.WireEvents();
        }
 protected override void CreateChildItems(RadElement parent)
 {
     base.CreateChildItems(parent);
     this.element = new RadCommandBarOverflowPanelElement();
     this.RootElement.Children.Add((RadElement)this.element);
     this.AutoSize = true;
     this.RootElement.StretchVertically   = false;
     this.RootElement.StretchHorizontally = true;
 }