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

📄 exdiag.c

📁 brew平台下
💻 C
📖 第 1 页 / 共 2 页
字号:
						IBITMAP_CreateCompatibleBitmap(pScreen, &pBitmap, (uint16)Info.cx,(uint16)Info.cy);
						IBITMAP_Release(pScreen);
						if(pBitmap==NULL)
						{
							IBITMAP_Release(pImage);
						}
						IBITMAP_BltIn(pBitmap,0,0,Info.cx,Info.cy,pImage,0,0,AEE_RO_COPY);
						IBITMAP_Release(pImage);
						IBITMAP_GetPixel(pBitmap,0,0,&color);
						IBITMAP_SetTransparencyColor(pBitmap,color);

						IBITMAP_CreateCompatibleBitmap(pBitmap, &pBmp2, (uint16)Info.cx,(uint16)Info.cy);
						IBITMAP_QueryInterface(pBmp2,AEECLSID_TRANSFORM,(void**)&pITransform);
						matrix.A = -256;
						matrix.B = 0;
						matrix.C = 0;
						matrix.D = 256;
						ITRANSFORM_TransformBltSimple(pITransform,0,0,pBitmap,0,0,Info.cx,Info.cy,TRANSFORM_ROTATE_90,COMPOSITE_OPAQUE);
						//ITRANSFORM_TransformBltComplex(pITransform,0,0,pBitmap,0,0,20,20,&matrix,COMPOSITE_OPAQUE);

						ITRANSFORM_Release(pITransform);

						IDISPLAY_BitBlt(pMe->pIDisplay,0,0,Info.cx,Info.cy,pBmp2,0,0,AEE_RO_COPY);
						IDISPLAY_Update(pMe->pIDisplay);
						IBITMAP_Release(pBitmap);*/

						//IMENUCTL_SetActive(pMe->pIMenuCtl,TRUE);
					/*	{
							AEERect rect;
								AECHAR buffer[1]={0};
	
							ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->pITextCtl);
							ISHELL_CreateInstance(pMe->pIShell,AEECLSID_SOFTKEYCTL,(void**)&pMe->pIMenuCtl);
							IMENUCTL_AddItem(pMe->pIMenuCtl,
							rect.x = 0;
							rect.y = 0;
							rect.dx = pMe->DeviceInfo.cxScreen;
							rect.dy = 50;
							 
							ITEXTCTL_SetTitle(pMe->pITextCtl,EXDIAG_RES_FILE,IDS_TEXT_TITLE,NULL);
							ITEXTCTL_SetRect(pMe->pITextCtl,&rect);
							ITEXTCTL_SetMaxSize(pMe->pITextCtl,15);
							ITEXTCTL_SetProperties(pMe->pITextCtl,TP_FRAME);
							ITEXTCTL_SetText(pMe->pITextCtl,buffer,1);
							//ITEXTCTL_SetInputMode(pMe->pITextCtl,AEE_TM_LETTERS);
							//ITEXTCTL_SetActive(pMe->pITextCtl,TRUE);
						}*/
						//ITEXTCTL_SetInputMode(pMe->pITextCtl,AEE_TM_LETTERS);
						//ITEXTCTL_SetActive(pMe->pITextCtl,TRUE);
						//IMENUCTL_SetActive(pMe->pIMenuCtl,TRUE);

					//	ITEXTCTL_SetActive(pMe->pITextCtl,TRUE);
					//ISTATIC_SetActive(pMe->pIStatic,TRUE);

					}
            return(TRUE);
				case EVT_DIALOG_INIT:
					
					return(TRUE);
				case EVT_DIALOG_START:
					
					return(TRUE);
				case EVT_DIALOG_END:
					return(TRUE);


        // App is told it is exiting
        case EVT_APP_STOP:
            // Add your code here...

      		return(TRUE);


        // App is being suspended 
        case EVT_APP_SUSPEND:
					if(pMe->pIStatic)
					{
						ISTATIC_Release(pMe->pIStatic);
						pMe->pIStatic = NULL;
					}
      		return(TRUE);
        case EVT_APP_RESUME:
					{
						AEERect rect;
						AECHAR *pBuffer;
						int size;
						rect.x = 0;
						rect.y = 0;
						rect.dx = pMe->DeviceInfo.cxScreen;
						rect.dy = pMe->DeviceInfo.cyScreen;
						ISHELL_CreateInstance(pMe->pIShell,AEECLSID_STATIC,(void**)&pMe->pIStatic);
						ISTATIC_SetRect(pMe->pIStatic,&rect);
						ISTATIC_SetProperties(pMe->pIStatic,ST_NOSCROLL);
						ISHELL_GetResSize(pMe->pIShell,EXDIAG_RES_FILE,IDS_STATIC,RESTYPE_STRING,&size);
						pBuffer = (AECHAR*)MALLOC(size);
						ISHELL_LoadResString(pMe->pIShell,EXDIAG_RES_FILE,IDS_STATIC,pBuffer,size);
						ISTATIC_SetText(pMe->pIStatic,NULL,pBuffer,AEE_FONT_NORMAL,AEE_FONT_NORMAL);
						FREE(pBuffer);
					}
      		return(TRUE);
				case EVT_COMMAND:
					switch(wParam)
					{
					case IDS_SOFT_1:
						{
							AECHAR userName[20];
							ITEXTCTL_GetText(pMe->pITextCtl,userName,19);
						}
						break;

					}
					break;


        // An SMS message has arrived for this app. Message is in the dwParam above as (char *)
        // sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
        case EVT_APP_MESSAGE:
		    // Add your code here...

      		return(TRUE);

        // A key was pressed. Look at the wParam above to see which key was pressed. The key
        // codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
        case EVT_KEY:
					//if(pMe->pIMenuCtl)
					{
						//if(IMENUCTL_HandleEvent(pMe->pIMenuCtl,eCode,wParam,dwParam))
						{
							//return TRUE;
						}
					}
					//if(pMe->pITextCtl)
					{
						//IMENUCTL_HandleEvent(pMe->pIMenuCtl,eCode,wParam,dwParam);
						//if(ITEXTCTL_HandleEvent(pMe->pITextCtl,eCode,wParam,dwParam))
						{
							//return TRUE;
						}
					//	else
						{
							//if(wParam==AVK_SELECT)
							{
							//	return TRUE;

							}
						}
					}

      		
					break;


        // If nothing fits up to this point then we'll just break out
        default:
            break;
   }

   return FALSE;
}


// this function is called when your application is starting up
boolean ExDiag_InitAppData(ExDiag* 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...

		{
			AEERect rect;
			CtlAddItem ai;



		/*	ai.dwData = 2;
			ai.pszResImage = EXDIAG_RES_FILE;
			ai.pszResText = EXDIAG_RES_FILE;
			ai.wItemID = IDS_MENU_3;
			ai.wText = IDS_MENU_3;
			ai.wImage = IDB_DIR;
			ai.pText = NULL;
			ai.pImage = NULL;
			IMENUCTL_AddItemEx(pMe->pIMenuCtl, &ai);

			ai.wItemID = IDS_MENU_1;
			ai.wText = IDS_MENU_1;
			ai.wImage = IDB_ICON1;
			IMENUCTL_AddItemEx(pMe->pIMenuCtl, &ai);
			ai.wText = IDS_MENU_2;
			ai.wItemID = IDS_MENU_2;
			ai.wImage = IDB_ICON2;*/
			//IMENUCTL_EnableCommand(pMe->pIMenuCtl,FALSE);
			//IMENUCTL_AddItemEx(pMe->pIMenuCtl, &ai);
			//IMENUCTL_SetRect(pMe->pIMenuCtl,&rect);
			//IMENUCTL_SetActive(pMe->pIMenuCtl,TRUE);		
		}
		/*{
			AEERect rect;
			ISHELL_CreateInstance(pMe->pIShell,AEECLSID_SOFTKEYCTL,(void**)&pMe->pIMenuCtl);
			IMENUCTL_AddItem(pMe->pIMenuCtl,EXDIAG_RES_FILE,IDS_SOFT_1,IDS_SOFT_1,NULL,1);
			ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void**)&pMe->pITextCtl);
			rect.x = 0;
			rect.y = 0;
			rect.dx = pMe->DeviceInfo.cxScreen;
			rect.dy = 50;

			ITEXTCTL_SetProperties(pMe->pITextCtl,TP_FRAME);
			ITEXTCTL_SetTitle(pMe->pITextCtl,EXDIAG_RES_FILE,IDS_TEXT_TITLE,NULL);
			ITEXTCTL_SetRect(pMe->pITextCtl,&rect);
			ITEXTCTL_SetMaxSize(pMe->pITextCtl,15);
			ITEXTCTL_SetSoftKeyMenu(pMe->pITextCtl, pMe->pIMenuCtl); 
			ITEXTCTL_SetInputMode(pMe->pITextCtl,AEE_TM_NUMBERS);
			//ITEXTCTL_EnableCommand(pMe->pITextCtl,TRUE,IDS_MENU_1);
			ITEXTCTL_SetActive(pMe->pITextCtl,TRUE);
		}*/
		{
			AEERect rect;
			AECHAR *pBuffer;
			int size;
			rect.x = 0;
			rect.y = 0;
			rect.dx = pMe->DeviceInfo.cxScreen;
			rect.dy = pMe->DeviceInfo.cyScreen;
			ISHELL_CreateInstance(pMe->pIShell,AEECLSID_STATIC,(void**)&pMe->pIStatic);
			ISTATIC_SetRect(pMe->pIStatic,&rect);
			ISTATIC_SetProperties(pMe->pIStatic,ST_NOSCROLL);
			ISHELL_GetResSize(pMe->pIShell,EXDIAG_RES_FILE,IDS_STATIC,RESTYPE_STRING,&size);
			pBuffer = (AECHAR*)MALLOC(size);
			ISHELL_LoadResString(pMe->pIShell,EXDIAG_RES_FILE,IDS_STATIC,pBuffer,size);
			ISTATIC_SetText(pMe->pIStatic,NULL,pBuffer,AEE_FONT_NORMAL,AEE_FONT_NORMAL);
			FREE(pBuffer);
		}



    // if there have been no failures up to this point then return success
    return TRUE;
}

// this function is called when your application is exiting
void ExDiag_FreeAppData(ExDiag* pMe)
{
	// insert your code here for freeing any resources you have allocated...
	if ( pMe->pIMenuCtl != NULL )         // check for NULL first
	{
		IMENUCTL_Release(pMe->pIMenuCtl);   // release the interface
		pMe->pIMenuCtl = NULL;             // set to NULL so no problems trying to free later
	}
	if(pMe->pITextCtl!=NULL)
	{
	}
}

⌨️ 快捷键说明

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