Improve classic and chardonnay rating editor simmilarity

This commit is contained in:
Michael Bucari-Tovo 2022-12-31 10:02:30 -07:00
parent c9497ef39e
commit 874bf9e7c0
14 changed files with 233 additions and 178 deletions

View file

@ -39,10 +39,10 @@ namespace LibationWinForms.GridView
private void Star_MouseEnter(object sender, EventArgs e)
{
var thisTbox = sender as Label;
var stackPanel = thisTbox.Parent as Panel;
var panel = thisTbox.Parent as Panel;
var star = SOLID_STAR;
foreach (Label child in stackPanel.Controls)
foreach (Label child in panel.Controls)
{
child.Text = star;
if (child == thisTbox) star = HOLLOW_STAR;

View file

@ -26,7 +26,7 @@ namespace LibationWinForms.GridView
internal class MyRatingGridViewCell : DataGridViewTextBoxCell
{
private Rating DefaultRating => new Rating(0, 0, 0);
private static Rating DefaultRating => new Rating(0, 0, 0);
public override object DefaultNewRowValue => DefaultRating;
public override Type EditType => typeof(MyRatingCellEditor);
public override Type ValueType => typeof(Rating);
@ -45,6 +45,7 @@ namespace LibationWinForms.GridView
if (value is Rating rating)
{
var starString = rating.ToStarString();
ToolTipText = starString;
base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, starString, starString, errorText, cellStyle, advancedBorderStyle, paintParts);
}
else