2018-12-20 17:33:31 +08:00
|
|
|
|
## calibration\_win\_t
|
|
|
|
|
### 概述
|
|
|
|
|
![image](images/calibration_win_t_0.png)
|
|
|
|
|
|
2018-12-26 14:33:36 +08:00
|
|
|
|
电阻屏校准窗口。
|
2018-12-26 15:08:22 +08:00
|
|
|
|
|
2018-12-26 14:33:36 +08:00
|
|
|
|
calibration\_win\_t是[window\_base\_t](window_base_t.md)的子类控件,
|
|
|
|
|
window\_base\_t的函数均适用于calibration\_win\_t控件。
|
|
|
|
|
|
|
|
|
|
在xml中使用"calibration\_win"标签创建电阻屏校准窗口。如:
|
|
|
|
|
|
|
|
|
|
```xml
|
|
|
|
|
<calibration_win name="cali" w="100%" h="100%" text="Please click the center of cross">
|
|
|
|
|
</calibration_win>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
> 更多用法请参考:
|
|
|
|
|
[window.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/raw/ui/calibration_win.xml)
|
|
|
|
|
|
|
|
|
|
在c代码中使用函数calibration\_win\_create创建窗口。如:
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
widget_t* win = calibration_win_create(NULL, 0, 0, 320, 480);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
通过calibration\_win\_set\_on\_done注册回调函数,用于保存校准数据。
|
|
|
|
|
|
2019-01-15 14:34:05 +08:00
|
|
|
|
|
|
|
|
|
----------------------------------
|
2018-12-20 17:33:31 +08:00
|
|
|
|
### 函数
|
|
|
|
|
<p id="calibration_win_t_methods">
|
|
|
|
|
|
|
|
|
|
| 函数名称 | 说明 |
|
|
|
|
|
| -------- | ------------ |
|
2018-12-21 12:11:40 +08:00
|
|
|
|
| <a href="#calibration_win_t_calibration_win_create">calibration\_win\_create</a> | 创建calibration_win对象 |
|
|
|
|
|
| <a href="#calibration_win_t_calibration_win_set_on_click">calibration\_win\_set\_on\_click</a> | 设置校准点击事件的处理函数。 |
|
|
|
|
|
| <a href="#calibration_win_t_calibration_win_set_on_done">calibration\_win\_set\_on\_done</a> | 设置校准完成的处理函数。 |
|
2018-12-20 17:33:31 +08:00
|
|
|
|
#### calibration\_win\_create 函数
|
2018-12-21 18:29:29 +08:00
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
|
|
* 函数功能:
|
|
|
|
|
|
|
|
|
|
> <p id="calibration_win_t_calibration_win_create"> 创建calibration_win对象
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-21 11:39:05 +08:00
|
|
|
|
* 函数原型:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
widget_t* calibration_win_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
* 参数说明:
|
|
|
|
|
|
2018-12-20 17:33:31 +08:00
|
|
|
|
| 参数 | 类型 | 说明 |
|
|
|
|
|
| -------- | ----- | --------- |
|
|
|
|
|
| 返回值 | widget\_t* | 对象。 |
|
|
|
|
|
| parent | widget\_t* | 父控件 |
|
|
|
|
|
| x | xy\_t | x坐标 |
|
|
|
|
|
| y | xy\_t | y坐标 |
|
|
|
|
|
| w | wh\_t | 宽度 |
|
|
|
|
|
| h | wh\_t | 高度 |
|
2018-12-21 18:29:29 +08:00
|
|
|
|
#### calibration\_win\_set\_on\_click 函数
|
|
|
|
|
-----------------------
|
|
|
|
|
|
2018-12-21 11:39:05 +08:00
|
|
|
|
* 函数功能:
|
|
|
|
|
|
2018-12-21 18:29:29 +08:00
|
|
|
|
> <p id="calibration_win_t_calibration_win_set_on_click"> 设置校准点击事件的处理函数。
|
2018-12-20 17:33:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-21 11:39:05 +08:00
|
|
|
|
* 函数原型:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
ret_t calibration_win_set_on_click (widget_t* widget, calibration_win_on_click_t on_click, void* ctx);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
* 参数说明:
|
|
|
|
|
|
2018-12-20 17:33:31 +08:00
|
|
|
|
| 参数 | 类型 | 说明 |
|
|
|
|
|
| -------- | ----- | --------- |
|
|
|
|
|
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
|
|
|
|
| widget | widget\_t* | widget对象。 |
|
|
|
|
|
| on\_click | calibration\_win\_on\_click\_t | 回调函数。 |
|
|
|
|
|
| ctx | void* | 回调函数的上下文。 |
|
2018-12-21 18:29:29 +08:00
|
|
|
|
#### calibration\_win\_set\_on\_done 函数
|
|
|
|
|
-----------------------
|
|
|
|
|
|
2018-12-21 11:39:05 +08:00
|
|
|
|
* 函数功能:
|
|
|
|
|
|
2018-12-21 18:29:29 +08:00
|
|
|
|
> <p id="calibration_win_t_calibration_win_set_on_done"> 设置校准完成的处理函数。
|
2018-12-20 17:33:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-21 11:39:05 +08:00
|
|
|
|
* 函数原型:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
ret_t calibration_win_set_on_done (widget_t* widget, calibration_win_on_done_t on_done, void* ctx);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
* 参数说明:
|
|
|
|
|
|
2018-12-20 17:33:31 +08:00
|
|
|
|
| 参数 | 类型 | 说明 |
|
|
|
|
|
| -------- | ----- | --------- |
|
|
|
|
|
| 返回值 | ret\_t | 返回RET\_OK表示成功,否则表示失败。 |
|
|
|
|
|
| widget | widget\_t* | widget对象。 |
|
|
|
|
|
| on\_done | calibration\_win\_on\_done\_t | 回调函数。 |
|
|
|
|
|
| ctx | void* | 回调函数的上下文。 |
|