int WEXPORT WListBox::insertString( const char *s, int index ) { /**************************************************************/ int newIndex; if( index < 0 ) { GUIAddText( parent()->handle(), controlId(), (char *)s ); newIndex = count() - 1; } else { GUIInsertText( parent()->handle(), controlId(), index, (char *)s ); newIndex = index; } if( count() == 1 ) { select( 0 ); } return newIndex; }
// ---------------------------------------------------------------------------- // CAknExPopFieldMultiPageDialog::ConfigurePageTimeL() // Configuration values (time) into Popup Fields. // ---------------------------------------------------------------------------- // void CAknExPopFieldMultiPageDialog::ConfigurePageTimeL() { // Calculate number of pop-up field. TInt index( KAknExPopFieldMultiPageIndexInitialize ); TInt count( KAknExPopFieldMultiPageCountInitialize ); TInt controlId( KAknExPopFieldMultiPageControlIdInitialize ); CAknPopupField* popup[ KAknExPopFieldMaxMultiPageValueField ]; for ( index = KAknExPopFieldMultiPageIndexInitialize; index < KAknExPopFieldMaxMultiPageValueField; index++ ) { popup[ index ] = NULL; controlId = EAknExPopFieldDlgCtrlIdTime01 + index; CCoeControl* control = ControlOrNull( controlId ); if ( control ) { popup[ count ] = static_cast<CAknPopupField*> ( control ); count++; } } // create an array of time TBuf<KAknExPopFieldArrayTextBufLength> text( NULL ); iCoeEnv->ReadResource( text, R_AKNEXPOPFIELD_TIME_INITIAL_TEXT ); iTimeArray = new ( ELeave ) CArrayFixFlat<TTime>( KAknExPopFieldMultiPageInitialArrayElementCount ); TTime value( text ); TInt step( KAknExPopFieldStepInitialize ); for ( step = KAknExPopFieldStepInitialize; step < KAknExPopFieldTimeArrayStepNumber; step++ ) { iTimeArray->AppendL( value ); value += KAknExPopFieldTimeArrayStepHour; } // wrap the time array iValueTimeArray = CAknQueryValueTimeArray::NewL( R_AKNEXPOPFIELD_TIME_FORMAT_STRING_TEXT ); iValueTimeArray->SetArray( *iTimeArray ); // set the same array into all the values, and set initial index values for ( index = KAknExPopFieldMultiPageIndexInitialize; index < count; index++ ) { iTimeValues[ index ] = CAknQueryValueTime::NewL(); iTimeValues[ index ]->SetArrayL( iValueTimeArray ); iTimeValues[ index ]->SetCurrentValueIndex( NULL ); iTimeValues[ index ]->SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT ); } // set values into popup fields for ( index = KAknExPopFieldMultiPageIndexInitialize; index < count; index++ ) { popup[ index ]->SetQueryValueL( iTimeValues[ index ] ); } }
void WEXPORT WListBox::getString( int index, WString& str ) { /***********************************************************/ char *list_item; list_item = GUIGetListItem( parent()->handle(), controlId(), index ); WString s( list_item ); GUIMemFree( list_item ); str = s; }
// ---------------------------------------------------------------------------- // CAknExPopFieldMultiPageDialog::ConfigurePageDurationL() // Configuration values (duration) into Popup Fields. // ---------------------------------------------------------------------------- // void CAknExPopFieldMultiPageDialog::ConfigurePageDurationL() { // Calculate number of pop-up field. TInt index( KAknExPopFieldMultiPageIndexInitialize ); TInt count( KAknExPopFieldMultiPageCountInitialize ); TInt controlId( KAknExPopFieldMultiPageControlIdInitialize ); CAknPopupField* popup[ KAknExPopFieldMaxMultiPageValueField ]; for ( index = KAknExPopFieldMultiPageIndexInitialize; index < KAknExPopFieldMaxMultiPageValueField; index++ ) { popup[index] = NULL; controlId = EAknExPopFieldDlgCtrlIdDura01 + index; CCoeControl* control = ControlOrNull( controlId ); if ( control ) { popup[ count ] = static_cast<CAknPopupField*> ( control ); count++; } } // create an array of duration iDurationArray = new ( ELeave ) CArrayFixFlat<TTimeIntervalSeconds>( KAknExPopFieldMultiPageInitialArrayElementCount ); TInt value( KAknExPopFieldValueInitialize ); for ( value = KAknExPopFieldDuraArrayMinimumValue; value < KAknExPopFieldDuraArrayMaximumValue; value += KAknExPopFieldDuraArrayStepValue ) { TTimeIntervalSeconds interval( value ); iDurationArray->AppendL( interval ); } // wrap the duration array iValueDurationArray = CAknQueryValueDurationArray::NewL( R_AKNEXPOPFIELD_DURA_FORMAT_STRING_TEXT ); iValueDurationArray->SetArray( *iDurationArray ); // set the same array into all the values, and set initial index values for ( index = KAknExPopFieldMultiPageIndexInitialize; index < count; index++ ) { iDurationValues[ index ] = CAknQueryValueDuration::NewL(); iDurationValues[ index ]->SetArrayL( iValueDurationArray ); iDurationValues[ index ]->SetCurrentValueIndex( NULL ); iDurationValues[ index ]-> SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT ); } // set values into popup fields for ( index = KAknExPopFieldMultiPageIndexInitialize; index < count; index++ ) { popup[ index ]->SetQueryValueL( iDurationValues[ index ] ); } }
void Console::ProcessEvent(Rocket::Core::Event& event) { String controlId(event.GetCurrentElement()->GetId().CString()); if (controlId == "cmd") { int key = event.GetParameters()->Get<int>("key_identifier", 0); Rocket::Controls::ElementFormControl* inputBox = static_cast<Rocket::Controls::ElementFormControl*>(event.GetCurrentElement()); if (key == Rocket::Core::Input::KI_RETURN) { String command = inputBox->GetValue().CString(); inputBox->SetValue(""); Execute(command); } } }
// ---------------------------------------------------------------------------- // CAknExPopFieldMultiPageDialog::ConfigurePageTextL() // Configuration values (text) into Popup Fields. // ---------------------------------------------------------------------------- // void CAknExPopFieldMultiPageDialog::ConfigurePageTextL() { // Calculate number of pop-up field. TInt index( KAknExPopFieldMultiPageIndexInitialize ); TInt count( KAknExPopFieldMultiPageCountInitialize ); TInt controlId( KAknExPopFieldMultiPageControlIdInitialize ); CAknPopupField* popup[ KAknExPopFieldMaxMultiPageValueField ]; for ( index = KAknExPopFieldMultiPageIndexInitialize; index < KAknExPopFieldMaxMultiPageValueField; index++ ) { popup[ index ] = NULL; controlId = EAknExPopFieldDlgCtrlIdText01 + index; CCoeControl* control = ControlOrNull( controlId ); if ( control ) { popup[ count ] = static_cast<CAknPopupField*> ( control ); count++; } } // Create text array. iTextArray = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_SIX_TEXT_ARRAY ); iValueTextArray = CAknQueryValueTextArray::NewL(); iValueTextArray->SetArray( *iTextArray ); // Set the same array into all the values, and initial value index. for ( index = KAknExPopFieldMultiPageIndexInitialize; index < count; index++ ) { iTextValues[ index ] = CAknQueryValueText::NewL(); iTextValues[ index ]->SetArrayL( iValueTextArray ); iTextValues[ index ]->SetCurrentValueIndex( NULL ); iTextValues[ index ]->SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT ); } // Set values into popup fields. for ( index = KAknExPopFieldMultiPageIndexInitialize; index < count; index++ ) { popup[ index ]->SetQueryValueL( iTextValues[ index ] ); } }
void WEXPORT WListBox::select( int index ) { /******************************************/ GUISetCurrSelect( parent()->handle(), controlId(), index ); }
bool WEXPORT WBoolSwitch::checked() { /***********************************/ return( GUIIsChecked( parent()->handle(), controlId() ) != 0 ); }
WCheckState3 WThreeState::checkState() { /**************************************/ return( (WCheckState3) GUIIsChecked( parent()->handle(), controlId() ) ); }
void WThreeState::setCheckState( WCheckState3 state ) { /*****************************************************/ GUISetChecked( parent()->handle(), controlId(), state ); }
void WEXPORT WListBox::setTagPtr( int index, void* tagPtr ) { /***********************************************************/ GUISetListItemData( parent()->handle(), controlId(), index, tagPtr ); }
void* WEXPORT WListBox::tagPtr( int index ) { /*******************************************/ return( GUIGetListItemData( parent()->handle(), controlId(), index ) ); }
int WEXPORT WListBox::topIndex() { /********************************/ return( GUIGetTopIndex( parent()->handle(), controlId() ) ); }
void WEXPORT WListBox::setExtent( WOrdinal extent ) { /***************************************************/ GUISetHorizontalExtent( parent()->handle(), controlId(), extent ); }
int WEXPORT WEdit::getSelectBounds( int *first, int *last ) { /***********************************************************/ GUIGetEditSelect( parent()->handle(), controlId(), first, last ); return( *last - *first ); }
void WEXPORT WBoolSwitch::setCheck( bool check ) { /************************************************/ GUISetChecked( parent()->handle(), controlId(), check ); }
int WEXPORT WListBox::selected() { /********************************/ return( GUIGetCurrSelect( parent()->handle(), controlId() ) ); }
int WEXPORT WListBox::count() { /******************************/ return( GUIGetListSize( parent()->handle(), controlId() ) ); }
void WEXPORT WListBox::reset() { /******************************/ GUIClearList( parent()->handle(), controlId() ); }
void WEXPORT WListBox::deleteString( int index ) { /************************************************/ GUIDeleteItem( parent()->handle(), controlId(), index ); }
// ---------------------------------------------------------------------------- // CAknExPopFieldOptionalListDialog::ConfigurePopfieldValueL() // Configuration values (text) into Popup Fields. // ---------------------------------------------------------------------------- // void CAknExPopFieldOptionalListDialog::ConfigurePopfieldValueL() { // Discard textarray. DiscardTextArray(); // Calculate number of pop-up field. TInt index( KAknExPopFieldOLIndexInitialize ); TInt count( KAknExPopFieldOLCountInitialize ); TInt controlId( KAknExPopFieldOLControlIdInitialize ); CAknPopupField* popup[ KAknExPopFieldMaxOLTextValueField ]; for ( index = KAknExPopFieldOLIndexInitialize; index < KAknExPopFieldMaxOLTextValueField; index++ ) { popup[ index ] = NULL; controlId = EAknExPopFieldDlgCtrlIdPop00 + index; CCoeControl* control = ControlOrNull( controlId ); if ( control ) { popup[ count ] = static_cast<CAknPopupField*> ( control ); count++; } } // Create textarray. iTextArray[ EAknExPopFieldTextArrayIndex0 ] = new ( ELeave ) CDesCArrayFlat( KAknExPopFieldInitialArrayElementCount ); iTextArray[ EAknExPopFieldTextArrayIndex1 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_ONE_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex2 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_TWO_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex3 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_THREE_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex4 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_FOUR_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex5 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_FIVE_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex6 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_SIX_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex7 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_SEVEN_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex8 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_EIGHT_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex9 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_NINE_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex10 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_TEN_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex11 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_ELEVEN_TEXT_ARRAY ); iTextArray[ EAknExPopFieldTextArrayIndex12 ] = iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_TWELVE_TEXT_ARRAY ); for ( index = KAknExPopFieldOLIndexInitialize; index < count; index++ ) { iValueTextArray[ index ] = CAknQueryValueTextArray::NewL(); iValueTextArray[ index ]->SetArray( *iTextArray[ index ] ); } // Set the same textarray into all the values, and initial value index. for ( index = KAknExPopFieldOLIndexInitialize; index < count; index++ ) { iTextValues[ index ] = CAknQueryValueText::NewL(); iTextValues[ index ]->SetArrayL( iValueTextArray[ index ] ); if ( index != KAknExPopFieldEmptyFieldIndex ) // array is no empty { iTextValues[ index ]->SetCurrentValueIndex( NULL ); iTextValues[ index ]-> SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT ); } } // Set values into popup fields. for ( index = KAknExPopFieldOLIndexInitialize; index < count; index++ ) { popup[ index ]->SetQueryValueL( iTextValues[ index ] ); } }
void WEXPORT WEdit::select( int first, int last ) { /*************************************************/ GUISetEditSelect( parent()->handle(), controlId(), first, last ); }
void WEXPORT WListBox::setTopIndex( int index ) { /***********************************************/ GUISetTopIndex( parent()->handle(), controlId(), index ); }