Ejemplo n.º 1
0
/*!
 * \brief 短按删除键处理函数
 * \param void 
 * \return 
 * \note 
 * \example
 * \author weizhiping
 * \date 2010-10-9 9:49:29
*/
void GBInputBox_DeletkeyHandler(void)
{
#if __MTK__ > 0
	PCLayoutAbstract pltAbstractObj = Global_GetCurrentLayoutObject();
	PCLayoutControl pLtCtl = Global_GetLayoutCtl();
	
	gui_reset_clip();
	gdi_layer_lock_frame_buffer();    
	gui_push_clip();
	gui_push_text_clip();

	if (pLtCtl->engineOutputInfo.bCandWindOpen)
	{
// 		pltAbstractObj->bSendEngineKeyEvent = GBTrue;
// 		pltAbstractObj->engineKeyEvent = GBKEY_BACK;
// 		Global_FillEventGroup(GBIME_CT_NORMAL_KEY_UP, GBKEY_BACK, 0);
		GBEngine_SendKeyEvent(Global_GetEnineInstance(), GBKEY_BACK, 0);//引擎pOutputString没有更新[BUG 611]
		//GBIME_Paint();
	}
	else
	{
		GBInputBox_DeleteChar();
	}

	gui_pop_clip();
	gui_pop_text_clip();    
	gdi_layer_unlock_frame_buffer();
	gdi_lcd_repaint_all();

	GBInputBox_UpdateSoftKeyLabel();
#endif
}
Ejemplo n.º 2
0
/*!
 * \brief 长按删除处理函数
 * \param void 
 * \return 
 * \note 
 * \example
 * \author weizhiping
 * \date 2010-10-9 9:49:00
*/
void GBInputBox_DeleteAllHandler(void)
{
#if __MTK__ > 0
	PCLayoutControl pLtCtl = Global_GetLayoutCtl();

	gui_reset_clip();
	gdi_layer_lock_frame_buffer();    
	gui_push_clip();
	gui_push_text_clip();

	// 循环清空引擎输入串内容
	if (pLtCtl->engineOutputInfo.bCandWindOpen)
	{
		GBEngine_Reset(Global_GetEnineInstance());
		//while (pEngineOutputInfo->.inputStringLen > 0)
		{
			//GBEventHandler(GBKEY_BACK, 0);//引擎pOutputString没有更新[BUG 611]		
		}
		//GBIME_Paint();
	}
	else // 清空编辑器输入框内容
	{
		// 		if(!GBInputBoxIsEmpty() && gbCurInputBox.pfDeleteAll)
		// 		{
		// 			(*gbCurInputBox.pfDeleteAll)();
		// 		}
		// 		mmi_imc_message_struct msg_ptr;
		// 		msg_ptr.message_id = MMI_IMC_MESSAGE_CLEAR_ALL;
		// 		msg_ptr.param_0 = 1;
		// 		msg_ptr.param_1 = 0;
		// 		mmi_imc_send_message( &msg_ptr );
		GBInputBox_DeleteAll();
	}

	gui_pop_clip();
	gui_pop_text_clip();    
	gdi_layer_unlock_frame_buffer();
	gdi_lcd_repaint_all();
	
	// 重置功能按键及引擎状态并关闭候选框
	//GBResetFuncKey();
	//GBInputMethodReset();
	//GBDrawCandWnd(1);
#endif
}
Ejemplo n.º 3
0
/*****************************************************************************
 * FUNCTION
 *  mmi_pen_editor_enable_multi_block_handwriting
 * DESCRIPTION
 *  Change from the main virtual keybaord mode to the multi-block handwriting mode. Enable the stroke mode.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_pen_editor_enable_multi_block_handwriting(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    int changed_height = 0;
    U16 input_type_only = MMI_current_input_type & INPUT_TYPE_MASK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_pen_editor_hide_virtual_keyboard_area();
	changed_height = mmi_pen_editor_get_candidate_box_height();
    if (changed_height < MMI_virtual_keyboard.height)
    {
        changed_height = MMI_virtual_keyboard.height;
        if (mmi_pen_editor_is_there_vk_candidate_box())
        {
            changed_height += (mmi_pen_editor_get_candidate_box_height() + 1);
        }
        mmi_pen_editor_set_it_has_vk_candidate_box_or_not(MMI_FALSE);
    }
    changed_height -= PEN_EDITOR_BLOCK_HEIGHT;
	gui_reset_clip();
	mmi_pen_editor_resize_content_area(changed_height);
    mmi_pen_editor_draw_handwriting_block();
    wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
    if (PEN_EDITOR_INLINE_TEXT == mmi_pen_editor_get_input_box_type()
        || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == mmi_pen_editor_get_input_box_type())
    {
        s32 temp_multiline_height = MMI_multiline_inputbox.height;
        MMI_BOOL temp_VKCandidate = mmi_pen_editor_is_there_vk_candidate_box();
        gui_virtual_keyboard_language_enum keyboard_type = MMI_virtual_keyboard.lang_type;

        mmi_pen_editor_vk_list_menu_resize();
        if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == mmi_pen_editor_get_input_box_type())
        {
            gui_resize_multi_line_input_box(
                &MMI_multiline_inputbox,
                MMI_multiline_inputbox.width,
                temp_multiline_height);
            redraw_fixed_list();
            redraw_current_inline_item();
           mmi_pen_editor_set_it_has_vk_candidate_box_or_not(temp_VKCandidate);
        }
        wgui_setup_virtual_keyboard(keyboard_type);
    }
    wgui_move_virtual_keyboard(
        MMI_virtual_keyboard.x,
        MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + 3);
    mmi_pen_editor_clear_and_show_virtual_keyboard_area();
    if (!(INPUT_TYPE_NUMERIC_PASSWORD == input_type_only ||
          INPUT_TYPE_SAT_NUMERIC_PASSWORD == input_type_only) && (!g_pen_editor_disable_handwriting))
    {
		    g_multi_block_stroke_area[0].x1 = 3;
            g_multi_block_stroke_area[0].y1 =
                MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT +
                mmi_pen_editor_compute_candidate_input_box_height() + 4;
            g_multi_block_stroke_area[0].x2 = (UI_device_width >> 1) - 2;
		    g_multi_block_stroke_area[0].y2 = MMI_content_y + MMI_content_height - 3;
		    g_multi_block_stroke_area[1].x1 = (UI_device_width >> 1) + 1;
            g_multi_block_stroke_area[1].y1 =
                MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT +
                mmi_pen_editor_compute_candidate_input_box_height() + 4;
            g_multi_block_stroke_area[1].x2 = UI_device_width - 3;
		    g_multi_block_stroke_area[1].y2 = MMI_content_y + MMI_content_height - 3;

		mmi_pen_editor_set_handwriting_enabled_or_not(MMI_TRUE);
        mmi_pen_start_capture_strokes(
            PEN_EDITOR_STROKE_BUFFER_SIZE,
            gPenEditorStrokeBuffer,
            2,
            g_multi_block_stroke_area,
            NULL);
        memcpy(
            &g_pen_editor_original_handwriting_area,
            &g_multi_block_stroke_area[0],
            sizeof(mmi_pen_handwriting_area_struct));
        
        /*
         * 06.38 Fixing LSK/RSK didnt be properly set when changing state 
         * from Virtual Keyboard to Multi-Block HandWriting in the case of
         * Candidate Inputbox in selection state.
         */
        mmi_pen_editor_reset_LSK_and_RSK_state();

        mmi_pen_register_stroke_down_handler(mmi_pen_editor_multi_block_stroke_down_handler);
        mmi_pen_register_stroke_move_handler(NULL, NULL, mmi_pen_editor_multi_block_stroke_move_handler);
        mmi_pen_register_stroke_up_handler(mmi_pen_editor_multi_block_stroke_up_handler);

        mmi_pen_editor_hand_writing_initialize();  //forrest

        mmi_pen_begin_strokes_of_character();
    }