protected override void CreateChildElements() { base.CreateChildElements(); this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.Class = "RibbonMDIMinimizeButton"; this.minimizeButton.Click += new EventHandler(this.OnMinimize); this.minimizeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.MDIminimize; this.minimizeButton.StretchHorizontally = false; this.minimizeButton.ImageAlignment = ContentAlignment.MiddleCenter; this.Children.Add((RadElement)this.minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.Class = "RibbonMDIMaximizeButton"; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); this.maximizeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.MDImaximize; this.maximizeButton.StretchHorizontally = false; this.maximizeButton.ImageAlignment = ContentAlignment.MiddleCenter; this.Children.Add((RadElement)this.maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.Class = "RibbonMDICloseButton"; this.closeButton.Click += new EventHandler(this.OnClose); this.closeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.MDIclose; this.closeButton.StretchHorizontally = false; this.closeButton.ImageAlignment = ContentAlignment.MiddleCenter; this.Children.Add((RadElement)this.closeButton); }
protected override void CreateChildElements() { base.CreateChildElements(); this.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren; this.systemButtons = new StackLayoutPanel(); this.systemButtons.Class = "RibbonMDIButtonsStackLayout"; this.systemButtons.Alignment = ContentAlignment.MiddleRight; base.Children.Add(this.systemButtons); this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.Class = "RibbonMDIMinimizeButton"; this.minimizeButton.Click += new EventHandler(this.OnMinimize); this.minimizeButton.Image = Properties.Resources.MDIminimize; this.systemButtons.Children.Add(minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.Class = "RibbonMDIMaximizeButton"; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); this.maximizeButton.Image = Properties.Resources.MDImaximize; this.systemButtons.Children.Add(maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.Class = "RibbonMDICloseButton"; this.closeButton.Click += new EventHandler(this.OnClose); this.closeButton.Image = Properties.Resources.MDIclose; this.systemButtons.Children.Add(closeButton); this.Visibility = ElementVisibility.Collapsed; }
protected override void CreateChildElements() { base.CreateChildElements(); this.captionText = new TextPrimitive(); this.captionText.Class = "TitleCaption"; this.captionText.TextAlignment = ContentAlignment.MiddleCenter; int num1 = (int)this.captionText.SetValue(RibbonBarCaptionLayoutPanel.CaptionTextProperty, (object)true); int num2 = (int)this.captionText.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay); this.ribbonTextAndContextGroupPanel = new RibbonBarCaptionLayoutPanel(); this.ribbonTextAndContextGroupPanel.Children.Add((RadElement)this.captionText); this.Children.Add((RadElement)this.ribbonTextAndContextGroupPanel); this.systemButtons = new StackLayoutElement(); this.systemButtons.Orientation = Orientation.Horizontal; this.systemButtons.StretchHorizontally = false; this.systemButtons.StretchVertically = true; this.systemButtons.FitInAvailableSize = true; this.systemButtons.Class = "SystemButtonsContainer"; this.Children.Add((RadElement)this.systemButtons); this.helpButton = new RadImageButtonElement(); this.helpButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.helpButton.ThemeRole = "RibbonHelpButton"; this.helpButton.Class = "HelpButton"; this.helpButton.Click += new EventHandler(this.OnHelpButtonClick); this.helpButton.ButtonFillElement.Class = "CaptionButtonFill"; this.helpButton.BorderElement.Class = "CaptionButtonBorder"; this.helpButton.StretchHorizontally = false; this.helpButton.Visibility = ElementVisibility.Collapsed; this.systemButtons.Children.Add((RadElement)this.helpButton); this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.minimizeButton.ThemeRole = "RibbonMinimizeButton"; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.ribbon_minimize; this.minimizeButton.Click += new EventHandler(this.OnMinimize); this.minimizeButton.ButtonFillElement.Class = "CaptionButtonFill"; this.minimizeButton.BorderElement.Class = "CaptionButtonBorder"; this.minimizeButton.StretchHorizontally = false; this.systemButtons.Children.Add((RadElement)this.minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.maximizeButton.ThemeRole = "RibbonMaximizeButton"; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.ribbon_maximize; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); this.maximizeButton.ButtonFillElement.Class = "CaptionButtonFill"; this.maximizeButton.BorderElement.Class = "CaptionButtonBorder"; this.maximizeButton.StretchHorizontally = false; this.systemButtons.Children.Add((RadElement)this.maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.closeButton.ThemeRole = "RibbonCloseButton"; this.closeButton.Class = "CloseButton"; this.closeButton.Image = (Image)Telerik\u002EWinControls\u002EUI\u002EResources.ribbon_close; this.closeButton.Click += new EventHandler(this.OnClose); this.closeButton.ButtonFillElement.Class = "CaptionButtonFill"; this.closeButton.BorderElement.Class = "CaptionButtonBorder"; this.closeButton.StretchHorizontally = false; this.systemButtons.Children.Add((RadElement)this.closeButton); }
protected override void CreateChildElements() { // if there is an old reference we clear it. this.contextItem = null; this.layoutPanel = new WrapLayoutPanel(); this.layoutPanel.ZIndex = 10; this.layoutPanel.BindProperty(WrapLayoutPanel.OrientationProperty, this, RadMenuElement.OrientationProperty, PropertyBindingOptions.OneWay); //todo: //this.layoutPanel.BindProperty(WrapLayoutPanel.Eql, this, RadMenuElement.AllItemsEqualHeightProperty, PropertyBindingOptions.OneWay); this.items.Owner = this.layoutPanel; this.Children.Add(this.layoutPanel); fill = new FillPrimitive(); fill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; fill.Visibility = ElementVisibility.Collapsed; fill.Class = "MenuFill"; fill.ZIndex = 5; this.Children.Add(fill); this.systemButtons = new StackLayoutPanel(); this.systemButtons.Alignment = ContentAlignment.MiddleRight; this.systemButtons.ZIndex = 0; this.systemButtons.Class = "SystemButtonsStackLayoutPanel"; this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StretchHorizontally = false; this.minimizeButton.StretchVertically = false; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill"; this.systemButtons.Children.Add(minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StretchHorizontally = false; this.maximizeButton.StretchVertically = false; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill"; this.systemButtons.Children.Add(maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StretchHorizontally = false; this.closeButton.StretchVertically = false; this.closeButton.Class = "CloseButton"; this.closeButton.ButtonFillElement.Name = "CloseButtonFill"; this.systemButtons.Children.Add(closeButton); this.systemButtons.ZIndex = 6; this.Children.Add(systemButtons); this.border = new BorderPrimitive(); border.Class = "MenuBorder"; border.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; this.Children.Add(border); systemButtons.Visibility = ElementVisibility.Collapsed; }
private void ToolStripDialogForm_Load(object sender, EventArgs e) { this.Size = new Size(492, 392); if (this.manager.RootElement != null) { if (this.manager.RootElement.ElementTree != null) { this.radTabStrip1.ThemeName = this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName; this.resetButton.ThemeName = this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName; this.closeButton.ThemeName = this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName; this.radListBox1.ThemeName = this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName; this.radTitleBar1.ThemeName = this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName; this.BackColor = Color.FromArgb(191, 219, 254); this.BorderColor = Color.FromArgb(150, 185, 240); if (this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName == "Office2007Black") { this.BackColor = Color.FromArgb(81, 81, 81); this.BorderColor = Color.Black; } if (this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName == "Office2007Silver") { this.BackColor = Color.FromArgb(208, 212, 221); this.BorderColor = Color.FromArgb(227, 232, 240); } if (this.manager.RootElement.ElementTree.ComponentTreeHandler.ThemeName == "Telerik") { this.BackColor = Color.FromArgb(242, 242, 242); this.BorderColor = Color.FromArgb(252, 255, 238); } } } foreach (RadElement element in this.radTitleBar1.RootElement.Children[0].Children) { if (element as StripLayoutPanel != null) { foreach (RadElement stack in element.Children) { if (stack as StackLayoutPanel != null) { if (stack.Children.Count < 4) { RadImageButtonElement imageButton = new RadImageButtonElement(); imageButton.Image = Properties.Resources.ribbon_close; imageButton.Click += new EventHandler(imageButton_Click); stack.Children.Add(imageButton); } } } } } }
protected override void CreateChildElements() { base.CreateChildElements(); this.minMaxCloseButtonsStackLayoutPanel = new StackLayoutPanel(); this.minMaxCloseButtonsStackLayoutPanel.EqualChildrenHeight = true; this.Children.Add(this.minMaxCloseButtonsStackLayoutPanel); this.systemButtons = new StackLayoutPanel(); this.systemButtons.Class = "SystemButtonsStackLayout"; this.systemButtons.Orientation = Orientation.Horizontal; this.systemButtons.Alignment = ContentAlignment.MiddleRight; this.minMaxCloseButtonsStackLayoutPanel.Children.Add(this.systemButtons); this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.minimizeButton.ThemeRole = "RibbonMinimizeButton"; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.Image = Properties.Resources.ribbon_minimize; this.minimizeButton.Click += new EventHandler(this.OnMinimize); ClassSelector selector = new ClassSelector("ButtonFill"); ClassSelector borderSelector = new ClassSelector("ButtonBorder"); selector.GetSelectedElements(this.minimizeButton).First.Value.Class = "CaptionButtonFill"; borderSelector.GetSelectedElements(this.minimizeButton).First.Value.Class = "CaptionButtonBorder"; this.systemButtons.Children.Add(minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.maximizeButton.ThemeRole = "RibbonMaximizeButton"; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.Image = Properties.Resources.ribbon_maximize; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); selector.GetSelectedElements(this.maximizeButton).First.Value.Class = "CaptionButtonFill"; borderSelector.GetSelectedElements(this.maximizeButton).First.Value.Class = "CaptionButtonBorder"; this.systemButtons.Children.Add(maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StateManager = new RibbonBarSystemButtonStateManager().StateManagerInstance; this.closeButton.ThemeRole = "RibbonCloseButton"; this.closeButton.Class = "CloseButton"; this.closeButton.Image = Properties.Resources.ribbon_close; this.closeButton.Click += new EventHandler(this.OnClose); selector.GetSelectedElements(this.closeButton).First.Value.Class = "CaptionButtonFill"; borderSelector.GetSelectedElements(this.closeButton).First.Value.Class = "CaptionButtonBorder"; this.systemButtons.Children.Add(closeButton); this.captionText = new TextPrimitive(); this.captionText.Class = "TitleCaption"; this.captionText.TextAlignment = ContentAlignment.MiddleCenter; captionText.SetValue(RibbonBarCaptionLayoutPanel.CaptionTextProperty, true); captionText.BindProperty(TextPrimitive.TextProperty, this, RadItem.TextProperty, PropertyBindingOptions.OneWay); this.captionText.FontChanged += new EventHandler(captionText_FontChanged); }
private void CreateCloseButton() { this.closeButton = new RadImageButtonElement(); this.closeButton.Class = "TabCloseButton"; this.closeButton.BorderElement.Visibility = ElementVisibility.Collapsed; this.closeButton.ButtonFillElement.Visibility = ElementVisibility.Hidden; this.closeButton.StretchHorizontally = false; this.closeButton.StretchVertically = false; this.closeButton.Click += OnCloseButtonClick; this.closeButton.Visibility = ElementVisibility.Collapsed; this.closeButton.SetAllLocalValuesAsDefault(true); this.Children.Add(this.closeButton); }
protected override void CreateChildElements() { this.contextItem = (RadItem)null; this.layoutPanel = new WrapLayoutPanel(); this.layoutPanel.ZIndex = 10; int num = (int)this.layoutPanel.BindProperty(WrapLayoutPanel.OrientationProperty, (RadObject)this, RadMenuElement.OrientationProperty, PropertyBindingOptions.OneWay); this.items.Owner = (RadElement)this.layoutPanel; this.Children.Add((RadElement)this.layoutPanel); this.fill = new FillPrimitive(); this.fill.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; this.fill.Visibility = ElementVisibility.Collapsed; this.fill.Class = "MenuFill"; this.fill.ZIndex = 5; this.Children.Add((RadElement)this.fill); this.systemButtons = new StackLayoutPanel(); this.systemButtons.Alignment = ContentAlignment.MiddleRight; this.systemButtons.ZIndex = 0; this.systemButtons.Class = "SystemButtonsStackLayoutPanel"; this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StretchHorizontally = false; this.minimizeButton.StretchVertically = false; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill"; this.systemButtons.Children.Add((RadElement)this.minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StretchHorizontally = false; this.maximizeButton.StretchVertically = false; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill"; this.systemButtons.Children.Add((RadElement)this.maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StretchHorizontally = false; this.closeButton.StretchVertically = false; this.closeButton.Class = "CloseButton"; this.closeButton.ButtonFillElement.Name = "CloseButtonFill"; this.systemButtons.Children.Add((RadElement)this.closeButton); this.systemButtons.ZIndex = 6; this.Children.Add((RadElement)this.systemButtons); this.border = new BorderPrimitive(); this.border.Class = "MenuBorder"; this.border.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; this.Children.Add((RadElement)this.border); this.systemButtons.Visibility = ElementVisibility.Collapsed; }
public CommandBarFloatingForm() { this.InitializeComponent(); this.HorizontalScroll.Visible = false; this.VerticalScroll.Visible = false; this.FormBehavior = (FormControlBehavior) new CommandBarFloatingForm.CommandBarFloatingFormBehavior((IComponentTreeHandler)this); this.CreateHostControl(); this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); this.StartPosition = FormStartPosition.Manual; this.customizeMenuButtonElement = new RadImageButtonElement(); this.customizeMenuButtonElement.ThemeRole = "CommandBarFloatingOverflowButton"; this.customizeMenuButtonElement.Class = "CommandBarFloatingOverflowButton"; this.customizeMenuButtonElement.Click += new EventHandler(this.customizeMenuButtonElement_Click); this.customizeMenuButtonElement.Visibility = ElementVisibility.Collapsed; this.FormElement.TitleBar.Children[2].Children[0].Children.Insert(2, (RadElement)this.customizeMenuButtonElement); this.FormElement.TitleBar.MouseDown += new MouseEventHandler(this.TitleBar_MouseDown); this.FormElement.VerticalScrollbar.Visibility = ElementVisibility.Collapsed; this.FormElement.HorizontalScrollbar.Visibility = ElementVisibility.Collapsed; }
protected override void CreateChildElements() { this.filterDropDown = new RadDropDownButtonElement(); this.filterDropDown.Alignment = ContentAlignment.TopLeft; this.filterDropDown.ExpandArrowButton = true; this.filterDropDown.ArrowButton.Arrow.Alignment = ContentAlignment.MiddleLeft; this.filterDropDown.Class = "RadGalleryPopupFilterDropDownButton"; this.filterDropDown.ActionButton.ButtonFillElement.Class = "RadGalleryPopupFilterActionButtonFill"; this.filterDropDown.ActionButton.BorderElement.Class = "RadGalleryPopupFilterActionButtonBorder"; this.filterDropDown.ActionButton.Class = "RadGalleryPopupFilterActionButton"; this.filterDropDown.ArrowButton.Fill.Class = "RadGalleryPopupFilterArrowButtonFill"; this.filterDropDown.ArrowButton.Border.Class = "RadGalleryPopupFilterArrowButtonBorder"; this.filterDropDown.ArrowButton.Arrow.Class = "RadGalleryPopupFilterArrowButtonArrow"; this.filterDropDown.BorderElement.Class = "RadGalleryPopupFilterDropDownButtonBorder"; this.popupGroupsViewport = new RadCanvasViewport(); this.popupScrollViewer = new RadScrollViewer(this.popupGroupsViewport); this.popupScrollViewer.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; this.popupScrollViewer.HorizontalScrollState = ScrollState.AlwaysHide; this.popupScrollViewer.UsePhysicalScrolling = true; this.popupScrollViewer.Class = "RadGalleryPopupScrollViewer"; this.popupScrollViewer.FillElement.Class = "RadGalleryPopupScrollViewerFill"; this.subMenuLayoutPanel = new RadGalleryMenuLayoutPanel(); this.subMenuLayoutPanel.Alignment = ContentAlignment.BottomLeft; this.subMenuLayoutPanel.Class = "RadGalleryPoupMenuPanel"; this.dropDownPanel = new StackLayoutPanel(); this.dropDownPanel.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; this.dropDownPanel.Orientation = System.Windows.Forms.Orientation.Vertical; this.dropDownPanel.EqualChildrenWidth = true; this.downMenu = new RadGalleryDropDown(this); this.WireMenuDropDownEvents(); this.downMenu.VerticalPopupAlignment = VerticalPopupAlignment.TopToTop; this.downMenu.HorizontalPopupAlignment = HorizontalPopupAlignment.LeftToLeft; this.downMenu.AnimationEnabled = false; this.galleryPopupElement = new RadGalleryPopupElement( this.Items, this.Groups, this.Filters, this.Tools); this.downMenu.PopupElement = this.galleryPopupElement; this.downMenu.LoadElementTree(); this.dropDownPanel.Children.Add(this.filterDropDown); this.dropDownPanel.Children.Add(this.popupScrollViewer); this.dropDownPanel.Children.Add(this.subMenuLayoutPanel); //TODO: perhaps we should implement RadStackViewport to support integral scrolling this.inribbonItemsLayoutPanel = new IntegralScrollWrapPanel(); this.inribbonItemsLayoutPanel.MaxColumns = this.MaxColumns; this.inribbonItemsLayoutPanel.MaxRows = this.MaxRows; this.Items.Owner = this.inribbonItemsLayoutPanel; this.upButton = new RadImageButtonElement(); this.upButton.Class = "GalleryUpButton"; this.upButton.Enabled = false; this.upButton.MinSize = arrowButtonsMinSize; this.upButton.Click += new EventHandler(upButton_Click); this.upButton.BorderElement.Class = "GalleryUpButtonBorder"; this.upButton.ButtonFillElement.Class = "GalleryArrowButtonFill"; this.downButton = new RadImageButtonElement(); this.downButton.Class = "GalleryDownButton"; this.downButton.MinSize = arrowButtonsMinSize; this.downButton.Click += new EventHandler(downButton_Click); this.downButton.BorderElement.Class = "GalleryDownButtonBorder"; this.downButton.ButtonFillElement.Class = "GalleryArrowButtonFill"; this.popupButton = new RadImageButtonElement(); this.popupButton.Class = "GalleryPopupButtonButton"; this.popupButton.MinSize = arrowButtonsMinSize; this.popupButton.MouseDown += new System.Windows.Forms.MouseEventHandler(popupButton_MouseDown); this.popupButton.BorderElement.Class = "GalleryPopupButtonButtonBorder"; this.popupButton.ButtonFillElement.Class = "GalleryArrowButtonFill"; this.buttonsPanel = new RadGalleryButtonsLayoutPanel(); this.buttonsPanel.MaxSize = buttonsPanelMaxSize; this.buttonsPanel.SetValue(DropDownEditorLayoutPanel.IsArrowButtonProperty, true); this.buttonsPanel.Children.Add(upButton); this.buttonsPanel.Children.Add(downButton); this.buttonsPanel.Children.Add(popupButton); this.inribbonPanel = new DropDownEditorLayoutPanel(); this.inribbonPanel.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize; this.inribbonFillPrimitive = new FillPrimitive(); this.inribbonFillPrimitive.Class = "InribbonGalleryFill"; this.inribbonPanel.Children.Add(this.inribbonItemsLayoutPanel); this.inribbonPanel.Children.Add(this.buttonsPanel); this.inribbonPanelBorder = new BorderPrimitive(); this.inribbonPanelBorder.Visibility = ElementVisibility.Collapsed; this.inribbonPanelBorder.Class = "InribbonGalleryBorder"; this.Children.Add(this.inribbonPanelBorder); this.Children.Add(this.inribbonFillPrimitive); this.Children.Add(this.inribbonPanel); }
protected override void CreateChildElements() { base.CreateChildElements(); this.StretchHorizontally = true; this.StretchVertically = true; this.fill = new FillPrimitive(); this.TitleBarFill.Class = "TitleFill"; this.Children.Add(this.TitleBarFill); this.border = new BorderPrimitive(); this.border.Class = "TitleBorder"; this.Children.Add(this.border); this.layout = new DockLayoutPanel(); this.layout.StretchVertically = true; this.layout.StretchHorizontally = true; this.Children.Add(this.layout); this.titleBarIcon = new ImagePrimitive(); this.titleBarIcon.Class = "TitleIcon"; this.layout.Children.Add(this.titleBarIcon); this.caption = new TextPrimitive(); this.caption.Class = "TitleCaption"; this.caption.StretchVertically = true; this.layout.Children.Add(this.caption); this.systemButtons = new StackLayoutPanel(); this.systemButtons.Alignment = ContentAlignment.MiddleRight; this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.minimizeButton.StretchHorizontally = false; this.minimizeButton.StretchVertically = false; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill"; this.minimizeButton.Click += new EventHandler(this.OnMinimize); this.minimizeButton.ThemeRole = "TitleBarMinimizeButton"; this.systemButtons.Children.Add(minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.maximizeButton.StretchHorizontally = false; this.maximizeButton.StretchVertically = false; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill"; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); this.maximizeButton.ThemeRole = "TitleBarMaximizeButton"; this.systemButtons.Children.Add(maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.closeButton.StretchHorizontally = false; this.closeButton.StretchVertically = false; this.closeButton.Class = "CloseButton"; this.closeButton.ButtonFillElement.Name = "CloseButtonFill"; this.closeButton.Click += new EventHandler(this.OnClose); this.closeButton.ThemeRole = "TitleBarCloseButton"; this.systemButtons.Children.Add(closeButton); this.layout.Children.Add(this.systemButtons); this.SetDockingAlignmentUponRtlChange(this.RightToLeft); layout.LastChildFill = false; this.caption.BindProperty(TextPrimitive.TextProperty, this, RadItem.TextProperty, PropertyBindingOptions.OneWay); }
protected override void CreateChildElements() { base.CreateChildElements(); this.StretchHorizontally = true; this.StretchVertically = true; this.fill = new FillPrimitive(); this.TitleBarFill.Class = "TitleFill"; this.Children.Add((RadElement)this.TitleBarFill); this.border = new BorderPrimitive(); this.border.Class = "TitleBorder"; this.Children.Add((RadElement)this.border); this.layout = new DockLayoutPanel(); this.layout.StretchVertically = true; this.layout.StretchHorizontally = true; this.Children.Add((RadElement)this.layout); this.titleBarIcon = new ImagePrimitive(); this.titleBarIcon.Class = "TitleIcon"; this.titleBarIcon.ImageScaling = ImageScaling.SizeToFit; this.layout.Children.Add((RadElement)this.titleBarIcon); this.systemButtons = new StackLayoutElement(); this.systemButtons.Orientation = Orientation.Horizontal; this.systemButtons.Alignment = ContentAlignment.MiddleRight; this.helpButton = new RadImageButtonElement(); this.helpButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.helpButton.StretchHorizontally = false; this.helpButton.StretchVertically = false; this.helpButton.Class = "HelpButton"; this.helpButton.ButtonFillElement.Name = "HelpButtonFill"; this.helpButton.Click += new EventHandler(this.OnHelpButtonClick); this.helpButton.ThemeRole = "TitleBarHelpButton"; this.helpButton.Visibility = ElementVisibility.Collapsed; this.systemButtons.Children.Add((RadElement)this.helpButton); this.minimizeButton = new RadImageButtonElement(); this.minimizeButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.minimizeButton.StretchHorizontally = false; this.minimizeButton.StretchVertically = false; this.minimizeButton.Class = "MinimizeButton"; this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill"; this.minimizeButton.Click += new EventHandler(this.OnMinimize); this.minimizeButton.ThemeRole = "TitleBarMinimizeButton"; this.systemButtons.Children.Add((RadElement)this.minimizeButton); this.maximizeButton = new RadImageButtonElement(); this.maximizeButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.maximizeButton.StretchHorizontally = false; this.maximizeButton.StretchVertically = false; this.maximizeButton.Class = "MaximizeButton"; this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill"; this.maximizeButton.Click += new EventHandler(this.OnMaximizeRestore); this.maximizeButton.ThemeRole = "TitleBarMaximizeButton"; this.systemButtons.Children.Add((RadElement)this.maximizeButton); this.closeButton = new RadImageButtonElement(); this.closeButton.StateManager = new TitleBarButtonStateManager().StateManagerInstance; this.closeButton.StretchHorizontally = false; this.closeButton.StretchVertically = false; this.closeButton.Class = "CloseButton"; this.closeButton.ButtonFillElement.Name = "CloseButtonFill"; this.closeButton.Click += new EventHandler(this.OnClose); this.closeButton.ThemeRole = "TitleBarCloseButton"; this.systemButtons.Children.Add((RadElement)this.closeButton); this.layout.Children.Add((RadElement)this.systemButtons); this.captionElement = (TextPrimitive) new TitleBarTextPrimitive(); this.captionElement.UseMnemonic = false; this.captionElement.ShowKeyboardCues = false; this.captionElement.Class = "TitleCaption"; this.captionElement.StretchVertically = true; this.layout.Children.Add((RadElement)this.captionElement); this.SetDockingAlignmentUponRtlChange(this.RightToLeft); int num = (int)this.captionElement.BindProperty(TextPrimitive.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.OneWay); }