66 { |
66 { |
67 ECalcCmdCancel, // C |
67 ECalcCmdCancel, // C |
68 ECalcCmdSeven, // 7 |
68 ECalcCmdSeven, // 7 |
69 ECalcCmdFour, // 4 |
69 ECalcCmdFour, // 4 |
70 ECalcCmdOne, // 1 |
70 ECalcCmdOne, // 1 |
71 ECalcCmdZero, // 0 |
71 ECalcCmdZero, // 0 |
72 ECalcCmdSqrt, // Sqrt |
72 ECalcCmdSqrt, // Sqrt |
73 ECalcCmdEight, // 8 |
73 ECalcCmdEight, // 8 |
74 ECalcCmdFive, // 5 |
74 ECalcCmdFive, // 5 |
75 ECalcCmdTwo, // 2 |
75 ECalcCmdTwo, // 2 |
76 ECalcCmdSeparator, // . |
76 ECalcCmdSeparator, // . |
77 ECalcCmdPercent, // % |
77 ECalcCmdPercent, // % |
78 ECalcCmdNine, // 9 |
78 ECalcCmdNine, // 9 |
79 ECalcCmdSix, // 6 |
79 ECalcCmdSix, // 6 |
80 ECalcCmdThree, // 3 |
80 ECalcCmdThree, // 3 |
81 ECalcCmdChangeSign, // +/- |
81 ECalcCmdChangeSign, // +/- |
82 ECalcCmdDivide, // / |
82 ECalcCmdDivide, // / |
83 ECalcCmdMultiply, // * |
83 ECalcCmdMultiply, // * |
84 ECalcCmdSubtract, // - |
84 ECalcCmdSubtract, // - |
85 ECalcCmdAdd, // + |
85 ECalcCmdAdd, // + |
86 ECalcCmdResult // = |
86 ECalcCmdResult // = |
87 }; |
87 }; |
88 |
88 |
89 const TInt KButtonsIdTbl[] = // The command ID of a button in non Touch Layout |
89 const TInt KButtonsIdTbl[] = // The command ID of a button in non Touch Layout |
90 { |
90 { |
91 ECalcCmdAdd, // + |
91 ECalcCmdAdd, // + |
92 ECalcCmdSubtract, // - |
92 ECalcCmdSubtract, // - |
93 ECalcCmdMultiply, // * |
93 ECalcCmdMultiply, // * |
94 ECalcCmdDivide, // / |
94 ECalcCmdDivide, // / |
95 ECalcCmdChangeSign, // +/- |
95 ECalcCmdChangeSign, // +/- |
96 ECalcCmdResult, // = |
96 ECalcCmdResult, // = |
97 ECalcCmdSqrt, // Sqrt |
97 ECalcCmdSqrt, // Sqrt |
98 ECalcCmdPercent, // % |
98 ECalcCmdPercent, // % |
99 ECalcCmdScrollUp, // Scroll-up |
99 ECalcCmdScrollUp, // Scroll-up |
100 ECalcCmdScrollDown // Scroll-down |
100 ECalcCmdScrollDown // Scroll-down |
101 }; |
101 }; |
102 |
102 |
103 |
103 |
104 // If const TChar is used, complie error occurs in THUMB build. |
104 // If const TChar is used, complie error occurs in THUMB build. |
105 // To avoid this, #define is used. |
105 // To avoid this, #define is used. |
106 #define KCalcAsteriskBtn '*' |
106 #define KCalcAsteriskBtn '*' |
211 // --------------------------------------------------------- |
211 // --------------------------------------------------------- |
212 // |
212 // |
213 void CCalcFuncmapSubPane::NotifyTimeoutL() |
213 void CCalcFuncmapSubPane::NotifyTimeoutL() |
214 { |
214 { |
215 |
215 |
216 /*Get the selected pointer |
216 /*Get the selected pointer |
217 button -> different layouts, different values*/ |
217 button -> different layouts, different values*/ |
218 CAknButton* button = iButtons[iSelected]; |
218 CAknButton* button = iButtons[iSelected]; |
219 if( !AknLayoutUtils::PenEnabled() ) |
219 if( !AknLayoutUtils::PenEnabled() ) |
220 { |
220 { |
221 #ifdef RD_INTELLIGENT_TEXT_INPUT |
221 #ifdef RD_INTELLIGENT_TEXT_INPUT |
222 if ( iKeyboardType == EPtiKeyboardHalfQwerty ) |
222 if ( iKeyboardType == EPtiKeyboardHalfQwerty ) |
223 { |
223 { |
224 if( ( iLastKeyCode == EStdKeyLeftShift && iDecimalPoint ) || ( iLastKeyCode == EStdKeyLeftFunc && iDecimalPoint )) |
224 if( ( iLastKeyCode == EStdKeyLeftShift && iDecimalPoint ) || ( iLastKeyCode == EStdKeyLeftFunc && iDecimalPoint )) |
225 { |
225 { |
226 iContainer->SetSeparatorFromTouchL(); |
226 iContainer->SetSeparatorFromTouchL(); |
227 } |
227 } |
228 else |
228 else |
229 { |
229 { |
230 iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] ); |
230 iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] ); |
231 } |
231 } |
232 } |
232 } |
233 else |
233 else |
234 #endif |
234 #endif |
235 { |
235 { |
236 iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] ); |
236 iContainer->View()->HandleCommandL( KButtonsIdTbl[iSelected] ); |
237 } |
237 } |
238 } |
238 } |
239 else |
239 else |
240 { |
240 { |
241 iContainer->View()->HandleCommandL( KButtonsIdTblTouch[iSelected] ); |
241 iContainer->View()->HandleCommandL( KButtonsIdTblTouch[iSelected] ); |
242 } |
242 } |
243 |
243 |
244 #ifdef RD_INTELLIGENT_TEXT_INPUT |
244 #ifdef RD_INTELLIGENT_TEXT_INPUT |
245 if ( iKeyboardType == EPtiKeyboardHalfQwerty ) |
245 if ( iKeyboardType == EPtiKeyboardHalfQwerty ) |
246 { |
246 { |
247 iLastKeyCode = 0; |
247 iLastKeyCode = 0; |
248 } |
248 } |
249 #endif |
249 #endif |
250 |
250 |
251 //Set to dimmed state |
251 //Set to dimmed state |
252 button->SetDimmed( EFalse ); |
252 button->SetDimmed( EFalse ); |
253 DrawDeferred(); |
253 DrawDeferred(); |
260 // (other items were commented in a header). |
260 // (other items were commented in a header). |
261 // --------------------------------------------------------- |
261 // --------------------------------------------------------- |
262 // |
262 // |
263 void CCalcFuncmapSubPane::NotifyReleaseKeyL() |
263 void CCalcFuncmapSubPane::NotifyReleaseKeyL() |
264 { |
264 { |
265 /*Get the selected pointer |
265 /*Get the selected pointer |
266 button -> different layouts, different values*/ |
266 button -> different layouts, different values*/ |
267 CAknButton* button = iButtons[iSelected]; |
267 CAknButton* button = iButtons[iSelected]; |
268 CAknButtonState* state = button->State(EnNormal); |
268 CAknButtonState* state = button->State(EnNormal); |
269 |
269 |
270 if(state->Flags() == EnPressed) |
270 if(state->Flags() == EnPressed) |
271 { |
271 { |
272 TKeyEvent aKeyEvent; |
272 TKeyEvent aKeyEvent; |
273 aKeyEvent.iScanCode = EStdKeyEnter; |
273 aKeyEvent.iScanCode = EStdKeyEnter; |
274 TEventCode aType = EEventKeyUp; |
274 TEventCode aType = EEventKeyUp; |
275 //trigger offerkeyeventl to this button |
275 //trigger offerkeyeventl to this button |
276 button->OfferKeyEventL(aKeyEvent,aType); |
276 button->OfferKeyEventL(aKeyEvent,aType); |
277 state->SetFlags(EnNormal); |
277 state->SetFlags(EnNormal); |
278 button->DrawNow(); |
278 button->DrawNow(); |
279 } |
279 } |
280 if( !AknLayoutUtils::PenEnabled() ) |
280 if( !AknLayoutUtils::PenEnabled() ) |
281 { |
281 { |
282 if(iSelected == EScrollUp) |
282 if(iSelected == EScrollUp) |
283 { |
283 { |
284 CCalcOutputSheet* outputSheet = iContainer->OutputSheet(); |
284 CCalcOutputSheet* outputSheet = iContainer->OutputSheet(); |
285 if(!outputSheet->CanUp()) |
285 if(!outputSheet->CanUp()) |
286 { |
286 { |
287 RedrawHighlight(EScrollUp,EScrollDown); |
287 RedrawHighlight(EScrollUp,EScrollDown); |
446 ( aKeyEvent.iScanCode == EStdKeyLeftShift && aType == EEventKeyDown ) ) |
454 ( aKeyEvent.iScanCode == EStdKeyLeftShift && aType == EEventKeyDown ) ) |
447 { |
455 { |
448 iEngine->MappingDataForKey( keyQwertyValue, keys, EPtiCaseFnLower ); |
456 iEngine->MappingDataForKey( keyQwertyValue, keys, EPtiCaseFnLower ); |
449 MapDataForChrShiftKey( keys, firstoperator, secondoperator); |
457 MapDataForChrShiftKey( keys, firstoperator, secondoperator); |
450 if ( (secondoperator == -1) && (firstoperator != -1)) |
458 if ( (secondoperator == -1) && (firstoperator != -1)) |
451 { |
459 { |
452 if ( AknLayoutUtils::PenEnabled() ) |
460 if ( AknLayoutUtils::PenEnabled() ) |
453 { |
461 { |
454 iSelected = firstoperator; |
462 iSelected = firstoperator; |
455 } |
463 } |
456 else |
464 else |
457 { |
465 { |
458 if ( firstoperator == ECmdTSeparator ) |
466 if ( firstoperator == ECmdTSeparator ) |
459 { |
467 { |
460 iDecimalPoint = ETrue; |
468 iDecimalPoint = ETrue; |
461 } |
469 } |
462 else |
470 else |
463 { |
471 { |
464 iSelected = firstoperator; |
472 iSelected = firstoperator; |
465 iDecimalPoint = EFalse; |
473 iDecimalPoint = EFalse; |
466 } |
474 } |
467 } |
475 } |
468 } |
476 } |
469 else if ( (firstoperator == -1) && (secondoperator != -1) ) |
477 else if ( (firstoperator == -1) && (secondoperator != -1) ) |
470 { |
478 { |
471 if ( AknLayoutUtils::PenEnabled() ) |
479 if ( AknLayoutUtils::PenEnabled() ) |
472 { |
480 { |
473 iSelected = secondoperator; |
481 iSelected = secondoperator; |
474 } |
482 } |
475 else |
483 else |
476 { |
484 { |
477 if ( secondoperator == ECmdTSeparator ) |
485 if ( secondoperator == ECmdTSeparator ) |
478 { |
486 { |
479 iDecimalPoint = ETrue; |
487 iDecimalPoint = ETrue; |
480 } |
488 } |
481 else |
489 else |
482 { |
490 { |
483 iSelected = secondoperator; |
491 iSelected = secondoperator; |
484 iDecimalPoint = EFalse; |
492 iDecimalPoint = EFalse; |
485 } |
493 } |
486 } |
494 } |
487 } |
495 } |
488 else if ( (firstoperator != -1) && (secondoperator != -1) ) |
496 else if ( (firstoperator != -1) && (secondoperator != -1) ) |
489 { |
497 { |
490 if ( iLastKeyCode == aKeyEvent.iScanCode ) |
498 if ( iLastKeyCode == aKeyEvent.iScanCode ) |
491 { |
499 { |
492 if ( AknLayoutUtils::PenEnabled() ) |
500 if ( AknLayoutUtils::PenEnabled() ) |
493 { |
501 { |
494 if ( iSelected == firstoperator ) |
502 if ( iSelected == firstoperator ) |
499 { |
507 { |
500 iSelected = firstoperator; |
508 iSelected = firstoperator; |
501 } |
509 } |
502 } |
510 } |
503 else |
511 else |
504 { |
512 { |
505 if ( firstoperator == ECmdTSeparator || secondoperator == ECmdTSeparator ) |
513 if ( firstoperator == ECmdTSeparator || secondoperator == ECmdTSeparator ) |
506 { |
514 { |
507 if ( iDecimalPoint ) |
515 if ( iDecimalPoint ) |
508 { |
516 { |
509 iDecimalPoint = EFalse; |
517 iDecimalPoint = EFalse; |
510 if ( firstoperator == ECmdTSeparator ) |
518 if ( firstoperator == ECmdTSeparator ) |
511 { |
519 { |
512 iSelected = secondoperator; |
520 iSelected = secondoperator; |
513 } |
521 } |
514 else |
522 else |
515 { |
523 { |
516 iSelected = firstoperator; |
524 iSelected = firstoperator; |
517 } |
525 } |
518 } |
526 } |
519 else |
527 else |
520 { |
528 { |
521 iDecimalPoint = ETrue; |
529 iDecimalPoint = ETrue; |
522 } |
530 } |
523 } |
531 } |
524 else |
532 else |
525 { |
533 { |
526 if ( iSelected == firstoperator ) |
534 if ( iSelected == firstoperator ) |
527 { |
535 { |
528 iSelected = secondoperator; |
536 iSelected = secondoperator; |
529 } |
537 } |
530 else |
538 else |
531 { |
539 { |
532 iSelected = firstoperator; |
540 iSelected = firstoperator; |
533 } |
541 } |
534 } |
542 } |
535 } |
543 } |
536 } |
544 } |
537 else |
545 else |
538 { |
546 { |
539 if ( AknLayoutUtils::PenEnabled() ) |
547 if ( AknLayoutUtils::PenEnabled() ) |
540 { |
548 { |
541 iSelected = firstoperator; |
549 iSelected = firstoperator; |
542 } |
550 } |
543 else |
551 else |
544 { |
552 { |
545 if ( firstoperator == ECmdTSeparator ) |
553 if ( firstoperator == ECmdTSeparator ) |
546 { |
554 { |
547 iDecimalPoint = ETrue; |
555 iDecimalPoint = ETrue; |
548 } |
556 } |
549 else |
557 else |
550 { |
558 { |
551 iSelected = firstoperator; |
559 iSelected = firstoperator; |
552 iDecimalPoint = EFalse; |
560 iDecimalPoint = EFalse; |
553 } |
561 } |
554 } |
562 } |
555 |
563 |
556 } |
564 } |
557 } |
565 } |
558 RedrawHighlight( oldSelect, iSelected ); |
566 RedrawHighlight( oldSelect, iSelected ); |
562 iIsShiftKeyPressed = ETrue; |
570 iIsShiftKeyPressed = ETrue; |
563 } |
571 } |
564 } |
572 } |
565 else |
573 else |
566 #endif |
574 #endif |
567 { |
575 { |
568 //For Multiplication operator in Qwerty keypad |
576 //For Multiplication operator in Qwerty keypad |
569 if(((aKeyEvent.iScanCode == EStdKeyLeftShift) || (aKeyEvent.iScanCode == EStdKeyRightShift)) && aType == EEventKeyDown) |
577 if(((aKeyEvent.iScanCode == EStdKeyLeftShift) || (aKeyEvent.iScanCode == EStdKeyRightShift)) && aType == EEventKeyDown) |
570 { |
578 { |
571 if(iShiftKeyPressed == EPtiCaseLower ) |
579 if(iShiftKeyPressed == EPtiCaseLower ) |
572 { |
580 { |
573 iShiftKeyPressed = EPtiCaseUpper; |
581 iShiftKeyPressed = EPtiCaseUpper; |
574 iShiftKey = 0; |
582 iShiftKey = 0; |
575 iValue = ETrue; |
583 iValue = ETrue; |
576 } |
584 } |
577 |
585 |
578 else |
586 else |
579 { |
587 { |
580 iShiftKeyPressed = EPtiCaseLower; |
588 iShiftKeyPressed = EPtiCaseLower; |
581 } |
589 } |
582 exitCode = EKeyWasConsumed; |
590 exitCode = EKeyWasConsumed; |
583 |
591 |
584 iIsShiftKeyPressed = ETrue; |
592 iIsShiftKeyPressed = ETrue; |
585 } |
593 } |
586 else if((aKeyEvent.iScanCode == EStdKeyLeftShift || aKeyEvent.iScanCode == EStdKeyRightShift)&& aType == EEventKeyUp) |
594 else if((aKeyEvent.iScanCode == EStdKeyLeftShift || aKeyEvent.iScanCode == EStdKeyRightShift)&& aType == EEventKeyUp) |
587 { |
595 { |
588 /*if(((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || |
596 /*if(((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || |
589 (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))&& iShiftKey >= 1)*/ |
597 (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))&& iShiftKey >= 1)*/ |
590 if( iShiftKey >= 1 ) |
598 if( iShiftKey >= 1 ) |
591 { |
599 { |
592 iShiftKeyPressed = EPtiCaseLower; |
600 iShiftKeyPressed = EPtiCaseLower; |
593 } |
601 } |
594 iValue = EFalse; |
602 iValue = EFalse; |
595 exitCode = EKeyWasConsumed; |
603 exitCode = EKeyWasConsumed; |
596 |
604 |
597 iIsShiftKeyPressed = ETrue; |
605 iIsShiftKeyPressed = ETrue; |
598 } |
606 } |
599 } |
607 } |
600 //else |
608 //else |
601 if ( !iIsShiftKeyPressed ) |
609 if ( !iIsShiftKeyPressed ) |
602 { |
610 { |
603 if (aType != EEventKey) |
611 if (aType != EEventKey) |
604 { |
612 { |
605 if (aType == EEventKeyDown) |
613 if (aType == EEventKeyDown) |
606 { |
614 { |
607 iIsOfferKeyEvent = ETrue; |
615 iIsOfferKeyEvent = ETrue; |
608 } |
616 } |
609 else if (aType == EEventKeyUp) |
617 else if (aType == EEventKeyUp) |
610 { |
618 { |
611 iIsOfferKeyEvent = EFalse; |
619 iIsOfferKeyEvent = EFalse; |
612 } |
620 } |
613 // when users press send key, EKeyWasNotConsumed is returned to system |
621 // when users press send key, EKeyWasNotConsumed is returned to system |
614 // to open dialer |
622 // to open dialer |
615 if ( aKeyEvent.iScanCode == EStdKeyYes ) |
623 if ( aKeyEvent.iScanCode == EStdKeyYes ) |
616 { |
624 { |
617 return EKeyWasNotConsumed; |
625 return EKeyWasNotConsumed; |
623 { |
631 { |
624 exitCode = EKeyWasConsumed; |
632 exitCode = EKeyWasConsumed; |
625 iShiftKeyPressed = EPtiCaseLower; |
633 iShiftKeyPressed = EPtiCaseLower; |
626 } |
634 } |
627 #else |
635 #else |
628 if(MapNumericCharL(keyQwertyValue,iShiftKeyPressed)) |
636 if(MapNumericCharL(keyQwertyValue,iShiftKeyPressed)) |
629 { |
637 { |
630 exitCode = EKeyWasConsumed; |
638 exitCode = EKeyWasConsumed; |
631 iShiftKeyPressed = EPtiCaseLower; |
639 iShiftKeyPressed = EPtiCaseLower; |
632 } |
640 } |
633 #endif |
641 #endif |
634 else |
642 else |
635 { |
643 { |
636 #ifdef RD_INTELLIGENT_TEXT_INPUT |
644 #ifdef RD_INTELLIGENT_TEXT_INPUT |
637 if( MapNumerics( aKeyEvent ) || aKeyEvent.iCode == EKeyBackspace ) |
645 if( MapNumerics( aKeyEvent ) || aKeyEvent.iCode == EKeyBackspace ) |
638 { |
646 { |
639 exitCode = EKeyWasNotConsumed; |
647 exitCode = EKeyWasNotConsumed; |
640 iShiftKeyPressed = EPtiCaseLower; |
648 iShiftKeyPressed = EPtiCaseLower; |
649 iShiftKeyPressed = EPtiCaseUpper; |
657 iShiftKeyPressed = EPtiCaseUpper; |
650 iShiftKey++; |
658 iShiftKey++; |
651 } |
659 } |
652 } |
660 } |
653 #else |
661 #else |
654 if(MapNumerics(keyQwertyValue,iShiftKeyPressed) || aKeyEvent.iCode == EKeyBackspace) |
662 if(MapNumerics(keyQwertyValue,iShiftKeyPressed) || aKeyEvent.iCode == EKeyBackspace) |
655 { |
663 { |
656 exitCode = EKeyWasNotConsumed; |
664 exitCode = EKeyWasNotConsumed; |
657 iShiftKeyPressed = EPtiCaseLower; |
665 iShiftKeyPressed = EPtiCaseLower; |
658 |
666 |
659 /*if((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || |
667 /*if((iLanguage == ELangFrench) || (iLanguage == ELangTaiwanChinese) || |
660 (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))*/ |
668 (iLanguage == ELangCzech) || (iLanguage == ELangSlovak))*/ |
661 { |
669 { |
662 if(!iValue) |
670 if(!iValue) |
663 iShiftKeyPressed = EPtiCaseLower; |
671 iShiftKeyPressed = EPtiCaseLower; |
664 |
672 |
665 else |
673 else |
666 iShiftKeyPressed = EPtiCaseUpper; |
674 iShiftKeyPressed = EPtiCaseUpper; |
667 iShiftKey++; |
675 iShiftKey++; |
668 } |
676 } |
669 } |
677 } |
670 #endif |
678 #endif |
671 else |
679 else |
672 { |
680 { |
673 exitCode = EKeyWasConsumed; |
681 exitCode = EKeyWasConsumed; |
674 iShiftKeyPressed = EPtiCaseLower; |
682 iShiftKeyPressed = EPtiCaseLower; |
675 } |
683 } |
676 |
684 |
677 } |
685 } |
678 |
686 |
679 } |
687 } |
680 |
688 |
681 // handle Enter key event |
689 // handle Enter key event |
682 if ( aKeyEvent.iCode == EKeyEnter ) |
690 if ( aKeyEvent.iCode == EKeyEnter ) |
683 { |
691 { |
684 exitCode = EKeyWasConsumed; |
692 exitCode = EKeyWasConsumed; |
685 HandleMiddleSoftKeyOREKeyOKL(); |
693 HandleMiddleSoftKeyOREKeyOKL(); |
686 iShiftKeyPressed = EPtiCaseLower; |
694 iShiftKeyPressed = EPtiCaseLower; |
687 return exitCode; |
695 return exitCode; |
688 } |
696 } |
689 |
697 |
690 iIsShiftKeyPressed = EFalse; |
698 iIsShiftKeyPressed = EFalse; |
691 |
699 |
692 } |
700 } |
693 |
701 |
694 /* if(aKeyEvent.iCode == EKeyOK) |
702 /* if(aKeyEvent.iCode == EKeyOK) |
695 { |
703 { |
696 |
704 |
697 HandleMiddleSoftKeyOREKeyOKL(); |
705 HandleMiddleSoftKeyOREKeyOKL(); |
698 exitCode = EKeyWasConsumed; |
706 exitCode = EKeyWasConsumed; |
699 } |
707 } |
755 |
763 |
756 iSelected = row + column * iButtonsInRow; |
764 iSelected = row + column * iButtonsInRow; |
757 |
765 |
758 }while( iButtons[iSelected]->IsDimmed() ); |
766 }while( iButtons[iSelected]->IsDimmed() ); |
759 |
767 |
760 RedrawHighlight(oldSelect, iSelected); |
768 RedrawHighlight( oldSelect, iSelected, ETrue ); |
761 exitCode = EKeyWasConsumed; |
769 exitCode = EKeyWasConsumed; |
762 break; |
770 break; |
763 } |
771 } |
764 |
772 |
765 case EKeyUpArrow: |
773 case EKeyUpArrow: |
766 { |
774 { |
767 |
775 |
768 SetNextCursorPosForUpArrow(oldSelect); |
776 SetNextCursorPosForUpArrow(oldSelect); |
769 |
777 |
770 RedrawHighlight(oldSelect, iSelected); |
778 RedrawHighlight( oldSelect, iSelected, ETrue ); |
771 exitCode = EKeyWasConsumed; |
779 exitCode = EKeyWasConsumed; |
772 break; |
780 break; |
773 } |
781 } |
774 |
782 |
775 case EKeyDownArrow: |
783 case EKeyDownArrow: |
776 { |
784 { |
777 |
785 |
778 SetNextCursorPosForDownArrow(oldSelect); |
786 SetNextCursorPosForDownArrow(oldSelect); |
779 |
787 |
780 RedrawHighlight(oldSelect, iSelected); |
788 RedrawHighlight( oldSelect, iSelected, ETrue ); |
781 exitCode = EKeyWasConsumed; |
789 exitCode = EKeyWasConsumed; |
782 break; |
790 break; |
783 } |
791 } |
784 |
792 |
785 case EKeyOK: |
793 case EKeyOK: |
947 RedrawHighlight( iSelected, iSelected ); |
957 RedrawHighlight( iSelected, iSelected ); |
948 |
958 |
949 User::LeaveIfError(iQwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive)); |
959 User::LeaveIfError(iQwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive)); |
950 |
960 |
951 iShiftKeyPressed = EPtiCaseLower; |
961 iShiftKeyPressed = EPtiCaseLower; |
952 iShiftKey = 0; |
962 iShiftKey = 0; |
953 |
963 |
954 // Try to get the English key mappings. If those are not available, use the |
964 // Try to get the English key mappings. If those are not available, use the |
955 // mappings of the current input language. The order is this because all mappings |
965 // mappings of the current input language. The order is this because all mappings |
956 // do not necessarily contain all characters neeeded by the Calculator. |
966 // do not necessarily contain all characters neeeded by the Calculator. |
957 iLanguage = ELangEnglish; |
967 iLanguage = ELangEnglish; |
958 iEngine = CPtiEngine::NewL(ETrue); |
968 iEngine = CPtiEngine::NewL(ETrue); |
959 iCoreLanguage = static_cast<CPtiCoreLanguage*>(iEngine->GetLanguage( iLanguage )); |
969 iCoreLanguage = static_cast<CPtiCoreLanguage*>(iEngine->GetLanguage( iLanguage )); |
960 |
970 |
961 if( !iCoreLanguage ) |
971 if( !iCoreLanguage ) |
962 { |
972 { |
963 iCRKey = CRepository::NewL(KCRUidAknFep); |
973 iCRKey = CRepository::NewL(KCRUidAknFep); |
964 TInt ret = iCRKey->Get(KAknFepInputTxtLang,iLanguage); |
974 TInt ret = iCRKey->Get(KAknFepInputTxtLang,iLanguage); |
965 if( ret!= KErrNone ) |
975 if( ret!= KErrNone ) |
966 { |
976 { |
967 //Exit application if server is busy( Error Raised ) |
977 //Exit application if server is busy( Error Raised ) |
1008 |
1018 |
1009 iIsShiftKeyPressed = EFalse; |
1019 iIsShiftKeyPressed = EFalse; |
1010 |
1020 |
1011 } |
1021 } |
1012 |
1022 |
1013 // --------------------------------------------------------- |
1023 // --------------------------------------------------------- |
1014 // CCalcFuncmapSubPane::RefreshButtonIcons |
1024 // CCalcFuncmapSubPane::RefreshButtonIcons |
1015 // This function is called by CCalcContainer::OfferKeyEventL |
1025 // This function is called by CCalcContainer::OfferKeyEventL |
1016 // (other items were commented in a header). |
1026 // (other items were commented in a header). |
1017 // --------------------------------------------------------- |
1027 // --------------------------------------------------------- |
1018 // |
1028 // |
1019 void CCalcFuncmapSubPane::RefreshButtonIcons() |
1029 void CCalcFuncmapSubPane::RefreshButtonIcons() |
1020 { |
1030 { |
1021 /*for (TInt count(0); count < iCountOfButtons; count++) |
1031 /*for (TInt count(0); count < iCountOfButtons; count++) |
1022 { |
1032 { |
1023 iButtons[count]->SetBitmapIcons(iCalcAppEnv->UnpressedButtonBmp(count), |
1033 iButtons[count]->SetBitmapIcons(iCalcAppEnv->UnpressedButtonBmp(count), |
1024 iCalcAppEnv->PressedButtonBmp(count), |
1034 iCalcAppEnv->PressedButtonBmp(count), |
1025 iCalcAppEnv->InactiveButtonBmp(count)); |
1035 iCalcAppEnv->InactiveButtonBmp(count)); |
1026 }*/ |
1036 }*/ |
1027 } |
1037 } |
1028 // --------------------------------------------------------- |
1038 // --------------------------------------------------------- |
1029 // CCalcFuncmapSubPane::SetScrollupEnable |
1039 // CCalcFuncmapSubPane::SetScrollupEnable |
1030 // Redraw scroll-up button on scrolling enable. |
1040 // Redraw scroll-up button on scrolling enable. |
1133 // (other items were commented in a header). |
1143 // (other items were commented in a header). |
1134 // --------------------------------------------------------- |
1144 // --------------------------------------------------------- |
1135 // |
1145 // |
1136 void CCalcFuncmapSubPane::RedrawHighlight |
1146 void CCalcFuncmapSubPane::RedrawHighlight |
1137 (TUint aOldId, // The button chosen before |
1147 (TUint aOldId, // The button chosen before |
1138 TUint aNewId) const // The button chosen newly |
1148 TUint aNewId) // The button chosen newly |
1139 { |
1149 { |
1140 // The State of each button is set. |
1150 // The State of each button is set. |
1141 CAknButton* button = iButtons[aOldId]; |
1151 CAknButton* button = iButtons[aOldId]; |
1142 CAknButtonState* state = button->State(EnNormal); |
1152 CAknButtonState* state = button->State(EnNormal); |
1143 |
1153 |
1144 if(state->Flags() == EnPressed) |
1154 if(state->Flags() == EnPressed) |
1145 { |
1155 { |
1146 TKeyEvent aKeyEvent; |
1156 TKeyEvent aKeyEvent; |
1147 aKeyEvent.iScanCode = EStdKeyEnter; |
1157 aKeyEvent.iScanCode = EStdKeyEnter; |
1148 TEventCode aType = EEventKeyUp; |
1158 TEventCode aType = EEventKeyUp; |
1149 //trigger offerkeyeventl to this button |
1159 //trigger offerkeyeventl to this button |
1150 TRAP_IGNORE(button->OfferKeyEventL(aKeyEvent,aType)); |
1160 TRAP_IGNORE(button->OfferKeyEventL(aKeyEvent,aType)); |
1151 state->SetFlags(EnNormal); |
1161 state->SetFlags(EnNormal); |
1152 } |
1162 } |
|
1163 |
1153 if( aOldId != aNewId ) |
1164 if( aOldId != aNewId ) |
1154 { |
1165 { |
|
1166 button = iButtons[aNewId]; |
|
1167 } |
|
1168 } |
|
1169 |
|
1170 // --------------------------------------------------------- |
|
1171 // CCalcFuncmapSubPane::RedrawHighlight |
|
1172 // An old highlight rectangle is erased and |
|
1173 // a new highlight rectangle is drawn. |
|
1174 // (other items were commented in a header). |
|
1175 // --------------------------------------------------------- |
|
1176 // |
|
1177 void CCalcFuncmapSubPane::RedrawHighlight |
|
1178 (TUint aOldId, // The button chosen before |
|
1179 TUint aNewId, |
|
1180 TBool aShowHightlight) // The button chosen newly |
|
1181 { |
|
1182 // The State of each button is set. |
|
1183 CAknButton* button = iButtons[aOldId]; |
|
1184 CAknButtonState* state = button->State(EnNormal); |
|
1185 iShowDrawHight = ETrue; |
|
1186 if( state->Flags() == EnPressed ) |
|
1187 { |
|
1188 TKeyEvent aKeyEvent; |
|
1189 aKeyEvent.iScanCode = EStdKeyEnter; |
|
1190 TEventCode aType = EEventKeyUp; |
|
1191 //trigger offerkeyeventl to this button |
|
1192 TRAP_IGNORE(button->OfferKeyEventL(aKeyEvent,aType)); |
|
1193 state->SetFlags(EnNormal); |
|
1194 } |
|
1195 if( aOldId != aNewId ) |
|
1196 { |
1155 button->SetFocus( EFalse, EDrawNow ); |
1197 button->SetFocus( EFalse, EDrawNow ); |
1156 button = iButtons[aNewId]; |
1198 button = iButtons[aNewId]; |
1157 button->SetFocus( ETrue, EDrawNow ); |
1199 button->SetFocus( ETrue, EDrawNow ); |
1158 } |
1200 } |
1159 } |
1201 } |
1160 |
|
1161 // --------------------------------------------------------- |
1202 // --------------------------------------------------------- |
1162 // CCalcFuncmapSubPane::SetLayout |
1203 // CCalcFuncmapSubPane::SetLayout |
1163 // Set functionmap button layout. |
1204 // Set functionmap button layout. |
1164 // (other items were commented in a header). |
1205 // (other items were commented in a header). |
1165 // --------------------------------------------------------- |
1206 // --------------------------------------------------------- |
1168 |
1209 |
1169 void CCalcFuncmapSubPane::SetLayout() |
1210 void CCalcFuncmapSubPane::SetLayout() |
1170 { |
1211 { |
1171 TRect parentRect(Rect()); |
1212 TRect parentRect(Rect()); |
1172 |
1213 |
1173 TInt t = 0; |
1214 TInt t = 0; |
1174 if( AknLayoutUtils::PenEnabled() ) |
1215 if( AknLayoutUtils::PenEnabled() ) |
1175 { |
1216 { |
1176 for (TInt count(0); count < KButtonsInColumnTouch; count++) |
1217 for (TInt count(0); count < KButtonsInColumnTouch; count++) |
1177 { |
1218 { |
1178 for (TInt row(0); row < 5; row++) |
1219 for (TInt row(0); row < 5; row++) |
1179 { |
1220 { |
1180 |
1221 |
1181 TAknWindowLineLayout area; |
1222 TAknWindowLineLayout area; |
1182 TAknWindowLineLayout area1; |
1223 TAknWindowLineLayout area1; |
1183 |
1224 |
1184 TAknWindowLineLayout areaG2; |
1225 TAknWindowLineLayout areaG2; |
1185 TAknWindowLineLayout areaGraphics; |
1226 TAknWindowLineLayout areaGraphics; |
1186 |
1227 |
1187 area= AknLayoutScalable_Apps::toolbar_button_pane_cp01(1).LayoutLine(); |
1228 area= AknLayoutScalable_Apps::toolbar_button_pane_cp01(1).LayoutLine(); |
1188 areaG2= AknLayoutScalable_Apps::cell_calc_pane_g2(1).LayoutLine(); |
1229 areaG2= AknLayoutScalable_Apps::cell_calc_pane_g2(1).LayoutLine(); |
1189 if (Layout_Meta_Data::IsLandscapeOrientation()) |
1230 if (Layout_Meta_Data::IsLandscapeOrientation()) |
1190 { |
1231 { |
1191 area1 = AknLayoutScalable_Apps::cell_calc_pane(count,row,enTouch_with_prt).LayoutLine(); |
1232 area1 = AknLayoutScalable_Apps::cell_calc_pane(count,row,enTouch_with_prt).LayoutLine(); |
1192 } |
1233 } |
1193 else |
1234 else |
1194 { |
1235 { |
1195 area1 = AknLayoutScalable_Apps::cell_calc_pane(count,row,enTouch_enabled).LayoutLine(); |
1236 area1 = AknLayoutScalable_Apps::cell_calc_pane(count,row,enTouch_enabled).LayoutLine(); |
1196 } |
1237 } |
1197 |
1238 |
1198 areaGraphics = area1; |
1239 areaGraphics = area1; |
1199 areaGraphics.iW = areaGraphics.iW - areaG2.il - areaG2.ir; |
1240 areaGraphics.iW = areaGraphics.iW - areaG2.il - areaG2.ir; |
1200 areaGraphics.iH = areaG2.iH; |
1241 areaGraphics.iH = areaG2.iH; |
1201 |
1242 |
1202 area1.il = area1.il + area.il; |
1243 area1.il = area1.il + area.il; |
1203 area1.ir = area1.ir - area.ir; |
1244 area1.ir = area1.ir - area.ir; |
1204 area1.it = area1.it + area.it; |
1245 area1.it = area1.it + area.it; |
1205 area1.ib = area1.ib - area.ib; |
1246 area1.ib = area1.ib - area.ib; |
1206 area1.iW = area1.iW - area.il - area.ir; |
1247 area1.iW = area1.iW - area.il - area.ir; |
1207 area1.iH = area1.iH - area.it - area.ib; |
1248 area1.iH = area1.iH - area.it - area.ib; |
1208 |
1249 |
1209 |
1250 |
1210 //A change in values here |
1251 //A change in values here |
1211 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
1252 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
1212 { |
1253 { |
1213 AknLayoutUtils::LayoutControl( |
1254 AknLayoutUtils::LayoutControl( |
1312 // (other items were commented in a header). |
1353 // (other items were commented in a header). |
1313 // --------------------------------------------------------- |
1354 // --------------------------------------------------------- |
1314 // |
1355 // |
1315 void CCalcFuncmapSubPane::SetSqrtEnable(TBool aEnable) |
1356 void CCalcFuncmapSubPane::SetSqrtEnable(TBool aEnable) |
1316 { |
1357 { |
1317 //Get the sqrt button |
1358 //Get the sqrt button |
1318 CAknButton* button = NULL; |
1359 CAknButton* button = NULL; |
1319 if( !AknLayoutUtils::PenEnabled() ) |
1360 if( !AknLayoutUtils::PenEnabled() ) |
1320 { |
1361 { |
1321 button = iButtons[ESqrtButton]; |
1362 button = iButtons[ESqrtButton]; |
1322 } |
1363 } |
1323 else |
1364 else |
1324 { |
1365 { |
1325 button = iButtons[ECmdTSqrt]; |
1366 button = iButtons[ECmdTSqrt]; |
1326 } |
1367 } |
1327 if( button ) |
1368 if( button ) |
1328 { |
1369 { |
1329 button->SetDimmed(!aEnable); |
1370 button->SetDimmed(!aEnable); |
1330 button->DrawNow(); |
1371 button->DrawNow(); |
1331 } |
1372 } |
1332 iIsSqrtDimmed = aEnable; |
1373 iIsSqrtDimmed = aEnable; |
1333 } |
1374 } |
1334 |
1375 |
1335 |
1376 |
1336 // --------------------------------------------------------- |
1377 // --------------------------------------------------------- |
1337 // CCalcFuncmapSubPane::SetPercentEnable |
1378 // CCalcFuncmapSubPane::SetPercentEnable |
1338 // Redraw percent button, either normal or dimmed. |
1379 // Redraw percent button, either normal or dimmed. |
1339 // (other items were commented in a header). |
1380 // (other items were commented in a header). |
1340 // --------------------------------------------------------- |
1381 // --------------------------------------------------------- |
1341 // |
1382 // |
1342 void CCalcFuncmapSubPane::SetPercentEnable(TBool aEnable) |
1383 void CCalcFuncmapSubPane::SetPercentEnable(TBool aEnable) |
1343 { |
1384 { |
1344 //Get the percent button |
1385 //Get the percent button |
1345 CAknButton* button = NULL; |
1386 CAknButton* button = NULL; |
1346 if( !AknLayoutUtils::PenEnabled() ) |
1387 if( !AknLayoutUtils::PenEnabled() ) |
1347 { |
1388 { |
1348 button = iButtons[EPercentButton]; |
1389 button = iButtons[EPercentButton]; |
1349 } |
1390 } |
1350 else |
1391 else |
1351 { |
1392 { |
1352 button = iButtons[ECmdTPercent]; |
1393 button = iButtons[ECmdTPercent]; |
1353 } |
1394 } |
1354 if( button ) |
1395 if( button ) |
1355 { |
1396 { |
1356 button->SetDimmed(!aEnable); |
1397 button->SetDimmed(!aEnable); |
1357 button->DrawNow(); |
1398 button->DrawNow(); |
1358 } |
1399 } |
1359 iIsPercentDimmed = aEnable; |
1400 iIsPercentDimmed = aEnable; |
1360 } |
1401 } |
1361 |
1402 |
1362 // --------------------------------------------------------- |
1403 // --------------------------------------------------------- |
1363 // CCalcFuncmapSubPane::MapNumericChar |
1404 // CCalcFuncmapSubPane::MapNumericChar |
1364 // Redraw percent button, either normal or dimmed. |
1405 // Redraw percent button, either normal or dimmed. |
1365 // (other items were commented in a header). |
1406 // (other items were commented in a header). |
1366 // --------------------------------------------------------- |
1407 // --------------------------------------------------------- |
1367 // |
1408 // |
1368 #ifdef RD_INTELLIGENT_TEXT_INPUT |
1409 #ifdef RD_INTELLIGENT_TEXT_INPUT |
1369 TBool CCalcFuncmapSubPane::MapNumericCharL( TKeyEvent aKeyEvent ) |
1410 TBool CCalcFuncmapSubPane::MapNumericCharL( TKeyEvent aKeyEvent ) |
1370 { |
1411 { |
1371 TBuf<KMaxNumCharsPerCase> keys; |
1412 TBuf<KMaxNumCharsPerCase> keys; |
1372 |
1413 |
1606 iSelected = buttonValue; |
1647 iSelected = buttonValue; |
1607 if ( iButtons[buttonValue]->Rect().Contains( aPointerEvent.iPosition ) ) |
1648 if ( iButtons[buttonValue]->Rect().Contains( aPointerEvent.iPosition ) ) |
1608 { |
1649 { |
1609 RedrawHighlight( oldSelect, iSelected ); |
1650 RedrawHighlight( oldSelect, iSelected ); |
1610 } |
1651 } |
1611 } |
1652 if( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
1612 CCoeControl::HandlePointerEventL( aPointerEvent ); |
1653 { |
1613 } |
1654 iContainer->View()->HandleCommandL(KButtonsIdTblTouch[iSelected]); |
1614 |
1655 iInputData = ETrue; |
|
1656 } |
|
1657 if( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
1658 { |
|
1659 iInputData = EFalse; |
|
1660 if( iErrorCode != KErrNone ) |
|
1661 { |
|
1662 ErrorMsgL( iErrorCode ); |
|
1663 iErrorCode = KErrNone; |
|
1664 } |
|
1665 } |
|
1666 } |
|
1667 |
|
1668 CCoeControl::HandlePointerEventL( aPointerEvent ); |
|
1669 |
|
1670 } |
|
1671 |
|
1672 // --------------------------------------------------------- |
|
1673 // CCalcFuncmapSubPane::SetErrorCode |
|
1674 // Call from container when an error code is display. |
|
1675 // --------------------------------------------------------- |
|
1676 // |
|
1677 void CCalcFuncmapSubPane::SetErrorCode(TInt aError) |
|
1678 { |
|
1679 iErrorCode = aError; |
|
1680 } |
|
1681 |
|
1682 // --------------------------------------------------------- |
|
1683 // CCalcFuncmapSubPane::ErrorMsgL |
|
1684 // Call when there is an error release event. |
|
1685 // --------------------------------------------------------- |
|
1686 // |
|
1687 void CCalcFuncmapSubPane::ErrorMsgL(TInt aErrorCode) |
|
1688 { |
|
1689 TInt resourceId(0); |
|
1690 |
|
1691 switch (aErrorCode) |
|
1692 { |
|
1693 case KErrOverflow: |
|
1694 { |
|
1695 resourceId = R_CALC_ERROR_OUTOFRANGE; |
|
1696 break; |
|
1697 } |
|
1698 case KErrDivideByZero: |
|
1699 { |
|
1700 resourceId = R_CALC_ERROR_DIVISIONBYZERO; |
|
1701 |
|
1702 // UpdateState( EOperator ); |
|
1703 break; |
|
1704 } |
|
1705 case KErrNotSupported: |
|
1706 { |
|
1707 resourceId = R_CALC_ERROR_NEGATIVEVALUESQRT; |
|
1708 break; |
|
1709 } |
|
1710 default: |
|
1711 { |
|
1712 return; |
|
1713 } |
|
1714 } |
|
1715 |
|
1716 //Localisation of scalable UI. |
|
1717 HBufC* message = iCoeEnv->AllocReadResourceLC( resourceId ) ; |
|
1718 CAknErrorNote* note = new (ELeave) CAknErrorNote(); |
|
1719 note->ExecuteLD( *message ); |
|
1720 CleanupStack::PopAndDestroy( message ); |
|
1721 |
|
1722 } |
1615 // --------------------------------------------------------- |
1723 // --------------------------------------------------------- |
1616 // CCalcFuncmapSubPane::FunctionPaneRect |
1724 // CCalcFuncmapSubPane::FunctionPaneRect |
1617 // This function gives the layout of Function Pnae. |
1725 // This function gives the layout of Function Pnae. |
1618 // (other items were commented in a header). |
1726 // (other items were commented in a header). |
1619 // --------------------------------------------------------- |
1727 // --------------------------------------------------------- |
1620 // |
1728 // |
1621 |
1729 |
1622 TRect CCalcFuncmapSubPane::FunctionPaneRect() |
1730 TRect CCalcFuncmapSubPane::FunctionPaneRect() |
1623 { |
1731 { |
1624 TRect parentRect(Rect()); |
1732 TRect parentRect(Rect()); |
1625 return parentRect; |
1733 return parentRect; |
1626 } |
1734 } |
1627 |
1735 |
1628 // --------------------------------------------------------- |
1736 // --------------------------------------------------------- |
1629 // CCalcFuncmapSubPane::CalculatingCorrectButton |
1737 // CCalcFuncmapSubPane::CalculatingCorrectButton |
1630 // Handled when there is Pen Input. |
1738 // Handled when there is Pen Input. |
1631 // (other items were commented in a header). |
1739 // (other items were commented in a header). |
1632 // --------------------------------------------------------- |
1740 // --------------------------------------------------------- |
1633 // |
1741 // |
1634 |
1742 |
1635 TInt CCalcFuncmapSubPane::CalculatingCorrectButton |
1743 TInt CCalcFuncmapSubPane::CalculatingCorrectButton |
1636 (const TPointerEvent& aPointerEvent) |
1744 (const TPointerEvent& aPointerEvent) |
1637 { |
1745 { |
1638 TInt selected = iSelected; |
1746 TInt selected = iSelected; |
1639 |
1747 |
1640 //Function that calculates the correct button where the pointer event had occurred |
1748 //Function that calculates the correct button where the pointer event had occurred |
1641 for(TInt i = 0; i<iCountOfButtons; i++) |
1749 for(TInt i = 0; i<iCountOfButtons; i++) |
1642 { |
1750 { |
1643 if(iButtons[i]->Rect().Contains(aPointerEvent.iPosition)) |
1751 if(iButtons[i]->Rect().Contains(aPointerEvent.iPosition)) |
1644 { |
1752 { |
1645 selected = i; |
1753 selected = i; |
1646 } |
1754 } |
1647 } |
1755 } |
1648 return selected; |
1756 return selected; |
1649 } |
1757 } |
1650 |
1758 |
1651 // --------------------------------------------------------- |
1759 // --------------------------------------------------------- |
1654 // --------------------------------------------------------- |
1762 // --------------------------------------------------------- |
1655 // |
1763 // |
1656 |
1764 |
1657 void CCalcFuncmapSubPane::HandleMiddleSoftKeyOREKeyOKL() |
1765 void CCalcFuncmapSubPane::HandleMiddleSoftKeyOREKeyOKL() |
1658 { |
1766 { |
1659 //get the selected button id |
1767 //get the selected button id |
1660 CAknButton* button = iButtons[iSelected]; |
1768 CAknButton* button = iButtons[iSelected]; |
1661 //put the button in the pressed state |
1769 //put the button in the pressed state |
1662 CAknButtonState* state = button->State(EnNormal); |
1770 CAknButtonState* state = button->State(EnNormal); |
1663 //Put the button in pressed state |
1771 //Put the button in pressed state |
1664 |
1772 |
1665 TKeyEvent aKeyEvent; |
1773 TKeyEvent aKeyEvent; |
1666 aKeyEvent.iScanCode = EStdKeyEnter; |
1774 aKeyEvent.iScanCode = EStdKeyEnter; |
1667 TEventCode aType = EEventKeyDown; |
1775 TEventCode aType = EEventKeyDown; |
1668 button->OfferKeyEventL(aKeyEvent,aType); |
1776 button->OfferKeyEventL(aKeyEvent,aType); |
1669 //put to pressed state |
1777 //put to pressed state |
1670 state->SetFlags(EnPressed); |
1778 state->SetFlags(EnPressed); |
1671 button->DrawNow(); |
1779 button->DrawNow(); |
1672 |
1780 |
1673 if(!iIsOfferKeyEvent) |
1781 if(!iIsOfferKeyEvent) |
1674 { |
1782 { |
1675 |
|
1676 NotifyReleaseKeyL(); |
1783 NotifyReleaseKeyL(); |
1677 } |
1784 } |
1678 } |
1785 } |
1679 |
1786 |
1680 // --------------------------------------------------------- |
1787 // --------------------------------------------------------- |
1752 // CCalcFuncmapSubPane::MapDataForChrShiftKey |
1859 // CCalcFuncmapSubPane::MapDataForChrShiftKey |
1753 // Redraw percent button, either normal or dimmed. |
1860 // Redraw percent button, either normal or dimmed. |
1754 // --------------------------------------------------------- |
1861 // --------------------------------------------------------- |
1755 // |
1862 // |
1756 void CCalcFuncmapSubPane::MapDataForChrShiftKey( TDes& aOperators, TInt& aFirstOperator, TInt& aSecondOperator) |
1863 void CCalcFuncmapSubPane::MapDataForChrShiftKey( TDes& aOperators, TInt& aFirstOperator, TInt& aSecondOperator) |
1757 { |
1864 { |
1758 if( aOperators.Length() > 0 ) |
1865 if( aOperators.Length() > 0 ) |
1759 { |
1866 { |
1760 TUint16 firstChar = aOperators[0]; |
1867 TUint16 firstChar = aOperators[0]; |
1761 TUint16 secondChar = firstChar; |
1868 TUint16 secondChar = firstChar; |
1762 |
1869 |
1763 if ( aOperators.Length() > 1 ) |
1870 if ( aOperators.Length() > 1 ) |
1764 { |
1871 { |
1765 secondChar = aOperators[1]; |
1872 secondChar = aOperators[1]; |
1766 } |
1873 } |
1767 |
1874 |
1768 switch ( firstChar ) |
1875 switch ( firstChar ) |
1769 { |
1876 { |
1770 case KPtiPinyinMarker: |
1877 case KPtiPinyinMarker: |
1771 case KPtiStrokeMarker: |
1878 case KPtiStrokeMarker: |
1772 case KPtiZhuyinMarker: |
1879 case KPtiZhuyinMarker: |
1776 { |
1883 { |
1777 firstChar = aOperators[1]; |
1884 firstChar = aOperators[1]; |
1778 secondChar = aOperators[2]; |
1885 secondChar = aOperators[2]; |
1779 } |
1886 } |
1780 else |
1887 else |
1781 { |
1888 { |
1782 firstChar = aOperators[1]; |
1889 firstChar = aOperators[1]; |
1783 secondChar = firstChar; |
1890 secondChar = firstChar; |
1784 } |
1891 } |
1785 break; |
1892 break; |
1786 default: |
1893 default: |
1787 break; |
1894 break; |
1788 |
1895 |
1789 } |
1896 } |
1790 |
1897 |
1791 MapOperators( firstChar, aFirstOperator ); |
1898 MapOperators( firstChar, aFirstOperator ); |
1792 |
1899 |
1793 MapOperators( secondChar, aSecondOperator ); |
1900 MapOperators( secondChar, aSecondOperator ); |
1794 |
1901 |
1795 } |
1902 } |
1796 } |
1903 } |
1797 |
1904 |
1798 // --------------------------------------------------------- |
1905 // --------------------------------------------------------- |
1799 // CCalcFuncmapSubPane::MapOperators |
1906 // CCalcFuncmapSubPane::MapOperators |
1800 // Redraw percent button, either normal or dimmed. |
1907 // Redraw percent button, either normal or dimmed. |
1801 // --------------------------------------------------------- |
1908 // --------------------------------------------------------- |
1802 // |
1909 // |
1803 TBool CCalcFuncmapSubPane::MapOperators( TUint16 aOperator, TInt& aResult) |
1910 TBool CCalcFuncmapSubPane::MapOperators( TUint16 aOperator, TInt& aResult) |
1804 { |
1911 { |
1805 TInt loc1 = KAllowedOperatorPlus().Locate( aOperator ); |
1912 TInt loc1 = KAllowedOperatorPlus().Locate( aOperator ); |
1806 if ( loc1 != KErrNotFound ) |
1913 if ( loc1 != KErrNotFound ) |
1807 { |
1914 { |
1808 if ( AknLayoutUtils::PenEnabled() ) |
1915 if ( AknLayoutUtils::PenEnabled() ) |
1809 { |
1916 { |
1810 aResult = ECmdTAdd; |
1917 aResult = ECmdTAdd; |
1811 } |
1918 } |
1812 else |
1919 else |
1813 { |
1920 { |
1814 aResult = EPlusButton; |
1921 aResult = EPlusButton; |
1815 } |
1922 } |
1816 return ETrue; |
1923 return ETrue; |
1817 } |
1924 } |
1818 TInt loc2 = KAllowedOperatorMinus().Locate( aOperator ); |
1925 TInt loc2 = KAllowedOperatorMinus().Locate( aOperator ); |
1819 if ( loc2 != KErrNotFound ) |
1926 if ( loc2 != KErrNotFound ) |
1820 { |
1927 { |
1821 if ( AknLayoutUtils::PenEnabled() ) |
1928 if ( AknLayoutUtils::PenEnabled() ) |
1822 { |
1929 { |
1823 aResult = ECmdTSubtract; |
1930 aResult = ECmdTSubtract; |
1824 } |
1931 } |
1825 else |
1932 else |
1826 { |
1933 { |
1827 aResult = EMinusButton; |
1934 aResult = EMinusButton; |
1828 } |
1935 } |
1829 return ETrue; |
1936 return ETrue; |
1830 } |
1937 } |
1831 TInt loc3 = KAllowedOperatorStar().Locate( aOperator ); |
1938 TInt loc3 = KAllowedOperatorStar().Locate( aOperator ); |
1832 if ( loc3 != KErrNotFound ) |
1939 if ( loc3 != KErrNotFound ) |
1833 { |
1940 { |
1834 if ( AknLayoutUtils::PenEnabled() ) |
1941 if ( AknLayoutUtils::PenEnabled() ) |
1835 { |
1942 { |
1836 aResult = ECmdTMultiply; |
1943 aResult = ECmdTMultiply; |
1837 } |
1944 } |
1838 else |
1945 else |
1839 { |
1946 { |
1840 aResult = EMultiplyButton; |
1947 aResult = EMultiplyButton; |
1841 } |
1948 } |
1842 return ETrue; |
1949 return ETrue; |
1843 } |
1950 } |
1844 TInt loc4 = KAllowedOperatorDivide().Locate( aOperator ); |
1951 TInt loc4 = KAllowedOperatorDivide().Locate( aOperator ); |
1845 if ( loc4 != KErrNotFound ) |
1952 if ( loc4 != KErrNotFound ) |
1846 { |
1953 { |
1847 if ( AknLayoutUtils::PenEnabled() ) |
1954 if ( AknLayoutUtils::PenEnabled() ) |
1848 { |
1955 { |
1849 aResult = ECmdTDivide; |
1956 aResult = ECmdTDivide; |
1850 } |
1957 } |
1851 else |
1958 else |
1852 { |
1959 { |
1853 aResult = EDivideButton; |
1960 aResult = EDivideButton; |
1854 } |
1961 } |
1855 return ETrue; |
1962 return ETrue; |
1856 } |
1963 } |
1857 TInt loc5 = KAllowedOperatorEquals().Locate( aOperator ); |
1964 TInt loc5 = KAllowedOperatorEquals().Locate( aOperator ); |
1858 if ( loc5 != KErrNotFound ) |
1965 if ( loc5 != KErrNotFound ) |
1859 { |
1966 { |
1860 if ( AknLayoutUtils::PenEnabled() ) |
1967 if ( AknLayoutUtils::PenEnabled() ) |
1861 { |
1968 { |
1862 aResult = ECmdTResult; |
1969 aResult = ECmdTResult; |
1863 } |
1970 } |
1864 else |
1971 else |
1865 { |
1972 { |
1866 aResult = EEqualButton; |
1973 aResult = EEqualButton; |
1867 } |
1974 } |
1868 return ETrue; |
1975 return ETrue; |
1869 } |
1976 } |
1870 TInt loc6 = KAllowedOperatorPercent().Locate( aOperator ); |
1977 TInt loc6 = KAllowedOperatorPercent().Locate( aOperator ); |
1871 if ( loc6 != KErrNotFound ) |
1978 if ( loc6 != KErrNotFound ) |
1872 { |
1979 { |
1873 if ( AknLayoutUtils::PenEnabled() ) |
1980 if ( AknLayoutUtils::PenEnabled() ) |
1874 { |
1981 { |
1875 aResult = ECmdTPercent; |
1982 aResult = ECmdTPercent; |
1876 } |
1983 } |
1877 else |
1984 else |
1878 { |
1985 { |
1879 aResult = EPercentButton; |
1986 aResult = EPercentButton; |
1880 } |
1987 } |
1881 return ETrue; |
1988 return ETrue; |
1882 } |
1989 } |
1883 TInt loc7 = KAllowedOperatorDecimal().Locate( aOperator ); |
1990 TInt loc7 = KAllowedOperatorDecimal().Locate( aOperator ); |
1884 if ( loc7 != KErrNotFound ) |
1991 if ( loc7 != KErrNotFound ) |
1885 { |
1992 { |
1886 aResult = ECmdTSeparator; |
1993 aResult = ECmdTSeparator; |
1887 return ETrue; |
1994 return ETrue; |
1888 } |
1995 } |
1889 return EFalse; |
1996 return EFalse; |
1890 } |
1997 } |
1891 |
1998 |
1892 // --------------------------------------------------------- |
1999 // --------------------------------------------------------- |
1893 // CCalcFuncmapSubPane::GetKeyboardType |
2000 // CCalcFuncmapSubPane::GetKeyboardType |
1894 // Returns the type of keyboard |
2001 // Returns the type of keyboard |
1895 // --------------------------------------------------------- |
2002 // --------------------------------------------------------- |