📄 gui_fixed_menuitems.c
字号:
gui_BLT_double_buffer(
GUI_current_fixed_text_menuitem_x,
GUI_current_fixed_text_menuitem_y,
GUI_current_fixed_text_menuitem_x + GUI_current_fixed_text_menuitem_common_data->width - 1,
GUI_current_fixed_text_menuitem_y + GUI_current_fixed_text_menuitem_common_data->height - 1);
}
gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_text_menuitem_scroll_handler);
}
/*****************************************************************************
* FUNCTION
* gui_fixed_text_menuitem_start_scroll
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void gui_fixed_text_menuitem_start_scroll(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
fixed_text_menuitem_type *t = (fixed_text_menuitem_type*) GUI_current_fixed_text_menuitem_data;
fixed_text_menuitem *m = (fixed_text_menuitem*) GUI_current_fixed_text_menuitem_common_data;
S32 w;
U32 flags;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
flags = m->flags;
flags |= t->flags;
gui_set_font(m->text_font);
w = gui_get_string_width(t->text);
m->text_width = w;
m->scroll_x = 0;
if (w >= (m->scroll_width - 1))
{
#if(UI_USE_WORD_SCROLLING_TEXT)
GUI_current_fixed_text_menuitem_scroll_text = t->text;
GUI_current_fixed_text_menuitem_scroll = 1;
GUI_current_fixed_text_menuitem_scroll_direction = 0;
GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
if (gui_get_current_list_effect() && gblock_list_effect != 1)
{
gui_register_callback_menuitem_scroll(gui_fixed_text_menuitem_scroll_handler);
}
else
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
{
gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_text_menuitem_scroll_handler);
}
#else /* (UI_USE_WORD_SCROLLING_TEXT) */
if ((flags & UI_MENUITEM_MARQUEE_SCROLL) || (flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
{
GUI_current_fixed_text_menuitem_scroll = 1;
GUI_current_fixed_text_menuitem_scroll_direction = 0;
GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
if (gui_get_current_list_effect() && gblock_list_effect != 1)
{
gui_register_callback_menuitem_scroll(gui_fixed_text_menuitem_scroll_handler);
}
else
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
{
gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_text_menuitem_scroll_handler);
}
}
#endif /* (UI_USE_WORD_SCROLLING_TEXT) */
}
else
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
{
gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
GUI_current_fixed_text_menuitem_scroll = 0;
}
#else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
{
GUI_current_fixed_text_menuitem_scroll = 0;
}
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
}
/*****************************************************************************
* FUNCTION
* gui_fixed_text_menuitem_stop_scroll
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void gui_fixed_text_menuitem_stop_scroll(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (GUI_current_fixed_text_menuitem_scroll)
{
gui_cancel_timer(gui_fixed_text_menuitem_scroll_handler);
GUI_current_fixed_text_menuitem_scroll = 0;
}
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
gui_restore_current_list_effect();
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
}
/*****************************************************************************
* FUNCTION
* gui_show_fixed_text_menuitem
* DESCRIPTION
* Displays the fixed text menuitem
* PARAMETERS
* item [IN] Is a specific fixed text menuitem object
* common_item_data [IN] Is the fixed text menuitem object (common_data)
* x [IN] Is the position at which the menuitem is displayed
* y [IN] Is the position at which the menuitem is displayed
* RETURNS
* void
*****************************************************************************/
void gui_show_fixed_text_menuitem(void *item, void *common_item_data, S32 x, S32 y)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 x1, y1, x2, y2;
S32 text_x, text_y;
color text_color;
UI_filled_area *f = NULL;
fixed_text_menuitem *m = (fixed_text_menuitem*) common_item_data;
fixed_text_menuitem_type *mi = (fixed_text_menuitem_type*) item;
U32 flags;
UI_string_type _text;
S32 sw, sh;
//zx add begin 20070507
#ifdef __MT170_UI_STYLE__
UI_filled_area symbol_picker_select_filler={
UI_FILLED_AREA_TYPE_COLOR,
UI_IMAGE_ID_NULL,
NULL,
{73,157,209,100},
{0,0,0,100},
{0,0,0,0},
{0,0,0,100},
0};
#endif
//zx add end
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
flags = mi->flags;
flags |= m->flags;
_text = mi->text;
if (flags & UI_MENUITEM_STATE_FOCUSSED)
{
GUI_current_fixed_text_menuitem_x = x;
GUI_current_fixed_text_menuitem_y = y;
}
/* Autocalculate the text position based on font */
gui_set_font(m->text_font);
gui_measure_string(_text, &sw, &sh);
if (flags & UI_MENUITEM_CENTER_TEXT_X)
{
if (m->width > sw)
{
m->text_x = (m->width >> 1) - (sw >> 1);
}
else
{
m->text_x = 0;
}
}
if (flags & UI_MENUITEM_CENTER_TEXT_Y)
{
if (m->height > sh)
{
m->text_y = (m->height >> 1) - (sh >> 1);
}
else
{
m->text_y = 0;
}
}
x1 = x;
y1 = y;
y2 = y1 + m->height - 1;
x2 = x1 + m->width - 1;
if (r2lMMIFlag)
{
text_x = m->width - 1 - m->text_x;
}
else
{
text_x = m->text_x;
}
text_y = m->text_y;
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
/* To hide the text of the menuitem up to the last frame for flash feel effect */
if (gblock_list_effect == 0)
{
if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING)
{
if (flash_feel_last_frame == 0)
{
if (flags & UI_MENUITEM_STATE_FOCUSSED)
{
flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
}
}
}
}
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
if (flags & UI_MENUITEM_STATE_FOCUSSED)
{
text_x += m->scroll_x;
}
if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
{
if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
{
f = m->focussed_filler;
}
text_color = m->focussed_text_color;
}
else if (flags & UI_MENUITEM_STATE_DISABLED)
{
if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
{
f = m->disabled_filler;
}
text_color = m->focussed_text_color;
}
else if (flags & UI_MENUITEM_STATE_SELECTED)
{
f = m->selected_filler;
text_color = m->selected_text_color;
}
else
{
if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
{
f = m->normal_filler;
}
text_color = m->normal_text_color;
}
if (f != NULL)
{
#ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
if (is_draw_next_frame_list_highlight_effect_value())
#endif
{
g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_TEXT_ITEM;
}
#endif
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
#ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
if (r2lMMIFlag)
{
gui_draw_list_filled_area(x1 + 1, y1 + 1, x2, y2, f);
}
else
{
gui_draw_list_filled_area(x1, y1 + 1, x2 - 1, y2, f);
}
#else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
//zx modfiy begin 20070507
#ifdef __MT170_UI_STYLE__
if(GetActiveScreenId()==SCR_SYMBOL_PICKER_SCREEN)
gui_draw_list_filled_area(x1, y1, x2, y2, &symbol_picker_select_filler);
else
gui_draw_list_filled_area(x1, y1, x2, y2, f);
#else
gui_draw_list_filled_area(x1, y1, x2, y2, f);
#endif
//zx modify end
#endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
#else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
//zx modfiy begin 20070507
#ifdef __MT170_UI_STYLE__
if(GetActiveScreenId()==SCR_SYMBOL_PICKER_SCREEN)
gui_draw_filled_area(x1, y1, x2, y2, &symbol_picker_select_filler);
else
gui_draw_filled_area(x1, y1, x2, y2, f);
#else
gui_draw_filled_area(x1, y1, x2, y2, f);
#endif
//zx modify end
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
}
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
/* To hide the text of the menuitem up to the last frame for flash feel effect */
if (!
((gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING) &&
(flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY) && (gblock_list_effect == 0)))
#endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
{
gui_push_text_clip();
gui_set_text_clip(x1, y1, x2, y2);
gui_move_text_cursor(x1 + text_x, y1 + text_y);
gui_set_line_height(sh);
//zx modify begin 20070507
//#ifdef __MT170_UI_STYLE__// wangbei del 20070703
#if defined (__MT170_UI_STYLE__) || defined (__MT118_A_UI_STYLE__)// wangbei add 20070703
// wangbei add 20070423
if(GetActiveScreenId()==SCR_SYMBOL_PICKER_SCREEN)
gui_set_text_color(gui_color(91,45,45));
else
gui_set_text_color(text_color);
// wangbei add end
#else
gui_set_text_color(text_color);
#endif
//zx modify end
#if(UI_USE_WORD_SCROLLING_TEXT)
if ((flags & UI_MENUITEM_STATE_FOCUSSED) && GUI_current_fixed_text_menuitem_scroll)
{
GUI_current_fixed_text_menuitem_scroll_text_end = GUI_current_fixed_text_menuitem_scroll_text;
if (gui_print_truncated_text2
(x1 + text_x, y1 + text_y, m->width, &GUI_current_fixed_text_menuitem_scroll_text_end))
{
GUI_current_fixed_text_menuitem_scroll_text_end = _text;
}
}
else
{
gui_print_truncated_text2(x1 + text_x, y1 + text_y, m->width, &_text);
}
#else /* (UI_USE_WORD_SCROLLING_TEXT) */
gui_print_text(_text);
if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_MARQUEE_SCROLL) &&
GUI_current_fixed_text_menuitem_scroll)
{
if (r2lMMIFlag)
{
gui_move_text_cursor(x1 + text_x - (m->text_width + UI_text_menuitem_scroll_gap), y1 + text_y);
}
else
{
gui_move_text_cursor(x1 + text_x + m->text_width + UI_text_menuitem_scroll_gap, y1 + text_y);
}
gui_set_line_height(sh);
gui_print_text(_text);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -