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

📄 uidraw.c

📁 T108 LCD屏的DEMO源代码!需要的就下吧
💻 C
字号:
#include "Common.h"
#include "Global.h"
#include "ICControl.h"	
#include "System.h"
#include "Timer0.h"
#include "TWICreg.h"
//#include "OSD1_Define.h"
#include "OSD1CSL.h"
//#include "OSD2_Define.h"
#include "OSD2CSL.h"	  
#include "E_OSDString.H"
#include "IconJigsaw.h"
#include "UIDraw.h"
#include "Keypad.h"

void Show_Menu1_ColorAdj(uCHAR ItemNow)
{							
//Draw OSD1
	ItemNow=1;
	OSD2InItClearMenu(MENU1);	
	OSD1ShowLine(iMenuNoOK_E,5,5,0,0,1);
	OSD1Enable();
	OSD1Menu1Enable();
//Draw OSD2

}

void Show_Menu1_ItemAdjNum(uCHAR ItemNow)
{
   ItemNow=1;
}

void Show_Source()
{
EX0 = 0;    // Disable Externel Interrup 0
	switch(EepPublic.cSource)
	{
		case 0:	 
			OSD1ShowLine(iCVBS_1_E,0,2,0,0,1);
		break;
		case 1:
			OSD1ShowLine(iSVideo_1_E,0,2,0,0,1);
		break;
	}
	OSD1Enable();
	OSD1Menu1Enable();
	Timer0Start();

EX0 = 1;    // Enable Externel Interrup 0
}


#define CALSTRX 10
#define CALSTRY 1


code uCHAR *NumArry[10]={Icon0,Icon1,Icon2,Icon3,Icon4,Icon5,Icon6,Icon7,Icon8,Icon9};
void Show_CalculateNum(unsigned long Number)
{
	int i,j,k;
	for(j=0;j<10;j++)	
		OSD2Show4BPIcon(IconUP,CALSTRX+2+j,CALSTRY,0,0,0,1);
	if(Number<10)
		j=1;
	else if(Number<100)
		j=2;
	else if(Number<1000)
		j=3;
	else if(Number<10000)
		j=4;
	else if(Number<100000)
		j=5;
	else if(Number<1000000)
		j=6;
	else if(Number<10000000)
		j=7;
	else if(Number<100000000)
		j=8;
	else
		j=9;
	for(i=0; i<j; i++)
	{
		k=Number%10;
		Number /= 10;
		OSD2Show4BPIcon(NumArry[k],CALSTRX+11-i,CALSTRY+2,0,0,0,1);	
	}

			   
}

void Show_Calculate()
{
  
	uCHAR j;
EX0 = 0;    // Disable Externel Interrup 0	

	ClosePanel(0, 0x80, 0x80);
	OSD1ClearLine(5,5,0,1);
	OSD1Disable();							   
	OSD2Show4BPIcon(IconLeftUp,CALSTRX,CALSTRY,0,0,0,1);
	for(j=0;j<10;j++)	
		OSD2Show4BPIcon(IconUP,CALSTRX+2+j,CALSTRY,0,0,0,1);
//	OSD2Show4BPIcon(Icon0,CALSTRX+2+j-1,CALSTRY+2,0,0,0,1);		
	Show_CalculateNum(0);
	OSD2Show4BPIcon(IconRightUP,CALSTRX+2+j,CALSTRY,0,0,0,1);
   
	OSD2Show4BPIcon(IconBT7,CALSTRX,CALSTRY+3,0,0,1,1);
	OSD2Show4BPIcon(IconBT8,CALSTRX+3,CALSTRY+3,0,0,0,1);
	OSD2Show4BPIcon(IconBT9,CALSTRX+6,CALSTRY+3,0,0,0,1);
	OSD2Show4BPIcon(IconBTdivd,CALSTRX+9,CALSTRY+3,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+3,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+4,0,0,0,1);

	OSD2Show4BPIcon(IconBT4,CALSTRX,CALSTRY+5,0,0,0,1);
	OSD2Show4BPIcon(IconBT5,CALSTRX+3,CALSTRY+5,0,0,0,1);
	OSD2Show4BPIcon(IconBT6,CALSTRX+6,CALSTRY+5,0,0,0,1);
	OSD2Show4BPIcon(IconBTmul,CALSTRX+9,CALSTRY+5,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+5,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+6,0,0,0,1);

	OSD2Show4BPIcon(IconBT1,CALSTRX,CALSTRY+7,0,0,0,1);
	OSD2Show4BPIcon(IconBT2,CALSTRX+3,CALSTRY+7,0,0,0,1);
	OSD2Show4BPIcon(IconBT3,CALSTRX+6,CALSTRY+7,0,0,0,1);
	OSD2Show4BPIcon(IconBTsub,CALSTRX+9,CALSTRY+7,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+7,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+8,0,0,0,1);

	OSD2Show4BPIcon(IconBT0,CALSTRX,CALSTRY+9,0,0,0,1);
	OSD2Show4BPIcon(IconBTdot,CALSTRX+3,CALSTRY+9,0,0,0,1);
	OSD2Show4BPIcon(IconBTans,CALSTRX+6,CALSTRY+9,0,0,0,1);
	OSD2Show4BPIcon(IconBTadd,CALSTRX+9,CALSTRY+9,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+9,0,0,0,1);
	OSD2Show4BPIcon(IconLeftBD,CALSTRX+12,CALSTRY+10,0,0,0,1);

	OSD2Show4BPIcon(IconLeftDown,CALSTRX,CALSTRY+11,0,0,0,1);
	for(j=0;j<11;j++)	
		OSD2Show4BPIcon(IconDown,CALSTRX+1+j,CALSTRY+11,0,0,0,1);
	OSD2Show4BPIcon(IconRightDown,CALSTRX+1+j,CALSTRY+11,0,0,0,1);

	OSD2Enable();
	OSD2Menu1Enable();	
EX0 = 1;					 
}

void CalculaterDraw()
{
	switch(m_cCurreKey)
	{
		case REMOTE_KEY_NUM0:	
			OSD2Show4BPIcon(IconBT0,CALSTRX,CALSTRY+9,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT0,CALSTRX,CALSTRY+9,0,0,0,1);
		break;
		case REMOTE_KEY_NUM1:
			OSD2Show4BPIcon(IconBT1,CALSTRX,CALSTRY+7,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT1,CALSTRX,CALSTRY+7,0,0,0,1);
		break;
		case REMOTE_KEY_NUM2:
			OSD2Show4BPIcon(IconBT2,CALSTRX+3,CALSTRY+7,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT2,CALSTRX+3,CALSTRY+7,0,0,0,1);
		break;
		case REMOTE_KEY_NUM3:
			OSD2Show4BPIcon(IconBT3,CALSTRX+6,CALSTRY+7,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT3,CALSTRX+6,CALSTRY+7,0,0,0,1);		
		break;
		case REMOTE_KEY_NUM4:
			OSD2Show4BPIcon(IconBT4,CALSTRX,CALSTRY+5,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT4,CALSTRX,CALSTRY+5,0,0,0,1);			 
		break;
		case REMOTE_KEY_NUM5:
			OSD2Show4BPIcon(IconBT5,CALSTRX+3,CALSTRY+5,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT5,CALSTRX+3,CALSTRY+5,0,0,0,1);
		break;	
	    case REMOTE_KEY_NUM6:
			OSD2Show4BPIcon(IconBT6,CALSTRX+6,CALSTRY+5,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT6,CALSTRX+6,CALSTRY+5,0,0,0,1);
		break;	
		case REMOTE_KEY_NUM7:
			OSD2Show4BPIcon(IconBT7,CALSTRX,CALSTRY+3,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT7,CALSTRX,CALSTRY+3,0,0,0,1);
		break;
		case REMOTE_KEY_NUM8:
			OSD2Show4BPIcon(IconBT8,CALSTRX+3,CALSTRY+3,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT8,CALSTRX+3,CALSTRY+3,0,0,0,1);
		break;
		case REMOTE_KEY_NUM9:
			OSD2Show4BPIcon(IconBT9,CALSTRX+6,CALSTRY+3,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBT9,CALSTRX+6,CALSTRY+3,0,0,0,1);
		break;
		case REMOTE_KEY_CH_INC:	  // divid /
			OSD2Show4BPIcon(IconBTdivd,CALSTRX+9,CALSTRY+3,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBTdivd,CALSTRX+9,CALSTRY+3,0,0,0,1);
		break;
		case REMOTE_KEY_CH_DEC:	  // mul *
			OSD2Show4BPIcon(IconBTmul,CALSTRX+9,CALSTRY+5,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBTmul,CALSTRX+9,CALSTRY+5,0,0,0,1);
		break;
		case REMOTE_KEY_VO_INC:	  // sub -
			OSD2Show4BPIcon(IconBTsub,CALSTRX+9,CALSTRY+7,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBTsub,CALSTRX+9,CALSTRY+7,0,0,0,1);
		break;
		case REMOTE_KEY_VO_DEC:	  // add +
			OSD2Show4BPIcon(IconBTadd,CALSTRX+9,CALSTRY+9,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBTadd,CALSTRX+9,CALSTRY+9,0,0,0,1);
		break;
		case REMOTE_KEY_MUTE:	  // ans =
			OSD2Show4BPIcon(IconBTans,CALSTRX+6,CALSTRY+9,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBTans,CALSTRX+6,CALSTRY+9,0,0,0,1);
		break;
		case REMOTE_KEY_RIGHT:	  // dot .
			OSD2Show4BPIcon(IconBTdot,CALSTRX+3,CALSTRY+9,0,0,4,1);
			twdDelay(1500);
			OSD2Show4BPIcon(IconBTdot,CALSTRX+3,CALSTRY+9,0,0,0,1);
		break;	
		case REMOTE_KEY_RETURN:
			OSD2Disable();	
		break;		
	} 				 
	m_cCurreKey=0;	 
}

⌨️ 快捷键说明

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