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改变,没找到原因,如果有解答请回复