Hi
The code below is a very compressed example of a real problem. This code in the exampl exists in a very simple form that has a StringEdit control called StringEdit and a button.
Before pressing the button, the StringEdit control has its default background color. In this case it is White. By code, I change it to a nice orange color. This procedure includes changing colorscheme. After that I restore the original color scheme and the original color. However, now the background turns black.
A functional workaround is to keep the new scheme and pass [255, 255, 255]. That makes the background white again. But if users have selected a different color scheme in Windows, white might be the wrong colour.
I would just like to know if anyone could explain this, and if you have seen any working combination of updates/window locks/redraws and so on to get passed this problem. At least I have failed.
void clicked()
{
int oldColor;
int oldScheme;
super();
oldScheme = StringEdit.colorScheme();
oldColor = StringEdit.backgroundColor();
//oldScheme has been set to 0
//oldColor has been set to 16777215
//Change color scheme and set color = orange
StringEdit.colorscheme(2);
StringEdit.backgroundcolor(5876991);
//Change to original scheme and color
StringEdit.colorscheme(oldScheme);
StringEdit.backgroundcolor(oldColor);
oldScheme = StringEdit.colorScheme();
oldColor = StringEdit.backgroundColor();
//Oops, now oldColor = 0, should be 16777215
}
/Jonas
*This post is locked for comments
I have the same question (0)