Dynamically changing CAknPopupFieldText
| Fri, 2006-02-03 21:25 | |
|
Does anyone know how to change the items in a CAknPopupFieldText or EAknCtPopupFieldText? I am at a lost... this is what I'm trying now:
Code: CAknPopupFieldText* field = static_cast <CAknPopupFieldText*>(ControlOrNull(EPopupFieldId)); const MDesCArray* array = field->MdcArray(); array->MdcaPoint(i); // does nothing CAknPopupFieldText does not have any members for changing the text. I am doing this from my CAknForm's PreLayoutDynInitL(). If it matters, here is the resource code: Code: RESOURCE FORM r_the_form { flags = EEikFormEditModeOnly | EAknDialogSelectionList; items = { // The service DLG_LINE { id = EPopupFieldId; type = EAknCtPopupFieldText; prompt = "Popup Field"; itemflags = EEikDlgItemSeparatorBefore | EEikDlgItemTakesEnterKey; control = POPUP_FIELD_TEXT { popupfield = POPUP_FIELD { width = 32; }; textarray = r_the_textarray; active = 0; }; } }; } So if I use resources to make a popup field on a form, am I out of luck or what? -euroq |
|






Forum posts: 149
RArray<TInt>
CAknQueryValueTextArray
CAknQueryValueText
-euroq
Forum posts: 7
Forum posts: 7
RArray<TInt>
CAknQueryValueTextArray
CAknQueryValueText
-euroq
For more details about the way to do it, here is the code:
CAknPopupField* mypopup=
STATIC_CAST(
CAknPopupField*,
ControlOrNull( EPopupID ) ) ;
CDesCArray* array = new (ELeave) CDesCArrayFlat( 8 );
array->AppendL( _L("January") );
array->AppendL( _L("February") );
array->AppendL( _L("March") );
array->AppendL( _L("April") );
array->AppendL( _L("May") );
array->AppendL( _L("June") );
CAknQueryValueTextArray* textArray =
CAknQueryValueTextArray::NewLC();
textArray->SetArray( *array );
CAknQueryValueText* queryVal = CAknQueryValueText::NewLC();
queryVal->SetArrayL( textArray );
queryVal->SetCurrentValueIndex( 0 ); mypopup->SetQueryValueL( queryVal );
Forum posts: 1
Hi, I am using the previous code, but I have a problem:
In the last line:
mypopup->SetQueryValueL(queryVal);
I have this problem:
illegal access from 'CAknPopupFieldText' to protected/private member 'CAknPopupFieldText::SetQueryValueL(MAknQueryValue *)'
Does someone know which is the problem?
Thanks in advance
Forum posts: 80
Use the base class CAknPopupField to set the query value
// Get the handle to control //(ControlOrNull(EOppFormPopUpCtrlId));
CAknPopupField* accountNameEditor = static_cast
CDesCArray* array = new (ELeave) CDesCArrayFlat( 2 );
TBuf16<100> temp16;
temp16.Copy(_L("Vasant"));
array->AppendL( temp16 );
textArray = CAknQueryValueTextArray::NewL();
textArray->SetArray( *array );
queryVal = CAknQueryValueText::NewL();
queryVal->SetArrayL( textArray );
// Sets the query values set //
accountNameEditor->SetQueryValueL( queryVal );
Vasant Patel.
Sr. Software Engineer.
S60 2nd Ed., S60 3rd Ed., Win32.