Ejemplo n.º 1
0
        public CommandBarControl(CommandBarLightweightControl commandBar, CommandBarDefinition commandBarDefinition)
        {
            // It's important that the commandBarDefinition not be set
            // on the command bar until after the command bar has a heavyweight parent.
            // Otherwise, command bar entries that have heavyweight controls will never
            // be parented properly and therefore never show up.

            Debug.Assert(commandBar.CommandBarDefinition == null,
                         "Don't set the command bar definition before creating CommandBarControl!");

            InitializeComponent();

            _commandBar = commandBar;

            _commandBar.LightweightControlContainerControl = this;
            _commandBar.CommandBarDefinition = commandBarDefinition;

            _commandBar.VirtualBounds = new Rectangle(new Point(0, 0), _commandBar.DefaultVirtualSize);
            Height       = _commandBar.VirtualHeight;
            SizeChanged += new EventHandler(CommandBarControl_SizeChanged);

            AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar;
            AccessibleName = commandBar.AccessibleName;
            InitFocusAndAccessibility();
        }
        public CommandBarControl(CommandBarLightweightControl commandBar, CommandBarDefinition commandBarDefinition)
        {
            // It's important that the commandBarDefinition not be set
            // on the command bar until after the command bar has a heavyweight parent.
            // Otherwise, command bar entries that have heavyweight controls will never
            // be parented properly and therefore never show up.

            Debug.Assert(commandBar.CommandBarDefinition == null,
                         "Don't set the command bar definition before creating CommandBarControl!");

            InitializeComponent();

            _commandBar = commandBar;

            _commandBar.LightweightControlContainerControl = this;
            _commandBar.CommandBarDefinition = commandBarDefinition;

            _commandBar.VirtualBounds = new Rectangle(new Point(0, 0), _commandBar.DefaultVirtualSize);
            Height = _commandBar.VirtualHeight;
            SizeChanged += new EventHandler(CommandBarControl_SizeChanged);

            AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar;
            AccessibleName = commandBar.AccessibleName;
            InitFocusAndAccessibility();
        }
Ejemplo n.º 3
0
        public static CommandBarDefinition Create(params object[] items)
        {
            CommandBarDefinition cbd = new CommandBarDefinition();

            AddItems(cbd.LeftCommandBarEntries, items);
            return(cbd);
        }
Ejemplo n.º 4
0
        public static CommandBarDefinition Create(object[] leftItems, object[] rightItems)
        {
            CommandBarDefinition cbd = new CommandBarDefinition();

            AddItems(cbd.LeftCommandBarEntries, leftItems);
            AddItems(cbd.RightCommandBarEntries, rightItems);
            return(cbd);
        }
 public TransparentCommandBarControl(CommandBarLightweightControl commandBar, CommandBarDefinition commandBarDefinition) : base(commandBar, commandBarDefinition)
 {
 }
        private void InitializeToolbar()
        {
            commandBarButtonEntryAddMenu = new CommandBarButtonEntry(components);
            commandBarButtonEntryAddMenu.CommandIdentifier = commandAddMenu.Identifier;

            commandBarButtonEntryRemoveMenu = new CommandBarButtonEntry(components);
            commandBarButtonEntryRemoveMenu.CommandIdentifier = commandImageRemove.Identifier;

            commandBarLabel = new CommandBarLabelEntry(components);
            commandBarLabel.Text = Res.Get(StringId.ImgSBEffectsLabel);

            commandBarDefinition = new CommandBarDefinition(components);
            commandBarDefinition.RightCommandBarEntries.Add(commandBarButtonEntryAddMenu);
            commandBarDefinition.RightCommandBarEntries.Add(commandBarButtonEntryRemoveMenu);

            commandBarDefinition.LeftCommandBarEntries.Add(commandBarLabel);

            commandBarLightweightControl = new ImageDecoratorsCommandBarLightweightControl(components);
            commandBarLightweightControl.LightweightControlContainerControl = this;

            commandAddMenu.CommandBarButtonContextMenuDefinition = addCommandContextMenuDefinition;

            commandBarLightweightControl.CommandManager = _decoratorsManager.CommandManager;
            commandBarLightweightControl.CommandBarDefinition = commandBarDefinition;

            InitFocusAndAccessibility();
        }
        private void InitializeToolbar()
        {
            CommandBarButtonEntry commandBarButtonEntryImageBrightness = new CommandBarButtonEntry(components) ;
            commandBarButtonEntryImageBrightness.CommandIdentifier = commandImageBrightness.Identifier ;

            CommandBarButtonEntry commandBarButtonEntryImageRotate = new CommandBarButtonEntry(components) ;
            commandBarButtonEntryImageRotate.CommandIdentifier = commandImageRotate.Identifier ;

            CommandBarButtonEntry commandBarButtonEntryImageReset = new CommandBarButtonEntry(components) ;
            commandBarButtonEntryImageReset.CommandIdentifier = commandImageReset.Identifier ;

            CommandBarButtonEntry commandBarButtonEntryImageSaveDefaults = new CommandBarButtonEntry(components) ;
            commandBarButtonEntryImageSaveDefaults.CommandIdentifier = commandImageSaveDefaults.Identifier ;

            CommandBarDefinition commandBarDefinition = new CommandBarDefinition(components) ;
            commandBarDefinition.LeftCommandBarEntries.Add( commandBarButtonEntryImageRotate ) ;
            commandBarDefinition.LeftCommandBarEntries.Add( commandBarButtonEntryImageBrightness ) ;

            commandBarDefinition.RightCommandBarEntries.Add( commandBarButtonEntryImageReset ) ;
            commandBarDefinition.RightCommandBarEntries.Add( commandBarButtonEntryImageSaveDefaults ) ;

            commandBarLightweightControl = new PrimaryWorkspaceWorkspaceCommandBarLightweightControl(components) ;
            commandBarLightweightControl.LightweightControlContainerControl = this ;

            commandBarLightweightControl.CommandManager = ApplicationManager.CommandManager ;
            commandBarLightweightControl.CommandBarDefinition = commandBarDefinition ;
        }
 public static CommandBarDefinition Create(object[] leftItems, object[] rightItems)
 {
     CommandBarDefinition cbd = new CommandBarDefinition();
     AddItems(cbd.LeftCommandBarEntries, leftItems);
     AddItems(cbd.RightCommandBarEntries, rightItems);
     return cbd;
 }
 public static CommandBarDefinition Create(params object[] items)
 {
     CommandBarDefinition cbd = new CommandBarDefinition();
     AddItems(cbd.LeftCommandBarEntries, items);
     return cbd;
 }
 public TransparentCommandBarControl(CommandBarLightweightControl commandBar, CommandBarDefinition commandBarDefinition) : base(commandBar, commandBarDefinition)
 {
 }