#include "hmiworks.h"
#pragma GCC diagnostic ignored "-Wunused-variable"

static tWidget *thisCanvas = (tWidget *)&CanvasFrame4;
static tContext globalContext;
static tContext *thisContext = &globalContext;

#pragma GCC diagnostic warning "-Wunused-variable"


static void ConnectWidgetVariable();
static void DisconnectWidgetVariable();

#include "__frame4.h"

HotSpot(HotSpotWidget28, WIDGET_ROOT, 0, 0, HMI_DISPLAY_DRIVER_PTR,
-1, -1, 241, 321, 0, ClrSilver, ClrSilver, 0, ClrSilver,
&g_sFontCm20, "-", NULL, NULL, 0, 0,
OnHotSpotWidget28Click);


Canvas(CanvasFrame4, WIDGET_ROOT, 0, 0, HMI_DISPLAY_DRIVER_PTR, 0, 0,
       240, 320, CANVAS_STYLE_APP_DRAWN, 0, 0, 0, 0, 0, 0, OnFrame427Paint);


void renderFrame427Vector(tContext *pContext, int ox, int oy) {
}
void OnFrame427Paint(tWidget *pWidget, tContext *pContext)
{
hmi_SetForeground(pContext, 0xFFFFFF);
hmi_FillRect(pContext, 0, 0, 240, 320);
renderFrame427Vector(pContext, 0, 0);
}


static void InitGlobalContext()
{
  GrContextInit(thisContext, thisCanvas->pDisplay);
  GrContextClipRegionSet(thisContext, &(thisCanvas->sPosition));
}
void InitWidget4()
{
    WidgetAdd(WIDGET_ROOT, (tWidget *)(&CanvasFrame4));
    WidgetAdd(WIDGET_ROOT, (tWidget *)&HotSpotWidget28);
    InitGlobalContext();
    WidgetPaint(WIDGET_ROOT);
    ConnectWidgetVariable();
 Frame427OnShow();
}

void FreeWidget4()
{
    DisconnectWidgetVariable();
    WidgetRemove((tWidget *)(&CanvasFrame4));
    WidgetRemove((tWidget *)(&HotSpotWidget28));
}


void OnHotSpotWidget28Click(tWidget *pWidget)
{
  hmi_PushButtonNormal(pWidget);
  hmi_GotoFrameByName("Frame1");
}


static void ConnectWidgetVariable()
{
  WidgetMessageQueueProcessEx(WIDGET_MSG_PAINT);
  if (_CurrentFrame != 4) return;
}

static void DisconnectWidgetVariable()
{
}

void _frame4()
{
  var_table_init();
  FreeCurrentFrame();
  _CurrentFrame = 4;
  InitWidget4();
}

