📄 framedemo.c
字号:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: FrameDemo.c
** Last modified Date: 2008-04-18
** Last Version: 1.0
** Descriptions: demonstrate the frame window's function
**
**------------------------------------------------------------------------------------------------------
** Created by: Houxiaolong
** Created date: 2008-04-16
** Version: 1.0
** Descriptions: demonstrate the frame window's function
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#include "cursor.h"
#include "config.h"
extern unsigned char pb1[];
/*********************************************************************************************************
** Function name: __showName
** Descriptions: show the demo name
** Input parameters: none
** Output parameters: none
*********************************************************************************************************/
static void __showName(void)
{
GUI_FillSCR(GREEN); /* clear panel with green */
GUI_SetColor(RED, GREEN); /* font color: RED
back color: GREEN */
GUI_PutString8_8(55, 150, "FrameWindow-Sample"); /* display the text */
delay_Ns(1500);
}
/*********************************************************************************************************
** Function name: __FrameDemo
** Descriptions: frame demo
** Input parameters: none
** Output parameters: none
*********************************************************************************************************/
void FrameDemo (void)
{
char i = 0;
WINDOWS Frame; /* Frame window's handle */
MMENU Menu; /* menu's handle */
/*
* Frame's parameter
*/
uint8 ucTitle[] = "FrameWindow-test";
uint8 ucState0[] = "Normal";
uint8 ucState1[] = "Max";
Frame.with = 100;
Frame.hight = 100;
Frame.title = ucTitle;
Frame.state = ucState0;
/*
* Menu's parameter
*/
Menu.win = &Frame;
Menu.no = 2;
Menu.str[0] = "text";
Menu.str[1] = "picture";
__showName();
GUI_FillSCR(BLACK);
delay_Ns(100);
cursor_SetPosition(0, 0); /* set the cursor's position */
cursor_On(); /* display the cursor */
/*
* move the frame window
*/
for (i = 0; i < 4; i++) {
Frame.x = 20 * i;
Frame.y = 20 * i;
GUI_SetColor(RED, BLUE);
GUI_WindowsDraw(&Frame); /* create a frame window */
GUI_SetColor(RED, LGRAY);
GUI_MMenuDraw(&Menu); /* create menu */
delay_Ns(500);
GUI_SetColor(RED, BLACK);
GUI_WindowsHide(&Frame); /* hide the frame window */
}
Frame.x = 80;
Frame.y = 80;
GUI_SetColor(RED, BLUE);
GUI_WindowsDraw(&Frame);
GUI_SetColor(RED, LGRAY);
GUI_MMenuDraw(&Menu);
delay_Ns(500);
GUI_SetColor(RED, BLACK);
GUI_WindowsHide(&Frame);
/*
* maximize the frame window
*/
Frame.x = 0;
Frame.y = 0;
Frame.with = GUI_LCM_XMAX - 1;
Frame.hight = GUI_LCM_YMAX - 1;
Frame.state = ucState1;
GUI_SetColor(RED, BLUE);
GUI_WindowsDraw(&Frame);
GUI_SetColor(RED, LGRAY);
GUI_MMenuDraw(&Menu);
delay_Ns(500);
for(i = 0; i <= 15; i++) {
cursor_SetPosition(i, i); /* set the cursor's position */
delay_Ns(20);
}
GUI_SetColor(WHITE, LGRAY);
GUI_MMenuSelect(&Menu, 0); /* select menu 0 */
delay_Ns(700);
GUI_MMenuNSelect(&Menu, 0); /* cancle select menu 0 */
GUI_SetColor(RED, BLUE);
GUI_PutString(113, 80, "ABC"); /* display the text */
GUI_SetColor(GREEN, BLUE);
for (i = 0; i < 3; i++) {
GUI_PutChar24_32(84 + i * 24 , 100, (0x31 + i ));
}
GUI_SetColor(WHITE, BLUE);
GUI_PutString8_8(30, 150, "You are testing ZLGGUI!");
for(i = 0; i < 55; i++) {
cursor_SetPosition(15 + i, 15); /* set the cursor's position */
delay_Ns(20);
}
GUI_SetColor(WHITE, LGRAY);
GUI_MMenuSelect(&Menu, 1); /* select menu 0 */
delay_Ns(700);
GUI_MMenuNSelect(&Menu, 1); /* cancle select menu 0 */
GUI_RectangleFill(20, 70, 220, 170, BLUE);
lcd_DrawBmp(56, 80, 128, 128, pb1); /* display a picture */
delay_Ns(1000);
cursor_SetPosition(5, 5); /* set the cursor's position */
delay_Ns(500);
GUI_FillSCR(BLACK);
delay_Ns(200);
cursor_Off(); /* hide the cursor */
GUI_FillSCR(YELLOW);
GUI_SetColor(BLUE, YELLOW);
GUI_PutString8_8(80, 158, "THANK YOU!!");
delay_Ns(500);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -