-
Notifications
You must be signed in to change notification settings - Fork 1
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
40 changed files
with
10,079 additions
and
8,418 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace MT32Edit; | ||
|
||
/// <summary> | ||
/// Custom drawing tools for MT-32 Editor UI | ||
/// </summary> | ||
internal class DrawingTools | ||
{ | ||
// MT32Edit: DrawingTools class | ||
// S.Fryers Feb 2024 | ||
|
||
public void DrawStructureList(DrawItemEventArgs e, bool isPartial12, bool droppedDown, float UIScale) | ||
{ | ||
//custom comboBox draw method- creates vertical divider between structure type and structure description | ||
if (e.Index < 0) | ||
{ | ||
return; | ||
} | ||
|
||
e.DrawBackground(); | ||
string partialConfigType = $"{e.Index + 1}: {MT32Strings.partialConfig[e.Index]}"; | ||
string partialConfigDescription; | ||
if (isPartial12) | ||
{ | ||
partialConfigDescription = MT32Strings.partialConfig12Desc[e.Index]; | ||
} | ||
else | ||
{ | ||
partialConfigDescription = MT32Strings.partialConfig34Desc[e.Index]; | ||
} | ||
|
||
int xLeft = e.Bounds.Location.X; | ||
int xMid = (int)(58 * UIScale); | ||
int yTop = e.Bounds.Location.Y; | ||
int yBottom = yTop + e.Bounds.Height; | ||
|
||
TextRenderer.DrawText(e.Graphics, partialConfigType, e.Font, new Point(xLeft, yTop), e.ForeColor); | ||
if (droppedDown) | ||
{ | ||
e.Graphics.DrawLine(SystemPens.ButtonFace, xMid, yTop, xMid, yBottom); | ||
TextRenderer.DrawText(e.Graphics, partialConfigDescription, e.Font, new Point(xMid + 5, yTop), e.ForeColor, TextFormatFlags.Left); | ||
e.DrawFocusRectangle(); | ||
} | ||
} | ||
} |
Oops, something went wrong.