javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtconstrainedtext.cpp
branchRCL_3
changeset 19 71c436fe3ce0
parent 17 0fd27995241b
equal deleted inserted replaced
18:9ac0a0a7da70 19:71c436fe3ce0
   653 
   653 
   654     switch (aConstraint)
   654     switch (aConstraint)
   655     {
   655     {
   656     case ENumeric:
   656     case ENumeric:
   657     {
   657     {
   658         CSwtIntegerEdwin* ed = new(ELeave)CSwtIntegerEdwin;
   658         editor = new(ELeave)CSwtIntegerEdwin;
   659         editor = ed;
       
   660         SetEditor(editor);
   659         SetEditor(editor);
   661         ed->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   660         editor->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   662         Editor().SetTextLimit(iTextLimit);
   661         editor->SetTextLimit(iTextLimit);
   663         Editor().SetAknEditorCase(EAknSCTNumeric);
   662         editor->SetAknEditorCase(EAknSCTNumeric);
   664         Editor().SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   663         editor->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   665         Editor().SetAknEditorInputMode(EAknEditorNumericInputMode);
   664         editor->SetAknEditorInputMode(EAknEditorNumericInputMode);
   666         Editor().SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   665         editor->SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   667         Editor().SetAknEditorFlags(EAknEditorFlagFixedCase | EAknEditorFlagNoT9);
   666         editor->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   668         Editor().SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   667         editor->SetAknEditorFlags(EAknEditorFlagFixedCase
   669 #ifdef RD_SCALABLE_UI_V2
   668                                   | EAknEditorFlagNoT9
   670         Editor().SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap
   669                                   | EAknEditorFlagUseSCTNumericCharmap
   671                                    | EAknEditorFlagDeliverVirtualKeyEventsToApplication);
   670                                   | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   672 #else
   671 #ifdef RD_JAVA_S60_RELEASE_9_2
   673         Editor().SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap);
   672                                   | EAknEditorFlagEnablePartialScreen
   674 #endif // RD_SCALABLE_UI_V2 
   673 #endif // RD_JAVA_S60_RELEASE_9_2                           
   675         Editor().SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_NUMERIC_MODE_DIALOG);
   674                                  );
       
   675         editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_NUMERIC_MODE_DIALOG);
   676     }
   676     }
   677     break;
   677     break;
   678     case EDecimal:
   678     case EDecimal:
   679     {
   679     {
   680         CSwtFloatingPointEdwin* fpe = new(ELeave) CSwtFloatingPointEdwin;
   680         editor = new(ELeave) CSwtFloatingPointEdwin;
   681         editor = fpe;
       
   682         SetEditor(editor);
   681         SetEditor(editor);
   683         fpe->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   682         editor->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   684         Editor().SetAknEditorCase(EAknSCTNumeric);
   683         editor->SetAknEditorCase(EAknSCTNumeric);
   685         Editor().SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   684         editor->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   686         Editor().SetAknEditorInputMode(EAknEditorNumericInputMode);
   685         editor->SetAknEditorInputMode(EAknEditorNumericInputMode);
   687         Editor().SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   686         editor->SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   688         Editor().SetAknEditorFlags(EAknEditorFlagFixedCase | EAknEditorFlagNoT9);
   687         editor->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   689         Editor().SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   688 
   690 #ifdef RD_SCALABLE_UI_V2
   689         editor->SetAknEditorFlags(EAknEditorFlagFixedCase
   691         Editor().SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap
   690                                   | EAknEditorFlagNoT9
   692                                    | EAknEditorFlagDeliverVirtualKeyEventsToApplication);
   691                                   | EAknEditorFlagUseSCTNumericCharmap
   693 #else
   692                                   | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   694         Editor().SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap);
   693 #ifdef RD_JAVA_S60_RELEASE_9_2
   695 #endif // RD_SCALABLE_UI_V2 
   694                                   | EAknEditorFlagEnablePartialScreen
       
   695 #endif // RD_JAVA_S60_RELEASE_9_2                           
       
   696                                  );
       
   697 
   696         if (iDecimalSeparator == ',')
   698         if (iDecimalSeparator == ',')
   697         {
   699         {
   698             Editor().SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_WITH_COMMA_DIALOG);
   700             editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_WITH_COMMA_DIALOG);
   699         }
   701         }
   700         else
   702         else
   701         {
   703         {
   702             Editor().SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_DIALOG);
   704             editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_DIALOG);
   703         }
   705         }
   704     }
   706     }
   705     break;
   707     break;
   706     case EPhoneNumber:
   708     case EPhoneNumber:
   707     {
   709     {
   714         editor->ConstructL(flags, 0, iTextLimit, 1);
   716         editor->ConstructL(flags, 0, iTextLimit, 1);
   715         editor->SetAknEditorCase(EAknSCTNumeric);
   717         editor->SetAknEditorCase(EAknSCTNumeric);
   716         editor->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   718         editor->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   717         editor->SetAknEditorInputMode(EAknEditorNumericInputMode);
   719         editor->SetAknEditorInputMode(EAknEditorNumericInputMode);
   718         editor->SetAknEditorNumericKeymap(EAknEditorAlphanumericNumberModeKeymap);
   720         editor->SetAknEditorNumericKeymap(EAknEditorAlphanumericNumberModeKeymap);
   719 #ifdef RD_SCALABLE_UI_V2
       
   720         editor->SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap
   721         editor->SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap
   721                                   | EAknEditorFlagDeliverVirtualKeyEventsToApplication);
   722                                   | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   722 #else
   723 #ifdef RD_JAVA_S60_RELEASE_9_2
   723         editor->SetAknEditorFlags(EAknEditorFlagUseSCTNumericCharmap);
   724                                   | EAknEditorFlagEnablePartialScreen
   724 #endif // RD_SCALABLE_UI_V2            
   725 #endif // RD_JAVA_S60_RELEASE_9_2                          
       
   726                                  );
   725         editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_PHONENUMBER_MODE_DIALOG);
   727         editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_PHONENUMBER_MODE_DIALOG);
   726     }
   728     }
   727     break;
   729     break;
   728     default:
   730     default:
   729         ASSERT(EFalse);
   731         ASSERT(EFalse);