TextBox_Text( LCUI_Widget *widget, char *utf8_text ) { wchar_t *unicode_text; LCUICharset_UTF8ToUnicode( utf8_text, &unicode_text ); TextBox_TextW( widget, unicode_text ); free( unicode_text ); }
void GameWindow_InitLicenseWindow(void) { window = Widget_New("window"); label_license = Widget_New("label"); textbox_license = Widget_New("text_box"); box = Widget_New(NULL); btn_ok = Widget_New("button"); Window_ClientArea_Add( window, label_license ); Window_ClientArea_Add( window, box ); Window_ClientArea_Add( window, btn_ok ); Widget_Container_Add( box, textbox_license ); Widget_SetBackgroundColor( label_license, RGB(255,255,255) ); Widget_SetBackgroundTransparent( label_license, FALSE ); Widget_SetAlign( label_license, ALIGN_TOP_CENTER, Pos(0,0) ); Widget_SetAlign( box, ALIGN_TOP_CENTER, Pos(0,8) ); Widget_SetAlign( btn_ok, ALIGN_BOTTOM_CENTER, Pos(0,-5) ); Label_TextW( label_license, TEXT_LICENSE ); Button_TextW( btn_ok, TEXT_OK ); TextBox_SetAutoWrap( textbox_license, TRUE ); TextBox_SetMultiline( textbox_license, TRUE ); TextBox_SetReadOnly( textbox_license, TRUE ); TextBox_SetUsingStyleTags( textbox_license, TRUE ); TextBox_TextW( textbox_license, license_text ); TextBox_ShowCursor( textbox_license, FALSE ); Widget_SetStyleID( window, WINDOW_STYLE_LINE ); Widget_SetPadding( Window_GetClientArea(window), Padding(10,10,10,10) ); Widget_SetAutoSize( btn_ok, FALSE, 0 ); Widget_SetBorder( box, Border(1,BORDER_STYLE_SOLID,RGB(200,200,200)) ); Widget_SetPadding( box, Padding(10,10,10,10) ); Widget_SetSize( box, "100%", "280px" ); Widget_SetSize( textbox_license, "100%", "100%" ); Widget_Resize( window, WINDOW_SIZE ); Widget_Resize( btn_ok, BTN_SIZE ); Widget_ConnectEvent( btn_ok, EVENT_CLICKED, btn_ok_on_clicked ); Widget_Show( textbox_license ); Widget_Show( box ); Widget_Show( label_license ); Widget_Show( btn_ok ); }