yangyi
项目合作联系我: yangyi_love@hotmail.com

导航

 

RESOURCE FORM r_numericeditor_form
 {
 flags = EEikFormEditModeOnly| EEikFormUseDoubleSpacedFormat;
 items =
  {
  DLG_LINE
   {
   type = EEikCtEdwin;
   prompt = CONFIG_NAME_TXT;
   id = EDialogNameTxt;
   control = EDWIN
    {
    width = 10;
    maxlength = 50;
    };
   },
    DLG_LINE
   {
   type = EAknCtPopupFieldText;
   prompt = YESORNOSENGPAIPAILE_TXT;
   id = ESendToPPL;
   itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
   control = POPUP_FIELD_TEXT
   {
    popupfield = POPUP_FIELD
    {
     width = 10;//KMaxPowerLength;
    };
    textarray = r_info_popup_yesnoarray;
    active =1;
   };
    };
 }


RESOURCE ARRAY r_info_popup_yesnoarray
    {
    items =
        {
        LBUF
            {
            txt = "yes";
            },
 LBUF
     {
     txt = ""no;
     }
        };

    }

需要重载的函数:
private: // from CAknForm

 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);

 TBool SaveFormDataL();

 void DoNotSaveFormDataL();

 void PostLayoutDynInitL();
 TBool OkToExitL(TInt aButtonId);//为了解决右软件(确定)无效的问题由他来替代SaveFormDataL();所完成的功能

TBool CNumericEditorForm::OkToExitL(TInt aButtonId){
CEikEdwin* desEditor1 = static_cast<CEikEdwin*>(ControlOrNull(EDialogDescripTxt));

 if (desEditor1)
  {
  desEditor1->GetText(iDes1);

  }
CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(ESendToPPL));
 if (popupFieldText)
{
popupFieldText->CurrentValueIndex(); //获得当前所选择的单选按牛ID
}


LoadFormValuesFromDataL()中
CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(ESendToPPL));
 if (popupFieldText)
{
popupFieldText->SetCurrentValueIndex(Tint  ??); }//这里指定当前被选中的单选按牛,但是会有个问题就是默认的文字总是不会随着当前载入的ID改变,没找到原因,如果有解答请回复

posted on 2006-04-28 17:26  谁是菜鸟?  阅读(1287)  评论(2编辑  收藏  举报