public static Image Overlay(Image image, Image overlay, int x, int y) { Bitmap composed = image.Clone() as Bitmap; using (Graphics destination = Graphics.FromImage(composed)) { Rectangle dest = new Rectangle(ScaleHelper.Scale(x), ScaleHelper.Scale(y), overlay.Width, overlay.Height); destination.DrawImage(overlay, dest, new Rectangle(0, 0, overlay.Width, overlay.Height), GraphicsUnit.Pixel); } return(composed); }
/// <summary> /// Initializes the graphics /// </summary> private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(Globals.MainForm.FindImage("153")); // clear imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.pictureBox.Image = Globals.MainForm.FindImage("229"); this.clearButton.ImageList = imageList; this.clearButton.ImageIndex = 0; }
/// <summary> /// Initializes the setting object groups /// </summary> private void InitializeItemGroups() { String mainHeader = TextHelper.GetString("Group.Main"); String pluginsHeader = TextHelper.GetString("Group.Plugins"); this.mainGroup = new ListViewGroup(mainHeader, HorizontalAlignment.Left); this.pluginsGroup = new ListViewGroup(pluginsHeader, HorizontalAlignment.Left); this.itemListView.Groups.Add(this.mainGroup); this.itemListView.Groups.Add(this.pluginsGroup); this.columnHeader.Width = ScaleHelper.Scale(this.columnHeader.Width); }
/// <summary> /// Initializes the external graphics /// </summary> private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(Globals.MainForm.FindImage("242")); this.infoPictureBox.Image = Globals.MainForm.FindImage("229"); this.argsListView.SmallImageList = imageList; this.argsListView.SmallImageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.columnHeader.Width = ScaleHelper.Scale(this.columnHeader.Width); }
/// <summary> /// Initializes the graphics used in the control /// </summary> private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(PluginBase.MainForm.FindImage("338|13|0|0")); this.pictureBox.Image = PluginBase.MainForm.FindImage("229"); this.listView.SmallImageList = imageList; this.listView.SmallImageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.columnHeader.Width = -2; }
private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(PluginBase.MainForm.FindImage("196")); // warning buttonClose.ImageEnabled = ResourceHelper.LoadBitmap("MessageBarClose.bmp"); label.ImageList = imageList; label.ImageIndex = 0; }
public void ShowAtMouseLocation() { mousePos = ((Form)PluginBase.MainForm).PointToClient(Control.MousePosition); toolTip.Left = mousePos.X; if (toolTip.Right > ((Form)PluginBase.MainForm).ClientRectangle.Right) { toolTip.Left -= (toolTip.Right - ((Form)PluginBase.MainForm).ClientRectangle.Right); } toolTip.Top = mousePos.Y - toolTip.Height - ScaleHelper.Scale(10); toolTip.Show(); toolTip.BringToFront(); }
/// <summary> /// Gets a menu strip from the specified xml file /// </summary> public static MenuStrip GetMenuStrip(String file) { MenuStrip menuStrip = new MenuStrip(); menuStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); XmlNode rootNode = XmlHelper.LoadXmlDocument(file); foreach (XmlNode subNode in rootNode.ChildNodes) { FillMenuItems(menuStrip.Items, subNode); } return(menuStrip); }
/// <summary> /// Gets a tool strip from the specified xml file /// </summary> public static ToolStrip GetToolStrip(String file) { ToolStripEx toolStrip = new ToolStripEx(); toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); XmlNode rootNode = XmlHelper.LoadXmlDocument(file); foreach (XmlNode subNode in rootNode.ChildNodes) { FillToolItems(toolStrip.Items, subNode); } return(toolStrip); }
/// <summary> /// Initializes the external graphics /// </summary> private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(Globals.MainForm.FindImage("341")); imageList.Images.Add(Globals.MainForm.FindImage("342")); imageList.Images.Add(Globals.MainForm.FindImage("50")); this.clearFilterButton.Image = Globals.MainForm.FindImage("153"); this.infoPictureBox.Image = Globals.MainForm.FindImage("229"); this.itemListView.SmallImageList = imageList; this.itemListView.SmallImageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); }
/// <summary> /// Gets a context menu strip from the specified xml file /// </summary> public static ContextMenuStrip GetContextMenu(String file) { ContextMenuStrip contextMenu = new ContextMenuStrip(); contextMenu.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); XmlNode rootNode = XmlHelper.LoadXmlDocument(file); foreach (XmlNode subNode in rootNode.ChildNodes) { FillMenuItems(contextMenu.Items, subNode); } return(contextMenu); }
/// <summary> /// Initializes the image list for entriesView /// </summary> public void InitializeGraphics() { imageList = new ImageListManager(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.TransparentColor = Color.Transparent; imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); imageList.Initialize(ImageList_Populate); this.toolStripFilters.ImageList = imageList; this.entriesView.SmallImageList = imageList; this.clearFilterButton.Image = PluginBase.MainForm.FindImage("153"); this.toolStripButtonInfo.Image = PluginBase.MainForm.FindImage("131"); this.toolStripButtonError.Image = PluginBase.MainForm.FindImage("197"); this.toolStripButtonWarning.Image = PluginBase.MainForm.FindImage("196"); }
public ModelsExplorer() { instance = this; InitializeComponent(); InitializeLocalization(); this.toolStrip.Font = PluginBase.Settings.DefaultFont; this.toolStrip.Renderer = new DockPanelStripRenderer(); this.outlineContextMenuStrip.Font = PluginBase.Settings.DefaultFont; this.outlineContextMenuStrip.Renderer = new DockPanelStripRenderer(); searchButton.Image = PluginBase.MainForm.FindImage("251"); refreshButton.Image = PluginBase.MainForm.FindImage("24"); rebuildButton.Image = PluginBase.MainForm.FindImage("153"); toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); }
protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) { if (renderer is ToolStripSystemRenderer) { if (e.ToolStrip is ToolStripDropDownMenu) { renderer.DrawSeparator(e); } else { Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2; e.Graphics.DrawLine(SystemPens.ControlDark, middle - 1, e.Item.ContentRectangle.Top + 1, middle - 1, e.Item.ContentRectangle.Bottom - 2); e.Graphics.DrawLine(SystemPens.ControlLightLight, middle, e.Item.ContentRectangle.Top + 1, middle, e.Item.ContentRectangle.Bottom - 2); } } else if (e.Item is ToolStripSeparator && e.Vertical) { Color light = GetThemeColor("ToolStrip.3dLightColor"); Color dark = GetThemeColor("ToolStrip.3dDarkColor"); if (dark != Color.Empty && light != Color.Empty) { Pen pen = new Pen(dark); Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2; e.Graphics.DrawLine(pen, middle - 1, e.Item.ContentRectangle.Top + 2, middle - 1, e.Item.ContentRectangle.Bottom - 4); pen.Dispose(); Pen pen2 = new Pen(light); e.Graphics.DrawLine(pen2, middle, e.Item.ContentRectangle.Top + 2, middle, e.Item.ContentRectangle.Bottom - 4); pen2.Dispose(); } else { renderer.DrawSeparator(e); } } else { Color sepFore = GetThemeColor("ToolStripSeparator.ForeColor"); if (sepFore != Color.Empty) { Pen pen2 = new Pen(sepFore); Int32 middle = e.Item.ContentRectangle.Top + e.Item.ContentRectangle.Height / 2; e.Graphics.DrawLine(pen2, ScaleHelper.Scale(16) + 16, middle, e.Item.ContentRectangle.Right - 6, middle); pen2.Dispose(); } else { renderer.DrawSeparator(e); } } }
public TreeBar(FDMenus menus, ProjectContextMenu treeMenu) { this.treeMenu = treeMenu; this.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); this.Size = new Size(200, 26); this.Renderer = new DockPanelStripRenderer(); this.GripStyle = ToolStripGripStyle.Hidden; this.Padding = new Padding(2, 1, 2, 1); this.CanOverflow = false; RefreshSelected = new ToolStripButton(Icons.Refresh.Img); RefreshSelected.ToolTipText = TextHelper.GetString("ToolTip.Refresh"); RefreshSelected.Padding = new Padding(0); ShowHidden = new ToolStripButton(Icons.HiddenItems.Img); ShowHidden.ToolTipText = TextHelper.GetString("ToolTip.ShowHiddenItems"); ShowHidden.Padding = new Padding(0); ProjectProperties = new ToolStripButton(Icons.Options.Img); ProjectProperties.ToolTipText = TextHelper.GetString("ToolTip.ProjectProperties"); ProjectProperties.Padding = new Padding(0); PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.Properties", ProjectProperties); Synchronize = new ToolStripButton(Icons.SyncToFile.Img); Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize"); Synchronize.Padding = new Padding(0); Synchronize.Checked = PluginMain.Settings.TrackActiveDocument; PluginBase.MainForm.RegisterShortcutItem("ProjectTree.LocateActiveFile", Keys.Shift | Keys.Alt | Keys.L); SynchronizeMain = new ToolStripButton(Icons.ActionScriptCompile.Img); SynchronizeMain.ToolTipText = TextHelper.GetString("ToolTip.SynchronizeMain"); SynchronizeMain.Padding = new Padding(0); ProjectTypes = new ToolStripButton(Icons.AllClasses.Img); ProjectTypes.ToolTipText = TextHelper.GetString("ToolTip.ProjectTypes"); ProjectTypes.Alignment = ToolStripItemAlignment.Right; ProjectTypes.Padding = new Padding(0); PluginBase.MainForm.RegisterSecondaryItem("FlashToolsMenu.TypeExplorer", ProjectTypes); Separator = new ToolStripSeparator(); Separator.Margin = new Padding(0, 0, 1, 0); Items.Add(ShowHidden); Items.Add(Synchronize); Items.Add(SynchronizeMain); Items.Add(RefreshSelected); Items.Add(Separator); Items.Add(ProjectProperties); Items.Add(ProjectTypes); }
/// <summary> /// Initializes the external graphics /// </summary> private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); imageList.Images.Add(Globals.MainForm.FindImage("341", false)); imageList.Images.Add(Globals.MainForm.FindImage("342", false)); imageList.Images.Add(Globals.MainForm.FindImage("50", false)); imageList.Images.Add(Globals.MainForm.FindImage("153", false)); // clear this.itemListView.SmallImageList = imageList; this.clearFilterButton.ImageList = imageList; this.clearFilterButton.ImageIndex = 3; }
/// <summary> /// Initializes the graphics after settings /// </summary> private void InitializeGraphics() { this.imageList = new ImageList(); this.imageList.ColorDepth = ColorDepth.Depth32Bit; this.imageList.TransparentColor = Color.Transparent; this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.imageList.Images.Add(PluginBase.MainForm.FindImage("151")); this.imageList.Images.Add(PluginBase.MainForm.FindImage("147")); this.imageList.Images.Add(PluginBase.MainForm.FindImage("56|8|2|4")); this.imageList.Images.Add(PluginBase.MainForm.FindImage("153")); this.clearFilterButton.Image = this.imageList.Images[3]; this.topMostButton.Image = this.imageList.Images[2]; this.toggleButton.Image = this.imageList.Images[1]; }
/// <summary> /// A handler for the MouseMove, used if you don't want the surface to handle this for you /// </summary> /// <param name="x">current mouse x</param> /// <param name="y">current mouse y</param> /// <returns>true if the event is handled, false if the surface needs to handle it</returns> public virtual bool HandleMouseMove(int x, int y) { Invalidate(); // reset "workrbench" rectangle to current bounds _boundsAfterResize = _boundsBeforeResize; ScaleHelper.Scale(_boundsBeforeResize, x, y, ref _boundsAfterResize, GetAngleRoundProcessor()); // apply scaled bounds to this DrawableContainer ApplyBounds(_boundsAfterResize.Round()); Invalidate(); return(true); }
/// <summary> /// Initializes the ui based on settings /// </summary> private void InitializeInterface() { this.addressComboBox.FlatStyle = Globals.Settings.ComboBoxFlatStyle; this.toolStrip.Renderer = new DockPanelStripRenderer(true, true); this.toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); if (ScaleHelper.GetScale() >= 1.5) { ComponentResourceManager resources = new ComponentResourceManager(typeof(Browser)); this.goButton.Image = ((System.Drawing.Image)(resources.GetObject("goButton.Image32"))); this.forwardButton.Image = ((System.Drawing.Image)(resources.GetObject("forwardButton.Image32"))); this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image32"))); this.backButton.Image = ((System.Drawing.Image)(resources.GetObject("backButton.Image32"))); this.Refresh(); } }
/// <summary> /// Initializes the external graphics /// </summary> private void InitializeGraphics() { this.imageList = new ImageList(); this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.imageList.ColorDepth = ColorDepth.Depth32Bit; this.imageList.Images.Add(PluginBase.MainForm.FindImage("559|26|0|1")); this.imageList.Images.Add(PluginBase.MainForm.FindImage("229")); this.imageList.Images.Add(PluginBase.MainForm.FindImage("197")); this.imageList.Images.SetKeyName(0, "Bookmark"); this.imageList.Images.SetKeyName(1, "Info"); this.imageList.Images.SetKeyName(2, "Error"); this.listView.SmallImageList = this.imageList; this.removeBookmarksItem.Image = PluginBase.MainForm.FindImage("402|4|4|4"); this.searchButton.Image = PluginBase.MainForm.FindImage("484|26|-4|4"); }
/// <summary> /// Initializes the graphics /// </summary> private void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(PluginBase.MainForm.FindImage("341", false)); imageList.Images.Add(PluginBase.MainForm.FindImage("342|24|3|3", false)); // revert imageList.Images.Add(PluginBase.MainForm.FindImage("342|9|3|3", false)); // export this.snippetListView.SmallImageList = imageList; this.snippetListView.SmallImageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.revertButton.ImageList = imageList; this.exportButton.ImageList = imageList; this.revertButton.ImageIndex = 1; this.exportButton.ImageIndex = 2; }
public static FDImage GetResource(string resourceID) { Bitmap image; try { resourceID = "ProjectManager." + resourceID; Assembly assembly = Assembly.GetExecutingAssembly(); image = new Bitmap(assembly.GetManifestResourceStream(resourceID)); } catch { image = new Bitmap(16, 16); } imageList.Images.Add(ScaleHelper.Scale(image)); return(new FDImage(image, imageList.Images.Count - 1)); }
/// <summary> /// Initializes the image list for entriesView /// </summary> public void InitializeGraphics() { ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.TransparentColor = Color.Transparent; imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); imageList.Images.Add(PluginBase.MainForm.FindImage("131")); // info imageList.Images.Add(PluginBase.MainForm.FindImage("197")); // error imageList.Images.Add(PluginBase.MainForm.FindImage("196")); // warning this.clearFilterButton.Image = PluginBase.MainForm.FindImage("153"); this.toolStripFilters.ImageList = imageList; this.toolStripButtonError.ImageIndex = 1; this.toolStripButtonWarning.ImageIndex = 2; this.toolStripButtonInfo.ImageIndex = 0; this.entriesView.SmallImageList = imageList; }
public ClasspathControl() { InitializeComponent(); InitializeLocalization(); ImageList imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.Images.Add(Icons.DownArrow.Img); imageList.Images.Add(Icons.UpArrow.Img); imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); btnDown.ImageList = imageList; btnUp.ImageList = imageList; btnDown.ImageIndex = 0; btnUp.ImageIndex = 1; btnRemove.Enabled = false; SetButtons(); }
/// <summary> /// Initializes the custom rendering /// </summary> private void InitializeLayout() { this.searchBox.FlatStyle = PluginBase.Settings.ComboBoxFlatStyle; this.toolStrip.Font = PluginBase.Settings.DefaultFont; this.toolStrip.Renderer = new DockPanelStripRenderer(); this.toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); this.statusStrip.Font = PluginBase.Settings.DefaultFont; this.statusStrip.Renderer = new DockPanelStripRenderer(); this.statusStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); this.contextMenuStrip.Font = PluginBase.Settings.DefaultFont; this.contextMenuStrip.Renderer = new DockPanelStripRenderer(false); this.contextMenuStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); foreach (ColumnHeader column in listView.Columns) { column.Width = ScaleHelper.Scale(column.Width); } }
/// <summary> /// Initializes the controls after settings /// </summary> private void InitializeControls() { this.tracking = false; this.viewLabel.Font = PluginBase.Settings.DefaultFont; this.logTextBox.Font = PluginBase.Settings.ConsoleFont; this.filterLabel.Font = PluginBase.Settings.DefaultFont; this.logComboBox.FlatStyle = PluginBase.Settings.ComboBoxFlatStyle; this.logComboBox.Width = ScaleHelper.Scale(this.logComboBox.Width); this.filterComboBox.FlatStyle = PluginBase.Settings.ComboBoxFlatStyle; this.toolStrip.Renderer = new DockPanelStripRenderer(); this.toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); this.refreshTimer = new Timer(); this.refreshTimer.Interval = this.GetUpdateInterval(); this.refreshTimer.Tick += new EventHandler(this.RefreshTimerTick); this.refreshTimer.Start(); this.refreshTimer.Enabled = false; }
public TreeBar(FDMenus menus, ProjectContextMenu treeMenu) { this.treeMenu = treeMenu; this.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); this.Size = new Size(200, 26); this.Renderer = new DockPanelStripRenderer(); this.GripStyle = ToolStripGripStyle.Hidden; this.Padding = new Padding(2, 1, 2, 1); this.CanOverflow = false; RefreshSelected = new ToolStripButton(Icons.Refresh.Img); RefreshSelected.ToolTipText = TextHelper.GetString("ToolTip.Refresh"); RefreshSelected.Padding = new Padding(0); ShowHidden = new ToolStripButton(Icons.HiddenItems.Img); ShowHidden.ToolTipText = TextHelper.GetString("ToolTip.ShowHiddenItems"); ShowHidden.Padding = new Padding(0); ProjectProperties = new ToolStripButton(Icons.Options.Img); ProjectProperties.ToolTipText = TextHelper.GetString("ToolTip.ProjectProperties"); ProjectProperties.Padding = new Padding(0); Synchronize = new ToolStripButton(Icons.SyncToFile.Img); Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize"); Synchronize.Padding = new Padding(0); SynchronizeMain = new ToolStripButton(Icons.ActionScriptCompile.Img); SynchronizeMain.ToolTipText = TextHelper.GetString("ToolTip.Synchronize"); SynchronizeMain.Padding = new Padding(0); ProjectTypes = new ToolStripButton(Icons.AllClasses.Img); ProjectTypes.ToolTipText = TextHelper.GetString("ToolTip.ProjectTypes"); ProjectTypes.Alignment = ToolStripItemAlignment.Right; ProjectTypes.Padding = new Padding(0); Separator = new ToolStripSeparator(); Separator.Margin = new Padding(0, 0, 1, 0); Items.Add(ShowHidden); Items.Add(Synchronize); Items.Add(SynchronizeMain); Items.Add(RefreshSelected); Items.Add(Separator); Items.Add(ProjectProperties); Items.Add(ProjectTypes); }
public ObjectRefsGrid() { BorderStyle = System.Windows.Forms.BorderStyle.None; Dock = System.Windows.Forms.DockStyle.Fill; GridLineStyle = GridLineStyle.HorizontalAndVertical; Font = PluginBase.Settings.DefaultFont; UseColumns = true; Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.Method"), 350)); Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.File"), 200)); Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.Line"), 50)); foreach (TreeColumn column in this.Columns) { column.Width = ScaleHelper.Scale(column.Width); } methodTB = new NodeTextBox(); methodTB.DataPropertyName = "Method"; methodTB.ParentColumn = Columns[0]; methodTB.Font = PluginBase.Settings.DefaultFont; fileTB = new NodeTextBox(); fileTB.DataPropertyName = "File"; fileTB.ParentColumn = Columns[1]; fileTB.Font = PluginBase.Settings.DefaultFont; lineTB = new NodeTextBox(); lineTB.DataPropertyName = "Line"; lineTB.ParentColumn = Columns[2]; lineTB.Font = PluginBase.Settings.DefaultFont; NodeControls.Add(methodTB); NodeControls.Add(fileTB); NodeControls.Add(lineTB); this.CustomDrawHeaders = PluginBase.MainForm.GetThemeColor("ColumnHeader.BorderColor") != Color.Empty; this.ColumnHeaderBackColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.BackColor", SystemColors.Control); this.ColumnHeaderTextColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.TextColor", SystemColors.ControlText); this.ColumnHeaderBorderColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.BorderColor", SystemColors.ActiveBorder); this.LineColor = PluginBase.MainForm.GetThemeColor("DataTreeControl.LineColor", SystemColors.ActiveBorder); this.LineColor2 = PluginBase.MainForm.GetThemeColor("DataTreeControl.LineColor", SystemColors.ActiveBorder); this.DragDropMarkColor = PluginBase.MainForm.GetThemeColor("DataTreeControl.ForeColor", SystemColors.WindowText); this.ForeColor = PluginBase.MainForm.GetThemeColor("TreeViewAdv.ForeColor", SystemColors.ControlText); this.BackColor = PluginBase.MainForm.GetThemeColor("TreeViewAdv.BackColor", SystemColors.Control); }
/// <summary> /// Initializes the used graphics /// </summary> private void InitializeGraphics() { this.imageList = new ImageListManager(); this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16)); this.imageList.ColorDepth = ColorDepth.Depth32Bit; this.imageList.TransparentColor = Color.Transparent; this.imageList.Initialize(ImageList_Populate); this.layoutsListView.SmallImageList = this.imageList; this.menuLoadButton.Image = PluginBase.MainForm.FindImage("42|24|3|2"); this.loadStripButton.Image = PluginBase.MainForm.FindImage("42|24|3|2"); this.menuDeleteButton.Image = PluginBase.MainForm.FindImage("153"); this.deleteStripButton.Image = PluginBase.MainForm.FindImage("153"); this.menuSaveButton.Image = PluginBase.MainForm.FindImage("168"); this.saveStripButton.Image = PluginBase.MainForm.FindImage("168"); this.menuSettingButton.Image = PluginBase.MainForm.FindImage("54"); this.settingStripButton.Image = PluginBase.MainForm.FindImage("54"); this.toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16)); }
/// <summary> /// Scale the control area based on font size and DPI /// </summary> private static Int32 ScaleArea(ScintillaControl sci, Int32 size) { Int32 value = ScaleHelper.Scale(size); Language lang = SciConfig.GetLanguage(sci.ConfigurationLanguage); if (lang != null && lang.usestyles != null && lang.usestyles.Length > 0) { // Only larger fonts need scaling... if (lang.usestyles[0].FontSize < 11) { return(value); } Double multi = lang.usestyles[0].FontSize / 9f; Double adjusted = Convert.ToDouble(value) * (multi < 1 ? 1 : multi); value = Convert.ToInt32(Math.Floor(adjusted)); } return(value); }