-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
105 additions
and
82 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2024/07/13 11:17:32.80 | ||
2024/07/13 18:17:53.68 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace opentuner.Utilities | ||
{ | ||
// an attempt at making a collapsable group box :p | ||
|
||
public class CustomGroupBox : GroupBox | ||
{ | ||
|
||
public string db_margin = ""; | ||
|
||
public CustomGroupBox() | ||
{ | ||
this.SetStyle(ControlStyles.UserPaint, true); | ||
} | ||
|
||
|
||
|
||
protected override void OnPaint(PaintEventArgs e) | ||
{ | ||
|
||
Graphics g = e.Graphics; | ||
|
||
Color borderColor = Color.FromKnownColor(KnownColor.ControlDark); | ||
Color textColor = Color.FromKnownColor(KnownColor.ControlText); | ||
Font textFont = this.Font; | ||
|
||
SizeF textSize = g.MeasureString(this.Text, textFont); | ||
|
||
int padding = (int)(textSize.Height / 2); | ||
|
||
Rectangle bounds = new Rectangle(0, padding , this.Width, this.Height - (padding * 2)); | ||
|
||
ControlPaint.DrawBorder(g, bounds, borderColor, ButtonBorderStyle.Dashed); | ||
|
||
Rectangle textBounds = new Rectangle(10, 0, (int)textSize.Width + 6, (int)textSize.Height); | ||
|
||
g.FillRectangle(new SolidBrush(Color.FromArgb(240, 240, 240)), textBounds); | ||
|
||
TextRenderer.DrawText(g, this.Text, textFont, new Point(10, 0), textColor); | ||
|
||
if (db_margin.Length > 1) | ||
{ | ||
Font db_margin_font = new Font(this.Font.FontFamily, 15f, FontStyle.Bold); | ||
|
||
SizeF db_margin_textSize = g.MeasureString(db_margin.ToString(), db_margin_font); | ||
|
||
g.FillRectangle(new SolidBrush(Color.FromArgb(240, 240, 240)), new Rectangle(this.Width - (int)db_margin_textSize.Width - 15, 0, (int)db_margin_textSize.Width + 5, (int)db_margin_textSize.Height)); | ||
TextRenderer.DrawText(g, db_margin.ToString(), db_margin_font, new Point(this.Width - (int)db_margin_textSize.Width - 15, 0), textColor); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters