金牌会员
- 积分
- 1383
- 金钱
- 1383
- 注册时间
- 2015-2-3
- 在线时间
- 197 小时
|
发表于 2016-8-3 12:41:03
|
显示全部楼层
本帖最后由 yyx112358 于 2016-8-3 12:42 编辑
不是PAINT消息而是WM_PAINT…………
[mw_shl_code=c,true]static void _cbDialog( WM_MESSAGE * pMsg ) {
WM_HWIN hItem;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
static char is_initing = 1;//加入该标志以免ICONVIEW初始化过程中即打开了图标0
// USER END
switch ( pMsg->MsgId )
{
case WM_INIT_DIALOG:
//
// Initialization of 'Desktop'
//
hItem = pMsg->hWin;
WINDOW_SetBkColor( hItem, 0x00C59A2A );
//
// Initialization of 'TEXT_Monitor'
//
hItem = WM_GetDialogItem( pMsg->hWin, ID_TEXT_0 );
TEXT_SetFont( hItem, GUI_FONT_16B_ASCII );
TEXT_SetText( hItem, "RAM:28%,46% CPU:24% TIME:23:59:59" );
TEXT_SetTextColor( hItem, 0x00FFFFFF );
// USER START (Optionally insert additional code for further widget initialization)
hItem = WM_GetDialogItem( pMsg->hWin, ID_ICONVIEW_0 );
ICONVIEW_SetSpace( hItem, GUI_COORD_X, 10 );
ICONVIEW_SetFrame( hItem, GUI_COORD_X,15 );
ICONVIEW_SetSpace( hItem, GUI_COORD_Y, 10 );
ICONVIEW_SetFrame( hItem, GUI_COORD_Y, 15 );
// ICONVIEW_AddBitmapItem( hItem, &bmDriver_alpha100x100, "FileExplorer" );
// ICONVIEW_AddBitmapItem( hItem, &bmDriver_alpha100x100, "DSO" );
// ICONVIEW_AddBitmapItem( hItem, &bmDriver_alpha100x100, "Control" );
// ICONVIEW_AddBitmapItem( hItem, &bmDriver_alpha100x100, "Setting" );
ICONVIEW_AddBitmapItem( hItem, &bmclock, "Measure" );
ICONVIEW_AddBitmapItem( hItem, &bmimage, "DSO" );
ICONVIEW_AddBitmapItem( hItem, &bmgame, "Calibre" );
ICONVIEW_AddBitmapItem( hItem, &bminfo, "About" );
ICONVIEW_SetSel( hItem, ICONVIEW_ITEM_SELNONE );
is_initing = 0;
// USER END
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId( pMsg->hWinSrc );
NCode = pMsg->Data.v;
switch ( Id )
{
case ID_ICONVIEW_0: // Notifications sent by 'ICONVIEW_FileExploer'
switch ( NCode )
{
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
//注:按下后移出范围不会发出该消息而是WM_NOTIFICATION_MOVED_OUT
// USER END
break;
case WM_NOTIFICATION_MOVED_OUT:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_SCROLL_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_SEL_CHANGED:
// USER START (Optionally insert code for reacting on notification message)
if ( is_initing != 1 )
{
int index = 0;
hItem = WM_GetDialogItem( pMsg->hWin, ID_ICONVIEW_0 );
index = ICONVIEW_GetSel( hItem );
switch ( index )//该序号与创建顺序相同
{
case 0:
APP_Running_Handle = CreateMonitor();
ICONVIEW_SetSel( hItem, ICONVIEW_ITEM_SELNONE );
APP_Running_Index = APP_Monitor;
break;
case 1:
APP_Running_Handle = CreateDSO();
ICONVIEW_SetSel( hItem, ICONVIEW_ITEM_SELNONE );
APP_Running_Index = APP_DSO;
break;
case 2:
// APP_Running_Handle = CreateFileExplorer();
ICONVIEW_SetSel( hItem, ICONVIEW_ITEM_SELNONE );//选定为-1以在打开程序返回后可以立即重选
APP_Running_Index = APP_FileExplorer;
break;
case 3:
APP_Running_Handle =CreateCopyright();
ICONVIEW_SetSel( hItem, ICONVIEW_ITEM_SELNONE );
APP_Running_Index = APP_CopyRight;
case -1:
break;
default:
APP_Running_Handle = GUI_HMEM_NULL;
APP_Running_Index = APP_NONE;
break;
}
}
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
// USER START (Optionally insert additional code for further Ids)
// USER END
}
break;
// USER START (Optionally insert additional message handling)
case WM_PAINT:
GUI_DrawBitmap( &bmsentinel, 0, 0 );
break;
case WM_DESKTOP_TEXT_MONITOR_UPDATE://【自定义消息】桌面监视文本更新
{
TEXT_Handle hTEXT_Monitor;
hTEXT_Monitor = WM_GetDialogItem( pMsg->hWin, ID_TEXT_0 );
TEXT_SetText( hTEXT_Monitor, (char*)( pMsg->Data.p ) );
}
break;
case WM_DESKTOP_CLOSE( APP_FileExplorer ):
case WM_DESKTOP_CLOSE(APP_DSO):
break;
// USER END
default:
WM_DefaultProc( pMsg );
break;
}
}[/mw_shl_code]
|
|