rem: RColor	color; char	tmp[3]; int		value; int		i=0;  W_ColorPanel *panel = (W_ColorPanel*)data;  while (i < 7) { if (w == panel->grayPresetBtn[i]) break; i++; }  value = rint(100.0/6.0*i); sprintf(tmp, "%d", value);  WMSetTextFieldText(panel->grayBrightnessT, tmp); color.red = color.green = color.blue = rint(255.0*i/6.0);  WMSetSliderValue(panel->grayBrightnessS, rint(100.0*i/6.0));  WMSetColorPanelColor(panel, color); panel->lastChanged = WMGrayModeColorPanel;
add: RColor    color; char    tmp[4]; int        value; int        i=0;  W_ColorPanel *panel = (W_ColorPanel*)data;  while (i < 7) { if (w == panel->grayPresetBtn[i]) break; i++; }  value = rint(100.0/6.0*i); sprintf(tmp, "%d", value);  WMSetTextFieldText(panel->grayBrightnessT, tmp); color.red = color.green = color.blue = rint(255.0*i/6.0);  WMSetSliderValue(panel->grayBrightnessS, rint(100.0*i/6.0));  WMSetColorPanelColor(panel, color); panel->lastChanged = WMGrayModeColorPanel;
context: grayPresetButtonCallback(WMWidget *w, void *data){	RColor	color;	char	tmp[3];	int		value;	int		i=0;		W_ColorPanel *panel = (W_ColorPanel*)data;	while (i < 7) {		if (w == panel->grayPresetBtn[i])			break;		i++;	}		value = rint(100.0/6.0*i);	sprintf(tmp, "%d", value);		WMSetTextFieldText(panel->grayBrightnessT, tmp);	color.red = color.green = color.blue = rint(255.0*i/6.0);		WMSetSliderValue(panel->grayBrightnessS, rint(100.0*i/6.0));		WMSetColorPanelColor(panel, color);	panel->lastChanged = WMGrayModeColorPanel;}