static uint32_t ScrMain_OnInitialize( SWGTScreen* pScreen ) { WGT_Screen_Initialize( pScreen, GUICLR_WHITE, NULL ) ; if ( g_demo_parameters.dwBacklight > 2 ) { g_WGT_CoreData.pBE->IOCtl( DISP_BACKEND_IOCTL_SET_BACKLIGHT, (uint32_t*)g_demo_parameters.dwBacklight, NULL ) ; } else { g_WGT_CoreData.pBE->IOCtl( DISP_BACKEND_IOCTL_SET_BACKLIGHT, (uint32_t*)14, NULL ) ; } WGT_CreateWidget( &g_btnAudio, WGT_TYPE_BUTTON, 14, 62, 64, 64 ) ; WGT_SetBitmap( &g_btnAudio, (void*)"/demo/bitmaps/btn_audio.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnAudio ) ; WGT_CreateWidget( &g_btnVideo, WGT_TYPE_BUTTON, 92, 60, 64, 64 ) ; WGT_SetBitmap( &g_btnVideo, (void*)"/demo/bitmaps/btn_video.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnVideo ) ; WGT_CreateWidget( &g_btnSlideShow, WGT_TYPE_BUTTON, 166, 61, 70, 63 ) ; WGT_SetBitmap( &g_btnSlideShow, (void*)"/demo/bitmaps/btn_slideshow.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnSlideShow ) ; WGT_CreateWidget( &g_btnSettings, WGT_TYPE_BUTTON, 18, 140, 59, 60 ) ; WGT_SetBitmap( &g_btnSettings, (void*)"/demo/bitmaps/btn_settings.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnSettings ) ; #if defined DEMO_USE_QTOUCH WGT_CreateWidget( &g_btnQTouch, WGT_TYPE_BUTTON, 95, 165-26, 69, 69 ) ; WGT_SetBitmap( &g_btnQTouch, (void*)"/demo/bitmaps/btn_qtouch.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnQTouch ) ; WGT_CreateWidget( &g_btnLPModes, WGT_TYPE_BUTTON, 184, 140, 47, 67 ) ; WGT_SetBitmap( &g_btnLPModes, (void*)"/demo/bitmaps/btn_low_power_modes.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnLPModes ) ; WGT_CreateWidget( &g_btnInfos, WGT_TYPE_BUTTON, 100, 217, 62, 62 ) ; WGT_SetBitmap( &g_btnInfos, (void*)"/demo/bitmaps/btn_infos.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnInfos ) ; #else WGT_CreateWidget( &g_btnLPModes, WGT_TYPE_BUTTON, 98, 140, 47, 67 ) ; WGT_SetBitmap( &g_btnLPModes, (void*)"/demo/bitmaps/btn_low_power_modes.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnLPModes ) ; WGT_CreateWidget( &g_btnInfos, WGT_TYPE_BUTTON, 166, 145, 62, 62 ) ; WGT_SetBitmap( &g_btnInfos, (void*)"/demo/bitmaps/btn_infos.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnInfos ) ; #endif // defined DEMO_USE_QTOUCH WGT_CreateWidget( &g_wgt_Status, WGT_TYPE_TEXT, 0, 300, BOARD_LCD_WIDTH, 20 ) ; WGT_SetText( &g_wgt_Status, NULL ) ; WGT_SetBkgndColor( &g_wgt_Status, GUICLR_WHITE ) ; WGT_SetTextColor( &g_wgt_Status, GUICLR_ATMEL_BLUE ) ; WGT_Screen_AddWidget( pScreen, &g_wgt_Status ) ; return SAMGUI_E_OK ; }
static uint32_t ScrAudio_OnInitialize( SWGTScreen* pScreen ) { //@code WGT_Screen_Initialize( pScreen, GUICLR_WHITE, NULL ) ;//initial data structure WGT_CreateWidget( &g_bmpUnderConstruction, WGT_TYPE_BITMAP, 87, 81, 70, 84 ) ; WGT_SetBitmap( &g_bmpUnderConstruction, (void*)"/demo/bitmaps/bmp_under_construction.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_bmpUnderConstruction ) ; WGT_CreateWidget( &g_btnBack, WGT_TYPE_BUTTON, 12, 252, 48, 48 ) ; WGT_SetBitmap( &g_btnBack, (void*)"/demo/bitmaps/btn_back.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnBack ) ; //@endcode return SAMGUI_E_OK ; }
static uint32_t _ScrSettings_Date_OnInitialize( SWGTScreen* pScreen ) { WGT_Screen_Initialize( pScreen, GUICLR_WHITE, NULL ) ; WGT_CreateWidget( &g_btnUpDay, WGT_TYPE_BUTTON, 43,96, 43, 31 ) ; WGT_SetBitmap( &g_btnUpDay, (void*)"/demo/bitmaps/btn_up.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnUpDay ) ; WGT_CreateWidget( &g_wgt_Day, WGT_TYPE_TEXT, 43+12, 135, 22, 14 ) ; WGT_SetText( &g_wgt_Day, "DD" ) ; WGT_SetBkgndColor( &g_wgt_Day, GUICLR_WHITE ) ; WGT_SetTextColor( &g_wgt_Day, GUICLR_ATMEL_BLUE ) ; WGT_Screen_AddWidget( pScreen, &g_wgt_Day ) ; WGT_CreateWidget( &g_btnDownDay, WGT_TYPE_BUTTON, 43, 164, 43, 31 ) ; WGT_SetBitmap( &g_btnDownDay, (void*)"/demo/bitmaps/btn_down.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnDownDay ) ; WGT_CreateWidget( &g_btnUpMonth, WGT_TYPE_BUTTON, 104,96, 43, 31 ) ; WGT_SetBitmap( &g_btnUpMonth, (void*)"/demo/bitmaps/btn_up.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnUpMonth ) ; WGT_CreateWidget( &g_wgt_Month, WGT_TYPE_TEXT, 104+12, 135, 22, 14 ) ; WGT_SetText( &g_wgt_Month, "MM" ) ; WGT_SetBkgndColor( &g_wgt_Month, GUICLR_WHITE ) ; WGT_SetTextColor( &g_wgt_Month, GUICLR_ATMEL_BLUE ) ; WGT_Screen_AddWidget( pScreen, &g_wgt_Month ) ; WGT_CreateWidget( &g_btnDownMonth, WGT_TYPE_BUTTON, 104, 164, 43, 31 ) ; WGT_SetBitmap( &g_btnDownMonth, (void*)"/demo/bitmaps/btn_down.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnDownMonth ) ; WGT_CreateWidget( &g_btnUpYear, WGT_TYPE_BUTTON, 162, 96, 43, 31 ) ; WGT_SetBitmap( &g_btnUpYear, (void*)"/demo/bitmaps/btn_up.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnUpYear ) ; WGT_CreateWidget( &g_wgt_Year, WGT_TYPE_TEXT, 162+12, 135, 22, 14 ) ; WGT_SetText( &g_wgt_Year, "YY" ) ; WGT_SetBkgndColor( &g_wgt_Year, GUICLR_WHITE ) ; WGT_SetTextColor( &g_wgt_Year, GUICLR_ATMEL_BLUE ) ; WGT_Screen_AddWidget( pScreen, &g_wgt_Year ) ; WGT_CreateWidget( &g_btnDownYear, WGT_TYPE_BUTTON, 162, 164, 43, 31 ) ; WGT_SetBitmap( &g_btnDownYear, (void*)"/demo/bitmaps/btn_down.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnDownYear ) ; WGT_CreateWidget( &g_btnBack, WGT_TYPE_BUTTON, 12, 252, 48, 48 ) ; WGT_SetBitmap( &g_btnBack, (void*)"/demo/bitmaps/btn_back.bmp" ) ; WGT_Screen_AddWidget( pScreen, &g_btnBack ) ; gs_dwDay=g_demo_parameters.dwDay ; gs_dwMonth=g_demo_parameters.dwMonth ; gs_dwYear=g_demo_parameters.dwYear ; // Initialize text widgets with parameters data _ScrSettings_Date_SetDay() ; _ScrSettings_Date_SetMonth() ; _ScrSettings_Date_SetYear() ; return SAMGUI_E_OK ; }