Curtain

The curtain widget enables you to create curtains in five directions: up, down, left, right, and middle (refer to Orientation). Before creating the curtain widget, you must first create a curtainview widget to accommodate the curtain.

Usage

Create Curtain Widget

If you want to create a curtain widget with a defined direction, you may opt to utilize the gui_curtain_create() function. orientation represents direction and can create curtain widgets in five different directions: up, down, left, right, and center. Scope refers to the curtain range that can be extended, which falls between 0 and 1.

Orientation

There are five orientations in curtain widget.

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

Example



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.

Parameters:
  • 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

Returns:

gui_curtain_t*

struct gui_curtain_t

curtain structure

Public Members

gui_obj_t base

base structure

T_GUI_CURTAIN_ENUM orientation
float scope