I have an image which is transparent.For press and unpress i want background color to be changed.
for this i am overwriting the button callback function
I am setting that callback while dialog initialization as below\
hBck=WM_GetDialogItem(pMsg->hWin, ID_PW_BUTTON_10);
WM_SetHasTrans(hBck);
BUTTON_SetFocussable(hBck,BUTTON_DISBLE_FOCUS);
WM_SetCallback(hBack, F076_callbkdelButton);
following is the callback function for that button
void F076_callbkdelButton(WM_MESSAGE * pMsg){
GUI_RECT Rect;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetClientRect(&Rect);
if(BUTTON_IsPressed(pMsg->hWin))
{
GUI_SetBkColor(GUI_GREEN);
GUI_DrawBitmap(&bm_backicon,0,0);
}
else
{
GUI_SetBkColor(GUI_RED);
GUI_DrawBitmap(&bm_backicon,0,0);
}
break;
default:
BUTTON_Callback(pMsg); // The original callback
break;
}
While initialization it is working fine but when some other window comes on that window the background color is not retained(it is changing to black)
can anyone explain this behaviour?
for this i am overwriting the button callback function
I am setting that callback while dialog initialization as below\
hBck=WM_GetDialogItem(pMsg->hWin, ID_PW_BUTTON_10);
WM_SetHasTrans(hBck);
BUTTON_SetFocussable(hBck,BUTTON_DISBLE_FOCUS);
WM_SetCallback(hBack, F076_callbkdelButton);
following is the callback function for that button
void F076_callbkdelButton(WM_MESSAGE * pMsg){
GUI_RECT Rect;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetClientRect(&Rect);
if(BUTTON_IsPressed(pMsg->hWin))
{
GUI_SetBkColor(GUI_GREEN);
GUI_DrawBitmap(&bm_backicon,0,0);
}
else
{
GUI_SetBkColor(GUI_RED);
GUI_DrawBitmap(&bm_backicon,0,0);
}
break;
default:
BUTTON_Callback(pMsg); // The original callback
break;
}
While initialization it is working fine but when some other window comes on that window the background color is not retained(it is changing to black)
can anyone explain this behaviour?