feat: 新增边线显示控件(未测试)
This commit is contained in:
106
app/page/cw_page_rtcam.c
Normal file
106
app/page/cw_page_rtcam.c
Normal file
@@ -0,0 +1,106 @@
|
||||
#include "zf_common_headfile.h"
|
||||
#include "cw_page_ui_widget.h"
|
||||
#include "cw_page.h"
|
||||
|
||||
#define LINE_HEAD 1
|
||||
#define LINE_END 7
|
||||
|
||||
static char Text[] = "RealTime Image";
|
||||
|
||||
static int8_t Curser = 1; // 定义光标位置
|
||||
static int8_t Curser_Last = 1; // 定义光标位置
|
||||
static void Print_Menu_p(void);
|
||||
/***************************************************************************************
|
||||
*
|
||||
* 以下为页面模板函数
|
||||
*
|
||||
***************************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief 页面初始化事件
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Setup()
|
||||
{
|
||||
ips114_clear();
|
||||
Print_Menu_p();
|
||||
Print_Curser(Curser, Curser_Last);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面退出事件
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Exit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面循环执行的内容
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Loop()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面事件
|
||||
* @param btn:发出事件的按键
|
||||
* @param event:事件编号
|
||||
* @retval 无
|
||||
*/
|
||||
static void Event(page_event event)
|
||||
{
|
||||
Curser_Last = Curser;
|
||||
|
||||
if (page_event_forward == event) {
|
||||
Curser--; // 光标上移
|
||||
} else if (page_event_backward == event) {
|
||||
Curser++; // 光标下移
|
||||
} else if (page_event_press == event) {
|
||||
if (page_max > Curser && page_menu < Curser) {
|
||||
Page_Shift(Curser); // 切换到光标选中的页面
|
||||
}
|
||||
}
|
||||
|
||||
if (Curser < LINE_HEAD) {
|
||||
Curser = LINE_END;
|
||||
} else if (Curser > LINE_END) {
|
||||
Curser = LINE_HEAD;
|
||||
}
|
||||
|
||||
Print_Curser(Curser, Curser_Last);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面注册函数
|
||||
*
|
||||
* @param pageID
|
||||
*/
|
||||
void PageRegister_page_rtcam(unsigned char pageID)
|
||||
{
|
||||
Page_Register(pageID, Text, Setup, Loop, Exit, Event);
|
||||
}
|
||||
|
||||
/***************************************************************************************
|
||||
*
|
||||
* 以下为页面自定义功能函数
|
||||
*
|
||||
***************************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief 打印菜单项
|
||||
*
|
||||
*/
|
||||
static void Print_Menu_p(void)
|
||||
{
|
||||
// SCREEN_showstr_style(5 * 8, 0, RED, WHITE, "#### MAIN MENU ####");
|
||||
ips200_show_string(0, 0, Text);
|
||||
for (uint8_t i = page_menu + 1; i < page_max; i++) {
|
||||
ips200_show_string(8, i, pagelist[i].Text);
|
||||
// SCREEN_showstr(8, i, pagelist[i].Text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user