Dear sirs,
we want to obtain buttons with a trasparency level in unpressed state and another transparecy level when pressed. So the button has to show, with indicated level of transparecy, what is drawn "under" him.
We made lots of test using all examples in emWin Simulator without result.
Please find below my brief explanation:
1) when button is created everything is OK: unpressed state is properly shown;
2) button color in unpressed state is defined as GUI_BLACK | 0x80000000, and it is ok (only immediately just after button creation!!);
3) button color in pressed state is defined as GUI_BLACK | 0x80000000, and it is ok when I press the button;
The problem arises when I release the button, that is, when button is back to its unpressed state: it is redrawn ONTO the pressed state; the final effect is that the button color becomes darker and darker as soon as you click&release it ... until it is completely black....The button color is continuously redrawn onto previous one.
We can understand this: if you write 2 different pure colors (without transparency) for unpressed and pressed states, as soon as the button status changes, its relative color is painted ... ok!
But we want that when button is released, so it goes back to unpressed state, with initial transparency.
We tried also to trigger an invalidation of button area but it didn't work. Doing tests, we realized that if you HIDE the button and then you SHOW it, it is properly shown, so, for example, we tried to HIDE the button when released and to show it back on POST_PAINT event (POST PAINT on button parent window) but it still doesn't work.
Our impression is that there is something wrong on API calling sequence ... even though it seems correct ....
Any suggestions?
Thanks a lot and best regards,
Valter Rasicci
INIM Electronics
we want to obtain buttons with a trasparency level in unpressed state and another transparecy level when pressed. So the button has to show, with indicated level of transparecy, what is drawn "under" him.
We made lots of test using all examples in emWin Simulator without result.
Please find below my brief explanation:
1) when button is created everything is OK: unpressed state is properly shown;
2) button color in unpressed state is defined as GUI_BLACK | 0x80000000, and it is ok (only immediately just after button creation!!);
3) button color in pressed state is defined as GUI_BLACK | 0x80000000, and it is ok when I press the button;
The problem arises when I release the button, that is, when button is back to its unpressed state: it is redrawn ONTO the pressed state; the final effect is that the button color becomes darker and darker as soon as you click&release it ... until it is completely black....The button color is continuously redrawn onto previous one.
We can understand this: if you write 2 different pure colors (without transparency) for unpressed and pressed states, as soon as the button status changes, its relative color is painted ... ok!
But we want that when button is released, so it goes back to unpressed state, with initial transparency.
We tried also to trigger an invalidation of button area but it didn't work. Doing tests, we realized that if you HIDE the button and then you SHOW it, it is properly shown, so, for example, we tried to HIDE the button when released and to show it back on POST_PAINT event (POST PAINT on button parent window) but it still doesn't work.
Our impression is that there is something wrong on API calling sequence ... even though it seems correct ....
Any suggestions?
Thanks a lot and best regards,
Valter Rasicci
INIM Electronics