1524 } |
1525 } |
1525 return CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
1526 return CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
1526 } |
1527 } |
1527 |
1528 |
1528 // ----------------------------------------------------------------------------- |
1529 // ----------------------------------------------------------------------------- |
1529 // CEvtEditor::HandleDialogPageEventL() |
1530 // CEvtEditor::HandlePointerEventL() |
1530 // Inherited from CAknForm |
1531 // Inherited from CAknForm |
1531 // ----------------------------------------------------------------------------- |
1532 // ----------------------------------------------------------------------------- |
1532 // |
1533 // |
1533 void CEvtEditor::HandleDialogPageEventL( TInt aEventID ) |
1534 void CEvtEditor::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
1534 { |
1535 { |
1535 EVTUIDEBUG("+ CEvtEditor::HandleDialogPageEventL()"); |
1536 EVTUIDEBUG("+ CEvtEditor::HandlePointerEventL()"); |
1536 CAknForm::HandleDialogPageEventL( aEventID ); |
1537 |
1537 if( aEventID == MEikDialogPageObserver::EDialogPageTapped ) |
1538 if( aPointerEvent.iType != TPointerEvent::EButton1Up ) |
1538 { |
1539 { |
1539 EVTUIDEBUG("+ CEvtEditor::HandleDialogPageEventL() EDialogPageTapped"); |
1540 CAknForm::HandlePointerEventL( aPointerEvent ); |
1540 if( !IsEditable() ) |
1541 if( aPointerEvent.iType == TPointerEvent::EDrag ) |
1541 { |
1542 iIsDragging++; |
1542 iIsEditMode = ETrue; |
1543 return; |
1543 SetEditableL(ETrue); |
1544 } |
1544 ChangeRSKCaptionL(); |
1545 |
1545 ChangeMSKCaptionL( IdOfFocusControl() ); |
1546 EVTUIDEBUG1("iIsDragging =%d",iIsDragging ); |
1546 return; |
1547 |
1547 } |
1548 //ToDo: Hack for kinetic scrolling |
1548 |
1549 // Must be removed once avkon fix is recieved. |
1549 CEikEdwin* editor = NULL; |
1550 if( iIsDragging >6 ) |
1550 CAknPopupFieldText* popupFieldText = NULL; |
1551 { |
1551 switch(IdOfFocusControl()) |
1552 CAknForm::HandlePointerEventL( aPointerEvent ); |
1552 { |
1553 iIsDragging = 0; |
1553 case EEvtMgmtUiDlgCIdPlace: // Place Editor |
1554 return; |
1554 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdPlace)); |
1555 } |
1555 if ( editor ) |
1556 |
1556 { |
1557 iIsDragging = 0; |
1557 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdSetPlace ); |
1558 // End of todo |
|
1559 |
|
1560 if( !IsEditable() ) |
|
1561 { |
|
1562 iIsEditMode = ETrue; |
|
1563 SetEditableL(ETrue); |
|
1564 ChangeRSKCaptionL(); |
|
1565 ChangeMSKCaptionL( IdOfFocusControl() ); |
|
1566 return; |
|
1567 } |
|
1568 |
|
1569 CEikEdwin* editor = NULL; |
|
1570 CAknPopupFieldText* popupFieldText = NULL; |
|
1571 switch(IdOfFocusControl()) |
|
1572 { |
|
1573 case EEvtMgmtUiDlgCIdPlace: // Place Editor |
|
1574 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdPlace)); |
|
1575 if ( editor ) |
|
1576 { |
|
1577 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdSetPlace ); |
|
1578 } |
|
1579 break; |
|
1580 case EEvtMgmtUiDlgCIdDesc: // Description Editor |
|
1581 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdDesc)); |
|
1582 if ( editor ) |
|
1583 { |
|
1584 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdEditDesc ); |
|
1585 } |
|
1586 break; |
|
1587 case EEvtMgmtUiDlgCIdAssignTone: // Tone Editor |
|
1588 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdAssignTone)); |
|
1589 if ( editor ) |
|
1590 { |
|
1591 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdAssignTone ); |
|
1592 } |
|
1593 break; |
|
1594 case EEvtMgmtUiDlgCIdStatus: // Status Editor |
|
1595 popupFieldText = static_cast <CAknPopupFieldText*> ( ControlOrNull(EEvtMgmtUiDlgCIdStatus) ); |
|
1596 if( popupFieldText ) |
|
1597 { |
|
1598 TInt editorStatus = popupFieldText->CurrentValueIndex(); |
|
1599 CheckStatusL(); |
|
1600 if( ECompleted != editorStatus ) |
|
1601 { |
|
1602 if( EActive == editorStatus ) |
|
1603 { |
|
1604 popupFieldText->SetCurrentValueIndex ( EDraft ); |
|
1605 } |
|
1606 else |
|
1607 { |
|
1608 popupFieldText->SetCurrentValueIndex ( EActive ); |
|
1609 } |
|
1610 HandleControlStateChangeL( EEvtMgmtUiDlgCIdStatus ); |
|
1611 UpdatePageL(ETrue); |
|
1612 return; |
1558 } |
1613 } |
1559 break; |
1614 else |
1560 case EEvtMgmtUiDlgCIdDesc: // Description Editor |
|
1561 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdDesc)); |
|
1562 if ( editor ) |
|
1563 { |
1615 { |
1564 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdEditDesc ); |
1616 CAknForm::HandlePointerEventL( aPointerEvent ); |
|
1617 return; |
1565 } |
1618 } |
1566 break; |
1619 } |
1567 case EEvtMgmtUiDlgCIdAssignTone: // Tone Editor |
1620 break; |
1568 editor = static_cast <CEikEdwin*> (ControlOrNull(EEvtMgmtUiDlgCIdAssignTone)); |
1621 case EEvtMgmtUiDlgCIdRepeat: // Repeat editor |
1569 if ( editor ) |
1622 case EEvtMgmtUiDlgCIdAudioLoop: // audio loop editor |
1570 { |
1623 TogglePopupFieldControlL( IdOfFocusControl() ); |
1571 iCmdHandler->HandleEditorCmdL( EEvtEditorCmdAssignTone ); |
1624 break; |
1572 } |
1625 default: |
1573 break; |
1626 CAknForm::HandlePointerEventL( aPointerEvent ); |
1574 case EEvtMgmtUiDlgCIdStatus: // Status Editor |
1627 break; |
1575 popupFieldText = static_cast <CAknPopupFieldText*> ( ControlOrNull(EEvtMgmtUiDlgCIdStatus) ); |
1628 } |
1576 if( popupFieldText ) |
1629 EVTUIDEBUG("- CEvtEditor::HandlePointerEventL()"); |
1577 { |
1630 } |
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 } |
|
1595 break; |
|
1596 case EEvtMgmtUiDlgCIdRepeat: // Repeat editor |
|
1597 case EEvtMgmtUiDlgCIdAudioLoop: // audio loop editor |
|
1598 TogglePopupFieldControlL( IdOfFocusControl() ); |
|
1599 break; |
|
1600 default: |
|
1601 break; |
|
1602 } |
|
1603 } |
|
1604 EVTUIDEBUG("- CEvtEditor::HandleDialogPageEventL()"); |
|
1605 } |
|
1606 // --------------------------------------------------------------------------- |
1631 // --------------------------------------------------------------------------- |
1607 // CEvtEditor::MakeTitleL() |
1632 // CEvtEditor::MakeTitleL() |
1608 // Set the Title Text |
1633 // Set the Title Text |
1609 // --------------------------------------------------------------------------- |
1634 // --------------------------------------------------------------------------- |
1610 // |
1635 // |