VIA 标题的滚动显示处理

           
印尼语inbox菜单进入后,标题处滚动显示有重叠的问题
与此前修改过的问题,某些MenuCtrl的标题不滚动,当时把[uimenuvendor.cpp ProcessAnimationTitle()]中Redraw的参数由-1改为-2
全屏刷新。后来驱动改变的下层参数,改为-5为全屏刷新,问题就出在驱动只改了其中一处uinormalmenuvendor.cpp中的Redraw[A]函数,还有uihugenormalmenuvendor.cpp中的函数没有改,由于Redraw[B]的多态性,从normalmenu调ProcessAnimationTitle将会调用Redraw[A],而Hugenormalmenu调用ProcessAnimationTitle将会调用Redraw[B],修改方法:同时改动Redraw[B]与Redraw[A]一样,问题解决。 

Message–>Outbox中,标题显示 的详细步骤:
   [appsms.cpp]
 1. MailHandlerResultT
SMSApplicationC::OnOutbox(void)
       {
messsageListOutboxMenuP = new HugeMenuControlC();
messsageListOutboxMenuP->SetHugeMenuItemVendor(smsOutboxMenuItemVendorP);//填充
mOutboxDialogP->AddChildWindow(messsageListOutboxMenuP);
//加入Dialog
DialogStackP->PushDialog(mOutboxDialogP); //Push的时候会进行 绘制
     ===> MailHub.SendWindowMailMsg(VTUI_PAINT, ALL_WINDOWS, 0, 0);
       }
2.[uimenucontrol.cpp]中对此VTUI_PAINT消息进行处理
 ON_MAIL_NOARGS(VTUI_PAINT,
MenuControlC::OnPaint)
 MailHandlerResultT
MenuControlC::OnPaint()
 {
   ReDraw();
   return
CONTINUE_MAIL_DELIVERY;
 }
 void MenuControlC::ReDraw(int16
Item)
 {
    if(mMenuVendorP != NULL)
      
mMenuVendorP->
ReDraw(Item);//此处的ReDraw具有多态性,此时应调用uihugenormalmenuvendor.cpp中的ReDraw()
 }
3.[uihugenormalmenuvendor.cpp]
 void
HugeNormalMenuVendorC::ReDraw(int16 Item)
{
    Draw();
    if(Item == -1)//refresh the whole
menu
     
HwdUpdateDisplayRect(NULL,GetMenuRect());
    else if(Item == -2)//refresh the
Selected item
     ………………………
}
 void
HugeNormalMenuVendorC::Draw()
 {
   /*title*/
 if( GetMenuTitle() != NULL &&
!(GetMenuFlags() & FLAG_MENU_NOT_DISPLAY_TITLE))
     DrawTitle();
//
uinormalmenuvendor.cpp中的DrawTitle
  /*scroll
bar*/
   ManageScrollBar();
   if(mScrollBarP != NULL)
   {
     
mScrollBarP->SetScrollRange(GetItemArray(
)->GetSize(),GetItemCount());
     
mScrollBarP->SetScrollPos(mFirstVisibleItem,true);
   }
  /*item*/
   uint16 LineCount = GetMenuLines()
;
   uint16 ItemCount = GetItemArray(
)->GetSize();
   LineCount = ItemCount >
LineCount ? LineCount : ItemCount;
   }
4.[uinormalmenuvendor.cpp]
 void NormalMenuVendorC::DrawTitle(
uint16 Line )
 {
     
if(GetMenuFlags()&FLAG_MENU_TITLE_SHOW_COUNT)
      {//TITLE SHOW COUNT
        uint16 Count =
GetItemCount();
        uint16 Selected =
mMenuControlP->GetSelectedItem() + 1;
        char tempCount[10];
       
memset(tempCount,’\0′,10);
       
//sprintf(tempCount,"(%d/%d)",Count,Selected);
      
sprintf(tempCount,"(%d/%d)",Count > 0 ? Selected : 0,Count);
         StringT* tempTitle;
        StringT* strCount =
StringCreate(0, strlen(tempCount), tempCount);
        tempTitle =
StringCat(GetMenuTitle(), strCount);
         DrawTitleText(mSelectedItem,
temp.x, temp.y , temp, tempTitle,DISP_HALIGN_CENTER);
                               
//
uimenuvendor.cpp中的DrawTitleText
        StringFree(tempTitle);
        StringFree(strCount);
   }
5.[uimenuvendor.cpp]
 void
MenuVendorC::DrawTitleText(uint16 Item,int16 x,int16 y,DispRectT Rect,
                     StringT*
stringRes,DispHAlignT Halign)
 {
      if(mAnimationTitleText <=
0)
      {
       mAnimationTitleText = 0;
       mTitleForward = true;
      
mTimerTitleText.StartWindowTimer(
VTUI_MENU_ANIMATION_TITLE,
(WindowHandleT)ALL_WINDOWS, (uint32)ANIMATION_TEXT,
(uint32)stringRes->CodePage, 1200);//延时一段时间执行,在此可直接跳回到第八步8
      }
   }
6.[ Uimenucontrol.cpp (ui)]: ON_MAIL_VOIDPTR(VTUI_MENU_ANIMATION_TITLE,
MenuControlC::OnAnimationTitle)
 MailHandlerResultT
MenuControlC::OnAnimationTitle(void *MailMsgP)
 {
   mMenuVendorP->ProcessAnimationTitle(TYPEA,TYPEB);
    return
CONTINUE_MAIL_DELIVERY;
 }
7.[uimenuvendor.cpp]
   void
MenuVendorC::ProcessAnimationTitle(uint32 type, uint32 codepage)
   {
     if(type ==
(uint32)ANIMATION_TEXT)
     {
       if(codepage ==
DISP_FNT_CP_LATIN1)
       {
         if(mTitleForward)
          
mAnimationTitleText++;
         else
          
mAnimationTitleText–;
       }
       else
       {
         if(mTitleForward)
          
mAnimationTitleText+=2;
         else
           mAnimationTitleText-=2;
       }
       ReDraw(-5); // ZJJ Change -2 to
-5 20080527
     }
8.[uihugenormalmenuvendor.cpp] //回到第3步的ReDraw继续Draw后的处理
 void
HugeNormalMenuVendorC::ReDraw(int16 Item)

 

开机后UIM卡验证过程

现在手机软件中的加锁方式有两种: SUPPORT_MIN_SID_LOCK=FALSE SUPPORT_MCC_MNC_LOCK=FALSE(还有对PIN PUK的验证)
 

[Uitask.cpp]Uitask()—–>UiPartInit()——>ChvAppInit(  { MailHub.SendMailMsg(CHVAPP_LAUNCH,NULL,0); }

[Appchv.cpp]    1.Chv_Initialize()
                            {

   ValChvGetStatus(ChvAppCGetStatusCB) ;// Get status

    }
  2.ValChvGetStatus()
   {
     /* Send the message to  UIM task */

     ExeMsgSend(EXE_UIM_ID, UIM_MAILBOX,
UIM_GET_STATUS_MSG, (void *) MsgP,

sizeof(UimCardStatusRecMsgT));   //  读取UIM卡里的数据给MsgP付值。

  }

3. void
ChvAppCGetStatusCB(ValChvStatusTresultStatus)

{

switch(ChvAppP->uimStatus.CardStatus){   

case
VAL_CHV_UIM_ENABLE: 
/* UIM card is enabled
*/

     #ifdef SUPPORT_MCC_MNC_LOCK
      ValUimGetMcc();
      #endif
       InitAfterPV();
     break;

 case VAL_CHV_UIM_CHV1:/*Waiting for correct
chv1(pin1) entry*/

     ChvAppP->isPINNeeded = true;
     ChvAppP->ChvDlgFor =  POWER_ON;

MailHub.PostGenericMailMsg(CHVAPP_CHV_CHECK, NULL, 0);     

     break;

case
VAL_CHV_UIM_PUK1:
/*Waiting for UNBLOCK1
entry and new CHV1 code*/

     ChvAppP->isPUKNeeded = true;   
     ChvAppP->DlgStatus = PUK_VERIFY;

MailHub.PostGenericMailMsg(CHVAPP_PUK_CHECK, NULL, 0);

     break;

   case
VAL_CHV_UIM_DISABLE:
  /* UIM card is not ready */    

   {
   #ifdef TATA_MIN_LOCK
     uint32 minlocknum = 0;
     uint32 opsize1 = sizeof(minlocknum);

     FsiSidbRead(ITEM_PHONE_MIN_LOCK,
KEY_PHONE_MIN_LOCK, (void *)&minlocknum, 0, &opsize1);

     if(minlocknum >= 5)
     {
       ChvAppP->MinLock();
     }
     else
   #endif
     {
       ChvAppP->NoUIM();//halt there
     }
    }
     break;

case
VAL_CHV_UIM_DEADLOCK:
/* UIM card deadlock
*/

 case VAL_CHV_UIM_NOTCDMA:/*NOT CDMA
CARD*/

     ChvAppP->UimDeadLocked(); //halt there
     break;
   default:
     break;
   }
}

开启PIN后 case
VAL_CHV_UIM_CHV1:
MailHub.PostGenericMailMsg(CHVAPP_CHV_CHECK, NULL, 0);

ChvAppC::ChvLock()

                               {
     unlock_by_input_CHV();
             {
   ChvAppP->mChvDlg->Create(IDD_ENTERPIN_DLG);//MsgID; CHVAPP_ENTER_PIN
             }
                               }
ChvAppC::unlock_by_input_CHV_OK()
                  {
   switch(ChvDlgFor){
case POWER_ON:

ValChvVerify(VAL_CHV1, EnteredPIN->StringLen,
(uint8*)(EnteredPIN->String),
 //输入的PINunlock_by_input_CHV_CB);

     break;
                  }

 void unlock_by_input_CHV_CB(ValChvOpResultT
OpResult)

  {
 case VAL_CHV_OP_SUCCESS: //若输入的PIN正确
     DialogStackP->CloseTopDialog(true);
     ChvAppP->mChvDlg= NULL;
     ChvAppP->ChvDlgFor = NONE;

     ChvAppP->uimStatus.Chv1LeftCount =
ChvAppP->uimStatus.ChvSum;

     ChvAppP->uimStatus.Puk1LeftCount =
ChvAppP->uimStatus.PukSum;

ChvAppP->sidb_write_storedCHV(ChvAppP->EnteredPIN);

     #ifdef SUPPORT_MCC_MNC_LOCK
      ValUimGetMcc();
      #endif
     InitAfterPV();
     break;

case
VAL_VAL_CHV_OP_FAILURE_AND_PERMIT_ATTEMPT:
//若输入的PIN不正确,提示重新输入

   {

     ChvAppP->uimStatus.Chv1LeftCount —
;   

     ChvAppP->ClearEditCtrl();
     ChvAppP->RefreshCount(PIN);

     SoftKeyBarControlC * SoftKeyP =
(SoftKeyBarControlC
*)ChvAppP->mChvDlg->GetControlByType(ControlC::SOFTKEYBAR_CONTROL_TYPE);

     MenuItemC * ItemP = new MenuItemC();

ItemP->Create(RCC_EMERGENCY_OPEN_MENUITEM);

     SoftKeyP->SetItem(0, ItemP, TRUE);

ChvAppP->OpenPopUp(IDS_INCORRECT_PIN_TEXT);

     break;
   }
  }