Пример #1
0
int Set_Label_TextStyle( LCUI_Widget *widget, LCUI_TextStyle style )
/* 为Label部件内显示的文本设定文本样式 */
{
	LCUI_TextLayer *layer;
	layer = Get_Widget_PrivData( widget );
	TextLayer_Text_Set_Default_Style( layer, style );
	Update_Label( widget );
	return 0;
}
Пример #2
0
int 
Label_TextStyle( LCUI_Widget *widget, LCUI_TextStyle style )
/* 为Label部件内显示的文本设定文本样式 */
{
	LCUI_Label *label;
	
	label = Get_Widget_PrivData( widget );
	TextLayer_Text_Set_Default_Style( &label->layer, style );
	Draw_Widget( widget ); 
	return 0;
}
Пример #3
0
int
TextLayer_Text( LCUI_TextLayer *layer, char *new_text )
/* 设定整个文本图层中需显示的文本,原有选中文本被删除 */
{
	DEBUG_MSG("enter\n"); 
	uint_t i, rows;
	LCUI_TextLayer new_layer;

	TextLayer_Init( &new_layer );
	TextLayer_Text_Set_Default_Style( &new_layer, layer->default_data);
	TextLayer_Using_StyleTags( &new_layer, layer->using_style_tags );
	TextLayer_Text_Process( &new_layer, new_text );
	/* 合并两个文本图层,记录不同字所在区域,等待处理刷新 */
	TextLayer_Merge( layer, &new_layer ); 
	TextLayer_Text_GenerateBMP( layer ); 
	/* 更新每一行文本位图的尺寸 */
	rows = Queue_Get_Total( &layer->rows_data );
	for(i=0; i<rows; ++i) {
		TextLayer_Update_RowSize( layer, i );
	}
	Destroy_TextLayer( &new_layer );  
	DEBUG_MSG("quit\n");
	return 0;
}