📄 wgui_categories_mms.c
字号:
#if defined(__MMI_T9_FRENCH__)
case INPUT_TYPE_SMART_UPPERCASE_FRENCH:
case INPUT_TYPE_SMART_LOWERCASE_FRENCH:
#endif
#if defined(__MMI_T9_GERMAN__)
case INPUT_TYPE_SMART_UPPERCASE_GERMAN:
case INPUT_TYPE_SMART_LOWERCASE_GERMAN:
#endif
#if defined(__MMI_T9_ITALIAN__)
case INPUT_TYPE_SMART_UPPERCASE_ITALIAN:
case INPUT_TYPE_SMART_LOWERCASE_ITALIAN:
#endif
// PMT BHASKAR START 20052907
#if defined(__MMI_T9_VIETNAMESE__)
case INPUT_TYPE_SMART_UPPERCASE_VIETNAMESE:
case INPUT_TYPE_SMART_LOWERCASE_VIETNAMESE:
#endif
// PMT BHASKAR END 20052907
//PMT Gurdev Start 20050729
#if defined(__MMI_T9_INDONESIAN__)
case INPUT_TYPE_SMART_UPPERCASE_INDONESIAN:
case INPUT_TYPE_SMART_LOWERCASE_INDONESIAN:
#endif
//PMT Gurdev End 20050729
//PMT CZ_PO_TU START 20050812
#if defined(__MMI_T9_CZECH__)
case INPUT_TYPE_SMART_UPPERCASE_CZECH:
case INPUT_TYPE_SMART_LOWERCASE_CZECH:
#endif
//PMT CZ_PO_TU END 20050812
//PMT CZ_PO_TU START 20050812
#if defined(__MMI_T9_TURKISH__)
case INPUT_TYPE_SMART_UPPERCASE_TURKISH:
case INPUT_TYPE_SMART_LOWERCASE_TURKISH:
#endif
//PMT CZ_PO_TU END 20050812
//PMT SHARIQ START 20050729
#if defined(__MMI_T9_PORTUGUESE__)
case INPUT_TYPE_SMART_UPPERCASE_PORTUGUESE:
case INPUT_TYPE_SMART_LOWERCASE_PORTUGUESE:
#endif
//PMT SHARIQ END 20050729
//PMT START HU_FI 20050825
#if defined(__MMI_T9_FINNISH__)
case INPUT_TYPE_SMART_UPPERCASE_FINNISH:
case INPUT_TYPE_SMART_LOWERCASE_FINNISH:
#endif
#if defined(__MMI_T9_HUNGARIAN__)
case INPUT_TYPE_SMART_UPPERCASE_HUNGARIAN:
case INPUT_TYPE_SMART_LOWERCASE_HUNGARIAN:
#endif
//PMT END HU_FI 20050825
//PMT NO_AR_SL_DU START 20050909
#if defined(__MMI_T9_ARABIC__)
case INPUT_TYPE_SMART_ARABIC:
#endif
//PMT VIKAS GUPTA START 20051129
#if defined(__MMI_T9_HINDI__)
case INPUT_TYPE_SMART_HINDI:
#endif
//PMT VIKAS GUPTA END 20051129
//Norwegian start
#if defined(__MMI_T9_NORWEGIAN__)
case INPUT_TYPE_SMART_UPPERCASE_NORWEGIAN:
case INPUT_TYPE_SMART_LOWERCASE_NORWEGIAN:
#endif
//Norwegian end
//START DUTCH_T9 20051021
#if defined(__MMI_T9_DUTCH__)
case INPUT_TYPE_SMART_UPPERCASE_DUTCH:
case INPUT_TYPE_SMART_LOWERCASE_DUTCH:
#endif
//END DUTCH_T9 20051021
//PMT NO_AR_SL_DU END 20050909
T9SynT9WithInputBox();
break;
}
#endif /* __MMI_T9__ */
}
/*****************************************************************************
* Global Variable
*****************************************************************************/
/*****************************************************************************
* Global Function
*****************************************************************************/
void DrawCate275CategoryControlArea(dm_coordinates * coordinate)
{
show_title_status_icon();
CAT275_CTX->draw_title_fp(CAT275_CTX->identifier);
wgui_show_inputbox();
//W05.46 Fix Category275 Display Issue
#if !defined(__MMI_FULL_SCREEN_EDITOR__)
category275_hide_multitap(); /* For the first time display */
#endif
if( RedrawSpellingOrCandidateBoxesFunction)
RedrawSpellingOrCandidateBoxesFunction();
}
/*----------------------------------------------------------------------------
Function: RedrawCategory275Screen
Description: Redraws the category275 screen
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void RedrawCategory275Screen(void)
{
pixtel_UI_lock_double_buffer();
clear_screen();
CAT275_CTX->draw_title_fp(CAT275_CTX->identifier);
#if defined(__MMI_FULL_SCREEN_EDITOR__)
category275_hide_multitap(); /* For the first time display */
#endif
wgui_show_inputbox();
#if !defined(__MMI_FULL_SCREEN_EDITOR__)
category275_hide_multitap(); /* For the first time display */
#endif
show_softkey_background();
show_left_softkey();
show_right_softkey();
pixtel_UI_unlock_double_buffer();
pixtel_UI_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1);
if( RedrawSpellingOrCandidateBoxesFunction)
RedrawSpellingOrCandidateBoxesFunction();
}
void SetCategory275RightSoftkeyFunction(void (*f)(void),MMI_key_event_type k)
{
UI_UNUSED_PARAMETER(k);
wgui_inputbox_RSK_function=f;
}
/*----------------------------------------------------------------------------
Function: Category275GotoHead
Description: Invoked after ShowCategory275Screen
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void Category275GotoTop(void)
{
MMI_multiline_inputbox.cursor_p = MMI_multiline_inputbox.text;
MMI_multiline_inputbox.flags|=UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
pixtel_UI_show_multi_line_input_box(&MMI_multiline_inputbox);
MMI_multiline_inputbox.flags&=~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
category275_sync_with_T9();
MMI_multiline_inputbox.text_offset_y=0;
pixtel_UI_show_multi_line_input_box(&MMI_multiline_inputbox);
}
/*----------------------------------------------------------------------------
Function: Category275GotoBottom
Description: Invoked after ShowCategory275Screen
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void Category275GotoBottom(void)
{
if (MMI_multiline_inputbox.text_length >= 2)
{
MMI_multiline_inputbox.cursor_p = (UI_buffer_type)((U8*)(MMI_multiline_inputbox.text) + (MMI_multiline_inputbox.text_length-2));
}
MMI_multiline_inputbox.flags|=UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
pixtel_UI_show_multi_line_input_box(&MMI_multiline_inputbox);
MMI_multiline_inputbox.flags&=~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
category275_sync_with_T9();
if (MMI_multiline_inputbox.text_height > MMI_multiline_inputbox.edit_height)
{
MMI_multiline_inputbox.text_offset_y = MMI_multiline_inputbox.edit_height - MMI_multiline_inputbox.text_height;
}
pixtel_UI_show_multi_line_input_box(&MMI_multiline_inputbox);
}
/*----------------------------------------------------------------------------
Function: Category275SetUnmodified
Description: Set that category 275 is unmodified.
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void Category275SetUnmodified(void)
{
g_mmi_gui_cat275_modified = FALSE;
}
/*----------------------------------------------------------------------------
Function: Category275CheckIfModified
Description:
Input Parameters: none
Output Parameters: none
Returns: Whether category 275 is modified.
----------------------------------------------------------------------------*/
BOOL Category275CheckIfModified(void)
{
return g_mmi_gui_cat275_modified;
}
void cat275_virtual_keypad_callback(void)
{
#if defined(__MMI_TOUCH_SCREEN__)
mmi_pen_editor_resize_multiline_input_box_for_vk();
#endif
}
/*----------------------------------------------------------------------------
Function: ShowCategory275Screen
Description: Displays the category275 screen
Input Parameters: [1] U32 identifier, Used as parameter for the callback functions described before
[2] STRING_ID left_softkey, Left softkey label
[3] IMAGE_ID left_softkey_icon, Icon for the left softkey
[4] STRING_ID right_softkey, Right softkey label
[5] IMAGE_ID right_softkey_icon, Icon for the right softkey
[6] INPUT_TYPE input_type, Type of input to use
[7] BUFFER buffer Buffer the input box should use.
[8] INT buffer_size Size of the buffer.
...
[] BYTE* history_buffer history buffer
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void ShowCategory275Screen( U32 identifier,
U16 left_softkey, U16 left_softkey_icon, U16 right_softkey, U16 right_softkey_icon,
s16 input_type, U8* buffer, S32 buffer_size, U16 vbar_width,
mmi_wgui_cat275_draw_title_hdlr draw_title_fp,
U16 draw_area_1_height, mmi_wgui_cat275_draw_area_hdlr draw_area_1_fp,
U16 draw_area_2_height, mmi_wgui_cat275_draw_area_hdlr draw_area_2_fp,
U8* history_buffer)
{
dm_data_struct dm_data;
S32 inputbox_height;
/* Setup context */
g_mmi_gui_cat275_context_p = OslMalloc(sizeof(mmi_gui_cat275_context_struct));
CAT275_CTX->identifier = identifier;
CAT275_CTX->draw_title_fp = draw_title_fp;
CAT275_CTX->draw_area_1_fp = draw_area_1_fp;
CAT275_CTX->draw_area_2_fp = draw_area_2_fp;
CAT275_CTX->draw_area_1_height = draw_area_1_height;
CAT275_CTX->draw_area_2_height = draw_area_2_height;
/* Setup layout */
pixtel_UI_lock_double_buffer();
MMI_menu_shortcut_number=-1;
MMI_disable_title_shortcut_display=1;
change_left_softkey(left_softkey,left_softkey_icon);
change_right_softkey(right_softkey,right_softkey_icon);
SetupCategoryKeyHandlers();
/* Input box */
#ifdef __MMI_T9__
InuptMethodEnterCategory5();
#elif defined __MMI_ZI__
ZiInuptMethodEnterCategory5();
#elif defined __MMI_KA__
KonkaInuptMethodEnterCategory5();
#elif defined __MMI_ITAP__
ItapInuptMethodEnterCategory5();
#elif defined(__MMI_GB__)//InuptMethodEnterCategory5
GBInputMethodEnterCategory5();
#endif
register_hide_multitap(category275_hide_multitap);
wgui_setup_inputbox_ext(0, MMI_content_y,
MMI_content_width,
#if defined(__MMI_FULL_SCREEN_EDITOR__)
MMI_content_height,
#else
MMI_content_height-MMI_multitap_height,
#endif
buffer, buffer_size,
MMI_CATEGORY275_ID, get_string(right_softkey), get_image(right_softkey_icon),
input_type, history_buffer, 1,
UI_MULTI_LINE_INPUT_BOX_DRAW_UNDERLINE,
#if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__) // TODO: tune style 4
(S16)(draw_area_1_height + draw_area_2_height + CAT275_MIN_LINE_HEIGHT * 2),
#else
(S16)(draw_area_1_height + draw_area_2_height + CAT275_MIN_LINE_HEIGHT),
#endif /* __MMI_MAINLCD_176X220__ || __MMI_MAINLCD_240X320__ */
CAT275_MIN_LINE_HEIGHT,
(S16) draw_area_1_height, (S16) draw_area_2_height,
NULL);
#if defined(__MMI_FULL_SCREEN_EDITOR__)
inputbox_height = MMI_content_height - wgui_inputbox_information_bar_height;
#else
inputbox_height = MMI_content_height-MMI_multitap_height - wgui_inputbox_information_bar_height;
#endif
if(MMI_multiline_inputbox.height > inputbox_height)
pixtel_UI_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
/* Input box attributes */
MMI_multiline_inputbox.header_callback = category275_header_callback;
MMI_multiline_inputbox.footer_callback = category275_footer_callback;
MMI_multiline_inputbox.change_callback = category275_change_callback;
/* Disable editor border and set background color of multitap*/
CAT275_CTX->backup_normal_filler = MMI_multiline_inputbox.normal_filler;
if (MMI_multiline_inputbox.normal_filler)
{
if ((MMI_multiline_inputbox.normal_filler->flags & UI_FILLED_AREA_MASK_TYPE) == UI_FILLED_AREA_TYPE_COLOR)
{
g_mmi_gui_cat275_editor_filler.flags = UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_BORDER;
g_mmi_gui_cat275_editor_filler.c = MMI_multiline_inputbox.normal_filler->c;
/* Tricky. Use multitap text color as editor border color */
g_mmi_gui_cat275_editor_filler.border_color = *current_MMI_theme->multitap_normal_text_color;
MMI_multiline_inputbox.normal_filler = (UI_filled_area*)&g_mmi_gui_cat275_editor_filler;
}
}
CAT275_CTX->backup_multitap_filler = current_multitap_input_theme->f;
g_mmi_gui_cat275_multitap_filler = *(current_multitap_input_theme->f);
g_mmi_gui_cat275_multitap_filler.c = category275_get_multitap_color();
current_multitap_input_theme->f = (UI_filled_area*) &g_mmi_gui_cat275_multitap_filler;
set_MMI_multitap_theme();
/* 070505 Calvin Start */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -