Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
f878c6a5
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f878c6a5
编写于
11月 13, 2017
作者:
还_没_想_好
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp]update rtgui_demo.c
上级
61273135
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
34 deletion
+34
-34
bsp/x1000/applications/rtgui_demo.c
bsp/x1000/applications/rtgui_demo.c
+34
-34
未找到文件。
bsp/x1000/applications/rtgui_demo.c
浏览文件 @
f878c6a5
...
...
@@ -45,42 +45,42 @@ struct rtgui_win *main_win;
rt_bool_t
dc_event_handler
(
struct
rtgui_object
*
object
,
rtgui_event_t
*
event
);
static
void
rt_gui_demo_entry
(
void
*
parameter
)
{
{
struct
rtgui_app
*
app
;
DEBUG_PRINTF
(
"gui demo entry
\n
"
);
/* create gui app */
/* create gui app */
app
=
rtgui_app_create
(
"gui_demo"
);
if
(
app
==
RT_NULL
)
{
DEBUG_PRINTF
(
"rtgui_app_create faild
\n
"
);
return
;
return
;
}
/* create main window */
main_win
=
rtgui_mainwin_create
(
RT_NULL
,
"UiWindow"
,
RTGUI_WIN_STYLE_NO_TITLE
|
RTGUI_WIN_STYLE_NO_BORDER
);
/* create main window */
main_win
=
rtgui_mainwin_create
(
RT_NULL
,
"UiWindow"
,
RTGUI_WIN_STYLE_NO_TITLE
|
RTGUI_WIN_STYLE_NO_BORDER
);
if
(
main_win
==
RT_NULL
)
{
DEBUG_PRINTF
(
"main_win is null
\n
"
);
rtgui_app_destroy
(
app
);
return
;
}
rtgui_object_set_event_handler
(
RTGUI_OBJECT
(
main_win
),
dc_event_handler
);
rtgui_object_set_event_handler
(
RTGUI_OBJECT
(
main_win
),
dc_event_handler
);
DEBUG_PRINTF
(
"rtgui_win_show
\n
"
);
rtgui_win_show
(
main_win
,
RT_FALSE
);
rtgui_win_show
(
main_win
,
RT_FALSE
);
DEBUG_PRINTF
(
"rtgui_app_run
\n
"
);
rtgui_app_run
(
app
);
rtgui_app_run
(
app
);
DEBUG_PRINTF
(
"rtgui_win_destroy
\n
"
);
rtgui_win_destroy
(
main_win
);
rtgui_win_destroy
(
main_win
);
DEBUG_PRINTF
(
"rtgui_app_destroy
\n
"
);
rtgui_app_destroy
(
app
);
rtgui_app_destroy
(
app
);
}
rt_bool_t
dc_event_handler
(
struct
rtgui_object
*
object
,
rtgui_event_t
*
event
)
...
...
@@ -91,31 +91,31 @@ rt_bool_t dc_event_handler(struct rtgui_object *object, rtgui_event_t *event)
{
struct
rtgui_dc
*
dc
;
rtgui_rect_t
rect
;
rt_kprintf
(
"
\r\n
RTGUI_EVENT_PAINT
\r\n
"
);
rtgui_win_event_handler
(
RTGUI_OBJECT
(
widget
),
event
);
DEBUG_PRINTF
(
"
\r\n
RTGUI_EVENT_PAINT
\r\n
"
);
rtgui_win_event_handler
(
RTGUI_OBJECT
(
widget
),
event
);
rtgui_widget_get_rect
(
widget
,
&
rect
);
DEBUG_PRINTF
(
"widget react x1: %d, y1: %d, x2: %d, y2: %d
\r\n
"
,
rect
.
x1
,
rect
.
y1
,
rect
.
x2
,
rect
.
y2
);
dc
=
rtgui_dc_begin_drawing
(
widget
);
if
(
dc
==
RT_NULL
)
{
DEBUG_PRINTF
(
"
\r\n
dc is null
\r\n
"
);
return
RT_FALSE
;
}
dc
=
rtgui_dc_begin_drawing
(
widget
);
if
(
dc
==
RT_NULL
)
{
DEBUG_PRINTF
(
"
\r\n
dc is null
\r\n
"
);
return
RT_FALSE
;
}
rtgui_dc_draw_line
(
dc
,
rect
.
x1
,
rect
.
y1
,
rect
.
x2
,
rect
.
y2
);
rtgui_dc_draw_line
(
dc
,
rect
.
x1
,
rect
.
y2
,
rect
.
x2
,
rect
.
y1
);
rtgui_dc_draw_line
(
dc
,
rect
.
x1
,
rect
.
y1
,
rect
.
x2
,
rect
.
y2
);
rtgui_dc_draw_line
(
dc
,
rect
.
x1
,
rect
.
y2
,
rect
.
x2
,
rect
.
y1
);
rect
.
x1
+=
(
rect
.
x2
-
rect
.
x1
)
/
2
;
rect
.
y1
+=
(
rect
.
y2
-
rect
.
y1
)
/
2
;
rtgui_dc_draw_text_stroke
(
dc
,
__DATE__
"--"
__TIME__
,
&
rect
,
HIGH_LIGHT
,
BLUE
);
rtgui_dc_end_drawing
(
dc
,
RT_TRUE
);
rtgui_dc_end_drawing
(
dc
,
RT_TRUE
);
}
return
RT_FALSE
;
return
RT_FALSE
;
}
int
rt_gui_demo_init
(
void
)
...
...
@@ -125,7 +125,7 @@ int rt_gui_demo_init(void)
rt_err_t
err
;
device
=
rt_device_find
(
"lcd"
);
if
(
device
==
RT_NULL
)
if
(
device
==
RT_NULL
)
{
rt_kprintf
(
"Not found LCD driver
\n
"
);
return
RT_ERROR
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录