Invalidate color sample after editing it so it'll get redrawn even if

not obscured by editor window.
This commit is contained in:
ehouse 2010-01-11 03:31:04 +00:00
parent 232551cd14
commit 8d3c951c81

View file

@ -296,7 +296,7 @@ initColorData( ColorsDlgState* cState )
cState->colors[i] = ref; cState->colors[i] = ref;
cState->brushes[i] = CreateSolidBrush( ref ); cState->brushes[i] = CreateSolidBrush( ref );
cState->buttons[i] = button; cState->buttons[i] = button;
EnableWindow( button, FALSE ); EnableWindow( button, FALSE ); /* sample, so disable */
} }
} /* initColorData */ } /* initColorData */
@ -336,8 +336,7 @@ wrapChooseColor( ColorsDlgState* cState, XP_U16 button )
cState->colors[index] = clrref; cState->colors[index] = clrref;
DeleteObject( cState->brushes[index] ); DeleteObject( cState->brushes[index] );
cState->brushes[index] = CreateSolidBrush( clrref ); cState->brushes[index] = CreateSolidBrush( clrref );
XP_LOGF( "%s: may need to invalidate the button since " InvalidateRect( cState->buttons[index], NULL, TRUE );
"color's changed", __func__ );
} }
#else #else
CHOOSECOLOR ccs; CHOOSECOLOR ccs;
@ -365,6 +364,7 @@ wrapChooseColor( ColorsDlgState* cState, XP_U16 button )
cState->colors[index] = ccs.rgbResult; cState->colors[index] = ccs.rgbResult;
DeleteObject( cState->brushes[index] ); DeleteObject( cState->brushes[index] );
cState->brushes[index] = CreateSolidBrush( ccs.rgbResult ); cState->brushes[index] = CreateSolidBrush( ccs.rgbResult );
InvalidateRect( cState->buttons[index], NULL, TRUE );
} }
#endif #endif
handled = XP_TRUE; handled = XP_TRUE;