16593 filterString: |
16593 filterString: |
16594 'expecco Testsuite', null, '*.ets', null, |
16594 'expecco Testsuite', null, '*.ets', null, |
16595 'expecco Logfile', null, '*.elf', null, |
16595 'expecco Logfile', null, '*.elf', null, |
16596 null |
16596 null |
16597 filterIndex:2 |
16597 filterIndex:2 |
16598 doSave:false. |
16598 doSave:false. |
16599 |
16599 |
16600 ########### example2 without owning view and termination ########## |
16600 ########### example2 without owning view and termination ########## |
16601 |
16601 |
16602 |null p| |
16602 |null p| |
16603 |
16603 |
16636 filterString: |
16636 filterString: |
16637 'expecco Testsuite', null, '*.ets', null, |
16637 'expecco Testsuite', null, '*.ets', null, |
16638 'expecco Logfile', null, '*.elf', null, |
16638 'expecco Logfile', null, '*.elf', null, |
16639 null |
16639 null |
16640 filterIndex:2 |
16640 filterIndex:2 |
16641 doSave:false. |
16641 doSave:false. |
16642 |
16642 |
16643 ########### example3 with owning view (makes the launcher modal) and termination ########## |
16643 ########### example3 with owning view (makes the launcher modal) and termination ########## |
16644 |
16644 |
16645 |null owningViewId p| |
16645 |null owningViewId p| |
16646 |
16646 |
16678 this is called as an ensure, when the native file dialog process gets terminated |
16678 this is called as an ensure, when the native file dialog process gets terminated |
16679 this is required because windows does not cleanup the dialog by itself when its thread gets terminated" |
16679 this is required because windows does not cleanup the dialog by itself when its thread gets terminated" |
16680 |
16680 |
16681 %{ /* STACK: 100000 */ |
16681 %{ /* STACK: 100000 */ |
16682 if (__isExternalAddress(dataAddress)) { |
16682 if (__isExternalAddress(dataAddress)) { |
16683 fileDialogData *pFdd = __externalAddressVal(dataAddress); |
16683 fileDialogData *pFdd = __externalAddressVal(dataAddress); |
16684 DWORD fileDialogThreadId = pFdd->fileDialogThreadId; |
16684 DWORD fileDialogThreadId = pFdd->fileDialogThreadId; |
16685 |
16685 |
16686 if (fileDialogThreadId != 0) { |
16686 if (fileDialogThreadId != 0) { |
16687 EnumWindows(enumWindowsToFindAndDestroyFileDialogProc, fileDialogThreadId); |
16687 EnumWindows(enumWindowsToFindAndDestroyFileDialogProc, fileDialogThreadId); |
16688 } |
16688 } |
16689 if (__isExternalAddress(threadHandleAddress)) { |
16689 if (__isExternalAddress(threadHandleAddress)) { |
16690 HANDLE fileDialogThread = _HWNDVal(threadHandleAddress); |
16690 HANDLE fileDialogThread = _HWNDVal(threadHandleAddress); |
16691 TerminateThread(fileDialogThread, 0); |
16691 TerminateThread(fileDialogThread, 0); |
16692 CloseHandle(fileDialogThread); |
16692 CloseHandle(fileDialogThread); |
16693 }; |
16693 }; |
16733 |
16734 |
16734 |fileDialogDataAddress fileDialogThreadHandle| |
16735 |fileDialogDataAddress fileDialogThreadHandle| |
16735 |
16736 |
16736 %{ /* STACK: 100000 */ |
16737 %{ /* STACK: 100000 */ |
16737 int i; |
16738 int i; |
16738 fileDialogData *pFileDialogData = malloc(sizeof(fileDialogData)); |
16739 fileDialogData *pFdd = malloc(sizeof(fileDialogData)); |
16739 ZeroMemory(pFileDialogData, sizeof(fileDialogData)); |
16740 ZeroMemory(pFdd, sizeof(fileDialogData)); |
16740 |
16741 |
16741 if (__isUnicode16String(defaultFilename)) { |
16742 if (__isUnicode16String(defaultFilename)) { |
16742 for (i = 0; i < __unicode16StringSize(defaultFilename); i++) { |
16743 for (i = 0; i < __unicode16StringSize(defaultFilename); i++) { |
16743 pFileDialogData->filename[i] = __unicode16StringVal(defaultFilename)[i]; |
16744 pFdd->filename[i] = __unicode16StringVal(defaultFilename)[i]; |
16744 } |
16745 } |
16745 pFileDialogData->filename[i] = 0; |
16746 pFdd->filename[i] = 0; |
16746 }; |
16747 }; |
16747 if (__isUnicode16String(dialogTitle)) { |
16748 if (__isUnicode16String(dialogTitle)) { |
16748 for (i = 0; i < __unicode16StringSize(dialogTitle); i++) { |
16749 for (i = 0; i < __unicode16StringSize(dialogTitle); i++) { |
16749 pFileDialogData->title[i] = __unicode16StringVal(dialogTitle)[i]; |
16750 pFdd->title[i] = __unicode16StringVal(dialogTitle)[i]; |
16750 } |
16751 } |
16751 pFileDialogData->title[i] = 0; |
16752 pFdd->title[i] = 0; |
16752 }; |
16753 }; |
16753 if (__isExternalAddress(owningViewId)) { |
16754 if (__isExternalAddress(owningViewId)) { |
16754 pFileDialogData->owningWindow = _HWNDVal(owningViewId); |
16755 pFdd->owningWindow = _HWNDVal(owningViewId); |
16755 }; |
16756 }; |
16756 if (__isUnicode16String(filterString)) { |
16757 if (__isUnicode16String(filterString)) { |
16757 for (i = 0; i < __unicode16StringSize(filterString); i++) { |
16758 for (i = 0; i < __unicode16StringSize(filterString); i++) { |
16758 pFileDialogData->filter[i] = __unicode16StringVal(filterString)[i]; |
16759 pFdd->filter[i] = __unicode16StringVal(filterString)[i]; |
16759 } |
16760 } |
16760 pFileDialogData->filter[i] = 0; |
16761 pFdd->filter[i] = 0; |
16761 }; |
16762 }; |
16762 if (__isInteger(filterIndexArg)) { |
16763 if (__isInteger(filterIndexArg)) { |
16763 pFileDialogData->filterIndex = filterIndexArg; |
16764 pFdd->filterIndex = filterIndexArg; |
16764 } |
16765 } |
16765 pFileDialogData->trueForSave = doSave == true; |
16766 pFdd->trueForSave = doSave == true; |
16766 pFileDialogData->fileDialogDidReturn = FALSE; |
16767 pFdd->fileDialogDidReturn = FALSE; |
16767 |
16768 |
16768 fileDialogDataAddress = __MKEXTERNALADDRESS(pFileDialogData); |
16769 fileDialogDataAddress = __MKEXTERNALADDRESS(pFdd); |
16769 fileDialogThreadHandle = __MKEXTERNALADDRESS(openFileDialogInNewThread(pFileDialogData)); |
16770 fileDialogThreadHandle = __MKEXTERNALADDRESS(openFileDialogInNewThread(pFdd)); |
16770 %}. |
16771 %}. |
16771 |
16772 |
16772 ^ Array |
16773 ^ Array |
16773 with:fileDialogDataAddress |
16774 with:fileDialogDataAddress |
16774 with:fileDialogThreadHandle |
16775 with:fileDialogThreadHandle |
16775 |
16776 |
16776 "Created: / 22-10-2018 / 13:31:46 / sr" |
16777 "Created: / 22-10-2018 / 13:31:46 / sr" |
|
16778 "Modified: / 22-10-2018 / 15:11:47 / sr" |
16777 ! ! |
16779 ! ! |
16778 |
16780 |
16779 !WinWorkstation methodsFor:'native widget support'! |
16781 !WinWorkstation methodsFor:'native widget support'! |
16780 |
16782 |
16781 nativeDialogs |
16783 nativeDialogs |