?? vdjmain.c
字號:
/*
* VideoDJ主菜單界面
* 創建人 : 張毅
* 創建時間: 2006-09-02
*/
#include "VDJApp.h"
#include "VDJApp_res.h"
//函數原型
IWindow * CVDJMain_New(CVDJApp * pVDJApp);
void CVDJMain_Enable(IWindow * po, boolean bEnable);
void CVDJMain_Delete(IWindow * po);
void CVDJMain_Redraw(IWindow * po);
boolean CVDJMain_HandleEvent(IWindow * po, AEEEvent eCode, uint16 wParam, uint32 dwParam);
extern IWindow * CWindow_New(int16 nSize, CVDJApp *pVDJApp, VTBL(IWindow) * pvt);
extern boolean CVDJApp_SetWindow(CVDJApp * pme, WINID eWinID, uint32 dwParam);
extern void CVDJApp_FreeIF(IBase ** ppif);
extern void CVDJApp_FreeWin(IWindow ** ppif);
extern void CVDJApp_Redraw(CVDJApp * pme, boolean bDefer);
extern void CVDJApp_RedrawNotify(CVDJApp * pme);
//創建VideoDJ主界面窗體
IWindow *CVDJMain_New(CVDJApp *pOwner)
{
CVDJMain * pMe;
//VTBL(IWindow) vtbl;
IWindowVtbl vtbl;
AEERect rect;
CVDJAPP_IWINDOW_SETVTBL(&vtbl, CVDJMain_Enable, CVDJMain_Redraw, CVDJMain_HandleEvent, CVDJMain_Delete);
pMe = (CVDJMain *)CWindow_New(sizeof(CVDJMain), pOwner, &vtbl);
if (!pMe)
{
return NULL;
}
//顯示head image
pMe->m_pHeadImage=ISHELL_LoadResImage(pMe->m_pIShell,VDJAPP_RES_FILE,IDB_HEADIMAGE);
//在Head的下面顯示Logo
pMe->m_pLogoImage=ISHELL_LoadResImage(pMe->m_pIShell,VDJAPP_RES_FILE,IDB_LOGOIMAGE);
//創建CVDJMain的菜單項
if(ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_MENUCTL, (void **)&pMe->m_pMainMenu))
{
CVDJAPP_RELEASEWIN(pMe);
}
SETAEERECT(&rect,20,80,80,50);
IMENUCTL_SetRect(pMe->m_pMainMenu,&rect);
IMENUCTL_AddItem(pMe->m_pMainMenu, VDJAPP_RES_FILE, IDM_PLAYINGFILE, IDM_PLAYINGFILE, NULL, 0);
IMENUCTL_AddItem(pMe->m_pMainMenu, VDJAPP_RES_FILE, IDM_ABOUT, IDM_ABOUT, NULL, 0);
return (IWindow *)pMe;
}
//設置VideoDJ主界面窗體活動的控件
void CVDJMain_Enable(IWindow * po, boolean bEnable)
{
CVDJMain *pMe = (CVDJMain *)po;
if(NULL!=pMe->m_pMainMenu)
{
IMENUCTL_SetActive(pMe->m_pMainMenu, TRUE);
}
}
//釋放VideoDJ主界面窗體控件內存
void CVDJMain_Delete(IWindow * po)
{
CVDJMain * pMe = (CVDJMain *)po;
CVDJAPP_RELEASEIF(pMe->m_pMainMenu);
CVDJAPP_RELEASEIF(pMe->m_pHeadImage);
CVDJAPP_RELEASEIF(pMe->m_pLogoImage);
FREE(pMe);
}
//重繪VideoDJ主界面窗體的控件
void CVDJMain_Redraw(IWindow * po)
{
CVDJMain * pMe = (CVDJMain *)po;
IDISPLAY_ClearScreen(pMe->m_pIDisplay);
if(NULL!=pMe->m_pMainMenu)
{
IMENUCTL_Redraw(pMe->m_pMainMenu);
}
if(NULL!=pMe->m_pHeadImage)
{
IIMAGE_Draw(pMe->m_pHeadImage,25,0);
}
if(NULL!=pMe->m_pLogoImage)
{
IIMAGE_Draw(pMe->m_pLogoImage,25,20);
}
IDISPLAY_Update(pMe->m_pIDisplay);
}
static void CVDJMain_About(CVDJMain * pme)
{
IWINDOW_Disable((IWindow *)pme);
pme->m_bAbout = TRUE;
IDISPLAY_ClearScreen(pme->m_pIDisplay);
//MP_DRAWHEADER(pme);
ISHELL_ShowCopyright(pme->m_pIShell);
}
//VideoDJ主界面窗體的事件處理函數
boolean CVDJMain_HandleEvent(IWindow * po, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
CVDJMain * pMe = (CVDJMain *)po;
boolean bRet = TRUE;
if (eCode == EVT_COPYRIGHT_END && pMe->m_bAbout)
{
pMe->m_bAbout = FALSE;
CVDJApp_Redraw(pMe->m_pOwner, TRUE);
// IWINDOW_Enable(pMe->m_pOwner->m_pIActiveWin);
// IWINDOW_Redraw(pMe->m_pOwner->m_pIActiveWin);
return TRUE;
}
switch(eCode)
{
case EVT_KEY:
{
switch(wParam)
{
//case AVK_SELECT:
case AVK_SOFT1:
{
if(NULL==pMe->m_pMainMenu)
{
return TRUE;
}
else
{
//進入下一個界面
int16 SelItemID = 0;
SelItemID = IMENUCTL_GetSel(pMe->m_pMainMenu);
switch(SelItemID)
{
case IDS_PLAY:
{
CVDJApp_SetWindow(pMe->m_pOwner, WINID_VDJEDIT, 0);
return TRUE;
}
case IDS_PAUSE:
{
//CVDJApp_SetWindow(pMe->m_pOwner, WINID_VDJEDIT, 0);
return TRUE;
}
default:
{
return TRUE;
}
}
}
}
case AVK_SOFT2:
{
//返回到上一個界面
ISHELL_CloseApplet(pMe->m_pIShell, FALSE);
}
}
if(NULL!=pMe->m_pMainMenu)
{
return IMENUCTL_HandleEvent(pMe->m_pMainMenu, eCode, wParam, dwParam);
}
}
case EVT_COMMAND:
{
switch(wParam)
{
case IDM_PLAYINGFILE:
{
break;
}
case IDM_ABOUT:
{
/*
IWINDOW_Enable(po);
pMe->m_bAbout = TRUE;
IDISPLAY_ClearScreen(pMe->m_pIDisplay);
//MP_DRAWHEADER(pme);
ISHELL_ShowCopyright(pMe->m_pIShell);
*/
CVDJMain_About(pMe);
}
default:
{
break;
}
}
}
default:
{
return FALSE;
}
}
return bRet;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -