private void CreateMediumSmallLabelView() { // Create the layout docker for the contents of the label _viewMediumSmall = new ViewLayoutDocker(); if (_ribbon.InDesignMode) { // At design time we need to know when the user right clicks the label ContextClickController controller = new ContextClickController(); controller.ContextClick += new MouseEventHandler(OnContextClick); _viewMediumSmall.MouseController = controller; } // Create the image and drop down content _viewMediumSmallLabelImage = new ViewDrawRibbonGroupLabelImage(_ribbon, _ribbonLabel, false); _viewMediumSmallText1 = new ViewDrawRibbonGroupLabelText(_ribbon, _ribbonLabel, true); _viewMediumSmallText2 = new ViewDrawRibbonGroupLabelText(_ribbon, _ribbonLabel, false); _viewMediumSmallImage = new ViewLayoutRibbonCenterPadding(_smallImagePadding); _viewMediumSmallImage.Add(_viewMediumSmallLabelImage); // Layout the content in the center of a row _viewMediumSmallCenter = new ViewLayoutRibbonRowCenter(); _viewMediumSmallCenter.Add(_viewMediumSmallImage); _viewMediumSmallCenter.Add(_viewMediumSmallText1); _viewMediumSmallCenter.Add(_viewMediumSmallText2); // Use content as only fill item _viewMediumSmall.Add(_viewMediumSmallCenter, ViewDockStyle.Fill); // Create controller for intercepting events to determine tool tip handling _viewMediumSmall.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager, _viewMediumSmall, _viewMediumSmall.MouseController); }
private void CreateLargeLabelView() { // Create the layout docker for the contents of the label _viewLarge = new ViewLayoutDocker(); if (_ribbon.InDesignMode) { // At design time we need to know when the user right clicks the label ContextClickController controller = new ContextClickController(); controller.ContextClick += new MouseEventHandler(OnContextClick); _viewLarge.MouseController = controller; } // Add the large button at the top _viewLargeLabelImage = new ViewDrawRibbonGroupLabelImage(_ribbon, _ribbonLabel, true); _viewLargeImage = new ViewLayoutRibbonCenterPadding(_largeImagePadding); _viewLargeImage.Add(_viewLargeLabelImage); _viewLarge.Add(_viewLargeImage, ViewDockStyle.Top); // Add the first line of text _viewLargeText1 = new ViewDrawRibbonGroupLabelText(_ribbon, _ribbonLabel, true); _viewLarge.Add(_viewLargeText1, ViewDockStyle.Bottom); // Add the second line of text _viewLargeText2 = new ViewDrawRibbonGroupLabelText(_ribbon, _ribbonLabel, false); _viewLarge.Add(_viewLargeText2, ViewDockStyle.Bottom); // Add a 1 pixel separator at bottom of button before the text _viewLarge.Add(new ViewLayoutRibbonSeparator(1, false), ViewDockStyle.Bottom); // Create controller for intercepting events to determine tool tip handling _viewLarge.MouseController = new ToolTipController(_ribbon.TabsArea.ButtonSpecManager.ToolTipManager, _viewLarge, _viewLarge.MouseController); }