幕布 (Curtain)

幕布控件可以创建5个不同方向的幕布,分别是上、下、左、右、中间 (参考 幕布控件方向),创建幕布控件之前,必须先创建幕布视图控件 (curtainview) 来容纳幕布。

用法

创建幕布控件

如果想要创建带有方向的幕布控件,可以使用 gui_curtain_create() 函数来创建。 orientation 表示方向,可以创建上、下、左、右、中间等五个不同方向的幕布控件。 Scope 表示幕布的扩展范围,范围为0到1。

幕布控件方向

幕布控件有5个方向。

typedef enum
{
    CURTAIN_UNDEFINED,
    CURTAIN_UP,
    CURTAIN_DOWN,
    CURTAIN_LEFT,
    CURTAIN_RIGHT,
    CURTAIN_MIDDLE,
} T_GUI_CURTAIN_ENUM;

示例



API

Functions

gui_curtain_t *gui_curtain_create(void *parent, const char *filename, int16_t x, int16_t y, int16_t w, int16_t h, T_GUI_CURTAIN_ENUM orientation, float scope)

Create a curtain effect widget, which should be nested in a curtainview.

参数:
  • parent – the father widget nested in(hould be a curtainview.)

  • filename – this curtain widget’s name.

  • x – the X-axis coordinate relative to parent widget

  • y – the Y-axis coordinate relative to parent widget

  • w – width

  • h – height

  • orientation – the orientation of the curtain,refer to gui_curtain_t_ORIENTATION.

  • scope – The range in which curtains can be expanded

返回:

gui_curtain_t*

struct gui_curtain_t

curtain structure

Public Members

gui_obj_t base

base structure

T_GUI_CURTAIN_ENUM orientation
float scope