📄 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 + -