private void InitializeComponent() { Text = LicenseString; Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; TextAlign = System.Drawing.ContentAlignment.MiddleLeft; if ((m_LicenseType != RhinoLicensing.LicenseType.Free) && (m_LicenseType != RhinoLicensing.LicenseType.Paid) && (m_DollarPrice > 0)) { m_buyBtn = new LinkLabelEx(); m_buyBtn.Text = String.Format("{0} (USD{1})", m_Trans.Translate("Buy"), m_DollarPrice); m_buyBtn.Anchor = AnchorStyles.Top | AnchorStyles.Right; m_buyBtn.Height = Height; m_buyBtn.TextAlign = System.Drawing.ContentAlignment.MiddleRight; m_buyBtn.LinkClicked += new LinkLabelLinkClickedEventHandler(OnBuyLicense); this.Controls.Add(m_buyBtn); m_buyBtnTooltip = new ToolTip(); m_buyBtnTooltip.SetToolTip(m_buyBtn, "https://www.paypal.com"); } RefreshColors(); FixupBorder(); }
private void RebuildMruList() { flRecentFiles.Controls.Clear(); for (int mruFileIndex = MruManager.MruFiles.Count - 1; mruFileIndex >= 0; --mruFileIndex) { LinkLabelEx recentFileLink = new LinkLabelEx { Text = MruManager.MruFiles[mruFileIndex].ToShortPath(SystemFonts.MessageBoxFont, flRecentFiles.Width), Tag = MruManager.MruFiles[mruFileIndex], ActiveLinkColor = ThemeManager.CurrentApplicationTheme.ColorPalette.SelectionBackgroundFocused, ForeColor = ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForeground, LinkColor = ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForeground, VisitedLinkColor = ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForeground, DisabledLinkColor = ThemeManager.CurrentApplicationTheme.ColorPalette.ContentForegroundDimmed, LinkBehavior = LinkBehavior.HoverUnderline, Padding = new Padding(0, 0, 0, 10), AutoSize = false, Width = flRecentFiles.Width - (flRecentFiles.Padding.Left + flRecentFiles.Padding.Right), Height = 26 }; recentFileLink.LinkClicked += RecentFileClicked; tlTip.SetToolTip(recentFileLink , (string)recentFileLink.Tag); flRecentFiles.Controls.Add(recentFileLink); } }
private void RecreateObjects(bool ModLayout = false) { foreach (LinkLabelEx LObj in LinksObjs) { this.Controls.Remove(LObj); } LinksObjs.Clear(); if (ModLayout) { this.SuspendLayout(); } int LIndex = 0; int LPos = LinksPadding.Top; if (LinkTitle.Visible) { LPos += LinkTitle.ClientRectangle.Height + TitlePadding.Bottom + TitleMargin.Bottom; } //LinkLabelEx LPrevObj = null; foreach (var L in LinksList) { LinkLabelEx LObj = new LinkLabelEx { AutoSize = true, BackColor = Color.Transparent, Font = this.Font, LinkBehavior = LinkBehavior.AlwaysUnderline, Margin = new Padding(0), Name = "LObj_" + (++LIndex), Location = new Point(this.LinksPadding.Left, LPos), Size = new Size(this.ClientRectangle.Width - this.LinksPadding.Horizontal - this.LinksMargin.Horizontal, 5), MaximumSize = new Size(this.ClientRectangle.Width - this.LinksPadding.Horizontal - this.LinksMargin.Horizontal, 100), TabIndex = LIndex, TabStop = true, Text = L.Caption, TextAlign = ContentAlignment.TopLeft, Tag = L, Cursor = SystemCursorsFix.GetHandCursor(), LinkColor = this.Links_TextColor_Normal, ActiveLinkColor = this.Links_TextColor_Active, }; this.Controls.Add(LObj); LinksObjs.Add(LObj); if (ModLayout) { LObj.PerformLayout(); } LPos += LObj.ClientRectangle.Height + LinksMargin.Bottom; } if (ModLayout) { this.ResumeLayout(false); } if (ModLayout) { this.PerformLayout(); } }