mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-12-01 16:56:34 +01:00
style(test): format code
This commit is contained in:
+20
-19
@@ -5,28 +5,29 @@
|
||||
#include <LCUI/gui/widget/textview.h>
|
||||
#include <LCUI/gui/widget/textedit.h>
|
||||
|
||||
static void OnBtnClick( LCUI_Widget self, LCUI_WidgetEvent e, void *arg )
|
||||
static void OnBtnClick(LCUI_Widget self, LCUI_WidgetEvent e, void *arg)
|
||||
{
|
||||
wchar_t str[256];
|
||||
LCUI_Widget edit = LCUIWidget_GetById( "edit" );
|
||||
LCUI_Widget txt = LCUIWidget_GetById( "text-hello" );
|
||||
TextEdit_GetTextW( edit, 0, 255, str );
|
||||
TextView_SetTextW( txt, str );
|
||||
wchar_t str[256];
|
||||
LCUI_Widget edit = LCUIWidget_GetById("edit");
|
||||
LCUI_Widget txt = LCUIWidget_GetById("text-hello");
|
||||
|
||||
TextEdit_GetTextW(edit, 0, 255, str);
|
||||
TextView_SetTextW(txt, str);
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
LCUI_Widget root, pack, btn;
|
||||
LCUI_Widget root, pack, btn;
|
||||
|
||||
LCUI_Init();
|
||||
root = LCUIWidget_GetRoot();
|
||||
pack = LCUIBuilder_LoadFile( "helloworld.xml" );
|
||||
if( !pack ) {
|
||||
return -1;
|
||||
}
|
||||
Widget_Append( root, pack );
|
||||
Widget_Unwrap( pack );
|
||||
btn = LCUIWidget_GetById( "btn" );
|
||||
Widget_BindEvent( btn, "click", OnBtnClick, NULL, NULL );
|
||||
return LCUI_Main();
|
||||
LCUI_Init();
|
||||
root = LCUIWidget_GetRoot();
|
||||
pack = LCUIBuilder_LoadFile("helloworld.xml");
|
||||
if (!pack) {
|
||||
return -1;
|
||||
}
|
||||
Widget_Append(root, pack);
|
||||
Widget_Unwrap(pack);
|
||||
btn = LCUIWidget_GetById("btn");
|
||||
Widget_BindEvent(btn, "click", OnBtnClick, NULL, NULL);
|
||||
return LCUI_Main();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ int test_textedit(void)
|
||||
value = String_New("property name is 'value'");
|
||||
Widget_BindProperty(w, "value", value);
|
||||
Widget_Update(w);
|
||||
CHECK(wcslen(L"property name is 'value'") == TextEdit_GetTextW(w, 0, 64, wcs));
|
||||
CHECK(wcslen(L"property name is 'value'") ==
|
||||
TextEdit_GetTextW(w, 0, 64, wcs));
|
||||
CHECK(wcscmp(L"property name is 'value'", wcs) == 0);
|
||||
|
||||
// change property value
|
||||
|
||||
Reference in New Issue
Block a user