⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmieditor.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
*******************************************************************************/
static int editor_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) 
{
    T_EDITOR_INFO * data = (T_EDITOR_INFO *)win->user;
    //zgz, 2002.8.27 add  for upper layer update
    T_MFW_HND       parent_win = data->parent;
    USHORT          Identifier = data->editor_data.Identifier;
    T_EDIT_CB       Callback   = data->editor_data.Callback;
    MfwHdr *edit_hdr=(MfwHdr *)data->edt_edt;
    MfwEdt *edit_controll=(MfwEdt *)edit_hdr->data;
    char Trace_data[10];    
    int currentTheme;
    //zgz, 2002.8.27 add  END
    UINT32 oldColor,oldFontColor;
    T_DISPLAY_DATA display_info;  //XSF ADD 12.03
    MMI_TRACE_EVENT(("sunsj-------------editor_win_cb()"));

    if( data EQ 0 )
    {
        return MFW_EVENT_CONSUMED;
    }

    //zgz,2002.7.5 Mobile Innovation
    if( data->edt_mode EQ E_MOBILEINNOVATION_MODE )
    {
        if( data->edt_edt != getactiveEditor() )
            ec_editActivate(data->edt_edt,data->editor_data.mode);
    }
    else
    {
        if( data->edt_edt!=activeEditor() )
            editActivate(data->edt_edt,data->editor_data.mode);

    }
    /* zgz,2002.7.5 Mobile Innovation     
          if (data->edt_edt!=activeEditor())
          editActivate(data->edt_edt,data->editor_data.mode);
    */      
    //editActivate(data->edt_edt,data->editor_data.mode);

    // SH - hidden mode

    if( data->editor_data.hide )
        editHiddenActivate(data->tmpBuf);

    // end hidden mode


    switch( event )
    {
    case E_WIN_VISIBLE: /* window is visible  */
        if( win->flags & E_WIN_VISIBLE )
        {
            /*
             * Clear Screen
             */
            MmiTrace("edior_win_cb");
            if( Identifier==CARD_REJECTED )
            {
                //dspl_Clear(0, 0, 104, 16);
                //dspl_Clear(0, 16, 120, 160);
                /* 2004/06/08 sunsj modify */
                dspl_Clear(0, 0, SCREEN_SIZE_X, CHINESE_MENU_VERTICAL_SIZE);
            }
            /* 2003/10/13 sunsj mark for remove mmihz.c & mmihzapi.c */
            /*else if (editForChineseInput)
            {
                TRACE_EVENT("exiting from chineseinput");
                if (wstrlen(data->editor_data.editor_attr.text) == 0)
                    displaySoftKeys(data->editor_data.LeftSoftKey, TxtSoftBack);
                else
                    displaySoftKeys(data->editor_data.LeftSoftKey, data->editor_data.RightSoftKey);
                return MFW_EVENT_CONSUMED;
            }*/
            else
            {
                dspl_ClearAll();
            }

            TRACE_EVENT("not exiting from chineseinput");

            if( Callback&&data->editor_data.edtInPbk )            //zgz add, 2002.8.27 indicate upper layer to update
                (Callback) (parent_win, 1, INFO_EDT_UPDATE);
            if( Callback && data->editor_data.Identifier==SMSREAD_EDIT )
                (Callback) (parent_win, 1, INFO_EDT_UPDATE);
            /*
             * Print the information
             */
#ifdef EASY_TEXT_ENABLED
            if( AllowPredText == TRUE && FFS_flashData.PredTextSelected == TRUE )
            {
                dspl_BitBlt(75,0,Mmi_layout_line_height(),Mmi_layout_line_height(),0,(char*)TextIconeZiTextSmall,0);
            }
#endif
            /****************************************************
            yq added to instead the edtshow
            ****************************************************/
            /*			edit_controll->attr->win.px=data->editor_data.editor_attr.win.px;
                        edit_controll->attr->win.py=data->editor_data.editor_attr.win.py;
                        edit_controll->attr->win.sx=data->editor_data.editor_attr.win.sx;
                        edit_controll->attr->win.sy=data->editor_data.editor_attr.win.sy;
                        if(wstrlen(data->editor_data.editor_attr.text)==0)
                            {
                                edit_controll->cp_curr_width=8;
                                edit_controll->cp_curr_x=data->editor_data.editor_attr.win.px;
                                edit_controll->cp_curr_y=data->editor_data.editor_attr.win.py;
                                edit_controll->cp_last_x=edit_controll->cp_curr_x;
                                edit_controll->cp_last_y=edit_controll->cp_curr_y;
                                edit_controll->cp=0;
                            }
                        else
                            {
                                edit_controll->cp_curr_width=8;
                                Setcursor(edit_controll,data->editor_data.editor_attr.text,data->editor_data.editor_attr.win);
                                dspl_TextOut(data->editor_data.editor_attr.win.px,data->editor_data.editor_attr.win.py,0,data->editor_data.editor_attr.text);			
                            }
                        inputIndicate_update(edit_controll);				
                        
                        dspl_DrawLine(edit_controll->cp_last_x,edit_controll->cp_last_y+15,edit_controll->cp_last_x+edit_controll->cp_curr_width-1,edit_controll->cp_last_y+15);
            /****************************************************
            end yq added
            ****************************************************/
            /* 2003/12/01 sunsj remove because edtshow will do the same thing */
            //updateWindow(edit_controll, 0);
            /* 2003/11/1 sunsj phone input need not display editor */
            if( data->editor_data.edtInPbk == 1 )
            {
                /* 2003/12/01 sunsj add update widow */
                updateWindow(edit_controll, 0);

                //2004-04-05 Sunny add
                edtShow(data->edt_edt);
            }
            else
            {
                edtShow(data->edt_edt);
            }
            /* 2003/11/10 sunsj */  
            if( wstrlen(edit_controll->attr->text)!=0&&(edit_controll->attr->mode)!=0&&(edit_controll->cp_curr_x!=15) )
                edtChar(data->edt_edt,ecBottom);
            /*
             * Print the label
             */
            //GW Removed T9 reference
            //GW Actually remove T9 ref, not code executed when T9 not enabled.
            /* 2003/11/1 sunsj modify title display */
            if( data->editor_data.TextId NEQ 0 )
            {
                if( data->editor_data.Identifier EQ CARD_REJECTED )  //xsf add 2002.10.24
                    PROMPT(10,22,0,data->editor_data.TextId);
                else
                {
                    /* 2004/01/14 sunsj modify for title */
#if 0
                    int title_x=0;
                    char *title;

                    currentTheme=FlashSettingData.theme;
                    //dspl_BitBlt(0, 0, menuup[currentTheme].area.sx, menuup[currentTheme].area.sy, 0, (void*)menuup[currentTheme].icons, 0);

                    title = (char *) MmiRsrcGetText(data->editor_data.TextId);
                    /*
                    if ( title != NULL )
                    {
                        title_x = get_StringWidth(title);
                        /* 2003/12/04 sunsj modify for global value
                        drawcolorclarity((SCREEN_SIZE_X-title_x)/2,1 ,title, 0x000000);
                    }
                    */
#endif
                    char *title;

                    title = (char *) MmiRsrcGetText(data->editor_data.TextId);
					/* 2004/05/19 sunsj remove */
                    //displayTitle( 0, title, 0, TITLE_MIDDLE, 0, 0);
                    //PROMPT(editor_menuArea.px,editor_menuArea.py,0,data->editor_data.TextId);
                }
            }
            else if( data->editor_data.TextString NEQ NULL )
            {
                /* sunsj modiyf for STK title */
				char spareNum[4];
				MfwEdt *edt = ((MfwHdr *) data->edt_edt)->data;
				if( getSymbolNumSpare(edt) >= 0 )
				{
					sprintf(spareNum, "%3d", getSymbolNumSpare(edt));
				}
				else
				{
					sprintf(spareNum, "%3d", 0);
				}
				/* 2004/04/22 sunsj modify */
				MMI_TRACE_EVENT(("sunsj------------there is no textstring"));
				//displayTitle( 0, data->LabelText, 0, TITLE_MIDDLE, 0, 0);
				displayTitle( 0, data->LabelText, spareNum, 4, 0, 0);
				/*
                if( data->editor_data.Identifier==SAT_SEND_SMS||data->editor_data.Identifier==SAT_SEND_SS
                    ||data->editor_data.Identifier==SAT_CALL_RESULT )
                    dspl_TextOut(editor_menuArea.px,editor_menuArea.py,0,data->LabelText);
                else
                {
                    currentTheme=FlashSettingData.theme;
                    dspl_BitBlt(0, 0, menuup[currentTheme].area.sx, menuup[currentTheme].area.sy, 0, (void*)menuup[currentTheme].icons, 0);
                    drawcolorclarity(editor_menuArea.px,editor_menuArea.py,data->LabelText,0x000000);
                }
				*/
                //  dspl_TextOut(editor_menuArea.px,editor_menuArea.py,0,data->LabelText);
                //dspl_TextOut(editor_menuArea.px,editor_menuArea.py,DSPL_TXTATTR_UNICODE|DSPL_TXTATTR_CURRENT_MODE	,data->editor_data.TextString);//zhaowm
            }
            /*
             oldColor=dspl_GetBkgColor();
             dspl_SetBkgColor(GetPreDefinedColor(ColorSoftKeyBG));
             oldFontColor=dspl_GetFrgColor();
             dspl_SetFrgColor(GetPreDefinedColor(ColorSoftKeyFont));  
             */

            if( data->edt_mode == E_PIN_SECURITY )//xsf add for no simcard 11.28
            {
/* zhq, 2004/07/08, modified for we will use pin_outer_wait to init sub screen
and only refresh sub screen until main screen drawIdle. */
            	  main_sreen_init_complete = TRUE;
		  drawOuterIdle();
                if( !wstrlen(data->editor_data.editor_attr.text) && (data->edt_anim_win EQ 0) )
                {
                    dspl_SetBkgColor(0xffffff);
                    //dspl_Clear(10,50,100,100);                 
                    dialog_info_init(&display_info);
                    display_info.KeyEvents    = KEY_0|KEY_1|KEY_2|KEY_3|KEY_4|KEY_5|KEY_6|KEY_7|KEY_8|KEY_9|KEY_STAR|KEY_ABC;
                    display_info.TextId2       = TxtInvalidCard;  //TxtInvalidCard;
                    display_info.TextId      = 0;  
                    display_info.TextString   = 0; 
                    display_info.TextString2  = 0;  
                    display_info.LeftSoftKey  = '\0';
                    display_info.RightSoftKey = '\0';
                    display_info.Identifier  = StartAnimNoSimcard;
                    display_info.Time         = FOREVER;  
                    display_info.Callback     = (T_VOID_FUNC)nosimcard_animation_cb;
                    data->edt_anim_win = info_dialog (data->edt_win , &display_info);

		    /* 2004/07/13 sunsj modify */
                    mmi_dialogs_insert_fixmov_animation(data->edt_anim_win , 500 ,NOSIMCARDANIM);/*2003/12/16, wangyan modify*/  
                }
            }
            /*
             * Print the softkeys
             */
            if( data->edt_mode != E_PIN_SECURITY )
            {
#ifdef EASY_TEXT_ENABLED
                if( data->editor_data.editor_attr.predText[0] != '\0' && FFS_flashData.PredTextSelected == TRUE )
                    displaySoftKeys(TxtSoftOK, TxtDelete);
                else
#endif
                {
                    /* 2004/03/24 sunsj modify for softkey display*/
                    if( wstrlen(data->editor_data.editor_attr.text) < data->editor_data.min_enter ) // zgz, 2002.7.11 it should be changed. function strlen is wrong for unicode string
                    {
                        if( data->editor_data.edtInPbk )
                        {
                            if( wstrlen(data->editor_data.editor_attr.text) ==0 )
                                displaySoftKeys(data->editor_data.AlternateLeftSoftKey, TxtSoftBack);
                            else
                                displaySoftKeys(data->editor_data.LeftSoftKey,TxtDelete);
                            (Callback) (parent_win, Identifier, INFO_EDT_UPDATE); 
                        }
                        else if( wstrlen(data->editor_data.editor_attr.text) == 0 && data->editor_data.edtInPbk==0 )
                        {
                            displaySoftKeys(data->editor_data.AlternateLeftSoftKey, TxtSoftBack);
                        }
                        else if( data->editor_data.edtInPbk == 0 )/* entered less than the required number of chars: Alternate Softkey appears */
                        {
                            displaySoftKeys(data->editor_data.LeftSoftKey, data->editor_data.RightSoftKey);
                        }
                        else if( Callback&&(data->editor_data.edtInPbk) )
                        {
                            displaySoftKeys(TxtNull, TxtDelete);
                            (Callback) (parent_win, 0, INFO_EDT_UPDATE); 
                        }
                    }
                    else
                    {
                        /* 2004/03/24 sunsj modify for softkey display*/
                        if( data->editor_data.edtInPbk )
                        {
                            if( wstrlen(data->editor_data.editor_attr.text) ==0 )
                                displaySoftKeys(data->editor_data.AlternateLeftSoftKey, TxtSoftBack);
                            else
                                displaySoftKeys(data->editor_data.LeftSoftKey,TxtDelete);
                            (Callback) (parent_win, Identifier, INFO_EDT_UPDATE); 
                        }
                        else if( wstrlen(data->editor_data.editor_attr.text) == 0 && data->editor_data.edtInPbk==0 )
                            displaySoftKeys(data->editor_data.AlternateLeftSoftKey, TxtSoftBack);
                        else if( data->editor_data.edtInPbk == 0 )/* entered less than the required number of chars: Alternate Softkey appears */
                            displaySoftKeys(data->editor_data.LeftSoftKey, data->editor_data.RightSoftKey);
                        else if( Callback && (data->editor_data.edtInPbk) )             //zgz add, 2002.8.27 indicate upper layer to update
                        {
                            displaySoftKeys(TxtNull, TxtDelete);
                            (Callback) (parent_win, 0, INFO_EDT_UPDATE); 
                        }
                    }
                }
            }
            else
            {
                if( data->emergency_call EQ TRUE )
                {
                    displaySoftKeys(TxtSoftCall, data->editor_data.RightSoftKey);
                    TRACE_EVENT ("softkeys , call, delete");
                }
                else
                {
                    //no emergency_call
                    if( strlen(data->editor_data.editor_attr.text) < data->editor_data.min_enter )
                    {


                        if( strlen(data->editor_data.editor_attr.text) EQ 0 )
                            displaySoftKeys(data->editor_data.AlternateLeftSoftKey, TxtNull);
                        else
                            displaySoftKeys(data->editor_data.AlternateLeftSoftKey, data->editor_data.RightSoftKey);

                        TRACE_EVENT ("softkeys , altern, delete");
                    }
                    else
                    {
                        if( strlen(data->editor_data.editor_attr.text) EQ 0 )
                            displaySoftKeys(data->editor_data.AlternateLeftSoftKey, TxtNull);
                        else
                            displaySoftKeys(data->editor_data.LeftSoftKey, data->editor_data.RightSoftKey);

                        TRACE_EVENT ("softkeys , ok, delete");
                    }
                }

            }
            /*
            dspl_SetBkgColor(oldColor);
            dspl_SetFrgColor(oldFontColor);
            */

        }
        break;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -