⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vencurschedule.c

📁 BREW 2.0.1平台开发的课程表
💻 C
📖 第 1 页 / 共 4 页
字号:
						ITEXTCTL_SetActive(pMe->Text[0],FALSE);
					}
					else{
						ITEXTCTL_SetActive(pMe->Text[i-1],TRUE);
						ITEXTCTL_SetActive(pMe->Text[i],FALSE);
					}
					pMe->point=(--pMe->point)%6;
					if (pMe->point==0) {
						pMe->point=6;
					}
					return TRUE;	
				}
				if(wParam == AVK_LEFT)
				{
					IMENUCTL_SetActive(pMe->m_pSoftMenu,TRUE);
				    ITEXTCTL_SetActive(pMe->Text[0],FALSE);
					ITEXTCTL_SetActive(pMe->Text[1],FALSE);
					ITEXTCTL_SetActive(pMe->Text[2],FALSE);
					ITEXTCTL_SetActive(pMe->Text[3],FALSE);
					ITEXTCTL_SetActive(pMe->Text[4],FALSE);
				return TRUE;
				}
				if(wParam == AVK_CLR)
				{
					return VenCurSchedule_MenuStart(pMe);
				}
				if(pMe->pITextCtl)ITEXTCTL_HandleEvent(pMe->pITextCtl,eCode,wParam,dwParam);
				if(pMe->CpITextCtl)ITEXTCTL_HandleEvent(pMe->CpITextCtl,eCode,wParam,dwParam);
                if(pMe->TpITextCtl)ITEXTCTL_HandleEvent(pMe->TpITextCtl,eCode,wParam,dwParam);
				if(pMe->RpITextCtl)ITEXTCTL_HandleEvent(pMe->RpITextCtl,eCode,wParam,dwParam);
				if(pMe->MpITextCtl)ITEXTCTL_HandleEvent(pMe->MpITextCtl,eCode,wParam,dwParam);
				if(pMe->m_pSoftMenu)IMENUCTL_HandleEvent(pMe->m_pSoftMenu,EVT_KEY,wParam,dwParam);
				return TRUE;

			case APP_STATE_MAINMENU:
				if(pMe->pIMenuCtl)IMENUCTL_HandleEvent(pMe->pIMenuCtl,EVT_KEY,wParam,dwParam);
				return TRUE;

			case APP_STATE_VMAINMENU:
				if(pMe->v_pIMenuCtl)IMENUCTL_HandleEvent(pMe->v_pIMenuCtl,EVT_KEY,wParam,dwParam);
				if(pMe->m_pSoftMenu)IMENUCTL_HandleEvent(pMe->m_pSoftMenu,EVT_KEY,wParam,dwParam);
				switch(wParam)
				{
				case AVK_LEFT:
					IMENUCTL_SetActive(pMe->v_pIMenuCtl,FALSE);
					IMENUCTL_SetActive(pMe->m_pSoftMenu,TRUE);
					return TRUE;
				case AVK_CLR:
					return VenCurSchedule_MenuStart(pMe);
				case AVK_SELECT:
					return TRUE;
				}
				return TRUE;
			
			case APP_STATE_QUIT:
				switch(wParam)
				{
				case AVK_CLR:
					return VenCurSchedule_MenuStart(pMe);
				case AVK_SELECT:
					pMe->m_nState = NULL;
					ISHELL_CloseApplet(pMe->pIShell,TRUE);
					return TRUE;
				default:
				    return FALSE;
				}
				return TRUE;
			
			case APP_STATE_ABOUT:
			case APP_STATE_EVERYDESIGN:
			    if(pMe->m_pSoftMenu)IMENUCTL_HandleEvent(pMe->m_pSoftMenu,EVT_KEY,wParam,dwParam);
					switch(wParam)
				{
				case AVK_CLR:
					ITEXTCTL_SetActive(pMe->pDTextCourse,FALSE);
					ITEXTCTL_SetActive(pMe->pDTextClass,FALSE);

					IDISPLAY_ClearScreen(pMe->pIDisplay);                          //清屏
					return VenCurSchedule_MenuStart(pMe);
				case AVK_SELECT:
				return TRUE;
				}
				
		        return TRUE;
				
			default:
					return FALSE;
			}
			case EVT_COMMAND:
				switch(wParam)
				{
				case IDS_SYLLABUS:
					GETJULIANDATE(0,&pMe->dwWeekDay);                                                              //得到系统时间
                    pMe->day = pMe->dwWeekDay.wWeekDay;
					VenCurSchedule_DisplayViewScreen(pMe,pMe->day);
					IMENUCTL_SetActive(pMe->m_pSoftMenu,FALSE);
					return TRUE;
					
				case IDS_BEFOREDAY:
					pMe->day =(pMe->day+6)%7;
					VenCurSchedule_DisplayViewScreen(pMe,pMe->day);
					IMENUCTL_SetActive(pMe->m_pSoftMenu,FALSE);
					return TRUE;
					
				case IDS_AFTERDAY:
					pMe->day = (pMe->day+1)%7;
					VenCurSchedule_DisplayViewScreen(pMe,pMe->day);
					IMENUCTL_SetActive(pMe->m_pSoftMenu,FALSE);
					return TRUE;

				case IDS_DESIGN:
					IDISPLAY_ClearScreen(pMe->pIDisplay);
					GETJULIANDATE(0,&pMe->dwWeekDay);                           //获得系统时间                                                           //得到系统时间
                    pMe->day = pMe->dwWeekDay.wWeekDay;
					pMe->period=0;
					VenCurSchedule_DisplayDesignScreen(pMe,pMe->day,pMe->period);
					return (TRUE);
					
				case IDS_DESIGN_BEFOREDAY:
					IDISPLAY_ClearScreen(pMe->pIDisplay);
					pMe->day = (pMe->day+6)%7;
					VenCurSchedule_DisplayDesignScreen(pMe,pMe->day,pMe->period);
					return TRUE;

				case IDS_DESIGN_AFTERDAY:
					IDISPLAY_ClearScreen(pMe->pIDisplay);
					pMe->day = (pMe->day+1)%7;
					pMe->period = 0;
					VenCurSchedule_DisplayDesignScreen(pMe,pMe->day,pMe->period);
					return TRUE;

				case IDS_BEFORE_NODAL:
					IDISPLAY_ClearScreen(pMe->pIDisplay);
					pMe->period = (pMe->period +7)%8;
					if(pMe->period == 7)pMe->period = 0;
					VenCurSchedule_DisplayDesignScreen(pMe,pMe->day,pMe->period);
					return TRUE;

				case IDS_AFTER_NODAL:
					IDISPLAY_ClearScreen(pMe->pIDisplay);
					pMe->period = (pMe->period +1)%8;
					if(pMe->period == 0)pMe->period = 7;
					VenCurSchedule_DisplayDesignScreen(pMe,pMe->day,pMe->period);
					return TRUE;
					
				case IDS_SYSTEM:
					VenCurSchedule_SystemDesignSCreen(pMe);
					return(TRUE);
				case IDS_HELP:
					return VenCurSchedule_DisplayHelpScreen(pMe);
				case IDS_ABOUT:
					VenCurSchedule_DisplayAboutScreen(pMe);
					return(TRUE);
					
				case IDS_QUIT:
					VenCurSchedule_DisplayQuitScreen(pMe);
					return TRUE;
					
				case IDS_V1:                                                           
                    pMe->Eday = pMe->day;
					pMe->period=0;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_V2:
					pMe->Eday = pMe->day;
					pMe->period=1;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_V3:
					pMe->Eday = pMe->day;
					pMe->period=2;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);
					
				case IDS_V4:
					pMe->Eday = pMe->day;
					pMe->period=3;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_V5:
					pMe->Eday = pMe->day;
					pMe->period=4;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_V6:
					pMe->Eday = pMe->day;
					pMe->period=5;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_V7:
					pMe->Eday = pMe->day;
					pMe->period=6;
					VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_V8:
					pMe->Eday = pMe->day;
					pMe->period=7;
			    	VenCurSchedule_EveryCourseDesignScreen(pMe);
					return (TRUE);

				case IDS_ED_CHANGE:
					ITEXTCTL_GetText(pMe->pDTextCourse,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Course,8);
					ITEXTCTL_GetText(pMe->pDTextClass,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Class,8);
					VenCurSchedule_WriteScheduleFile(pMe);
					ISHELL_EndDialog(pMe->a.m_pIShell);
					VenCurSchedule_FinishSplashScreen(pMe);
					return TRUE;
					
				case IDS_CHANGE:
			    	ITEXTCTL_GetText(pMe->pITextCtl,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Course,8);
                    ITEXTCTL_GetText(pMe->CpITextCtl,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Class,8);
					ITEXTCTL_GetText(pMe->TpITextCtl,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Teacher,8);
					ITEXTCTL_GetText(pMe->RpITextCtl,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Remind,8);
					ITEXTCTL_GetText(pMe->MpITextCtl,pMe->FileArry[pMe->day].DetailFileArry[pMe->period].Memo,8);
					VenCurSchedule_WriteScheduleFile(pMe);
					ISHELL_EndDialog(pMe->a.m_pIShell);
					VenCurSchedule_FinishSplashScreen(pMe);
					return TRUE;
				case IDS_HELP_SOFTOK:
					return VenCurSchedule_MenuStart(pMe);
				case IDS_SYSTEM_SOFTOK:
					pMe->m_nState = APP_STATE_MAINMENU;
					return VenCurSchedule_MenuStart(pMe);
					
			
				}			
				return(TRUE);
				default:
					break;
	}	
	return FALSE;
}
// this function is called when your application is starting up
boolean VenCurSchedule_InitAppData(VenCurSchedule* pMe)
{
    // Get the device information for this handset.
    // Reference all the data by looking at the pMe->DeviceInfo structure
    // Check the API reference guide for all the handy device info you can get
    pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
    ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
	
    // The display and shell interfaces are always created by
    // default, so we'll asign them so that you can access
    // them via the standard "pMe->" without the "a."
    pMe->pIDisplay = pMe->a.m_pIDisplay;
    pMe->pIShell   = pMe->a.m_pIShell;
	
    // Insert your code here for initializing or allocating resources...
	if(ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_MENUCTL, (void**)&pMe->pIMenuCtl) != SUCCESS)
		return FALSE;                                      //创建菜单控件实例并获取其接口指针
	if(ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_MENUCTL, (void**)&pMe->v_pIMenuCtl) != SUCCESS)
		return FALSE;                                      //创建菜单控件实例并获取其接口指针
	if(ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SOFTKEYCTL,(void**)&pMe->m_pSoftMenu) != SUCCESS) 
		return FALSE;                                      //创建软件菜单实例并获取其接口指针 
	if(ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SOFTKEYCTL,(void**)&pMe->helpSoftMenu) != SUCCESS)
		return FALSE;                                      //创建软件菜单实例并获取其接口指针 
	if(ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_STATIC,(void**)&pMe->m_pIStatic) != AEE_SUCCESS)
		return FALSE;                                      //创建istatic接口
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_HTML,(void**)&(pMe->pIHtml)) != SUCCESS) 
		return FALSE;                                      //创建Ihtml接口
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_FILEMGR,(void**)&pMe->pIFileMgr) != SUCCESS)
		return FALSE;                                      //创建FileMgr接口
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_FILEMGR,(void**)&pMe->pScheduleFileMgr) != SUCCESS)
		return FALSE;                                      //创建ScheduleFileMgr接口
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->pITextCtl) != SUCCESS)
		return FALSE;                                      //创建TextCtl接口
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->CpITextCtl) != SUCCESS)
		return FALSE;                                       
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->TpITextCtl) != SUCCESS)	
		return FALSE; 
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->RpITextCtl) != SUCCESS)
		return FALSE; 
	if(ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->MpITextCtl) != SUCCESS)
		return FALSE; 

	/*get the height of font*/
	pMe->m_nLineHeight = IDISPLAY_GetFontMetrics(pMe->pIDisplay,
		AEE_FONT_NORMAL,
		NULL,
		NULL);
	pMe->m_nLargeLineHeight = IDISPLAY_GetFontMetrics(pMe->pIDisplay,
		AEE_FONT_LARGE,
		NULL,
		NULL);
    pMe->m_nScrWidth = pMe->DeviceInfo.cxScreen;
	pMe->m_nScrHeight = pMe->DeviceInfo.cyScreen;
	SETAEERECT(&pMe->m_nClntAreaRect,0,0,
		pMe->DeviceInfo.cxScreen,
		pMe->DeviceInfo.cyScreen - pMe->m_nLargeLineHeight);            //初始化指定的矩形
	pMe->point=1;
    return TRUE;
}

// this function is called when your application is exiting
void VenCurSchedule_FreeAppData(VenCurSchedule* pMe)
{
 
	if( pMe->pIMenuCtl != NULL)
	{
		IMENUCTL_Release(pMe->pIMenuCtl);
		pMe->pIMenuCtl = NULL;
	}
	if(pMe->v_pIMenuCtl != NULL)
	{
		IMENUCTL_Release(pMe->v_pIMenuCtl);
		pMe->v_pIMenuCtl = NULL;
	}
		if(pMe->m_pSoftMenu != NULL)
	{
		IMENUCTL_Release(pMe->m_pSoftMenu);
		pMe->m_pSoftMenu = NULL;
	}
	if(pMe->m_pIStatic != NULL)
	{
		ISTATIC_Release(pMe->m_pIStatic);
		pMe->m_pIStatic = NULL;
	}

	if(pMe->pIHtml != NULL)
	{
		IHTMLVIEWER_Release(pMe->pIHtml);
		 pMe->pIHtml = NULL;
	}
    if(pMe->pIFileMgr != NULL)
	{	
	    IFILEMGR_Release(pMe->pIFileMgr);
		pMe->pIFileMgr = NULL;
	}
	if(pMe->pScheduleFileMgr != NULL)
	{
		IFILEMGR_Release(pMe->pScheduleFileMgr);
		pMe->pScheduleFileMgr = NULL;
	}

	if(pMe->helpSoftMenu != NULL)
	{
		IMENUCTL_Release(pMe->helpSoftMenu);
		pMe->helpSoftMenu = NULL;
	}
	if(pMe->pITextCtl != NULL)
	{
		ITEXTCTL_Release(pMe->pITextCtl);
		pMe->pITextCtl = NULL;
	}

	if(pMe->CpITextCtl != NULL)
	{
		ITEXTCTL_Release(pMe->CpITextCtl);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -