本文整理汇总了C++中CEikEdwin类的典型用法代码示例。如果您正苦于以下问题:C++ CEikEdwin类的具体用法?C++ CEikEdwin怎么用?C++ CEikEdwin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEikEdwin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
// -----------------------------------------------------------------------------
// CLandmarksEditDialog::FetchFloatL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksEditDialog::FetchFloatL(
TRealX& aFloat,
TInt aEditorResourceId,
TInt aErrorResourceId)
{
const TChar KDecimalPoint = '.';
TBuf<KPosLmMaxTextFieldLength> textFieldValue;
TLex fieldLex;
TInt result(KErrNone);
CEikEdwin* editor = static_cast <CEikEdwin*> (Control(aEditorResourceId));
editor->GetText(textFieldValue);
if (textFieldValue == KNullDesC)
{
// User has indicated that he/she wants this value to be undefined.
aFloat.SetNaN();
}
else
{
// Try to extract value
fieldLex = textFieldValue;
TReal floatValue(0);
result = fieldLex.Val(floatValue, KDecimalPoint);
if (result != KErrNone)
{
NotifyErrorToUserL(aErrorResourceId);
}
// Update output parameter
User::LeaveIfError(aFloat.Set(floatValue));
}
}
示例2: Control
// ----------------------------------------------------------------------------
// CCreate2WayVideoSessionDialog::PreLayoutDynInitL()
// .
// ----------------------------------------------------------------------------
//
void CCreate2WayVideoSessionDialog::PreLayoutDynInitL()
{
CEikEdwin* edwinPoCAddress = static_cast<CEikEdwin*>(
Control( ESessionDialog2WayVideoRecipientAddress ) );
TBuf<KBufLength> defaultAddress;
defaultAddress.Copy(iParams->iRecipentAddress);
edwinPoCAddress->SetTextL(&defaultAddress);
edwinPoCAddress->SetCursorPosL(defaultAddress.Length(),EFalse);
CAknPopupFieldText* popupFieldText =
static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoVideoCodec));
popupFieldText->SetCurrentValueIndex(0);
popupFieldText =
static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoAudioCodec));
popupFieldText->SetCurrentValueIndex(0);
popupFieldText =
static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoViewFinder));
popupFieldText->SetCurrentValueIndex(0);
popupFieldText =
static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoCamera));
popupFieldText->SetCurrentValueIndex(0);
CAknForm::PreLayoutDynInitL();
}
示例3: SetLineNonFocusing
// ----------------------------------------------------------------------------
// CNewDestDialog::PrepareLC( TInt aResourceId )
//
// ----------------------------------------------------------------------------
//
void CNewDestDialog::PrepareLC( TInt aResourceId )
{
CAknForm::PrepareLC( aResourceId );
SetLineNonFocusing( EWayFinderCtrlNewDestCountryEdwin );
CEikEdwin* control = static_cast<CEikEdwin*>( ControlOrNull( EWayFinderCtrlNewDestStringEdwin ) );
if( control ){
control->AddEdwinObserverL( this );
}
}
示例4: ResetHides
/**
* If aControl is an edwin, set its clipping rect to empty. This
* will disable the text hiding.
*/
static void ResetHides(CEikCaptionedControl *aControl)
{
aControl->SetPartiallyVisible( EFalse );
if (aControl->ControlIsAnEdwin(aControl->iControlType))
{
CEikEdwin *edwin = (CEikEdwin*)aControl->iControl;
edwin->SetTextLinesRect(TRect());
}
}
示例5: HandleLogWriteL
void CSymellaConsoleView::HandleLogWriteL(const TDesC& aText)
{
/*if (aText.Length() < KMaxConsoleBufferSize)
{
// Checks the new text length
TInt diff = iTextBuffer->DocumentLength() +
aText.Length() - KMaxConsoleBufferSize;
// If it's longer than the maximum then deletes from
// the beginning
if ( diff > 0)
{
iTextBuffer->DeleteL(0, diff);
if (iContainer)
iContainer->Edwin()->Text()->DeleteL(0, diff);
}
iTextBuffer->InsertL(iTextBuffer->DocumentLength(), aText);*/
if (iContainer)
{
CEikEdwin* edwin = iContainer->Edwin();
TInt diff = edwin->Text()->DocumentLength() +
aText.Length() - KMaxConsoleBufferSize;
if (diff > edwin->Text()->DocumentLength())
diff = edwin->Text()->DocumentLength();
if ( diff > 0)
edwin->Text()->DeleteL(0, diff);
edwin->Text()->InsertL(edwin->Text()->DocumentLength(), aText);
edwin->HandleTextChangedL();
edwin->SetCursorPosL(edwin->Text()->DocumentLength(), EFalse);
}
/* }
else
{
TPtrC ptr = aText.Right(KMaxConsoleBufferSize);
iTextBuffer->DeleteL(0, iTextBuffer->DocumentLength());
iTextBuffer->InsertL(0, ptr);
if (iContainer)
{
CEikEdwin* edwin = iContainer->Edwin();
edwin->Text()->DeleteL(0, edwin->Text()->DocumentLength());
edwin->Text()->InsertL(0, ptr);
edwin->HandleTextChangedL();
edwin->SetCursorPosL(edwin->Text()->DocumentLength(), EFalse);
}
}*/
}
示例6: OfferKeyEventL
TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType) {
LOGD("CMyAknTextQueryDialog::OfferKeyEventL(%i, %i)\n", aKeyEvent.iCode, aType);
if(aKeyEvent.iCode == EKeyEnter) {
LOGD("Enter 7\n");
// offer this event to only the edit box.
// this prevents it from closing the dialog.
CEikEdwin* e = ((CMyAknQueryControl*)QueryControl())->getEdwin();
DEBUG_ASSERT(e != NULL);
//e->ClearSelectionL();
return e->OfferKeyEventL(aKeyEvent, aType);
}
return CAknTextQueryDialog::OfferKeyEventL(aKeyEvent, aType);
}
示例7: new
// ---------------------------------------------------------------------------
// CBCTestMix50Case::TestCEikEdwinCaseL()
// ( menu item -7- )
// ---------------------------------------------------------------------------
//
void CBCTestMix50Case::TestCEikEdwinCaseL()
{
CEikEdwin* eikEdwin = new( ELeave ) CEikEdwin;
CleanupStack::PushL( eikEdwin );
_LIT( KTxtCEikEdwin, "CEikEdwin::CEikEdwin" );
AssertNotNullL( eikEdwin, KTxtCEikEdwin );
TRect rect( KXLeftPos, KYUpPos, KXRightPos, KYDownPos );
eikEdwin->SetScrollRect( rect );
_LIT( KTxtSetScrollRect, "CEikEdwin::SetScrollRect" );
AssertTrueL( ETrue, KTxtSetScrollRect );
CleanupStack::PopAndDestroy( eikEdwin );
}
示例8: UpdateTitleBarL
// -----------------------------------------------------------------------------
// CLandmarksEditDialog::UpdateTitleBarL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksEditDialog::UpdateTitleBarL(TBool aFromField)
{
if (aFromField)
{
TBuf<KPosLmMaxTextFieldLength> name;
CEikEdwin* nameEditor =
static_cast<CEikEdwin*>(Control(ELandmarkNameField));
nameEditor->GetText(name);
iTitlePane->SetTextL(name);
}
else
{
TPtrC ptr;
iLandmark->GetLandmarkName(ptr);
iTitlePane->SetTextL(ptr);
}
}
示例9: CALLSTACKITEM_N
TKeyResponse CUploadContainer::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType)
{
CALLSTACKITEM_N(_CL("CUploadContainer"), _CL("OfferKeyEventL"));
// lessen chance of accidental dismissal
if (aKeyEvent.iCode == KEY_CANCEL) return EKeyWasConsumed;
if (! iDescriptionEdit) {
if (iActive) {
return iActive->OfferKeyEventL(aKeyEvent, aType);
} else {
return EKeyWasNotConsumed;
}
}
if (aKeyEvent.iCode==JOY_CLICK) {
SetEditActive(iSelected, iActive==0);
return EKeyWasConsumed;
}
else if(iActive)
{
TKeyResponse ret;
ret=iActive->OfferKeyEventL(aKeyEvent, aType);
return ret;
} else if (aKeyEvent.iCode==JOY_UP || aKeyEvent.iCode==JOY_DOWN ||
aKeyEvent.iCode==JOY_LEFT || aKeyEvent.iCode==JOY_RIGHT ) {
CEikEdwin *prev=iSelected;
SetEditSelected(iSelected, false);
if (prev==iTagEdit) {
SetEditSelected(iDescriptionEdit, true);
} else {
SetEditSelected(iTagEdit, true);
}
return EKeyWasConsumed;
} else {
return EKeyWasNotConsumed;
}
}
示例10: defaultCharFormat
void CEikListBoxTextEditor::UseFontL( CEikEdwin& aEditor, const CFont& aFont )
{
_AKNTRACE_FUNC_ENTER;
CGlobalText* globalText;
TCharFormatMask defaultCharFormatMask;
defaultCharFormatMask.SetAttrib(EAttFontTypeface);
defaultCharFormatMask.SetAttrib(EAttFontHeight);
TFontSpec fontspec = aFont.FontSpecInTwips();
TCharFormat defaultCharFormat( fontspec.iTypeface.iName, fontspec.iHeight );
iParaFormatLayer=CParaFormatLayer::NewL();
iCharFormatLayer=CCharFormatLayer::NewL(defaultCharFormat,defaultCharFormatMask);
globalText=CGlobalText::NewL(iParaFormatLayer,iCharFormatLayer,CEditableText::ESegmentedStorage,5);
CleanupStack::PushL(globalText);
TCharFormat charFormat;
TCharFormatMask charMask;
iCharFormatLayer->Sense(charFormat,charMask);
if ( fontspec.iFontStyle.Posture()==EPostureItalic )
{
charMask.SetAttrib(EAttFontPosture);
charFormat.iFontSpec.iFontStyle.SetPosture(EPostureItalic);
}
if ( fontspec.iFontStyle.StrokeWeight()==EStrokeWeightBold )
{
charMask.SetAttrib(EAttFontStrokeWeight );
charFormat.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
}
iCharFormatLayer->SetL(charFormat,charMask);
CPlainText* old=aEditor.Text();
CleanupStack::Pop(); // globalText
CleanupStack::PushL(old); // old is pushed because we're using EUseText in the subsequent call
aEditor.SetDocumentContentL(*globalText,CEikEdwin::EUseText);
CleanupStack::PopAndDestroy(); // old
_AKNTRACE_FUNC_EXIT;
}
示例11: new
// -----------------------------------------------------------------------------
// CTestSDKForm::TestFSaveFormDataL
// -----------------------------------------------------------------------------
TInt CTestSDKForm::TestFSaveFormDataL( CStifItemParser& /*aItem*/ )
{
CTestSDKFormControl* form = new (ELeave) CTestSDKFormControl;
CleanupStack::PushL( form );
STIF_ASSERT_NOT_NULL( form );
form->ConstructL();
form->PrepareLC( R_TESTSDK_FORM_DIALOG );
CleanupStack::Pop( form );
CEikEdwin* edwin = static_cast<CEikEdwin*>( form->ControlOrNull( ETestSDKEdwin ) );
_LIT( KEdwin, "edwin" );
TBuf<KLength> tedwin( KEdwin );
edwin->SetTextL( &tedwin );
TBool save = form->SaveFormDataL();
STIF_ASSERT_TRUE( save );
CleanupStack::PopAndDestroy( form );
return KErrNone;
}
示例12: SetEditActive
void CUploadContainer::SetEditActive(CEikEdwin *Edit, bool IsActive)
{
CALLSTACKITEM_N(_CL("CUploadContainer"), _CL("SetEditActive"));
TBuf<20> label;
if (Edit==iDescriptionEdit) label=KDescription();
else label=KTag();
const TDesC& text=Edit->Text()->Read(0).Left(Edit->Text()->Read(0).Length()-1);
if (IsActive) {
iActive=Edit;
iActive->SetFocus(ETrue);
if (! text.CompareF(label) ) {
Edit->SetTextL(&KNullDesC);
}
} else {
if (iActive) iActive->SetFocus(EFalse);
if (text.Length()==0) Edit->SetTextL(&label);
iActive=0;
}
DrawNow();
}
示例13: SaveFormDataL
TBool CEmTubeVideoUploadDialog::SaveFormDataL()
{
TBuf<KUploadVideoMaxFieldLength> data;
CEikEdwin* editor;
editor = static_cast <CEikEdwin*> (Control(EUploadVideoFieldTitle));
editor->GetText( data );
iQueueEntry->SetTitleL( data );
editor = static_cast <CEikEdwin*> (Control(EUploadVideoFieldDescription));
editor->GetText( data );
iQueueEntry->SetDescriptionL( data );
editor = static_cast <CEikEdwin*> (Control(EUploadVideoFieldTags));
editor->GetText( data );
iQueueEntry->SetTagsL( data );
CAknPopupFieldText* popup = static_cast<CAknPopupFieldText*>(ControlOrNull(EUploadVideoFieldPublic));
switch ( popup->CurrentValueIndex() )
{
case 0:
iQueueEntry->SetPublic( ETrue );
break;
case 1:
iQueueEntry->SetPublic( EFalse );
break;
}
popup = static_cast<CAknPopupFieldText*>(ControlOrNull(EUploadVideoFieldCategory));
iQueueEntry->SetCategory( KCategories[ popup->CurrentValueIndex() ] );
return ETrue;
}
示例14: ActivePageId
TBool CVoIPForm::SaveFormDataL()
{
CVoIPAppUi* iAppUi = static_cast<CVoIPAppUi*> (iEikonEnv->EikAppUi());
CVoIPDocument* iDocument =
static_cast<CVoIPDocument*> (iAppUi->Document());
TInt iModifyIndex = iDocument->ModifyIndex();
RPointerArray<CContact> contacts = iAppUi->GetPhoneBook()->GetContactsL();
if (iModifyIndex >= 0)
{
CContact* contact = contacts[iModifyIndex];
if (contact)
{
iAppUi->GetPhoneBook()->DeleteContactItem(contact->GetEntryId());
TContactItemId contactItemId =
iAppUi->GetPhoneBook()->CreateDefaultContactItem();
contact->SetEntryId(contactItemId);
CPbkContactItem* contactItem =
iAppUi->GetPhoneBook()->OpenContactItemLCX(contactItemId);
TInt pageId = ActivePageId();
RArray<CEikCaptionedControl*> aControls;
ControlsOnPage(aControls, pageId);
for (TInt i = 0; i < aControls.Count(); i++)
{
CEikCaptionedControl* control =
((CEikCaptionedControl*) aControls[i]);
TPbkContactItemField* field = contactItem->FindField(
control->iId);
if (field == NULL)
{
CPbkFieldInfo* fieldInfo =
iAppUi->GetPhoneBook()->GetFieldsInfo().Find(
control->iId);
contactItem->AddFieldL(*fieldInfo);
field = contactItem->FindField(control->iId);
}
field->SetLabelL(control->GetFullCaptionText());
CPbkFieldInfo& fieldInfo = field->FieldInfo();
if (fieldInfo.CtrlType() == EPbkFieldCtrlTypeDateEditor)
{
CEikDateEditor* nEditor =
static_cast<CEikDateEditor*> (ControlOrNull(
control->iId));
TTime time = nEditor->Date();
field->DateTimeStorage()->SetTime(time);
}
else
{
CEikEdwin* nEditor =
static_cast<CEikEdwin*> (ControlOrNull(
control->iId));
HBufC* text = nEditor->GetTextInHBufL();
field->TextStorage()->SetText(text);
}
}
aControls.Reset();
iAppUi->GetPhoneBook()->CommitContactItem(contactItem);
CleanupStack::PopAndDestroy(2); //OpenContactItemLCX
}
}
return ETrue;
}
示例15: FetchFloatL
// -----------------------------------------------------------------------------
// CLandmarksEditDialog::SaveFormDataL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
TBool CLandmarksEditDialog::SaveFormDataL()
{
CEikEdwin* editor = NULL;
// Fetch name
TBuf<KPosLmMaxTextFieldLength> name;
editor = static_cast <CEikEdwin*> (Control(ELandmarkNameField));
editor->GetText(name);
// Fetch description
HBufC* descBuf = HBufC::NewLC(KPosLmMaxDescriptionLength);
TPtr desc = descBuf->Des();
editor = static_cast <CEikEdwin*> (Control(ELandmarkDescField));
editor->GetText(desc);
// Fetch existing location
TLocality existingLocation;
TBool locationExists =
(iLandmark->GetPosition(existingLocation) == KErrNone);
TRealX floatFieldValue;
// Fetch Latitude
TReal latitude = existingLocation.Latitude();
if (iIsRealValueEdited[ELatitudeEditor] || !locationExists)
{
FetchFloatL(floatFieldValue, ELandmarkLatitudeField,
R_LMREFAPP_LATITUDE_ERROR);
floatFieldValue.GetTReal(latitude);
}
// Fetch Longitude
TReal longitude = existingLocation.Longitude();
if (iIsRealValueEdited[ELongitudeEditor] || !locationExists)
{
FetchFloatL(floatFieldValue, ELandmarkLongitudeField,
R_LMREFAPP_LONGITUDE_ERROR);
floatFieldValue.GetTReal(longitude);
}
// Fetch Altitude
TReal32 altitude = existingLocation.Altitude();
if (iIsRealValueEdited[EAltitudeEditor] || !locationExists)
{
FetchFloatL(floatFieldValue, ELandmarkAltitudeField,
R_LMREFAPP_ALTITUDE_ERROR);
floatFieldValue.GetTReal(altitude);
}
// Fetch horizontal accuracy
TReal32 horAcc = existingLocation.HorizontalAccuracy();
if (iIsRealValueEdited[EHorizontalAccEditor] || !locationExists)
{
FetchFloatL(floatFieldValue, ELandmarkHorAccField,
R_LMREFAPP_HOR_ACC_ERROR);
floatFieldValue.GetTReal(horAcc);
}
// Fetch vertical accuracy
TReal32 verAcc = existingLocation.VerticalAccuracy();
if (iIsRealValueEdited[EVerticalAccEditor] || !locationExists)
{
FetchFloatL(floatFieldValue, ELandmarkVerAccField,
R_LMREFAPP_VER_ACC_ERROR);
floatFieldValue.GetTReal(verAcc);
}
// Fetch Coverage Radius
TReal32 radius;
TInt radiusExists = (iLandmark->GetCoverageRadius(radius) == KErrNone);
if (iIsRealValueEdited[ERadiusEditor] || !radiusExists)
{
FetchFloatL(floatFieldValue, ELandmarkRadiusField,
R_LMREFAPP_RADIUS_ERROR);
floatFieldValue.GetTReal(radius);
}
// Fetch street
TBuf<KPosLmMaxTextFieldLength> street;
editor =
static_cast <CEikEdwin*> (Control(ELandmarkStreetField));
editor->GetText(street);
// Fetch postal code
TBuf<KPosLmMaxTextFieldLength> postalCode;
editor =
static_cast <CEikEdwin*> (Control(ELandmarkPostalField));
editor->GetText(postalCode);
// Fetch city
TBuf<KPosLmMaxTextFieldLength> city;
editor = static_cast <CEikEdwin*> (Control(ELandmarkCityField));
editor->GetText(city);
// Fetch country
//.........这里部分代码省略.........