private void InitialiseToolbars() { // Main toolbar var tbRenderer = new UIThemeToolbarRenderer(); tbRenderer.SetUITheme(new UITheme()); tbRenderer.EnableDrawRowSeparators(true); this.Toolbar.Renderer = tbRenderer; this.Toolbar.BackColor = BackColor; if (DPIScaling.WantScaling()) { int imageSize = DPIScaling.Scale(16); this.Toolbar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize); } // Place this at the end to ensure the toolbar has finished its resize Toolbars.FixupButtonSizes(this.Toolbar); UpdateToolbar(); // Page toolbars var theme = new UITheme(); theme.SetAppDrawingColor(UITheme.AppColor.AppBackLight, headerPage.BackColor); theme.SetAppDrawingColor(UITheme.AppColor.ToolbarLight, headerPage.BackColor); theme.SetAppDrawingColor(UITheme.AppColor.ToolbarDark, headerPage.BackColor); this.htmlReportHeaderControl.SetUITheme(theme); this.htmlReportTitleControl.SetUITheme(theme); this.htmlReportTasksControl.SetUITheme(theme); this.htmlReportFooterControl.SetUITheme(theme); }
private void InitializeComponentEx() { InitialiseFeatures(); if (DPIScaling.WantScaling()) { int imageSize = DPIScaling.Scale(16); this.ToolBar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize); this.ContextMenu.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize); } this.ToolbarDock = DockStyle.Top; this.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; this.InnerText = ""; this.TabIndex = 26; this.BorderSize = 0; this.ContentMargin = 5; this.BrowserPanel.Anchor = AnchorStyles.None; // we handle positioning ourselves this.WebBrowser.Document.AttachEventHandler("onfocusout", OnLostFocus); this.WebBrowser.Document.AttachEventHandler("onfocusin", OnGotFocus); // Place this at the end to ensure the toolbar has finished its resize Toolbars.FixupButtonSizes(this.ToolBar); }
private void InitialiseToolbars() { this.MenuBar.Renderer = m_toolbarRenderer; this.RowContextMenu.Renderer = m_toolbarRenderer; this.CellContextMenu.Renderer = m_toolbarRenderer; this.HeaderContextMenu.Renderer = m_toolbarRenderer; this.ColumnContextMenu.Renderer = m_toolbarRenderer; this.ToolBar.Renderer = m_toolbarRenderer; this.FontBar.Renderer = m_toolbarRenderer; this.StatusBar.Renderer = m_toolbarRenderer; Toolbars.FixupButtonSizes(this.ToolBar); Toolbars.FixupButtonSizes(this.FontBar); if (m_ControlsFont != null) { this.MenuBar.Font = m_ControlsFont; this.ToolBar.Font = m_ControlsFont; this.StatusBar.Font = m_ControlsFont; this.FontBar.Font = m_ControlsFont; this.FontBar.Items["fontToolStripComboBox"].Font = m_ControlsFont; this.FontBar.Items["fontSizeToolStripComboBox"].Font = m_ControlsFont; this.RowContextMenu.Font = m_ControlsFont; this.CellContextMenu.Font = m_ControlsFont; this.HeaderContextMenu.Font = m_ControlsFont; this.ColumnContextMenu.Font = m_ControlsFont; } if (DPIScaling.WantScaling()) { int imageSize = DPIScaling.Scale(16); var scalingSize = new Size(imageSize, imageSize); this.MenuBar.ImageScalingSize = scalingSize; this.FontBar.ImageScalingSize = scalingSize; this.ToolBar.ImageScalingSize = scalingSize; this.RowContextMenu.ImageScalingSize = scalingSize; this.CellContextMenu.ImageScalingSize = scalingSize; this.HeaderContextMenu.ImageScalingSize = scalingSize; this.ColumnContextMenu.ImageScalingSize = scalingSize; } this.ToolBar.GripStyle = ToolStripGripStyle.Hidden; this.FontBar.GripStyle = ToolStripGripStyle.Hidden; this.StatusBar.SizingGrip = false; // After all resizing has occurred, set menu bar height to // match application and make its top-level items full height this.MenuBar.AutoSize = false; this.MenuBar.Height = Win32.GetSystemMetric(15); // SM_CYMENU this.MenuBar.Padding = new Padding(0); }
private void CreateToolbar() { var assembly = Assembly.GetExecutingAssembly(); var images = new Bitmap(assembly.GetManifestResourceStream("DayViewUIExtension.toolbar_std.bmp")); m_TBImageList = new ImageList(); m_TBImageList.ImageSize = new System.Drawing.Size(16, 16); m_TBImageList.TransparentColor = Color.Magenta; m_TBImageList.Images.AddStrip(images); m_Toolbar = new ToolStrip(); m_Toolbar.Anchor = AnchorStyles.None; m_Toolbar.GripStyle = ToolStripGripStyle.Hidden; m_Toolbar.ImageList = m_TBImageList; if (DPIScaling.WantScaling()) { int imageSize = DPIScaling.Scale(16); m_Toolbar.ImageScalingSize = new Size(imageSize, imageSize); m_Toolbar.AutoSize = false; m_Toolbar.Height = (imageSize + 10); } m_TBRenderer = new UIThemeToolbarRenderer(); m_Toolbar.Renderer = m_TBRenderer; var btn1 = new ToolStripButton(); btn1.ImageIndex = 0; btn1.Click += new EventHandler(OnGoToToday); btn1.ToolTipText = m_Trans.Translate("Go to Today"); m_Toolbar.Items.Add(btn1); var btn2 = new ToolStripButton(); btn2.ImageIndex = 1; btn2.Click += new EventHandler(OnPreferences); btn2.ToolTipText = m_Trans.Translate("Preferences"); m_Toolbar.Items.Add(btn2); var btn3 = new ToolStripButton(); btn3.ImageIndex = 2; btn3.Click += new EventHandler(OnHelp); btn3.ToolTipText = m_Trans.Translate("Online Help"); m_Toolbar.Items.Add(btn3); Toolbars.FixupButtonSizes(m_Toolbar); Controls.Add(m_Toolbar); }
private void InitialiseToolbar() { m_TBRenderer = new UIThemeToolbarRenderer(); m_TBRenderer.SetUITheme(new UITheme()); m_TBRenderer.EnableDrawRowDividers(true); this.Toolbar.Renderer = m_TBRenderer; if (DPIScaling.WantScaling()) { int imageSize = DPIScaling.Scale(16); this.Toolbar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize); } // Place this at the end to ensure the toolbar has finished its resize Toolbars.FixupButtonSizes(this.Toolbar); }
public void SetFont(String fontName, int fontSize) { m_Renderer.SetFont(fontName, fontSize); // Long appt height to match Calendar in core app int fontHeight = 0; if (DPIScaling.WantScaling()) { fontHeight = m_Renderer.BaseFont.Height; } else { fontHeight = Win32.GetPixelHeight(m_Renderer.BaseFont.ToHfont()); } int itemHeight = (fontHeight + 6 - longAppointmentSpacing); LongAppointmentHeight = Math.Max(itemHeight, 17); }
private void InitializeComponent() { InitialiseFeatures(); this.ToolBar.Renderer = m_toolbarRenderer; this.ToolBar.Font = m_ControlsFont; if (DPIScaling.WantScaling()) { int imageSize = DPIScaling.Scale(16); this.ToolBar.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize); this.ContextMenu.ImageScalingSize = new System.Drawing.Size(imageSize, imageSize); } this.ToolbarDock = DockStyle.Top; this.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; this.InnerText = ""; this.TabIndex = 26; this.BorderStyle = System.Windows.Forms.BorderStyle.None; this.BorderSize = 0; this.NavigateAction = MSDN.Html.Editor.NavigateActionOption.NewWindow; this.ContentMargin = 8; this.BrowserPanel.Anchor = AnchorStyles.None; // we handle positioning ourselves m_Trans.Translate(ToolBar.Items); m_Trans.Translate(ContextMenu.Items); m_TextChangeTimer.Tick += new EventHandler(OnTextChangeTimer); m_TextChangeTimer.Interval = 200; m_TextChangeTimer.Start(); // Dynamic tooltip handling this.WebBrowser.Document.MouseOver += new HtmlElementEventHandler(OnDocumentMouseOver); // Place this at the end to ensure the toolbar has finished its resize Toolbars.FixupButtonSizes(this.ToolBar); }
private void DoHighDPIFixups() { if (DPIScaling.WantScaling()) { // LHS this.Toolbar.Width = this.splitContainer.Panel1.Width; this.tabControl.Width = this.splitContainer.Panel1.Width; this.tabControl.Height = this.splitContainer.Panel1.Height - this.tabControl.Top; // RHS this.panel1.Width = this.splitContainer.Panel2.Width - DPIScaling.Scale(3); this.panel1.Height = this.splitContainer.Panel2.Height - this.panel1.Top; this.browserPreview.Width = this.panel1.Width; this.browserPreview.Height = this.panel1.Height - this.browserPreview.Top; this.previewDefaultBrowser.Location = new Point(this.panel1.Width - this.previewDefaultBrowser.Size.Width, 0); this.labelPreview.Width = this.previewDefaultBrowser.Left; this.splitContainer.Panel1.AutoSize = true; this.splitContainer.Panel2.AutoSize = true; this.splitContainer.SplitterDistance = DPIScaling.Scale(this.splitContainer.SplitterDistance); } }