protected void customizeButton_Click(object sender, EventArgs e) { RadControl senderControl = null; if (this.ElementTree != null) { senderControl = this.ElementTree.Control as RadControl; } if (this.owner.FloatingForm != null && !this.owner.FloatingForm.IsDisposed) { senderControl = this.owner.FloatingForm.ItemsHostControl; CommandBarCustomizeDialogProvider.CurrentProvider.ShowCustomizeDialog(this.owner, this.owner.FloatingForm.StripInfoHolder); } else { RadCommandBar commandBar = null; if (senderControl != null) { commandBar = senderControl as RadCommandBar; } if (commandBar != null) { CommandBarCustomizeDialogProvider.CurrentProvider.ShowCustomizeDialog(this.owner, commandBar.CommandBarElement.StripInfoHolder); } } }
protected void customizeButton_Click(object sender, EventArgs e) { RadControl radControl = (RadControl)null; if (this.ElementTree != null) { radControl = this.ElementTree.Control as RadControl; } if (this.owner.FloatingForm != null && !this.owner.FloatingForm.IsDisposed) { RadControl itemsHostControl = (RadControl)this.owner.FloatingForm.ItemsHostControl; CommandBarCustomizeDialogProvider.CurrentProvider.ShowCustomizeDialog((object)this.owner, this.owner.FloatingForm.StripInfoHolder); } else { RadCommandBar radCommandBar = (RadCommandBar)null; if (radControl != null) { radCommandBar = radControl as RadCommandBar; } if (radCommandBar == null) { return; } CommandBarCustomizeDialogProvider.CurrentProvider.ShowCustomizeDialog((object)this.owner, radCommandBar.CommandBarElement.StripInfoHolder); } }
/// <summary> /// Tries to dock the floating strip in a specified <c ref="RadCommandBar"/>. /// </summary> /// <param name="commandBar">The <c ref="RadCommandBar"/> control into which the strip should be docked.</param> public void TryDocking(RadCommandBar commandBar) { if (commandBar == null || commandBar.CommandBarElement.CallOnFloatingStripDocking(this.stripElement)) { return; } this.Capture = false; this.isWindowMoving = false; this.stripElement.EnableDragging = true; this.stripElement.Capture = false; this.stripElement.ForceEndDrag(); this.stripElement.Items.Owner = this.stripElement.ItemsLayout; bool enableFloatingOldValue = this.stripElement.EnableFloating; this.stripElement.EnableFloating = false; while (this.hostControl.Element.Layout.Children.Count > 0) { RadElement item = this.hostControl.Element.Layout.Children[0]; if (item is RadCommandBarBaseItem || !this.stripElement.Items.Contains(item as RadCommandBarBaseItem)) { this.hostControl.Element.Layout.Children.Remove(item); this.stripElement.Items.Add(item as RadCommandBarBaseItem); } } this.stripElement.FloatingForm = null; this.stripInfoHolder.RemoveStripInfo(this.stripElement); if (commandBar.Rows.Count == 0) { commandBar.Rows.Add(new CommandBarRowElement()); } commandBar.Rows[0].Strips.Add(this.stripElement); this.stripElement.OverflowButton.HostControlThemeName = commandBar.ThemeName; this.stripElement.Capture = false; this.stripElement.ForceEndDrag(); this.stripElement.ElementTree.Control.Capture = false; this.stripElement.CallDoMouseUp(new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 1, 0, 0, 0)); Point location = this.parentControl.PointToClient(this.Location); if (stripElement.RightToLeft) { location.X = this.parentControl.Size.Width - location.X - this.Size.Width; } this.stripElement.DesiredLocation = location; this.stripElement.EnableFloating = enableFloatingOldValue; commandBar.CommandBarElement.CallOnFloatingStripDocked(this.stripElement); this.StripElement = null; this.Close(); }
/// <summary> /// Tries to dock the floating strip on a specified point of screen. The docking will be completed only if /// the control under that point is <c ref="RadCommandBar"/>. /// </summary> /// <param name="screenLocation">The location in screen coordinates where the strip should try to dock.</param> public void TryDocking(Point screenLocation) { if (this.parentControl == null) { return; } RadCommandBar commandBar = (this.ParentControl.GetChildAtPoint(this.parentControl.PointToClient(screenLocation)) as RadCommandBar); this.TryDocking(commandBar); }
public RadCommandBarAccessibleObject(RadCommandBar owner) : base((Control)owner) { this.owner = owner; this.cachedObjects = new Dictionary <RadCommandBarBaseItem, RadCommandBarItemAccessibleObject>(); }
public RadCommandBarAccessibleObject(RadCommandBar owner) : base(owner) { this.owner = owner; }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(RadPrintPreviewDialog)); this.printPreviewControl = new RadPrintPreviewControl(); this.radCommandBar = new RadCommandBar(); this.commandBarRowElement1 = new CommandBarRowElement(); this.stripElementTools = new CommandBarStripElement(); this.buttonPrint = new CommandBarButton(); this.buttonSettings = new CommandBarButton(); this.commandBarButtonWatermark = new CommandBarButton(); this.stripElementNavigation = new CommandBarStripElement(); this.buttonPrevPage = new CommandBarButton(); this.buttonNextPage = new CommandBarButton(); this.textBoxCurrentPage = new CommandBarTextBox(); this.labelTotalPages = new CommandBarLabel(); this.commandBarSeparator1 = new CommandBarSeparator(); this.buttonZoomOut = new CommandBarButton(); this.buttonZoomIn = new CommandBarButton(); this.dropDownZoom = new CommandBarDropDownList(); this.dropDownButtonLayout = new CommandBarDropDownButton(); this.menuItemFile = new RadMenuItem(); this.menuItemPrint = new RadMenuItem(); this.menuItemExit = new RadMenuItem(); this.menuItemView = new RadMenuItem(); this.radMenuSeparatorItem1 = new RadMenuSeparatorItem(); this.menuItemPreviousPage = new RadMenuItem(); this.menuItemNextPage = new RadMenuItem(); this.radMenuSeparatorItem2 = new RadMenuSeparatorItem(); this.menuItemLayout = new RadMenuItem(); this.menuItemTools = new RadMenuItem(); this.menuItemPrintSettings = new RadMenuItem(); this.menuItemWatermark = new RadMenuItem(); this.radMenu = new RadMenu(); this.radCommandBar.BeginInit(); this.radMenu.BeginInit(); this.BeginInit(); this.SuspendLayout(); this.printPreviewControl.AutoZoom = false; this.printPreviewControl.BackColor = Color.FromArgb(156, 179, 207); this.printPreviewControl.Dock = DockStyle.Fill; this.printPreviewControl.Location = new Point(0, 58); this.printPreviewControl.Name = "printPreviewControl"; this.printPreviewControl.PageBorderColor = Color.White; this.printPreviewControl.PageInnerBorderColor = Color.White; this.printPreviewControl.PageShadowColor = Color.FromArgb(109, 125, 144); this.printPreviewControl.ScrollOffset = new Point(0, 0); this.printPreviewControl.ShadowThickness = 6; this.printPreviewControl.Size = new Size(713, 399); this.printPreviewControl.TabIndex = 1; this.printPreviewControl.StartPageChanged += new EventHandler(this.printPreviewControl1_StartPageChanged); this.printPreviewControl.MouseDown += new MouseEventHandler(this.printPreviewControl1_MouseDown); this.printPreviewControl.MouseMove += new MouseEventHandler(this.printPreviewControl1_MouseMove); this.printPreviewControl.MouseUp += new MouseEventHandler(this.printPreviewControl1_MouseUp); this.printPreviewControl.MouseWheel += new MouseEventHandler(this.printPreviewControl1_MouseWheel); this.radCommandBar.AutoSize = true; this.radCommandBar.Dock = DockStyle.Top; this.radCommandBar.Location = new Point(0, 20); this.radCommandBar.Name = "radCommandBar"; this.radCommandBar.Rows.AddRange(this.commandBarRowElement1); this.radCommandBar.Size = new Size(713, 38); this.radCommandBar.TabIndex = 3; this.radCommandBar.Text = "radCommandBar1"; this.commandBarRowElement1.DisplayName = (string)null; this.commandBarRowElement1.MinSize = new Size(25, 25); this.commandBarRowElement1.Strips.AddRange(this.stripElementTools, this.stripElementNavigation); this.stripElementTools.DisplayName = "Tools"; this.stripElementTools.Items.AddRange((RadCommandBarBaseItem)this.buttonPrint, (RadCommandBarBaseItem)this.buttonSettings, (RadCommandBarBaseItem)this.commandBarButtonWatermark); this.stripElementTools.Name = "commandBarStripElement1"; this.stripElementTools.Text = ""; this.buttonPrint.AccessibleDescription = "Print"; this.buttonPrint.AccessibleName = "Print"; this.buttonPrint.DisplayName = "Print..."; this.buttonPrint.DrawText = false; this.buttonPrint.Image = (Image)componentResourceManager.GetObject("print"); this.buttonPrint.Name = "buttonPrint"; this.buttonPrint.Text = "Print"; this.buttonPrint.ToolTipText = "Print..."; this.buttonPrint.Visibility = ElementVisibility.Visible; this.buttonPrint.MouseDown += new MouseEventHandler(this.buttonPrint_Click); this.buttonSettings.AccessibleDescription = "Settings"; this.buttonSettings.AccessibleName = "Settings"; this.buttonSettings.DisplayName = "Print Settings..."; this.buttonSettings.DrawText = false; this.buttonSettings.Image = (Image)componentResourceManager.GetObject("page-setup"); this.buttonSettings.Name = "buttonSettings"; this.buttonSettings.Text = "Settings"; this.buttonSettings.ToolTipText = "Print Settings..."; this.buttonSettings.Visibility = ElementVisibility.Visible; this.buttonSettings.MouseDown += new MouseEventHandler(this.buttonSettings_Click); this.commandBarButtonWatermark.AccessibleDescription = "Watermark"; this.commandBarButtonWatermark.AccessibleName = "Watermark"; this.commandBarButtonWatermark.DisplayName = "Watermark"; this.commandBarButtonWatermark.DrawText = false; this.commandBarButtonWatermark.Image = (Image)componentResourceManager.GetObject("watermark"); this.commandBarButtonWatermark.Name = "commandBarButtonWatermark"; this.commandBarButtonWatermark.Text = "Watermark"; this.commandBarButtonWatermark.ToolTipText = "Watermark"; this.commandBarButtonWatermark.Visibility = ElementVisibility.Visible; this.commandBarButtonWatermark.MouseUp += new MouseEventHandler(this.commandBarButtonWatermark_Click); this.stripElementNavigation.DisplayName = "Navigation"; this.stripElementNavigation.Items.AddRange((RadCommandBarBaseItem)this.buttonPrevPage, (RadCommandBarBaseItem)this.buttonNextPage, (RadCommandBarBaseItem)this.textBoxCurrentPage, (RadCommandBarBaseItem)this.labelTotalPages, (RadCommandBarBaseItem)this.commandBarSeparator1, (RadCommandBarBaseItem)this.buttonZoomOut, (RadCommandBarBaseItem)this.buttonZoomIn, (RadCommandBarBaseItem)this.dropDownZoom, (RadCommandBarBaseItem)this.dropDownButtonLayout); this.stripElementNavigation.Name = "commandBarStripElement2"; this.stripElementNavigation.Text = ""; this.buttonPrevPage.AccessibleDescription = "<"; this.buttonPrevPage.AccessibleName = "<"; this.buttonPrevPage.DisplayName = "Previous Page"; this.buttonPrevPage.DrawText = false; this.buttonPrevPage.Image = (Image)componentResourceManager.GetObject("arrow-up"); this.buttonPrevPage.Name = "buttonPrevPage"; this.buttonPrevPage.Text = "<"; this.buttonPrevPage.ToolTipText = "Previous Page"; this.buttonPrevPage.Visibility = ElementVisibility.Visible; this.buttonPrevPage.MouseDown += new MouseEventHandler(this.buttonPrevPage_Click); this.buttonNextPage.AccessibleDescription = ">"; this.buttonNextPage.AccessibleName = ">"; this.buttonNextPage.DisplayName = "Next Page"; this.buttonNextPage.DrawText = false; this.buttonNextPage.Image = (Image)componentResourceManager.GetObject("arrow-down"); this.buttonNextPage.Name = "buttonNextPage"; this.buttonNextPage.Text = ">"; this.buttonNextPage.ToolTipText = "Next Page"; this.buttonNextPage.Visibility = ElementVisibility.Visible; this.buttonNextPage.MouseDown += new MouseEventHandler(this.buttonNextPage_Click); this.textBoxCurrentPage.DisplayName = "Current Page"; this.textBoxCurrentPage.Font = new Font("Segoe UI Semibold", 12f, FontStyle.Bold, GraphicsUnit.Point, (byte)204); this.textBoxCurrentPage.MaxSize = new Size(0, 0); this.textBoxCurrentPage.Name = "textBoxCurrentPage"; this.textBoxCurrentPage.StretchVertically = true; this.textBoxCurrentPage.Text = ""; this.textBoxCurrentPage.Visibility = ElementVisibility.Visible; this.textBoxCurrentPage.KeyDown += new KeyEventHandler(this.commandBarTextBox1_KeyDown); ((RadItem)this.textBoxCurrentPage.GetChildAt(0)).Text = ""; this.textBoxCurrentPage.GetChildAt(0).Alignment = ContentAlignment.MiddleCenter; this.textBoxCurrentPage.GetChildAt(0).MinSize = new Size(40, 20); this.labelTotalPages.AccessibleDescription = "of 0"; this.labelTotalPages.AccessibleName = "of 0"; this.labelTotalPages.DisplayName = "Total Pages"; this.labelTotalPages.Font = new Font("Segoe UI Semibold", 12f, FontStyle.Bold, GraphicsUnit.Point, (byte)204); this.labelTotalPages.Name = "labelTotalPages"; this.labelTotalPages.Text = "/ 0"; this.labelTotalPages.Visibility = ElementVisibility.Visible; this.commandBarSeparator1.AccessibleDescription = "commandBarSeparator1"; this.commandBarSeparator1.AccessibleName = "commandBarSeparator1"; this.commandBarSeparator1.DisplayName = "commandBarSeparator1"; this.commandBarSeparator1.Name = "commandBarSeparator1"; this.commandBarSeparator1.Visibility = ElementVisibility.Visible; this.commandBarSeparator1.VisibleInOverflowMenu = false; this.buttonZoomOut.AccessibleDescription = "-"; this.buttonZoomOut.AccessibleName = "-"; this.buttonZoomOut.DisplayName = "Zoom Out"; this.buttonZoomOut.DrawText = false; this.buttonZoomOut.Image = (Image)componentResourceManager.GetObject("zoom-out"); this.buttonZoomOut.Name = "buttonZoomOut"; this.buttonZoomOut.Text = "-"; this.buttonZoomOut.ToolTipText = "Zoom Out"; this.buttonZoomOut.Visibility = ElementVisibility.Visible; this.buttonZoomIn.AccessibleDescription = "+"; this.buttonZoomIn.AccessibleName = "+"; this.buttonZoomIn.DisplayName = "Zoom In"; this.buttonZoomIn.DrawText = false; this.buttonZoomIn.Image = (Image)componentResourceManager.GetObject("zoom-in"); this.buttonZoomIn.Name = "buttonZoomIn"; this.buttonZoomIn.Text = "+"; this.buttonZoomIn.ToolTipText = "Zoom In"; this.buttonZoomIn.Visibility = ElementVisibility.Visible; this.dropDownZoom.DisplayName = "Zoom"; this.dropDownZoom.DropDownAnimationEnabled = true; this.dropDownZoom.MinSize = new Size(90, 22); this.dropDownZoom.Name = "dropDownZoom"; this.dropDownZoom.Text = ""; this.dropDownZoom.Visibility = ElementVisibility.Visible; this.dropDownButtonLayout.AccessibleDescription = "commandBarDropDownButton1"; this.dropDownButtonLayout.AccessibleName = "commandBarDropDownButton1"; this.dropDownButtonLayout.DisplayName = "Layout"; this.dropDownButtonLayout.Image = (Image)componentResourceManager.GetObject("view-thumbnail"); this.dropDownButtonLayout.Name = "dropDownButtonLayout"; this.dropDownButtonLayout.Text = "commandBarDropDownButton1"; this.dropDownButtonLayout.ToolTipText = "Layout"; this.dropDownButtonLayout.Visibility = ElementVisibility.Visible; this.menuItemFile.AccessibleDescription = "File"; this.menuItemFile.AccessibleName = "File"; this.menuItemFile.Items.AddRange((RadItem)this.menuItemPrint, (RadItem)this.menuItemExit); this.menuItemFile.Name = "menuItemFile"; this.menuItemFile.Text = "File"; this.menuItemFile.Visibility = ElementVisibility.Visible; this.menuItemPrint.AccessibleDescription = "Print..."; this.menuItemPrint.AccessibleName = "Print..."; this.menuItemPrint.Name = "menuItemPrint"; this.menuItemPrint.Text = "Print..."; this.menuItemPrint.Visibility = ElementVisibility.Visible; this.menuItemPrint.Click += new EventHandler(this.buttonPrint_Click); this.menuItemExit.AccessibleDescription = "Exit"; this.menuItemExit.AccessibleName = "Exit"; this.menuItemExit.Name = "menuItemExit"; this.menuItemExit.Text = "Exit"; this.menuItemExit.Visibility = ElementVisibility.Visible; this.menuItemExit.Click += new EventHandler(this.radMenuItem6_Click); this.menuItemView.AccessibleDescription = "View"; this.menuItemView.AccessibleName = "View"; this.menuItemView.Items.AddRange((RadItem)this.radMenuSeparatorItem1, (RadItem)this.menuItemPreviousPage, (RadItem)this.menuItemNextPage, (RadItem)this.radMenuSeparatorItem2, (RadItem)this.menuItemLayout); this.menuItemView.Name = "menuItemView"; this.menuItemView.Text = "View"; this.menuItemView.Visibility = ElementVisibility.Visible; this.radMenuSeparatorItem1.Name = "radMenuSeparatorItem1"; this.radMenuSeparatorItem1.Visibility = ElementVisibility.Visible; this.menuItemPreviousPage.AccessibleDescription = "Previous Page"; this.menuItemPreviousPage.AccessibleName = "Previous Page"; this.menuItemPreviousPage.Name = "menuItemPreviousPage"; this.menuItemPreviousPage.Text = "Previous Page"; this.menuItemPreviousPage.Visibility = ElementVisibility.Visible; this.menuItemPreviousPage.Click += new EventHandler(this.buttonPrevPage_Click); this.menuItemNextPage.AccessibleDescription = "Next Page"; this.menuItemNextPage.AccessibleName = "Next Page"; this.menuItemNextPage.Name = "menuItemNextPage"; this.menuItemNextPage.Text = "Next Page"; this.menuItemNextPage.Visibility = ElementVisibility.Visible; this.menuItemNextPage.Click += new EventHandler(this.buttonNextPage_Click); this.radMenuSeparatorItem2.Name = "radMenuSeparatorItem2"; this.radMenuSeparatorItem2.Visibility = ElementVisibility.Visible; this.menuItemLayout.AccessibleDescription = "Layout"; this.menuItemLayout.AccessibleName = "Layout"; this.menuItemLayout.Name = "menuItemLayout"; this.menuItemLayout.Text = "Layout"; this.menuItemLayout.Visibility = ElementVisibility.Visible; this.menuItemTools.AccessibleDescription = "Tools"; this.menuItemTools.AccessibleName = "Tools"; this.menuItemTools.Items.AddRange((RadItem)this.menuItemPrintSettings, (RadItem)this.menuItemWatermark); this.menuItemTools.Name = "menuItemTools"; this.menuItemTools.Text = "Tools"; this.menuItemTools.Visibility = ElementVisibility.Visible; this.menuItemPrintSettings.AccessibleDescription = "Printer Settings"; this.menuItemPrintSettings.AccessibleName = "Printer Settings"; this.menuItemPrintSettings.Name = "menuItemPrintSettings"; this.menuItemPrintSettings.Text = "Printer Settings..."; this.menuItemPrintSettings.Visibility = ElementVisibility.Visible; this.menuItemPrintSettings.Click += new EventHandler(this.buttonSettings_Click); this.menuItemWatermark.AccessibleDescription = "Watermark Settings..."; this.menuItemWatermark.AccessibleName = "Watermark Settings..."; this.menuItemWatermark.Name = "menuItemWatermark"; this.menuItemWatermark.Text = "Watermark Settings..."; this.menuItemWatermark.Visibility = ElementVisibility.Visible; this.menuItemWatermark.Click += new EventHandler(this.commandBarButtonWatermark_Click); this.radMenu.Items.AddRange((RadItem)this.menuItemFile, (RadItem)this.menuItemView, (RadItem)this.menuItemTools); this.radMenu.Location = new Point(0, 0); this.radMenu.Name = "radMenu"; this.radMenu.Size = new Size(713, 20); this.radMenu.TabIndex = 4; this.radMenu.Text = "radMenu1"; this.radMenu.Visible = false; this.AutoScaleDimensions = new SizeF(96f, 96f); this.AutoScaleMode = AutoScaleMode.Dpi; this.ClientSize = new Size(713, 457); this.Controls.Add((Control)this.printPreviewControl); this.Controls.Add((Control)this.radCommandBar); this.Controls.Add((Control)this.radMenu); this.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); this.MinimizeBox = false; this.Name = nameof(RadPrintPreviewDialog); this.RootElement.ApplyShapeToControl = true; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "Print Preview"; this.radCommandBar.EndInit(); this.radMenu.EndInit(); this.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }