int main( int argc, char **argv ) { LCUI_Widget w, root, text; LCUI_Graph desktop_image; InitConsoleWindow(); LCUI_Init(); LCUIDisplay_SetMode( LDM_WINDOWED ); LCUIDisplay_SetSize( 960, 540 ); w = LCUIWidget_New("debug-widget"); text = LCUIWidget_New("textview"); Widget_Append( w, text ); TextView_SetTextW( text, L"测试文本内容,呵呵达!\nABCDEFG,abcdefg,[color=#ff0000]color font[/color]"); Widget_Top( w ); Widget_Show( w ); Widget_Resize( w, 320, 240 ); Widget_Move( w, 200, 200 ); Widget_SetTitleW( w, L"测试" ); Graph_Init( &desktop_image ); Graph_LoadImage( "images/background-image.png", &desktop_image ); root = LCUIWidget_GetRoot(); Widget_PullStyle( root, WSS_BACKGROUND ); root->style.background.color = RGB(255,242,223); root->style.background.image = desktop_image; root->style.background.size.using_value = TRUE; root->style.background.size.value = SV_COVER; Widget_PushStyle( root, WSS_BACKGROUND ); Widget_PullStyle( w, WSS_BACKGROUND | WSS_SHADOW | WSS_BORDER ); w->style.background.color.value = 0xccffffff; w->style.background.size.w.scale = 0.50; w->style.background.size.h.px = 200; w->style.background.size.w.type = SVT_SCALE; w->style.background.size.h.type = SVT_PX; w->style.background.size.using_value = FALSE; w->style.background.position.using_value = TRUE; w->style.background.position.value = SV_BOTTOM_CENTER; w->style.shadow.color = ARGB(200,0,122,204); w->style.shadow.x = 2; w->style.shadow.y = 2; w->style.shadow.spread = 0; w->style.shadow.blur = 8; w->style.border.top.width = 1; w->style.border.right.width = 1; w->style.border.bottom.width = 1; w->style.border.left.width = 1; w->style.border.top.color = RGB(0,122,204); w->style.border.right.color = RGB(0,122,204); w->style.border.bottom.color = RGB(0,122,204); w->style.border.left.color = RGB(0,122,204); Widget_PushStyle( w, WSS_BACKGROUND | WSS_SHADOW | WSS_BORDER ); //LCUITimer_Set( 5000, onTimer, NULL, TRUE ); return LCUI_Main(); }
void onTimer( void *arg ) { static int mode = LDM_SEAMLESS; _DEBUG_MSG("tip\n"); LCUIDisplay_SetMode( mode ); if( mode == LDM_SEAMLESS ) { mode = LDM_WINDOWED; } else { mode = LDM_SEAMLESS; } }
int main( int argc, char **argv ) { LCUI_Widget root, box; #ifdef LCUI_BUILD_IN_WIN32 InitConsoleWindow(); #endif LCUI_Init(); LCUIDisplay_SetMode( LDM_WINDOWED ); LCUIDisplay_SetSize( 960, 540 ); box = LCUIBuilder_LoadFile("hello.xml"); if( box ) { root = LCUIWidget_GetRoot(); Widget_Append( root, box ); Widget_Unwrap( &box ); } return LCUI_Main(); }