Jump to content

zhw7238

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by zhw7238

  1. if you use ugfx with c++, you need add this in checkbox.h( added code in red )

    /* A Checkbox window */

    typedef struct GCheckboxObject {

    GWidgetObject w;

    #if GINPUT_NEED_TOGGLE

    uint16_t toggle;

    #endif

    } GCheckboxObject;

    #ifdef __cplusplus

    extern "C" {

    #endif

    ....

    #ifdef __cplusplus

    }

    #endif

    #endif /* _GWIN_CHECKBOX_H */

    /** @} */

  2. same as i reported for progressbar.c; the gwinGImageCreate need add red line , otherwise in gwinImageOpenFile may crashed.

    ENV: MCU=STM32F103VT IDE =IAR 6.6

    GHandle gwinGImageCreate(GDisplay *g, GImageObject *gobj, GWindowInit *pInit) {

    if (!(gobj = (GImageObject *)_gwindowCreate(g, &gobj->g, pInit, &imageVMT, 0)))

    return 0;

    // Ensure the gdispImageIsOpen() gives valid results

    gobj->image.type = 0;

    gobj->image.fns = 0;//add for fix this bug

    // Initialise the timer

    #if GWIN_NEED_IMAGE_ANIMATION

    gtimerInit(&gobj->timer);

    #endif

    gwinSetVisible((GHandle)gobj, pInit->show);

    return (GHandle)gobj;

    }

  3. GHandle gwinGProgressbarCreate(GDisplay *g, GProgressbarObject *gs, const GWidgetInit *pInit) {

    if (!(gs = (GProgressbarObject *)_gwidgetCreate(g, &gs->w, pInit, &progressbarVMT)))

    return 0;

    gs->min = 0;

    gs->max = 100;

    gs->res = 1;

    gs->pos = 0;

    gs->delay = 0;

    gtimerInit(&gs->gt);//GTimer need init, otherwise call gwinProgressbarStop will crash, my MCU is STM32F103VT

    ResetDisplayPos(gs);

    gwinSetVisible((GHandle)gs, pInit->g.show);

    return (GHandle)gs;

    }

×
×
  • Create New...