javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtconstrainedtext.cpp
branchRCL_3
changeset 71 d5e927d5853b
parent 66 2455ef1f5bbc
equal deleted inserted replaced
66:2455ef1f5bbc 71:d5e927d5853b
   653 
   653 
   654     switch (aConstraint)
   654     switch (aConstraint)
   655     {
   655     {
   656     case ENumeric:
   656     case ENumeric:
   657     {
   657     {
   658         editor = new(ELeave)CSwtIntegerEdwin;
   658         // The intEd has to be CSwtIntererEdwin*, otherwise wrong
       
   659         // ConstrucL() method is called.
       
   660         CSwtIntegerEdwin* intEd = new(ELeave)CSwtIntegerEdwin;
       
   661         editor = intEd;
   659         SetEditor(editor);
   662         SetEditor(editor);
   660         editor->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   663         intEd->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   661         editor->SetTextLimit(iTextLimit);
   664         intEd->SetTextLimit(iTextLimit);
   662         editor->SetAknEditorCase(EAknSCTNumeric);
   665         intEd->SetAknEditorCase(EAknSCTNumeric);
   663         editor->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   666         intEd->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   664         editor->SetAknEditorInputMode(EAknEditorNumericInputMode);
   667         intEd->SetAknEditorInputMode(EAknEditorNumericInputMode);
   665         editor->SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   668         intEd->SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   666         editor->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   669         intEd->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   667         editor->SetAknEditorFlags(EAknEditorFlagFixedCase
   670         intEd->SetAknEditorFlags(EAknEditorFlagFixedCase
   668                                   | EAknEditorFlagNoT9
   671                                  | EAknEditorFlagNoT9
   669                                   | EAknEditorFlagUseSCTNumericCharmap
   672                                  | EAknEditorFlagUseSCTNumericCharmap
   670                                   | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   673                                  | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   671 #ifdef RD_JAVA_S60_RELEASE_9_2
   674 #ifdef RD_JAVA_S60_RELEASE_9_2
   672                                   | EAknEditorFlagEnablePartialScreen
   675                                  | EAknEditorFlagEnablePartialScreen
   673 #endif // RD_JAVA_S60_RELEASE_9_2                           
   676 #endif // RD_JAVA_S60_RELEASE_9_2                           
   674                                  );
   677                                 );
   675         editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_NUMERIC_MODE_DIALOG);
   678         intEd->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_NUMERIC_MODE_DIALOG);
   676     }
   679     }
   677     break;
   680     break;
   678     case EDecimal:
   681     case EDecimal:
   679     {
   682     {
   680         editor = new(ELeave) CSwtFloatingPointEdwin;
   683         // The floatEd has to be CSwtFloatingPointEdwin*, otherwise wrong
       
   684         // ConstrucL() method is called.
       
   685         CSwtFloatingPointEdwin* floatEd = new(ELeave) CSwtFloatingPointEdwin;
       
   686         editor = floatEd;
   681         SetEditor(editor);
   687         SetEditor(editor);
   682         editor->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   688         floatEd->ConstructL(-KMaxTInt, KMaxTInt, iTextLimit);
   683         editor->SetAknEditorCase(EAknSCTNumeric);
   689         floatEd->SetAknEditorCase(EAknSCTNumeric);
   684         editor->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   690         floatEd->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
   685         editor->SetAknEditorInputMode(EAknEditorNumericInputMode);
   691         floatEd->SetAknEditorInputMode(EAknEditorNumericInputMode);
   686         editor->SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   692         floatEd->SetAknEditorCurrentInputMode(EAknEditorNumericInputMode);
   687         editor->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   693         floatEd->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
   688 
   694 
   689         editor->SetAknEditorFlags(EAknEditorFlagFixedCase
   695         floatEd->SetAknEditorFlags(EAknEditorFlagFixedCase
   690                                   | EAknEditorFlagNoT9
   696                                    | EAknEditorFlagNoT9
   691                                   | EAknEditorFlagUseSCTNumericCharmap
   697                                    | EAknEditorFlagUseSCTNumericCharmap
   692                                   | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   698                                    | EAknEditorFlagDeliverVirtualKeyEventsToApplication
   693 #ifdef RD_JAVA_S60_RELEASE_9_2
   699 #ifdef RD_JAVA_S60_RELEASE_9_2
   694                                   | EAknEditorFlagEnablePartialScreen
   700                                    | EAknEditorFlagEnablePartialScreen
   695 #endif // RD_JAVA_S60_RELEASE_9_2                           
   701 #endif // RD_JAVA_S60_RELEASE_9_2                           
   696                                  );
   702                                   );
   697 
   703 
   698         if (iDecimalSeparator == ',')
   704         if (iDecimalSeparator == ',')
   699         {
   705         {
   700             editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_WITH_COMMA_DIALOG);
   706             floatEd->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_WITH_COMMA_DIALOG);
   701         }
   707         }
   702         else
   708         else
   703         {
   709         {
   704             editor->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_DIALOG);
   710             floatEd->SetAknEditorSpecialCharacterTable(R_ESWT_CONSTRAINEDTEXT_DECIMAL_MODE_DIALOG);
   705         }
   711         }
   706     }
   712     }
   707     break;
   713     break;
   708     case EPhoneNumber:
   714     case EPhoneNumber:
   709     {
   715     {