5523 ListModel* dataModdel = reinterpret_cast< ListModel* > ( aHandle ); |
5523 ListModel* dataModdel = reinterpret_cast< ListModel* > ( aHandle ); |
5524 dataModdel->remove(aIndex); |
5524 dataModdel->remove(aIndex); |
5525 } |
5525 } |
5526 SWT_CATCH |
5526 SWT_CATCH |
5527 } |
5527 } |
5528 |
5528 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1setItemContentsToNull ) |
5529 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1setItem__IILjava_lang_String_2 ) |
5529 ( JNIEnv* aJniEnv , jclass, jint aHandle, jint aIndex ) |
5530 ( JNIEnv* aJniEnv , jclass, jint aHandle, jint aIndex, jstring aString ) |
|
5531 { |
5530 { |
5532 SWT_TRY |
5531 SWT_TRY |
5533 { |
5532 { |
5534 SWT_LOG_JNI_CALL(); |
5533 SWT_LOG_JNI_CALL(); |
5535 SWT_LOG_DATA_2( "handle=%x index=%d ", aHandle, aIndex ); |
5534 SWT_LOG_DATA_2( "handle=%x index=%d ", aHandle, aIndex ); |
5536 ListModel* dataModdel = reinterpret_cast< ListModel* > ( aHandle ); |
5535 ListModel* dataModel = reinterpret_cast< ListModel* > ( aHandle ); |
5537 dataModdel->setItem(aIndex, swtApp->jniUtils().JavaStringToQString(aJniEnv, aString)); |
5536 dataModel->setItemContentsToNull( aIndex ); |
5538 } |
|
5539 SWT_CATCH |
|
5540 } |
|
5541 |
|
5542 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1setItem__IILjava_lang_String_2I ) |
|
5543 ( JNIEnv* aJniEnv , jclass, jint aHandle, jint aIndex, jstring aString, jint aImageHandle ) |
|
5544 { |
|
5545 SWT_TRY |
|
5546 { |
|
5547 SWT_LOG_JNI_CALL(); |
|
5548 SWT_LOG_DATA_3( "handle=%x index=%d imageHandle=%x", aHandle, aIndex, aImageHandle ); |
|
5549 ListModel* dataModdel = reinterpret_cast< ListModel* > ( aHandle ); |
|
5550 QPixmap* pixmap = reinterpret_cast< QPixmap* >( aImageHandle ); |
|
5551 dataModdel->setItem(aIndex, swtApp->jniUtils().JavaStringToQString(aJniEnv, aString), pixmap ); |
|
5552 } |
5537 } |
5553 SWT_CATCH |
5538 SWT_CATCH |
5554 } |
5539 } |
5555 |
5540 |
5556 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1clearList ) |
5541 JNIEXPORT void JNICALL OS_NATIVE( ListModel_1clearList ) |
10024 } |
10009 } |
10025 SWT_CATCH |
10010 SWT_CATCH |
10026 return text; |
10011 return text; |
10027 } |
10012 } |
10028 |
10013 |
10029 |
10014 JNIEXPORT jstring JNICALL OS_NATIVE(QInputDialog_1swt_1getInteger) |
10030 JNIEXPORT jstring JNICALL OS_NATIVE(QInputDialog_1swt_1getDouble) |
10015 (JNIEnv *aJniEnv, jclass, jint aParentHandle, jstring aTitle, jstring aLabel, |
10031 (JNIEnv* aJniEnv , jclass, jint aParentHandle, jstring aTitle, jstring aLabel, |
10016 jint aMin, jint aMax, jint aDefaultValue, jstring aDialogId, jint aLayoutDirection) |
10032 jdouble aMin, jdouble aMax, jdouble aDefaultValue, jint aDecimals, jstring aDialogId, jint aLayoutDirection) |
10017 { |
10033 { |
10018 jstring integerString = NULL; |
10034 jstring doubleString = NULL; |
10019 SWT_TRY |
10035 SWT_TRY |
10020 { |
10036 { |
10021 SWT_LOG_JNI_CALL(); |
10037 SWT_LOG_JNI_CALL(); |
10022 SWT_LOG_DATA_5("parent handle=%x min=%d, max=%d, default=%d, layoutDirection=%d", |
10038 SWT_LOG_DATA_5("parent handle=%x min=%e, max=%e, default=%e, decimals=%d layoutDirection=%d", |
10023 aParentHandle, aMin, aMax, aDefaultValue, aLayoutDirection); |
10039 aParentHandle, aMin, aMax, aDefaultValue, aDecimals); |
|
10040 HANDLE_TO_POINTER(QWidget*, parent, aParentHandle); |
10024 HANDLE_TO_POINTER(QWidget*, parent, aParentHandle); |
10041 QInputDialog dialog(parent); |
10025 QInputDialog dialog(parent); |
10042 dialog.setObjectName(swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogId)); |
10026 dialog.setObjectName(swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogId)); |
10043 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10027 dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) ); |
10044 dialog.setInputMode(QInputDialog::DoubleInput); |
10028 dialog.setInputMode(QInputDialog::IntInput); |
10045 dialog.setWindowTitle(swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle)); |
10029 dialog.setWindowTitle(swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle)); |
10046 dialog.setLabelText(swtApp->jniUtils().JavaStringToQString(aJniEnv, aLabel)); |
10030 dialog.setLabelText(swtApp->jniUtils().JavaStringToQString(aJniEnv, aLabel)); |
10047 dialog.setDoubleRange(aMin, aMax); |
10031 dialog.setIntRange(aMin, aMax); |
10048 dialog.setDoubleDecimals(aDecimals); |
|
10049 // Order of this call matters, causes problems if done before setting range |
10032 // Order of this call matters, causes problems if done before setting range |
10050 dialog.setDoubleValue(aDefaultValue); |
10033 dialog.setIntValue(aDefaultValue); |
10051 AutoPopExecStack stackExec(&dialog); |
10034 AutoPopExecStack stackExec(&dialog); |
10052 int result = dialog.exec(); |
10035 int result = dialog.exec(); |
10053 if (result == QDialog::Accepted) |
10036 if (result == QDialog::Accepted) |
10054 { |
10037 { |
10055 QString str = QString("%1").arg(dialog.doubleValue(), 0 , 'f', aDecimals); |
10038 QString str = QString("%1").arg(dialog.intValue()); |
10056 doubleString = swtApp->jniUtils().QStringToJavaString(aJniEnv, str); |
10039 integerString = swtApp->jniUtils().QStringToJavaString(aJniEnv, str); |
10057 } |
10040 } |
10058 } |
10041 } |
10059 SWT_CATCH |
10042 SWT_CATCH |
10060 return doubleString; |
10043 return integerString; |
10061 } |
10044 } |
10062 |
|
10063 |
|
10064 // |
10045 // |
10065 // QVBoxLayout |
10046 // QVBoxLayout |
10066 // |
10047 // |
10067 |
10048 |
10068 JNIEXPORT jint JNICALL OS_NATIVE( QVBoxLayout_1new ) |
10049 JNIEXPORT jint JNICALL OS_NATIVE( QVBoxLayout_1new ) |