/********************************************************************* * * GUIDEMO_Main */ void GUIDEMO_Main(void) { FRAMEWIN_SKINFLEX_PROPS Framewin_Props; #if GUIDEMO_USE_AUTO_BK int NumFreeBytes; int BitsPerPixel; #endif GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed); WM_SetCallback(WM_HBKWIN, _cbBk); BUTTON_SetReactOnLevel(); FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE); Framewin_Props.Radius = 0; FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE); FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE); Framewin_Props.Radius = 0; FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE); FRAMEWIN_SetDefaultSkin (_FRAMEWIN_DrawSkinFlex); PROGBAR_SetDefaultSkin (PROGBAR_SKIN_FLEX); BUTTON_SetDefaultSkin (BUTTON_SKIN_FLEX); SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX); SLIDER_SetDefaultSkin (SLIDER_SKIN_FLEX); HEADER_SetDefaultSkin (HEADER_SKIN_FLEX); GUI_SetTextMode (GUI_TM_TRANS); GUIDEMO_Config(&_GUIDemoConfig); #if GUIDEMO_USE_VNC if (GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_VNC)) { _GUIDemoConfig.pGUI_VNC_X_StartServer(0, 0); } #endif #if GUIDEMO_USE_AUTO_BK // // Determine if HW has enough memory to draw the gradient circle as background // BitsPerPixel = LCD_GetBitsPerPixel(); if ((BitsPerPixel >= 16) && GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_AUTO_BK)) { NumFreeBytes = GUI_ALLOC_GetNumFreeBytes(); if (NumFreeBytes > NUMBYTES_NEEDED) { _pfDrawBk = _DrawBkCircle; } else { _pfDrawBk = _DrawBk; } } else #endif { _pfDrawBk = _DrawBkSimple; } GUIDEMO_SetDrawLogo(1); while (1) { _Main(); } }
/********************************************************************* * * GUIDEMO_Main */ void GUIDEMO_Main(void) { FRAMEWIN_SKINFLEX_PROPS Framewin_Props; #if AUTO_BK int NumFreeBytes; int BitsPerPixel; #endif GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed); WM_SetCallback(WM_HBKWIN, _cbBk); BUTTON_SetReactOnLevel(); FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE); Framewin_Props.Radius = 0; FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE); FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE); Framewin_Props.Radius = 0; FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE); FRAMEWIN_SetDefaultSkin (_FRAMEWIN_DrawSkinFlex); PROGBAR_SetDefaultSkin (PROGBAR_SKIN_FLEX); BUTTON_SetDefaultSkin (BUTTON_SKIN_FLEX); SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX); SLIDER_SetDefaultSkin (SLIDER_SKIN_FLEX); HEADER_SetDefaultSkin (HEADER_SKIN_FLEX); GUI_SetTextMode (GUI_TM_TRANS); #if GUIDEMO_USE_VNC GUI_VNC_X_StartServer(0, 0); #endif #if AUTO_BK // Commented out as hardware is not fast enough to draw gradient background. Can be used on faster targets like ARM9 // // Determine if HW has enough memory to draw the gradient circle as background // BitsPerPixel = LCD_GetBitsPerPixel(); if (BitsPerPixel >= 16) { NumFreeBytes = GUI_ALLOC_GetNumFreeBytes(); if (NumFreeBytes > NUMBYTES_NEEDED) { _pfDrawBk = _DrawBkCircle; } else { _pfDrawBk = _DrawBk; } } else { _pfDrawBk = _DrawBkSimple; } #else _pfDrawBk = _DrawBkSimple; #endif _Main(); }
/********************************************************************* * * MainTask */ void MainTask(void) { GUI_Init(); // // Check if recommended memory for the sample is available // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) { GUI_ErrorOut("Not enough memory available."); return; } #if GUI_SUPPORT_MEMDEV WM_SetCreateFlags(WM_CF_MEMDEV); #endif FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX); BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX); RADIO_SetDefaultSkin(RADIO_SKIN_FLEX); CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX); HEADER_SetDefaultSkin(HEADER_SKIN_FLEX); GUI_CURSOR_Show(); WM_SetCallback(WM_HBKWIN, _cbBkWin); while (1) { GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, 0, 0, 0); GUI_Delay(1000); } }
/********************************************************************* * * GUIDEMO_Main */ void GUIDEMO_Main(void) { FRAMEWIN_SKINFLEX_PROPS Framewin_Props; #if GUIDEMO_USE_AUTO_BK int NumFreeBytes; int BitsPerPixel; #endif /*设置在处理动画时要调用的的处理函数,决定终止或继续动画,——cbEffect,用户定义的回调函数*/ GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed); /*设置窗口的回调例程*/ WM_SetCallback(WM_HBKWIN, _cbBk); /*将所有按钮设置对水平做出反应*/ BUTTON_SetReactOnLevel(); /*返回framewin皮肤属性*/ FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);/*FRAMEWIN_SKINFLEX_PI_ACTIVE活动状态的属性*/ Framewin_Props.Radius = 0; FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE); FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);/*FRAMEWIN_SKINFLEX_PI_INACTIVE非活动状态的属性*/ Framewin_Props.Radius = 0; FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE); /*设置新创建窗口小工具的皮肤*/ FRAMEWIN_SetDefaultSkin (_FRAMEWIN_DrawSkinFlex/*FRAMEWIN_SKIN_FLEX的换肤回调函数*/); /*设置新创建的PROGBAR小工具的皮肤****/ PROGBAR_SetDefaultSkin (PROGBAR_SKIN_FLEX); /*设置新创建的 BUTTON 小工具的皮肤****/ BUTTON_SetDefaultSkin (BUTTON_SKIN_FLEX); /*设置新创建的 SCROLLBAR滑块 小工具的皮肤****/ SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX); /*设置新创建的 滑块 小工具的皮肤****/ SLIDER_SetDefaultSkin (SLIDER_SKIN_FLEX); /*设置新创建的 heder 小工具的皮肤****/ HEADER_SetDefaultSkin (HEADER_SKIN_FLEX); /* 设置文本绘制模式 */ GUI_SetTextMode (GUI_TM_TRANS); #if GUIDEMO_USE_VNC if (GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_VNC)) { _GUIDemoConfig.pGUI_VNC_X_StartServer(0, 0); } #endif #if GUIDEMO_USE_AUTO_BK // // Determine if HW has enough memory to draw the gradient circle as background // BitsPerPixel = LCD_GetBitsPerPixel(); if ((BitsPerPixel >= 16) && GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_AUTO_BK)) { NumFreeBytes = GUI_ALLOC_GetNumFreeBytes(); if (NumFreeBytes > NUMBYTES_NEEDED) { _pfDrawBk = _DrawBkCircle; } else { _pfDrawBk = _DrawBk; } } else #endif { _pfDrawBk = _DrawBkSimple; } GUIDEMO_SetDrawLogo(1); while (1) { _Main(); } }