论坛元老
- 积分
- 4133
- 金钱
- 4133
- 注册时间
- 2018-5-14
- 在线时间
- 902 小时
|
发表于 2023-6-19 16:35:06
|
显示全部楼层
static void _cbWindow(WM_MESSAGE* pMsg)
{
switch (pMsg->MsgId)
{
case WM_INIT_DIALOG:
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_RIGHT);
WM_SetCallback(hItem, _cb_ButtonRight);
break;
.....
}
}
static void _cb_ButtonRight(WM_MESSAGE* pMsg)
{
int xsize;
int ysize;
xsize = WM_GetWindowSizeX(pMsg->hWin);
ysize = WM_GetWindowSizeY(pMsg->hWin);
switch (pMsg->MsgId)
{
case WM_PAINT:
if (BUTTON_IsPressed(pMsg->hWin))
{
/*设置按下图片*/
GUI_DrawBitmap(&bmimage_downbutton, (xsize - bmimage.XSize) / 2, (ysize - bmimage.YSize) / 2 + 5);
}
else
{
/*设置弹起图片*/
GUI_DrawBitmap(&bmimage_downbutton, (xsize - bmimage.XSize) / 2, (ysize - bmimage.YSize) / 2);
}
break;
default:
BUTTON_Callback(pMsg);
}
}
|
|