예제 #1
0
static FtkWidget* ftk_bluetooth_create_window(void)
{
	FtkWidget *widget;
	FtkListRender* render = NULL;

	FtkWidget* win =  ftk_app_window_create();
	ftk_window_set_animation_hint(win, "app_main_window");

	ftk_widget_set_text(win, "블루투스");

	widget = ftk_label_create(win, 10, 10, 220, 30);
	ftk_widget_set_id(widget, IDC_INFO);
	ftk_widget_set_text(widget, "검색 중");

	widget = ftk_list_view_create(win, 10, 40, 220, 200);
	ftk_list_view_set_clicked_listener(widget, _bt_on_item_clicked, win);
	ftk_widget_set_id(widget, IDC_LIST);

	_model = ftk_list_model_default_create(10);
	render = ftk_list_render_default_create();

	ftk_list_render_default_set_marquee_attr(render,
			FTK_MARQUEE_AUTO | FTK_MARQUEE_RIGHT2LEFT | FTK_MARQUEE_FOREVER);

	ftk_list_view_init(widget, _model, render, 40);
	ftk_list_model_unref(_model);

	_timer = ftk_source_timer_create(300, _bt_scan_start, win);
	ftk_main_loop_add_source(ftk_default_main_loop(), _timer);

	return win;
}
예제 #2
0
FtkWidget* ftk_file_browser_create(FtkFileBrowserType type)
{
	FtkListModel* model = NULL;
	FtkListRender* render = NULL;	
	FtkPrepareOptionsMenu option_menu = NULL;
	FtkWidget* win  = ftk_app_window_create();
	PrivInfo* priv  = FTK_NEW(PrivInfo);
	FtkWidget* list = ftk_list_view_create(win, 0, 0, ftk_widget_width(win), ftk_widget_height(win));

	if(type == FTK_FILE_BROWER_APP)
	{
		option_menu = ftk_file_browser_on_prepare_options_menu;
	}
	else
	{
		option_menu = ftk_file_browser_on_prepare_options_menu_for_choose;
	}
	ftk_app_window_set_on_prepare_options_menu(win, option_menu, win);

	model = ftk_list_model_default_create(10);
	render = ftk_list_render_default_create();

	priv->type = type;
	priv->model = model;
	priv->list_view = list;
	ftk_list_view_init(list, model, render, 40);
	ftk_widget_set_text(win, _("File Browser"));
	ftk_widget_set_user_data(win, priv_info_destroy, priv);
	ftk_list_view_set_clicked_listener(list, ftk_file_browser_on_item_clicked, win);
	ftk_list_render_default_set_marquee_attr(render, 
		FTK_MARQUEE_AUTO | FTK_MARQUEE_RIGHT2LEFT | FTK_MARQUEE_FOREVER);
	ftk_list_model_unref(model);

	return win;
}