493 case EEvtMgmtUiDlgCIdAssignTone: |
493 case EEvtMgmtUiDlgCIdAssignTone: |
494 { |
494 { |
495 aMenuPane->SetItemDimmed(EAknFormCmdEdit, ETrue); |
495 aMenuPane->SetItemDimmed(EAknFormCmdEdit, ETrue); |
496 aMenuPane->SetItemDimmed(EEvtEditorCmdAssignTone, EFalse); |
496 aMenuPane->SetItemDimmed(EEvtEditorCmdAssignTone, EFalse); |
497 break; |
497 break; |
498 } |
498 } |
499 case EEvtMgmtUiDlgCIdRepeat: |
499 case EEvtMgmtUiDlgCIdRepeat: |
500 case EEvtMgmtUiDlgCIdAudioLoop: |
500 case EEvtMgmtUiDlgCIdAudioLoop: |
501 case EEvtMgmtUiDlgCIdStatus: |
501 case EEvtMgmtUiDlgCIdStatus: |
502 { |
502 { |
503 aMenuPane->SetItemDimmed(EAknFormCmdEdit, EFalse); |
503 aMenuPane->SetItemDimmed(EAknFormCmdEdit, EFalse); |
504 aMenuPane->SetItemTextL(EAknFormCmdEdit,R_EVTUI_CREATENEW_FORM_CMDCHANGE); |
504 aMenuPane->SetItemTextL(EAknFormCmdEdit,R_EVTUI_CREATENEW_FORM_CMDCHANGE); |
505 break; |
505 break; |
506 } |
506 } |
507 default: |
507 default: |
508 { |
508 { |
509 break; |
509 break; |
510 } |
510 } |
511 |
|
512 }//switch |
511 }//switch |
513 |
512 |
514 // Activate and Draft are absent in Edit mode |
513 // Activate and Draft are absent in Edit mode |
515 aMenuPane->SetItemDimmed(EEvtEditorCmdActivate, ETrue); |
514 aMenuPane->SetItemDimmed(EEvtEditorCmdActivate, ETrue); |
516 aMenuPane->SetItemDimmed(EEvtEditorCmdSaveDraft, ETrue); |
515 aMenuPane->SetItemDimmed(EEvtEditorCmdSaveDraft, ETrue); |
1525 } |
1524 } |
1526 return CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
1525 return CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
1527 } |
1526 } |
1528 |
1527 |
1529 // ----------------------------------------------------------------------------- |
1528 // ----------------------------------------------------------------------------- |
1530 // CEvtEditor::HandlePointerEventL() |
1529 // CEvtEditor::HandleDialogPageEventL() |
1531 // Inherited from CAknForm |
1530 // Inherited from CAknForm |
1532 // ----------------------------------------------------------------------------- |
1531 // ----------------------------------------------------------------------------- |
1533 // |
1532 // |
1534 void CEvtEditor::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
1533 void CEvtEditor::HandleDialogPageEventL( TInt aEventID ) |
1535 { |
1534 { |
1536 EVTUIDEBUG("+ CEvtEditor::HandlePointerEventL()"); |
1535 EVTUIDEBUG("+ CEvtEditor::HandleDialogPageEventL()"); |
1537 |
1536 CAknForm::HandleDialogPageEventL( aEventID ); |
1538 /* As default HandlePointerEventL() calls control's HandlePointerEventL() |
1537 if( aEventID == MEikDialogPageObserver::EDialogPageTapped ) |
1539 * We have to modify status's array before CAknForm::HandlePointerEventL() is called. |
1538 { |
1540 */ |
1539 EVTUIDEBUG("+ CEvtEditor::HandleDialogPageEventL() EDialogPageTapped"); |
1541 if(aPointerEvent.iType == TPointerEvent::EButton1Up ) |
1540 if( !IsEditable() ) |
1542 { |
|
1543 CAknPopupFieldText* statusEditor = static_cast <CAknPopupFieldText*> ( ControlOrNull(EEvtMgmtUiDlgCIdStatus) ); |
|
1544 if (statusEditor) |
|
1545 { |
|
1546 if( statusEditor->Rect().Contains(aPointerEvent.iPosition) ) |
|
1547 CheckStatusL(); |
|
1548 } |
|
1549 } |
|
1550 |
|
1551 EVTUIDEBUG1("+ b4 HandlePointerEventL- %d", aPointerEvent.iType); |
|
1552 CAknForm::HandlePointerEventL( aPointerEvent ); |
|
1553 EVTUIDEBUG1("+ after HandlePointerEventL- %d", aPointerEvent.iType); |
|
1554 if(aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
1555 { |
|
1556 if( !IsEditable() ) |
|
1557 { |
|
1558 iIsEditMode = ETrue; |
|
1559 SetEditableL(ETrue); |
|
1560 ChangeRSKCaptionL(); |
|
1561 ChangeMSKCaptionL( IdOfFocusControl() ); |
|
1562 return; |
|
1563 } |
|
1564 |
|
1565 switch ( IdOfFocusControl() ) |
|
1566 { |
1541 { |
1567 case EEvtMgmtUiDlgCIdPlace: |
1542 iIsEditMode = ETrue; |
1568 { |
1543 SetEditableL(ETrue); |
1569 CEikEdwin* placeEditor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdPlace)); |
1544 ChangeRSKCaptionL(); |
1570 if (placeEditor) |
1545 ChangeMSKCaptionL( IdOfFocusControl() ); |
1571 { |
1546 return; |
1572 if( placeEditor->Rect().Contains(aPointerEvent.iPosition) ) |
1547 } |
1573 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdSetPlace ); |
1548 |
|
1549 CEikEdwin* editor = NULL; |
|
1550 CAknPopupFieldText* popupFieldText = NULL; |
|
1551 switch(IdOfFocusControl()) |
|
1552 { |
|
1553 case EEvtMgmtUiDlgCIdPlace: // Place Editor |
|
1554 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdPlace)); |
|
1555 if ( editor ) |
|
1556 { |
|
1557 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdSetPlace ); |
1574 } |
1558 } |
1575 break; |
1559 break; |
1576 } |
1560 case EEvtMgmtUiDlgCIdDesc: // Description Editor |
1577 case EEvtMgmtUiDlgCIdDesc: |
1561 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdDesc)); |
1578 { |
1562 if ( editor ) |
1579 CEikEdwin* descEditor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdDesc)); |
|
1580 if (descEditor) |
|
1581 { |
1563 { |
1582 if( descEditor->Rect().Contains(aPointerEvent.iPosition) ) |
1564 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdEditDesc ); |
1583 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdEditDesc ); |
|
1584 } |
1565 } |
1585 break; |
1566 break; |
1586 } |
1567 case EEvtMgmtUiDlgCIdAssignTone: // Tone Editor |
1587 case EEvtMgmtUiDlgCIdAssignTone: |
1568 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdAssignTone)); |
1588 { |
1569 if ( editor ) |
1589 CEikEdwin* toneEditor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdAssignTone)); |
|
1590 if (toneEditor) |
|
1591 { |
1570 { |
1592 if( toneEditor->Rect().Contains(aPointerEvent.iPosition) ) |
1571 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdAssignTone ); |
1593 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdAssignTone ); |
|
1594 } |
1572 } |
1595 break; |
1573 break; |
1596 } |
1574 case EEvtMgmtUiDlgCIdStatus: // Status Editor |
1597 default: |
1575 popupFieldText = static_cast <CAknPopupFieldText*> ( ControlOrNull(EEvtMgmtUiDlgCIdStatus) ); |
1598 { |
1576 if( popupFieldText ) |
|
1577 { |
|
1578 TInt editorStatus = popupFieldText->CurrentValueIndex(); |
|
1579 CheckStatusL(); |
|
1580 if( ECompleted != editorStatus ) |
|
1581 { |
|
1582 if( EActive == editorStatus ) |
|
1583 { |
|
1584 popupFieldText->SetCurrentValueIndex ( EDraft ); |
|
1585 } |
|
1586 else |
|
1587 { |
|
1588 popupFieldText->SetCurrentValueIndex ( EActive ); |
|
1589 } |
|
1590 HandleControlStateChangeL( EEvtMgmtUiDlgCIdStatus ); |
|
1591 UpdatePageL(ETrue); |
|
1592 return; |
|
1593 } |
|
1594 } |
1599 break; |
1595 break; |
1600 } |
1596 case EEvtMgmtUiDlgCIdRepeat: // Repeat editor |
|
1597 case EEvtMgmtUiDlgCIdAudioLoop: // audio loop editor |
|
1598 TogglePopupFieldControlL( IdOfFocusControl() ); |
|
1599 break; |
|
1600 default: |
|
1601 break; |
1601 } |
1602 } |
|
1603 } |
|
1604 EVTUIDEBUG("- CEvtEditor::HandleDialogPageEventL()"); |
1602 } |
1605 } |
1603 |
|
1604 EVTUIDEBUG("- CEvtEditor::HandlePointerEventL()"); |
|
1605 } |
|
1606 // --------------------------------------------------------------------------- |
1606 // --------------------------------------------------------------------------- |
1607 // CEvtEditor::MakeTitleL() |
1607 // CEvtEditor::MakeTitleL() |
1608 // Set the Title Text |
1608 // Set the Title Text |
1609 // --------------------------------------------------------------------------- |
1609 // --------------------------------------------------------------------------- |
1610 // |
1610 // |